After some HSV correction, erosion and dilation using trackbars
, contours are generated using
findContours(hsv, contours, RETR_TREE, CHAIN_APPROX_SIMPLE);
and then in a sequential loop
for (int i = 0; i < contours.size(); i++) {
bound = boundingRect(contours[i]);
if (bound.area() > 1000 && bound.area() < 2000)
rectangle(cam, bound.tl(), bound.br(), color);
}
rectangles are drawn on screen.
Is there any built in function to do it in parallel or without using sequential loop?