How to estimate particle velocity with video input not image?
I'm new to PTV. I have a video file and also a text file of sensor data (accelerometer) of a particle movement (angular and linear movement) through a channel. If I want to use PIVlab can I have video or text file input? or PIVlab get just images? What do you suggest? Do I need to capture image frames of the video file ?
Thank in advance for any help
A tip if you have many frames in your video, pad the frame numbering with zeros to ensure that the files are ordered correctly when PIVLab imports them. This is shown in my example code below as '%04d'. This means the file name will be padded with zeros and 4 total digits displayed since I had over 1000 frames to extract. You can modify this to whatever works for you.
My Example (works but I am sure this is not optimal):
a = VideoReader('F:\PIV_Files\MovieFileName.mp4');
for img = 1:a.NumberOfFrames
filename = sprintf('Frame_%04d.bmp', img);
b = read(a, img);
Note: According to MATLAB R2016, they are phasing out both .NumberOfFrames and read, but I did not get their replacements to work easily, so I left it in this form. I hope this helps you or someone!