Hi I have a mp4 video , I turned it into Frames ... but I want to make operations on EACH frame
Can any one help ???

 채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 21일

0 개 추천

Loop?
for K = 1 : number_of_frames
this_frame = frames{K}; %or however you stored them
now do something with this_frame
end

댓글 수: 3

Christine Ak
Christine Ak 2013년 12월 21일
Yeah its the way how I converted the video into frames ,, but using " this_frame" is not a good Idea because it will use the LAST value of it , I want to use EACH frame
Walter Roberson
Walter Roberson 2013년 12월 21일
That code will apply whatever onto each frame. Your code to do something with the frame is within the loop, so it gets presented with one frame at a time, in sequence.
Perhaps your question has to do with storing the results as you go. In that case have a look at
Christine Ak
Christine Ak 2013년 12월 22일
That's what I did.......Thank You so much :D

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Image Analyst
Image Analyst 2013년 12월 21일

0 개 추천

See my demo, attached. I calculate a background frame comprised of the last few frames, and then subtract it from the current frame. You can do something similar with whatever operation you want to do.

댓글 수: 5

Christine Ak
Christine Ak 2013년 12월 21일
Thank You , but I need to apply a code on all the frames , but each one will give a specific answer , which means that each frame should has a specific name can be called with .
Image Analyst
Image Analyst 2013년 12월 21일
I'm not sure what you're asking. It does each frame, which means it does all frames. Do you have some different definition of each and all that I don't know about? Of course every frame is different so every frame will have a different result or value, that's why I kept track of them in arrays that have the same number of elements as there are frames in the video. I really have no idea at all how to answer you, ... well not " answer" you since you didn't ask a question in your comment above, but I guess I mean "reply" to you.
Christine Ak
Christine Ak 2013년 12월 22일
actually I found my answer.... thank You Soooooo much ... You are always helpful :D
how you did it??
Image Analyst
Image Analyst 2019년 4월 3일
I doubt she'll answer, after more than 5 years, but I will. Is there something wrong with my code that doesn't work for you? Did you adapt it? Attach your adapted code.

댓글을 달려면 로그인하십시오.

komal
komal 2019년 6월 10일

0 개 추천

i have converted the videos into frames and now I want to subtract one frame from another like frame 1-frame 2 and then frame 2-frame3 and so on till the video ends.

댓글 수: 2

Image Analyst
Image Analyst 2019년 6월 11일
Did you see my answer? That's basically what I do. Adapt it as needed. It should be trivial.
komal
komal 2019년 6월 11일
Yes sir I saw your answer but my question is different.
I want to subtract the frames and continously run the loop for the whole video frames.
ex-frame 1-frame 2 and show the result in graph and then frame 2 - frame 3.Individual ans shown on graph
Sorry if I m unable to explain you clearly

댓글을 달려면 로그인하십시오.

질문:

2013년 12월 21일

댓글:

2019년 6월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by