Shape recognition with added noise
조회 수: 8 (최근 30일)
이전 댓글 표시
I am trying to write a program that will recognize shapes. The program works for the png "Stickers" that has no noise but I am having trouble removing the added "noise" in the png "StickersWithNoise." I am having trouble knowing where to begin.
My Shape_recognition.m does the following (you can also see my comments in MATLAB)
- Reads picture
- Converts the white background to black
- Converts the picture from rgb to grayscale
- Converts picture from grayscale to binary
- Find connected components
- Use regionprops to find area and perimeter
- Calculate ratio of perimeter/sqrt(area) as suggested by the pdf "The Perimeter-Area Relation"
- Determine shape based upon these values
댓글 수: 0
답변 (1개)
Image Analyst
2022년 2월 19일
Try getting rid of the purple and brown line like this
[labeledImage, numBlobs] = bwlabel(BW_pic);
% Get rid of the purple line
purpleLine = ismember(labeledImage, 1); % First find purple line. It will be blob #1.
BW_pic(purpleLine) = false; % Then erase it from the binary image.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!