MATLAB Eliminate Noise from an Image in MATLAB

AI Thread Summary
The discussion revolves around techniques for eliminating noise from binary images in MATLAB, specifically addressing how to transform an initial noisy image (Noise.pdf) into a cleaner version (Noise1.pdf). Key methods suggested include using a low-pass filter on the FFT to reduce noise and employing a systematic approach to remove vertical lines that exceed a certain length, which could help in refining the data points. The user outlines their process for transforming the images, which involves creating a row vector to identify and extract the lowest values above a defined threshold, effectively filtering out noise. Additional suggestions include adjusting scan controls in MATLAB, using alternative imaging techniques like CAD scanners or laser scanners, and exploring methods like Persistent Homology to distinguish between signal and noise based on topological analysis. The conversation emphasizes the importance of maintaining relevant data while minimizing noise, depending on the specific goals of the project.
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

Last edited by a moderator:
Physics news on Phys.org
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:
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 ?
 
@joshmccraney : What is the actual project that you are working on ?
 
Last edited:
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?
 
joshmccraney said:
or do you actually want to know the details of what I'm working on?

Yes please .
 
Nidum said:
Yes please .
I'll PM you!
 
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.
 
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:

Similar threads

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