Monday, 15 June 2015

opencv - Draw minimum enclosing circle around a contour in EmguCV -



opencv - Draw minimum enclosing circle around a contour in EmguCV -

how draw minimum enclosing circle around contour in emgucv?. findcontours() method returns set of points. draw circle asks pointf. there work around this? thanks.

yes there way. have convert contour array of pointf this:

for (var contour = binaryimage.findcontours(chain_approx_method.cv_chain_approx_simple, retr_type.cv_retr_ccomp, mem); contour != null; contour = contour.hnext) { //assuming have way of getting index of //point wanted extract current contour var index = 0; pointf[] pointfs = array.convertall(contour.toarray(), input => new pointf(input.x, input.y)); //just illustration var circle = new circlef(pointfs[index], 2.0f); }

opencv image-processing emgucv

No comments:

Post a Comment