No, there isn't a way to authorise access via Tesseract save the default way your OS provides. Please copy paste the entire error log, it might help figuring out the exact problem.
On Fri, Oct 12, 2018 at 8:22 AM Adam Richards <ajrichard...@gmail.com> wrote: > Thanks Soumik, I can access the original image but I guess it must be a > problem with Tesseract accessing the OpenCV mats wherever they exist, which > I'll have to try and work out. > > Is there a way to authorise access? I'm using cmake to compile on a > raspberry pi > > On Fri, Oct 12, 2018 at 3:08 AM Soumik Ranjan Dasgupta < > srd1...@cse.jgec.ac.in> wrote: > >> Although I've not used the C++ API, I've run into segmentation errors >> quite a lot during my initial days, and in most of the cases it generally >> stemmed from unauthorised directory accesses. Check whether the directory >> where the images are stored is readable and writable by you. Hope this >> helps! >> >> On Thu, Oct 11, 2018 at 4:09 PM Adam Richards <ajrichard...@gmail.com> >> wrote: >> >>> Hi I am having issues with sending a Mat image the I have opened through >>> OpenCV to Tesseract using the "SetImage" function. >>> I can use Tesseract on the image when I just input the commented out bit >>> at the end of the line as: SetImage(image); >>> >>> however when I run it as below the program will crash before even >>> reaching this point and return to console "segmentation error" >>> >>> I have found this code as being identical to somebody who previously did >>> my project, and i have no idea why this error is occurring. >>> >>> >>> Please if somebody can help me or provide a working example of Tesseract >>> using Mats from OpenCv I would greatly appreciate it. >>> >>> kind regards, >>> >>> Adam >>> >>> >>> int main(int argc, char** argv ) >>> { >>> >>> imgOriginal = imread(argv[1],1); // open image >>> Mat img = imgOriginal; >>> >>> ......... >>> >>> namedWindow("img", WINDOW_NORMAL); >>> imshow("img", img); >>> waitKey(0); // hold window open until user presses a key >>> >>> char *outText; >>> tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI(); >>> // Initialize tesseract-ocr with English, without specifying >>> tessdata path >>> if (api->Init("/usr/share/tesseract-ocr", "eng")) { >>> fprintf(stderr, "Could not initialize tesseract.\n"); >>> exit(1); >>> } >>> >>> // Open input image with leptonica library >>> Pix *image = >>> pixRead("/home/pi/opencv/sudoku_capture/sudoku2/Sudoku.jpg"); >>> api->TesseractRect( img.data, 1, img.step1(), 0, 0, img.cols, >>> img.rows); >>> api->SetImage((uchar*)img.data, img.size().width, img.size().height, >>> img.channels(), img.step1()); //image); >>> api->Recognize(0); >>> >>> // Get OCR result >>> outText = api->GetUTF8Text(); >>> printf("OCR output:\n%s", outText); >>> >>> // Destroy used object and release memory >>> api->End(); >>> delete [] outText; >>> //pixDestroy(&image); >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "tesseract-ocr" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to tesseract-ocr+unsubscr...@googlegroups.com. >>> To post to this group, send email to tesseract-ocr@googlegroups.com. >>> Visit this group at https://groups.google.com/group/tesseract-ocr. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/tesseract-ocr/5248e483-3f5c-4834-9c31-341b6873ffe5%40googlegroups.com >>> <https://groups.google.com/d/msgid/tesseract-ocr/5248e483-3f5c-4834-9c31-341b6873ffe5%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> -- >> Regards, >> Soumik Ranjan Dasgupta >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "tesseract-ocr" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/tesseract-ocr/LQ92oBFKBU8/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> tesseract-ocr+unsubscr...@googlegroups.com. >> To post to this group, send email to tesseract-ocr@googlegroups.com. >> Visit this group at https://groups.google.com/group/tesseract-ocr. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/tesseract-ocr/CAB_aDAcwRr1F3D5R-OcK6fEPQBLuJykyGEAX_zkx1YPXWErwUA%40mail.gmail.com >> <https://groups.google.com/d/msgid/tesseract-ocr/CAB_aDAcwRr1F3D5R-OcK6fEPQBLuJykyGEAX_zkx1YPXWErwUA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "tesseract-ocr" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tesseract-ocr+unsubscr...@googlegroups.com. > To post to this group, send email to tesseract-ocr@googlegroups.com. > Visit this group at https://groups.google.com/group/tesseract-ocr. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tesseract-ocr/CAJ_g6yUQXba3k4%3Dx%3DLwv9E1UDG2RDusBCKCdF6KCd8%2BOBpgPxw%40mail.gmail.com > <https://groups.google.com/d/msgid/tesseract-ocr/CAJ_g6yUQXba3k4%3Dx%3DLwv9E1UDG2RDusBCKCdF6KCd8%2BOBpgPxw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Regards, Soumik Ranjan Dasgupta -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To post to this group, send email to tesseract-ocr@googlegroups.com. Visit this group at https://groups.google.com/group/tesseract-ocr. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/CAB_aDAc%3DGf%3DpdLsH38HZT4JvYisxKHVzDUPjkU05b0e9AKE9ZA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.