I have a video of about 400 frames(.AVI), first I changed the brightness, then cropped the images to focus on interesting areas. After that, I converted the cropped image to a binary image. In the end, I saved both binary and original images which should be the same size.
I already did this only for one frame (image) but I have no idea how to do these steps for the entire video...
Here is what I did>>>
img = imread('3217.tif');
I = imcrop(img,[120,280,1990,980]);
[rows,columns,ch] = size(img);
imwrite(I, 'F:\Herder\collective obstacles\process\PIV\No obstacle\cropped\3217.tif');
imwrite(img1, 'F:\Herder\collective obstacles\process\PIV\No obstacle\cropped\binary\3217.tif');