Quick process detection in a video

2 次查看(过去 30 天)
I have a video with 30 fps frame rate that recorded in 50k fps. The video has some quick sparks that I need to find their corresponding frames. The sparks occurrence is around a specific location with colour change. Which techniques can I utilize to obtain the desired frames?
  2 个评论
Ajay Gajulapally
Ajay Gajulapally 2023-3-2
You can use "videoReader" function in matlab, to read video and use "read" function to get frame by frame values, but without the sample data, it would be hard to tell which techniques can be used. Can you share the sample data?
Seyed Mahmoud Seyedi Sahebari
Here are three sequence frames with 20 microsecond interval. The spark is visible just in the second one, which shows how the spark is quick.

请先登录,再进行评论。

回答(1 个)

Akshat
Akshat 2023-11-15
Hi Seyed,
As per my understanding of the question, you want to find out the frames with sparks in them, and the rest of the frames are same, as the sparks are instantaneous.
This task can be done using two approaches:
  1. You go frame by frame and find the difference between the current and the previous frame. A reference to this technique is this answer: https://www.mathworks.com/matlabcentral/answers/168762-how-can-i-write-code-to-calculate-frames-differnces-of-video-frames. This might help as the task you need to perform is quite similar.
  2. You can leverage the Computer Vision toolbox in MATLAB and can detect “movement” of the objects in them. This might be a very lengthy approach for your use case but I’m still stating this approach as this might work. Here is the link to the Computer Vision Toolbox : https://www.mathworks.com/products/computer-vision.html.
For the first approach, you can preprocess the video using the code attached, which is also in the answer I stated above. Then you can use the function “diff” to find the difference in the frames.
Hope this helps!
Regards
Akshat

Community Treasure Hunt

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

Start Hunting!

Translated by