0
$\begingroup$

enter image description here

I am looking to count the sharp pointy triangular things in the image. However I was unable to do so. One approach I did try was take a convex hull of the contour and then find convex defects but it led to lot of irregularities. You can find the it in the labelled image below. enter image description here

$\endgroup$
  • $\begingroup$ Welcome to SE.SP! Can you explain a bit more about how you labelled the red points? And then why some of them are "irregularities" ? $\endgroup$ – Peter K. Jul 3 at 14:54
  • $\begingroup$ @PeterK. After I got the contour of my desired region (represented in green dots), I tried taking a convex hull of the contour which are represented by blue dots, Using my convex hull and contour I passed it to opencv's find convex defect and the result I got are the red points in the image. I was expecting convex defect to be found only on the sharp 8 regions but I got it on the entire outline. $\endgroup$ – AJAY G Jul 3 at 15:08
0
$\begingroup$

Ok I solved this problem using a simple solution. After I computed my convex defects in my countours, I performed a point polygon test and found the distance between the point in the convex defect and the hull. And I gave a threshold after looking at the distance of the points and all the sharp points were in the threshold greater than approximately 30. So this filtered my points

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.