C++ iOS应用程序上的CVF格式
我接着介绍了使用OpenCV的ANPR算法C++ iOS应用程序上的CVF格式,c++,ios,opencv,C++,Ios,Opencv,我接着介绍了使用OpenCV的ANPR算法 我下载了C++示例代码,并在iOS应用程序上移植了这个代码。 使用一些示例照片,此代码运行良好 现在,我想用iPhone摄像头拍摄照片,并将其传递给ANPR算法,但我经常会得到一个错误,因此也会发生崩溃。错误是: int area = floodFill(input, mask, seed, Scalar(255,0,0), &ccomp, Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDif
我下载了C++示例代码,并在iOS应用程序上移植了这个代码。 使用一些示例照片,此代码运行良好
现在,我想用iPhone摄像头拍摄照片,并将其传递给ANPR算法,但我经常会得到一个错误,因此也会发生崩溃。错误是:int area = floodFill(input, mask, seed, Scalar(255,0,0), &ccomp, Scalar(loDiff, loDiff, loDiff), Scalar(upDiff, upDiff, upDiff), flags);
OpenCV错误:cvFloodFill文件/src/floodfill.cpp第621行中不支持的格式或格式组合
在这种情况下使用泛洪填充功能:
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);
}
一些建议?尝试在输入中使用灰色图像代替输入。从标题和标签中删除ANPR。即使对ANPR一无所知的人也可以回答有关CVPR格式的问题。