Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Eliminate Noise from an Image in MATLAB

  1. Mar 30, 2017 #1

    joshmccraney

    User Avatar
    Gold Member

    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:

    Last edited: Mar 31, 2017
  2. jcsd
  3. Mar 31, 2017 #2

    Nidum

    User Avatar
    Science Advisor
    Gold Member

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

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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 ?
     
  5. Mar 31, 2017 #4

    Nidum

    User Avatar
    Science Advisor
    Gold Member

    @joshmccraney : What is the actual project that you are working on ?
     
    Last edited: Mar 31, 2017
  6. Apr 4, 2017 #5

    joshmccraney

    User Avatar
    Gold Member

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

    Nidum

    User Avatar
    Science Advisor
    Gold Member

    Yes please .
     
  8. Apr 4, 2017 #7

    joshmccraney

    User Avatar
    Gold Member

    I'll PM you!
     
  9. Apr 4, 2017 #8

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

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

    joshmccraney

    User Avatar
    Gold Member

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

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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, ...)
     
  12. Apr 4, 2017 #11

    Nidum

    User Avatar
    Science Advisor
    Gold Member

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

    Nidum

    User Avatar
    Science Advisor
    Gold Member

  14. Apr 4, 2017 #13

    joshmccraney

    User Avatar
    Gold Member

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

    Nidum

    User Avatar
    Science Advisor
    Gold Member

    As in #2
     
  16. Apr 4, 2017 #15

    Nidum

    User Avatar
    Science Advisor
    Gold Member

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

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    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
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Eliminate Noise from an Image in MATLAB
  1. Matlab noise cleaning (Replies: 6)

  2. Noise Filter In Matlab (Replies: 1)

Loading...