How to remove the background/background noise from the images that comprise my video?

Hi,
I have a video in which a cell moves along a channel...however, the background i.e. the channel is near the brightness of that of my cell, so when I convert the video into images of its frames, and turn them into grayscale images, I cannot isolate the cell from its background very clearly, though I can faintly see it move against the background.
I tried frame subtraction..after subtracting the first frame that does not contain the cell from the remaining, I still get a lot of background noise. *Thus, when I try locating the cell by trying to identify the maximum brightness spot, *I get the locations of different other points with the greater brightness than the cell.
Can you suggest what I can do?

 採用された回答

Image Analyst
Image Analyst 2011 年 11 月 3 日

0 投票

You can get a fairly comprehensive overview of several of the main noise removal techniques here: http://www.stanford.edu/~slansel/tutorial/software.htm The methods the web page discusses are generally thought of as the best, state of the art methods, from among thousands that have been invented and more that are invented every month.

2 件のコメント

Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
編集済み: DGM 2023 年 2 月 13 日
I uploaded some images and they're on the links
based on what u see, is there any one of those toolbars that you would reccommend? Or could you categorize the kind of filtering I need?..or should i just download and use any one?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
編集済み: DGM 2023 年 2 月 13 日
AFTER FILTERING TWICE BY MEDFILT2....
I get the following image:
However, the cell is NOT THE BIGHTEST SPOT here, so I cannot use the code to find the brightest spot in order to locate the cell...so do I go for any other filter, or do I choose some other criterion to locate the cell?

サインインしてコメントする。

その他の回答 (3 件)

Image Analyst
Image Analyst 2011 年 11 月 2 日

0 投票

I'd suggest you post a few frames of your video somewhere so people can make informed suggestions.

19 件のコメント

Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 3 日
I used medfilt2 and it worked pretty well, though I'd like to be able to get more effective noise removal...can you give me an ida as to what I could do?
Walter Roberson
Walter Roberson 2011 年 11 月 3 日
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
編集済み: DGM 2023 年 2 月 13 日
AFTER FILTERING TWICE BY MEDFILT2....
I get the following image:
However, the cell is NOT THE BIGHTEST SPOT here, so I cannot use the code to find the brightest spot in order to locate the cell...so do I go for any other filter, or do I choose some other criterion to locate the cell?
Image Analyst
Image Analyst 2011 年 11 月 4 日
I'm not sure what you want to keep. Do you want the blue stuff to be uniform and the lines to "pop out" and be really visible?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
As you can see, there is a bright oval kind of thing at around (1200,250)...I want to keep just that. Everything else needs to be removed.
That's the cell. I need to make it as prominent as possible.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
Right now, the problem I'm stuck with is that there are multiple points outside the oval(my cell) that have same/greater intensity than my cell...but those are just small points here and there.....is there any function that allows me to identify regions above a certain intensity with a prescribed size? I mean...since my cell is bigger than any other isolated point, I could identify it by prescribing a size limit...
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 5 日
I TRIED LOCATING THE CELL BY USING BWCONNCOMP, BUT IT DIDN'T WORK OUT. SEEING THE IMAGES, IS THERE ANY OTHER WAY I COULD SPECIFY THE LOCATION OF THE CELL OR COMPLETELY REMOVE THE BACKGROUND? AS I MENTIONED BEFORE, THE CELL DOES NOT HAVE THE MAXIMUM INTENSITY.....
Image Analyst
Image Analyst 2011 年 11 月 7 日
Around 1200, 250 on which image? And do you have a grayscale version of these images rather than this pseudocolored image? It looks like you used imagesc() which applies some strange colormap by default. Can you just save the image without the figure axes, tick marks, colormap, etc.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 7 日
編集済み: DGM 2023 年 2 月 13 日
Here's the image using imshow...both image and imagesc gave pseudocolour..
PLEASE NOTE:
1. the cell is the very faint whitish blob on the farther right side of the image.
2. there are brighter spots, shown by a line of dots on the left side of the image.
3. i tried imtophat and imbothat , followed by BWCONNCOMP, because I thought that the cell could be identified as one connected element...however, there are just too many other connected elements, and the cell is neither the smallest or largest of them.
4. since the background varies, even using imtophat before frame subtraction didn't work..
please suggest.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 8 日
Imbothat worked better...but the cell still disappears into the background sometimes...I attached a picture in the link given directly above..
Image Analyst
Image Analyst 2011 年 11 月 8 日
Sorry - I still don't know which one you're trying to find. Can you annotate an image with an arrow pointing to the blob you want and tell me what's different about it than all the other blobs or dots, other than its location? Or is it the same and the only way you know it's there is that it's the only thing that moves from frame to frame?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 9 日
編集済み: DGM 2023 年 2 月 13 日
...I annotated it....So far I haven't been able to find anything distinguishing about it except that its the only thing that moves from frame to frame.
PLEASE NOTE:
In another similar video, there are other cells looking just like the cell in this picture....Somehow I need to locate ANY one cell's coordinates in all of the 480 frames and plot a graph of its coordinates...so how could I identify this one cell for starters?...Basically, how could I identify it?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 9 日
even when I try bwconccomp, it gives locations other than the cell itself...
Image Analyst
Image Analyst 2011 年 11 月 11 日
Why can't you just point to it with ginput. If you want, you can look in an area around the point to try to home in on it. It might be tedious for 480 frames but at least you'll get it done. You'd have had it done by now if you'd done that. I can't really do much more without the video and I don't really have time to do free private consulting for you, since this looks like it will take more than 10 minutes or so.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 12 日
編集済み: DGM 2023 年 2 月 13 日
Yeah, so ginput is better than nothing...and is certainly better than cpselect,which was my earlier option..
One more small point..
After I finish selecting one point on each frame, I need to plot all the points in a single plot...I've been trying this and it hasn't worked...
So what's wrong in this code:
M = mmreader('fractogene.avi');
N = M.NumberOfFrames;
for ii = 1:N
image(M.read(ii));
[X,Y]=ginput(1);
pause(0.1)
end
AFTER THAT, TO GET THE PLOT:
for ii=1:N
plot(X,Y,'ro')
end
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 12 日
編集済み: DGM 2023 年 2 月 13 日
this time i tried:
M = mmreader('fractogene.avi');
N = M.NumberOfFrames;
for ii = 1:N
image(M.read(ii));
[x(ii),y(ii)]=ginput(1);
[x(ii),y(ii)]
plot(x(ii),y(ii),'ro')
pause(0.1)
end
but it momentarily hold the plot for a single frame with a red spot, but i need to put all the points into a single plot..
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 12 日
編集済み: DGM 2023 年 2 月 13 日
its ok, i got it using:
for ii= 1:N
hold on
plot(x(ii),y(ii),'ro')
hold off
end
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 12 日
SO before I end off, I'd just like to ask if there is any other function that I could try out...i didn't know about ginput before this, so I'm wondering if there are others that would serve a similar purpose...or maybe even better

