1
BoostでPythonでプログラムを最適化し、PythonコードをC++関数に置き換えようとしています。画像をPythonからC++にBoost経由で送信
Pythonコード:C++で
from PIL import Image
for i in xrange(len(lines)):
im = Image.fromarray(lines[i])
line = pytesseract.image_to_string(im, "ukr+ukrb") # working to slow
とコード:
Pix *image = pixRead("/home/lucas63/Downloads/test.tif"); # here i need to get image directly from Python
api->SetImage(image);
outText = api->GetUTF8Text();
printf("OCR output:\n%s", outText);`
だから、私は2つのことにする必要があります。
- をパイソンからの画像を送信しますC++は
Boost.Python
を使用しています。 - イメージの配列をC++に送信します(C++でマルチ処理を使用してパフォーマンスを向上させたい)。
答えていただきありがとうございます。私はpy-tesseractをtesserocrに置き換えようとします。結果について後ほど書きます。 – lucas63
Ty、 – lucas63