Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openCV shape defects recognition

Tags:

c++

opencv

shapes

I want to do recognition: is this shape damaged or not. in OpenCV.

To enclosure the problem I'm uploading pictures of 3 good images and 4 damaged.

Problem is that: damaged shapes have a lot common properties with the good ones. I was trying to use: cv::contourArea - but area every time is very similar

cv::matchShapes - but comparing for example 'OK1' with 'OK3' Was giving very similar value as compare 'OK1' with 'NOK1' .

cv::convexityDefects - i created convexHull for OK1 and compare the sum of all defectContours depth with other images but the value was always very similar.

Slowly I'm running out of ideas what else Can work. I'm sure that task is possible to done. I'm looking for hints now.

Many thanks for your consideration!

https://i.sstatic.net/RTScy.jpg <- images

Also sorry for my English. It's not my first language.

like image 879
Tomasz Edwin Avatar asked Mar 08 '26 17:03

Tomasz Edwin


1 Answers

Description and solution for these who may have similar problem.

Solution for this problem was usage of the SurfFeatureDetector -> OpenCV::Doc

Tricky thing in this solution is that circular shapes are hard to describe for this detector. So, small number of the key points mean that nothing wrong is happening with this shape.

Thanks Vorac for a hint!

Circular shapes and cv::SurfFeatureDetector

like image 101
Tomasz Edwin Avatar answered Mar 11 '26 08:03

Tomasz Edwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!