サインインしてコメントする。

Bjorn Gustavsson
Bjorn Gustavsson 2011 年 11 月 3 日

0 投票

In addition to medfilt2, you can also play around with wiener2 (Lee's sigma filter). Then there are a bunc of filter functions on the file exchange. One that I'd suggest you could try is bilateral or susan filters, there are a couple of those. Then there is a few nonlinear diffusion filters - they are really fancy and powerful but might be on the slow side when it comes to filtering a large number of frames. These two types of "more advanced" filters are my favourites outside of medfilt2 and wiener2, but tastes might vary.
Another point you might have to take into account (couldn't see your images so I'm really shooting in the dark here) is that you might have photo-respons non-uniformities - pixel-to-pixel variation in sensitivity. That is something you might be able to correct for by calculating the average of the ratio between medfilt2(frame,[5,5])./frame over all frames. That might give you a correction factor for PRNU, that might make filtering easier.
Then you might have a few bright or dark spots that eats up most of your grayscale. That you can overcome by setting the intensity limits manually or by doing some histogram clipping automatically.
I'm just tossing up a few ideas that I know can be useful, hopefully some of them helps.

3 件のコメント

Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
hi...thanks for your answer...please see the images I uploaded(links provided as a comment to the previous answer by Walter Roberson)....I need to isolate the cell, seen as a bright blob. As you can see, there are other patches/points on the images that have the same intensity as the cell...so which filter would you reccommend based on the images?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
Also, please note that in some other videos that I will be working on with MATLAB, there are multiple cells(looking exactly like the cell i showed in the images)....but I need to trace the position and velocity of any one of those...so would the filters that you are referring to meet this requirement? i.e. can i eliminate one of two completely similar looking objects?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
編集済み: DGM 2023 年 2 月 13 日
AFTER FILTERING TWICE BY MEDFILT2....
I get the following image:
However, the cell is NOT THE BIGHTEST SPOT here, so I cannot use the code to find the brightest spot in order to locate the cell...so do I go for any other filter, or do I choose some other criterion to locate the cell?

サインインしてコメントする。

i Venky
i Venky 2011 年 11 月 4 日

0 投票

Use top hat or bottom hat. It is used to reduce illumination

5 件のコメント

Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
編集済み: DGM 2023 年 2 月 13 日
Hi,
I tried imtophat...I put:
SE = strel('disk',5,8)
J = imtophat(D{300},SE);
figure, imshow(J)
I got the following:
I guess it gave the points which are of higher intensity than the cell. Please also see the images I uploaded...links are given as comments on previous answers.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 4 日
So I guess I'm looking for a way to eliminate the points of higher intensity....can you suggest something?
i Venky
i Venky 2011 年 11 月 5 日
移動済み: DGM 2023 年 2 月 13 日
I think you got me wrong. You have performed tophat after you have processed the frames. You have to use imtophat before you process the frame. Sometimes the background intensities change at different points because it's doesn't have constant value throughout. So before you process the frames( say frame subtraction) try using imtophat to the frames. It would give you uniform intensity for the background. Now if you do frame subtraction the background of the two frames will have the same intensity and will clearly become zero.
I got the same problem once and I did top hat and it worked. I am not sure if it would work for you. Anyway give it a try.
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 7 日
移動済み: DGM 2023 年 2 月 13 日
it didn't work too well with me...since the cell is so similar to its background, it itself gets invisible when I use imtophat..any other suggestions?
Yagnaseni Roy
Yagnaseni Roy 2011 年 11 月 11 日
移動済み: DGM 2023 年 2 月 13 日
The problem is that my background isn't constant at all. Even after applying imtophat or imbothat, it doesn't completely help.

サインインしてコメントする。

カテゴリ

質問済み:

2011 年 11 月 1 日

編集済み:

DGM
2023 年 2 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by