Clear Filters
Clear Filters

How to remove unsteady reflections in images ?

11 views (last 30 days)
Tomer
Tomer on 5 Apr 2024
Commented: DGM on 10 Apr 2024
Hi. I have TIF format gray images with some particles. There are some reflections that are inevitable during the experiments. Unfortunatley, these unsteady reflections change their intensity and locations in every frame. I want to convert these gray images to binary images after removing the reflections. If I do not remove these glares and reflections then the binarized images are very noisy.
I have tried imreducehaze and some other operations but unfortunatley, it does not result in satisfactory result. Any help is highly appreciated.

Answers (1)

Ayush Anand
Ayush Anand on 5 Apr 2024
Hi,
You can achieve the sliding average operation in MATLAB using the "fspecial" and "imfilter" functions:
kernel = fspecial('average', [3 3]); % You can adjust the size as per requirement
img_filtered = imfilter(img_gray, kernel, 'replicate');
You can read more on "fspecial" and "imfilter" here:
  1. https://www.mathworks.com/help/images/ref/fspecial.html (Official documentation on "fspecial")
  2. https://www.mathworks.com/help/images/ref/imfilter.html (Official documentation on "imfilter")
  5 Comments
DGM
DGM on 9 Apr 2024
Edited: DGM on 9 Apr 2024
Perhaps they are doing some sort of frame averaging process. If the artifacts are short-lived compared to the objects of interest, a moving average of frames will subdue the artifacts enough that they might not interfere with segmentation, while only blurring objects of interest to a minor degree. If the objects of interest are truly static across all frames, there are plenty of routines used for background extraction which would also be applicable. Otherwise, interframe mean (or maybe median) filtering would work. It's really not clear what's appropriate given a single frame.
DGM
DGM on 10 Apr 2024
I really don't know what to say. The reflections seem to move almost as much as the particles do. Averaging doesn't seem to be helpful. My attempts at background extraction and removal weren't really any more helpful either. I don't know what they could be doing unless they're incorporating some sort of optical flow magic into the works. That's something I'm not familiar with.
There is one thing I can recommend that's only tangential. Don't save images by taking screenshots of figures. Save the images with imwrite(), and avoid JPG when appropriate. It's not going to be a grave problem for this task, but it's something you should avoid before you paint yourself into a corner.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!