Subtracting the first frame of a movie from all the others....using imsubract maybe?

2 ビュー (過去 30 日間)
Yagnaseni Roy
Yagnaseni Roy 2011 年 10 月 19 日
回答済み: komal 2019 年 6 月 10 日
Hi, I split all the frames of my movie into its frames using the following code.....
M = mmreader('cell.avi');
N = M.NumberOfFrames;
for ii = 1:N
image(M.read(ii));
pause(0.1);
end
Now I'd like to isolate the cell that's changing location in the scene from one frame to another, by subtracting the first frame from all the others, since the fist frame is the only one that has everything except the cell...
How do I modify the above code to subtract the first frame from all the others?
I tried imsubtract(oneFrame,1)
but it didn't work....
  1 件のコメント
Yagnaseni Roy
Yagnaseni Roy 2011 年 10 月 20 日
HEY i DID IT USING
M = mmreader('cell.avi');
N = M.NumberOfFrames;
for ii = 1:N
A=imsubtract(M.read(1),M.read(ii));
imshow(A);
pause(0.1);
end
.....IS THERE ANY WAY I CAN SHOW THE COORDINATE AXIS SO THAT I CAN MEASURE HOW MUCH IT HAS MOVED?

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

回答 (2 件)

Ashish Uthama
Ashish Uthama 2012 年 9 月 17 日
"HEY i DID IT USING "
M = mmreader('cell.avi');
N = M.NumberOfFrames;
for ii = 1:N
A=imsubtract(M.read(1),M.read(ii));
imshow(A);
pause(0.1);
end

komal
komal 2019 年 6 月 10 日
if i want to subtract one frame from the next one then how can i do it?
like frame1-frame2 ,frame2-frame3 and so on till video ends.
please provide me the code

Community Treasure Hunt

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

Start Hunting!

Translated by