Only draw Rectangle when largest than the minimum size [closed]

asked 2016-01-19 22:20:45 -0600

tenkeason gravatar image

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)

This is My Picture

main.cpp : http://paste.ofcode.org/33beiUcpvTuPd...

Color.cpp : http://paste.ofcode.org/xbRhjeB3fnR2i...

Color.h : http://paste.ofcode.org/zeu4brWENxvtZ...

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-12-08 18:20:36.632970

Comments

Your question is extremely confusing and unclear

LorenaGdL gravatar imageLorenaGdL ( 2016-01-19 22:49:57 -0600 )edit

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)

tenkeason gravatar imagetenkeason ( 2016-01-19 23:34:36 -0600 )edit

if (minRect.area() > desiredValue) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}

Pedro Batista gravatar imagePedro Batista ( 2016-01-20 04:57:49 -0600 )edit

May i know if my minimum size is 100*150, how to change in the desiredValue?

tenkeason gravatar imagetenkeason ( 2016-01-20 05:24:23 -0600 )edit

if (minRect.width() > desiredWidth && minRect.height() > desiredHeight) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}

Pedro Batista gravatar imagePedro Batista ( 2016-01-20 05:31:19 -0600 )edit

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

tenkeason gravatar imagetenkeason ( 2016-01-20 05:41:42 -0600 )edit

Yeah, never mind the ().

if (minRect.width > 100 && minRect.height > 150) {rectangle( frame, minRect, Scalar( 0, 0, 255 ),2 );}

Pedro Batista gravatar imagePedro Batista ( 2016-01-20 06:10:21 -0600 )edit

ok its works, thanks for help!

tenkeason gravatar imagetenkeason ( 2016-01-20 07:27:29 -0600 )edit

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)

tenkeason gravatar imagetenkeason ( 2016-01-20 10:42:57 -0600 )edit