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;
}