Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Create an array of Rectangles : Opencv , Android

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.