How to Create Defect Class for Image Processing?

조회 수: 6(최근 30일)
Afrena Azman
Afrena Azman 2021년 11월 30일
댓글: Afrena Azman 2021년 12월 1일
Good day everyone, I have a code to inspect part's surface using image processing. And i want one of my output to show the scratches class such as:
class 1 scratch;
class 2 scratch;
class 3 scratch.
I've already calculate the total area of the image for this system. How can I generate the coding for this kind of output? Thank you so much for your replies.

답변(2개)

Image Analyst
Image Analyst 2021년 11월 30일
Maybe try thresholding with the 'adaptive' option in imbinarize().
Or try a bottomhat filter with imbothat().
Or try getting a standard deviation image with stdfilt() and then thresholding.
Once you have the binary image you can measure all kinds of features with regionprops, like area, perimeter, maximum length, etc. Then you can train it with the Classification Learner app to take all those features and make a prediction as to what kind of defect (Class 1 scratch, class 2 scratch, etc.) it is.
  댓글 수: 3
Afrena Azman
Afrena Azman 2021년 12월 1일
Understood sir, thank you so much for your help.

댓글을 달려면 로그인하십시오.


yanqi liu
yanqi liu 2021년 12월 1일
yes,sir,may be use regionprops to get some properties,such as
Boundingbox,Area,Circularity
then make judge rule to classify
  댓글 수: 1
Afrena Azman
Afrena Azman 2021년 12월 1일
Noted that. I tried using the Classification Learner Apps and it works. Thank you so much

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by