How can I write code to calculate frames differnces of video frames

From attached picture, you can see the difference between frame (h8.png) that contain on white area and frame h4.png is 4 frames and difference between h13.png & h8.png is 5 frames, the difference between h26.png & h13.png is 13 frames and the difference between h29.png & h26.png is 3 frames. How can I write code to calculate differences between frames that contain on white areas.

 Réponse acceptée

I think I already gave you code to do video processing (attached again just in case). So you just keep track, in the frame index loop, which frame have white blobs in them. Then just use the diff() function:
frameDifferences = diff(framesWithWhiteBlobs);

5 commentaires

Many Thanks Sir, Your dome is very valuable. Can you help me please how can I make loop (frameIndex). I need to matlab answer show me this results: >> h8-h4= 4 frames h13-h8= 5 frames h26-h13=13 frames h29-h26=3 frames Best Regards & thx in advance
I have no idea what any of that means. Try to re-phase it. My code does show you how to go through frame - by - frame.
Mehmed Ozkan
Mehmed Ozkan le 4 Juil 2023
Modifié(e) : Mehmed Ozkan le 4 Juil 2023
@Image Analyst Hi imageanalyst, I am not sure if this is the appropriate way to reach out, so forgive me. The above code is proving to be very useful for my research project and has brought me many smiles. I wanted to ask you for your permission to modify and use it accordingly or whether you want it to be treated as just coding advice. Anyway I can appropriately credit you? Thanks!
Excuse me for the late response Image Analyst, it gave me so many smiles and sent me down so many new rabbit holes. Learned a lot! Thank you

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by