我使用2.4.3版本的OpenCV,並試圖用「findContours」功能Canny邊緣檢測這樣的後:OpenCV的:findContours功能錯誤
struct Component
{
cv::Rect boundingBox;
double area;
double circularity;
}
cv::vector <Component> components;
cv::vector <cv::Vec4i> hierarchy;
cv::findContours (cannyEdges, components, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_NONE);
然後,它拋出了一行行的錯誤「CV :: findContours」像這樣:
OpenCV Error: Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) && ((1((type0) & fixedDepthMask) != 0)) in unknown function, file ...\opencv\modeuls\core\src\matrix.cpp, line 1421
我怎樣才能解決這個問題?
我們不能用你給我們重現錯誤。請提供[簡短,獨立,正確(可編譯),示例](http://sscce.org/)。 – karlphillip
@karlphillip:該鏈接爲+1 –