Friday, 15 June 2012

opencv - Confusion analyzing blobs using contours -



opencv - Confusion analyzing blobs using contours -

i want analyze blobs received using contours. however, came across slight problems there difference analyzing blobs before , after using next code?

for(unsigned int = 0; < rects3.size(); i++) { scalar color = scalar(255,255,255); drawcontours( drawing3, contours3, i, color, cv_filled, 8); }

before using above, there boundaries line , after using code can see white blobs. attached illustration of it.

you want iterate through possible blobs , analyze (area, perimeter, etc).

your contours in vector called rects3.

// iterating trough for(unsigned int = 0; < rects3.size(); i++) { // bounding box of 1 contour rect rect = boundingrect(rects3[i]); //area double area = contourarea(rects3[i]); //perimiter double perimiter = arclength(rects3[i], true); }

see http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html

opencv

No comments:

Post a Comment