Ask Your Question

Anonymous9951's profile - activity

2017-01-04 22:41:54 -0500 received badge  Supporter (source)
2017-01-04 22:41:45 -0500 commented answer Opencv tesseract run() function run into segmentation fault

@berak thank you, I found my problem, yes you are right, I have to initialize it before i can use it, before that I'm using wrong syntax that's why I run into segmentation fault.

2017-01-04 22:28:49 -0500 commented answer Opencv tesseract run() function run into segmentation fault

But by right it should use the default value if I not initialize it, doesn't it?

2017-01-04 13:48:45 -0500 received badge  Editor (source)
2017-01-04 12:11:07 -0500 asked a question Opencv tesseract run() function run into segmentation fault

Here is my code, I'm not sure why I only run into segmentation 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++)
{
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;
}