Ask Your Question

Revision history [back]

Opencv tesseract run() function run into segmentation fault

Here is my code, im not sure why I only run into segmentatin fault when perform reg->run()

void Char_Reg( Mat& img, vector<string>& txt, vector<rect>& loc){
Ptr<text::ocrtesseract> reg;
vector<rect> a ;
vector<string> b ;
vector<float> c ;
string num;

for(int i=0; i<loc.size(); i++){<="" p="">

Mat plt=img(loc[i]);

cvtColor(plt,plt,CV_8UC1);

adaptiveThreshold(plt,plt, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, 15, 5.5);

imshow("plt",plt);

reg->run(plt, num,&a, &b, &c,5);

cout<<num&lt;<endl; }="" <code="">

Opencv tesseract run() function run into segmentation fault

Here is my code, im not sure why I only run into segmentatin fault when perform perform

reg->run()

void Char_Reg( Mat& img, vector<string>& txt, vector<rect>& loc){
Ptr<text::ocrtesseract> vector<Rect>& loc)
{
Ptr<text::OCRTesseract> reg;
vector<rect> vector<Rect> a ;
vector<string> b ;
vector<float> c ;
string num;

num;

for(int i=0; i<loc.size(); i++){<="" p="">

i++) { Mat plt=img(loc[i]);

cvtColor(plt,plt,CV_8UC1);

plt=img(loc[i]); cvtColor(plt,plt,CV_GRAYSCALE); adaptiveThreshold(plt,plt, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, 15, 5.5);

5.5); imshow("plt",plt); reg->run(plt, num,&a, &b, &c,5); cout<<num<<endl; }

imshow("plt",plt);

reg->run(plt, num,&a, &b, &c,5);

cout<<num&lt;<endl; }="" <code="">

Opencv tesseract run() function run into segmentation fault

Here is my code, im I'm not sure why I only run into segmentatin segmentation fault when performperform

reg->run()

reg->run()

void Char_Reg( Mat& img, vector<string>& txt, vector<Rect>& loc)
{
Ptr<text::OCRTesseract> reg;
vector<Rect> a ;
vector<string> b ;
vector<float> c ;
string num;

for(int i=0; i<loc.size(); i++)
{
Mat plt=img(loc[i]);
cvtColor(plt,plt,CV_GRAYSCALE);
adaptiveThreshold(plt,plt, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, 15, 5.5);
imshow("plt",plt);
reg->run(plt, num,&a, &b, &c,5);
cout<<num<<endl;
}