remove salt and pepper from an image then convert to binary

조회 수: 2 (최근 30일)
Md
Md 2022년 9월 17일
답변: Image Analyst 2022년 9월 17일
How can I convert the first image to the second image? I used the code below but it didn't help, and I didn't convert it to binary because it makes it look worse due to the salt and pepper. Also, using medfilt2 making my image blurry.
RGB = imread('center.png');
imshow(RGB);
I=im2gray(RGB);
k=medfilt2(I,[22,22]);
imshow(k)

답변 (1개)

Image Analyst
Image Analyst 2022년 9월 17일
See my attached demos. You might be able to adapt them.
But you don't have what is called classical salt and pepper noise. I suggest you call adapthisteq then threshold to get blobs brighter and darker than the mean gray level. You also need to fix your horrible lighting situation. Try to avoid the reflection of the overhead light. If you can't arrange the geometry, then use polarizers.

Community Treasure Hunt

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

Start Hunting!

Translated by