Only draw Rectangle when largest than the minimum size [closed]
May i know how to draw the rectangle at the object when the object is largest than the minimum size(left window picture), i already got to draw the rectangle when it was largest than the minimum size(right window picture) but i confused about this "Original Image" window(left window picture)
main.cpp : http://paste.ofcode.org/33beiUcpvTuPd...
Color.cpp : http://paste.ofcode.org/xbRhjeB3fnR2i...
Color.h : http://paste.ofcode.org/zeu4brWENxvtZ...
Your question is extremely confusing and unclear
ok now at "original image" window (right picture), it will only draw rectangles on 2 largest object(black color) was been detect. now i need add some function that is it will draw rectangle on object if only the object was largest than the minimum size (eg, 100*300)
if (minRect.area() > desiredValue) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}
May i know if my minimum size is 100*150, how to change in the desiredValue?
if (minRect.width() > desiredWidth && minRect.height() > desiredHeight) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}
if (minRect.width() > 100 && minRect.height() > 150) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}
it got error there :expression preceding parentheses of apparent call must have (point-to-) function type
Yeah, never mind the ().
if (minRect.width > 100 && minRect.height > 150) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}
ok its works, thanks for help!
May i know is that posible if i want change the minimum size at line 279 in main.cpp, if posible what should i use here? can i use if(width>100 && height>150) replace with this code
if(area>MIN_OBJECT_AREA)