ANPR Algorithm example using OpenCV
Hi all,
I followed this example/tutorial about ANPR algorithm using OpenCV.
I downloaded c++ example code and I ported this code on iOS app.
Using some example photos, this code work well.
Now, I would to use the iPhone camera to take the photo to pass to the ANPR algorithm but oft I obtain an error (so also a crash). The error is this:
int area = floodFill(input, mask, seed, Scalar(255,0,0), &ccomp, Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDiff, upDiff), flags);
OpenCV Error: Unsupported format or combination of formats () in cvFloodFill, file /src/floodfill.cpp, line 621
floodFill function is used in this context:
Mat mask;
mask.create(input.rows + 2, input.cols + 2, CV_8UC1);
mask= Scalar::all(0);
int loDiff = 30;
int upDiff = 30;
int connectivity = 4;
int newMaskVal = 255;
int NumSeeds = 10;
cv::Rect ccomp;
int flags = connectivity + (newMaskVal << 8 ) + CV_FLOODFILL_FIXED_RANGE + CV_FLOODFILL_MASK_ONLY;
for(int j=0; j<NumSeeds; j++){
cv::Point seed;
seed.x=rects[i].center.x+rand()%(int)minSize-(minSize/2);
seed.y=rects[i].center.y+rand()%(int)minSize-(minSize/2);
circle(result, seed, 1, Scalar(0,255,255), -1);
int area = cv::floodFill(input, mask, seed, Scalar(255,0,0), &ccomp,
Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDiff, upDiff), flags);
printf("%d",area);
}
some suggestions?
you should probably add the error msg, or whatever you get there
The error that I reported in the text question is this: Error: Unsupported format or combination of formats () in cvFloodFill,