Create an array of Rectangles : Opencv , Android

asked 2015-05-03 11:46:06 -0500

Zain ul abdeen gravatar image

I have contours which are extracted from findcontours() , Now I want to create an array of all the boundingrects of contours.

int area,total=0;

for(int i=0; i<contours.size(); i++)
{
area = (int) Imgproc.contourArea(contours.get(i));

if(area>4600 && area<5100)
{
    Rect abc = Imgproc.boundingRect(contours.get(i));                          
}
}

Here it is saving only 1 contour in Rect , I want an array of Rect of all contours.

edit retag flag offensive close merge delete