Eliminate Noise from an Image in MATLAB

In summary, the conversation discusses ways to eliminate noise from a binary image in MATLAB. Some suggestions include deleting vertical lines longer than a specified value, using curve fitting, and applying a low-pass filter on the FFT. Other possibilities mentioned include using a slit light source to capture the surface profile and utilizing persistent homology to identify the signal and noise in the data. The key is to correctly choose the method based on the specific project and its requirements.
  • #1
member 428835
Hi PF!

Attached is a binary image I have in MATLAB, where I have drawn an error pointing to some noise. Does anyone know of a systematic way to eliminate all noise below this line (or basically what appears to be the line)?

I also uploaded the same image only processed, titled Noise1. This shows the same problem at a later stage (my actual problem). I would like to know how to address both if anyone can help.

Thanks!
 

Attachments

  • Noise.pdf
    46.6 KB · Views: 326
  • Noise1.pdf
    10.6 KB · Views: 304
Last edited by a moderator:
Physics news on Phys.org
  • #2
noise1.pn.png


Any vertical line longer than some specified small value is deleted . You will lose a point on the curve for each line deleted . Use curve fit then to get best true line through remaining points .
 
Last edited:
  • #3
What's the transform to go from noise to noise1 ?

Wouldn't a simple low-pass filter on the FFT remove most of the noise in noise.pdf ?
 
  • #4
@joshmccraney : What is the actual project that you are working on ?
 
Last edited:
  • #5
BvU said:
What's the transform to go from noise to noise1 ?

Wouldn't a simple low-pass filter on the FFT remove most of the noise in noise.pdf ?
What do you mean noise to noise1? I'm just confused here, sorry.

Nidum said:
@joshmccraney : What is the actual project that you are working on ?
The actually project is kind of difficult to explain, but what I'm trying to do here is remove those far out data points. Does this answer the crux of your question or do you actually want to know the details of what I'm working on?
 
  • #6
joshmccraney said:
or do you actually want to know the details of what I'm working on?

Yes please .
 
  • #7
Nidum said:
Yes please .
I'll PM you!
 
  • #8
joshmccraney said:
What do you mean noise to noise1? I'm just confused here, sorry.

The actually project is kind of difficult to explain, but what I'm trying to do here is remove those far out data points. Does this answer the crux of your question or do you actually want to know the details of what I'm working on?
Noise.pdf is one picture. Noise1.pdf is a totally different picture. Your own nomenclature. What do you do to transform noise.pdf into noise1.pdf ?
I really don't know how to ask differently.
 
  • #9
BvU said:
Noise.pdf is one picture. Noise1.pdf is a totally different picture. Your own nomenclature. What do you do to transform noise.pdf into noise1.pdf ?
I really don't know how to ask differently.
Ohhhhhh shoot sorry, I totally spaced this! Okay I see, here are my steps:
1) from the image Noise, I create a row vector of 1's above the maximum of the meniscus
2) I tell MATLAB to grab the lowest cell value that is a 1 from each column
3) Noise1 plots these results
 
  • #10
joshmccraney said:
2) I tell MATLAB to grab the lowest cell value that is a 1 from each column
So scoring a blank instead of 212 (or whatever the max ##h## is) gets rid of 97% of the noise.
A cut on ##\Delta h## from one ##z## to the next gets rid of the droopers.
Basically as @Nidum already proposed.

Not so sure you want to do much more so as not to cut into actual information -- depends on your purpose (do you want the low frequencies, the high frequencies, both, ...)
 
  • #11
(1) A photograph is taken in an experiment where the profile of a surface has to be recorded and measured .

A MATLAB routine is used to process the photograph and extract a bitmap image of the required surface profile .

The MATLAB routine traces the surface profile reasonably well but also generates or does not supress a large amount of image noise .

(2) A solution to the problem may be to strip off the spurious image components .

(3) There may be ways of changing the scan controls of the MATLAB routine to reduce the noise levels .

(4) Other possibilities :

Hand tracing .

CAD scanner.

Masked images for the scan process .

Sequence of photographs or a short video rather than a single frame .

Travelling microscope or laser scanner for direct recording and measurement .
 
  • #13
How do you recommend to "strip off" spurious components, or "store a blank"? I'm using a matrix so I can't have empty values.
 
  • #14
As in #2
 
  • #15
Any possibility of taking photographs in low light conditions but with a slit light source which just picks out the surface profile ? Should produce an image with very high contrast . Basically a white line which is the profile against a dark background . Much easier to get a good trace then .
 
  • #16
EDIT :Just throwing something in case you ( or anyone else) is/are familiar with it : Persistent Homology?

http://www.sci.utah.edu/~beiwang/teaching/cs6170-spring-2017/Scribe11.pdf

https://en.wikipedia.org/wiki/Persistent_homology

You assign a mathematical object, a Topological space to your data , which inlcludes a "filtration" at different levels of resolution. The n data that "persists" at enough consecutive levels of resolution is the signal and the data that does not persist is noise. I am learning it at this point. Attaching this Mathematical/Topological
space allows you to use all the existing associated machinery.

The idea/skill , of course, is to attach the correct type of object and correctly define the levels of resolution, of course, all depending on the problem at hand.
 
Last edited:

FAQ: Eliminate Noise from an Image in MATLAB

How can I eliminate noise from an image in MATLAB?

To eliminate noise from an image in MATLAB, you can use a variety of techniques such as median filtering, Wiener filtering, and Gaussian filtering. These techniques can be applied using built-in functions in MATLAB, such as medfilt2, wiener2, and imgaussfilt.

What is the most effective way to remove noise from an image in MATLAB?

The most effective way to remove noise from an image in MATLAB depends on the type of noise present in the image. For example, if the noise is random and follows a Gaussian distribution, then Gaussian filtering may be the most effective. If the noise is impulsive, then median filtering may be more effective. It is recommended to experiment with different techniques to find the best one for a specific image.

Can I eliminate noise from a color image in MATLAB?

Yes, you can eliminate noise from a color image in MATLAB by applying the chosen filtering technique to each color channel separately. This is because each color channel represents a separate image with its own noise. After filtering each channel, the channels can be combined to create a denoised color image.

Is it possible to eliminate noise from a video in MATLAB?

Yes, it is possible to eliminate noise from a video in MATLAB by applying the chosen filtering technique to each frame of the video. This can be done using a loop or the built-in function filter2. The resulting denoised frames can then be combined to create a denoised video.

Can I adjust the level of noise reduction in MATLAB?

Yes, you can adjust the level of noise reduction in MATLAB by changing the parameters of the chosen filtering technique. For example, in median filtering, you can adjust the size of the filter window to control the amount of noise reduction. It is important to find a balance between reducing noise and preserving important details in the image.

Similar threads

Replies
10
Views
2K
Replies
2
Views
3K
Replies
4
Views
2K
Replies
2
Views
1K
Replies
4
Views
1K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Back
Top