I'm currently coding an app that will use OCR to read page numbers. I am using Visual Studio 2013 on a PC. I'm using C++ with OpenCV and Tesseract to complete this.
An error keeps on coming up and while I have come across similar problems, I can't find anything where it specific relates to the identifier 'and'. As such, I don't know how to fix this problem. Here is the section of code that it applies to:
vector<string> PgNrOCR::runRecognition(const vector<Mat> &pgnrImage, int pgnrType)
{
vector<string> output;
output.resize(pgnrImage.size());
for (size_t i = 0; i < pgnrImage.size(); i++)
{
if (!pgnrImage[i].empty() and pgnrType == 1)
output[i] = runPrediction1(pgnrImage[i], i);
if (!pgnrImage[i].empty() and pgnrType == 2)
output[i] = runPrediction2(pgnrImage[i], i);
}
return (output);
}
The 'and' identifiers in the if statement are bringing up the error, so I need to find an alternative solution. The full error appears as so.
Error 3 error C2146: syntax error : missing ')' before identifier 'and' c:\users\andrew\documents\visual studio 2013\projects\project1\project1\pgnrocr.cpp 152 1 PgTurn
I appreciate any help!