How to find an unclear edge?

2 visualizzazioni (ultimi 30 giorni)
Leyana Khouri
Leyana Khouri il 13 Giu 2021
Risposto: Image Analyst il 13 Giu 2021
Hello everyone,
I am trying to find one way to find an edge in a set of photos, one code that works for all photos, in order to find the coordinates of this line in all photos. The problem is that the edge I am looking for is unclear.
Here is my code. It worked only on one image but I have to find out something that works on all images I have.
Attached here are 3 examples of the Images.
I would really appreciate your help. Thank you in advance.
result{1}=bestImage;
for K = 2:6
result{K} = medfilt2(result{K-1});
end
medImage=result{5};
contrastImage=imadjust(medImage, [0.3 0.4]); %0.3 0.5
figure(2),imshow(contrastImage )
%brighten
brightImage = imlocalbrighten(contrastImage,0.6);
figure(3),imshow(brightImage)
%% binarize
binImage=imbinarize(brightImage,0.1);
figure(4),imshow(binImage),title('imbinarize')
%figure(5),imshowpair(bestImage,binImage,'blend')
binImage1=bwareaopen(binImage,300);
figure(6),imshow(binImage1)
binImage2=imfill(binImage1,'holes');
figure(7),imshow(binImage2)
edgeSklera=edge(binImage2);
figure(8),imshow(edgeSklera)

Risposte (1)

Image Analyst
Image Analyst il 13 Giu 2021
Try to denoise your image first. You might try imnlmfit() or a mean shift filter or something like that.

Community Treasure Hunt

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

Start Hunting!

Translated by