I have this code:
mat.copyTo(tmpMat); cvtColor(tmpMat, tmpMat, CV_BGR2GRAY); cv::equalizeHist(tmpMat, tmpMat); cv::Mat browMat = tmpMat(eyebrowRect); std::vector<std::vector<Point> > contours; cv::findContours(browMat, contours, cv::RETR_LIST, cv::CHAIN_APPROX_NONE);
but this error fails:
OpenCV error: statement failed (type == type0 || (CV_MAT_CN (type) == CV_MAT_CN (type0) && ((1 <type0) and fixedDepthMask)! = 0)) in the creation, file / Users / robin / Projects / OpenCVForiPhone / opencv / opencv / modules / core / src / matrix.cpp, line 1249 ending the call throwing exception
I think my Mat is already on a 1-channel gray scale due to a call to cvtColor ...
How can i fix this?
source share