1 | initial version |
If you can use OpenCV 3.0 then the solution could be to use the new connectedComponents functions, s. http://docs.opencv.org/trunk/d3/dc0/group__imgproc__shape.html#gae57b028a2b2ca327227c2399a9d53241 . It's not even much faster than findContours but gives you also the area.