# Eliminate Noise from an Image in MATLAB

1. Mar 30, 2017

### joshmccraney

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!

#### Attached Files:

File size:
46.6 KB
Views:
73
• ###### Noise1.pdf
File size:
10.6 KB
Views:
57
Last edited: Mar 31, 2017
2. Mar 31, 2017

### Nidum

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: Mar 31, 2017
3. Mar 31, 2017

### BvU

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. Mar 31, 2017

### Nidum

@joshmccraney : What is the actual project that you are working on ?

Last edited: Mar 31, 2017
5. Apr 4, 2017

### joshmccraney

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?

6. Apr 4, 2017

7. Apr 4, 2017

I'll PM you!

8. Apr 4, 2017

### BvU

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. Apr 4, 2017

### joshmccraney

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. Apr 4, 2017

### BvU

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.

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. Apr 4, 2017

### Nidum

(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 .

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 .

12. Apr 4, 2017

### Nidum

13. Apr 4, 2017

### joshmccraney

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. Apr 4, 2017

### Nidum

As in #2

15. Apr 4, 2017

### Nidum

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. Apr 4, 2017

### WWGD

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: Apr 4, 2017