[問題] cvfindcontours圖片太大?
看板C_and_CPP (C/C++)作者dagosun (little sunshine:))時間13年前 (2012/11/05 15:20)推噓0(0推 0噓 0→)留言0則, 0人參與討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
opencv
問題(Question):
請問一下
有時候使用cvfindcontours的時候
輪廓太大的好像會偵測不出來
縮小整張圖片就可以偵測
請問除了縮小圖片以外
還有沒有其他方法不要更動到原本的尺寸也可以偵測呢?
謝謝
程式碼(Code):(請善用置底文網頁, 記得排版)
for(; contour; contour = contour->h_next)
{
CvRect r = ((CvContour*)contour)->rect;
ContourArea = r.height * r.width;
if(ContourArea > deleteArea && ContourArea<src->height*src->width)
{
CvScalar color = CV_RGB( rand()&255, rand()&255, rand()&255 );
cvDrawContours( dst, contour, color,color,-1,CV_FILLED,8);
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.118.175.46
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章