このサイトvisual studio2017でtesseractとOpenCVを使用できるようにするための記事を参考にビルドし,以下のサンプルコード(opencvで文字認識その1 Tesseractラッパ - …)
c
1void main() 2{ 3 // 画像読み込み 4 auto image = cv::imread("moji.jpg"); 5 // グレースケール化 6 cv::Mat gray; 7 cv::cvtColor(image, gray, COLOR_RGB2GRAY); 8 // 文字認識クラスのインスタンス生成 9 auto ocr = cv::text::OCRTesseract::create("C:\Tesseract-OCR_v_20181030\tessdata","jpn"); 10 11 std::string text; 12 std::vector<cv::Rect> boxes; 13 std::vector<std::string> words; 14 vector<float> confidences; 15 // 文字認識の実行 16 ocr->run(gray, text, &boxes, &words, &confidences); 17 18 // 結果出力 19 printf("%s\n", text.c_str()); 20 // 文字のかたまりごとに出力 21 printf(" 文字 | 位置 | 大きさ | 信頼度\n"); 22 printf("-----------+------------+------------+----------\n"); 23 for (int i = 0; i < boxes.size(); i++) 24 { 25 printf("%-10s | (%3d, %3d) | (%3d, %3d) | %f\n", 26 words[i].c_str(), 27 boxes[i].x, boxes[i].y, 28 boxes[i].width, boxes[i].height, 29 confidences[i]); 30 } 31}
を実行したが,tesseract not foundと表示され結果が出ないです.
これはどのような原因が考えられるのでしょうか.教えていただきたいです.

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/04/17 07:33 編集
2020/04/17 07:33