how to remove speckles from image?

조회 수: 12 (최근 30일)
Akram
Akram 2020년 6월 8일
답변: Bjorn Gustavsson 2020년 6월 9일
Hi All
i have an image . its a pupil image of an optical system. If i use a large aperture in front of my source ( 200 um-so a finite source), then my image at pupil looks uniform and i can easily see defects/contamination in the image. however if i use a much smaller apertur right in front of my source ( 6um), then in my pupil I see lots of laser speckle shape features . The algorithm I use for detecting defects works based on intensity drop, so the problem i have is that now algorithm gets confused and also takes speckles too as defects. i have example images ( please look at attached images, i have circled what i mean by defects and i want to only detect those). I think this phenomenan happens due to diffraction and nature of light. since small aperture makes my light source work light somewhat coherent light and causes diffraction so all features in the lens system can be seen. I hve averaged several images too but didnt work.
i have asked suport in matlab that what they told me but i am still not successful. I am not that good at matlab and am struggling. I would appreciate any help
"After reviewing the images, it seems that a a lot of the specks you mention can be handled by using morphological operations:
In addition, you can get a full list of all types of morphological filters available here:
The exact sequence of commands needed is hard to predict and it's something you will have to experiment with.
As a recommendation thresholding along with "imerode" and "imdilate" could help in the process.
With that being said, here is a page with a list of all available feature extractors that you can use:
"
thanks very much
  댓글 수: 11
Akram
Akram 2020년 6월 9일
thanks very much Bjorn. It works great. I am not sure how to vote it as accepted answer but thanks a lot!
Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 9일
Ok, then I move it to an answer. Great that it worked. Obviously you'll have to tweak the filter-settings and check that it behaves as you want it to...

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

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 9일
Well the filtering you want to achieve is to keep structures with smaller spatial scales that have some magnitude above the speckle-level while reduce the speckles. That is kind-of the strength of the Lee's sigma-filter, wiener2 in matlab. At first I didn't think that would be the way forward considering the size of the speckles. However, if you force wiener2 to work with a set level for the noise it seems to work OK:
Im = double(imread('small.png'));
subplot(2,2,1)
imagesc(Im)
subplot(2,2,2)
D = wiener2(Im,[55,55],10000000/6);
imagesc(D)
subplot(2,2,3)
D = wiener2(wiener2(Im,[35,35],10000000/6),[35 35],1000000);
imagesc(D)
subplot(2,2,4)
D = wiener2(wiener2(Im,[35,35],10000000/6),[25 25],1000000);
imagesc(D)
So as you can see it is well possible to reduce/supress the speckles.
HTH

추가 답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 8일
If your solution is not to use a large apperture (Why? The example you've shown us seems to work for the large apperture.) then you might get something out of trying to remove the speckles in the Fourier-domain, this might work or not. You might want to window your image giving it a smooth transition from image to black background before doing the fft. Then you might have to suppress the frequency components corresponding to the speckles - this will be tricky since your objects-of-interest have very sharp edges and therefore a wide Fourier-spectrum. But I would give it a try.
HTH
  댓글 수: 1
Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 8일
Well, then you might find the attached function usefull, it is an implementation the interference-removal filter in chapter 5.7 of Gonzalez and Woods Digital Image Processing (1993). It should have a decent help-information. It might work for this case but I cannot guarantee a success.

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

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by