Make matrix numbers below 'X' equal to zero and help with overlaying images

Hey guys
I am doing some image processing from HD video. I am reading the video in frame by frame, converting each frame to grey and then subtracting a template image from them.
What I am doing then is overlaying the resulting images. Or trying to anyway.
The first thing I need help with, is that really I am only interested in a certain event within the images. The event is an electrical discharge and this event shows up as pure white (255). So I want to perform a matrix operation on each image whereby I cull all the numbers less than say 250 and make them zero (but still keeping the original matrix dimensions).
The second thing is, how do I overlay the images ontop of each other so as to build up a plot showing all the locations of this event at once? (ie so I can check that the event occured evenly across an area). is imadd(X,Y) sufficient?
Thanks for any help offered
Alex

 Accepted Answer

IMG(IMG<250) = 0;

5 Comments

If the events can overlap, then imadd() may not be suitable.
Wow simple as that? this is my first day really using matlab and I quite like it. Im used to VB, but this is even easier!
yeah the events can overlap, but as they pretty much max out the white value first time, then I dont know what to do. Perhaps giving each image its own false colour?
On a related subject, if IMG is an image (12 bit gray scale), how could you show the image as its normal 12 bit scale, but colour in red all values below a certain value (i.e. IMG<250)?
I cannot get that to work
I assume by IMG you mean whatever variable I have called my image. In this case FF
but FF = FF(FF<250) = 0 is invalid
even FF2 = FF(FF<250) = 0 doesnt work. What am I missing?
oh i dont need the FF= bit, sorted!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!