I have a video,I am extracting its frames and I need to find the connected components of every frame of that video and also find the centroid of the connected components along with their corresponding pixel size.I am running a loop to do this.I want to save the centroids and pixel size in a matrix but I couldn't do that.How to do this?Below is the code-
vidobj=VideoReader('cloud.mp4');
Frame_No=vidobj.NumberOfFrames;
for i=1:NumberOfFrames
imwrite(read(vidobj,i),strcat('C:\Users\PRACKKZ\Documents\MATLAB\cloudframes\',num2str(i),'.png'))
end
for i=1:NoOfFrames
rgb=imread(strcat('C:\Users\PRACKKZ\Documents\MATLAB\cloudframes\',num2str(i),'.png'));
I=imresize(rgb,[512 512]);
bw = im2bw(I);
CC=bwconncomp(bw);
lab=labelmatrix(CC);
props = regionprops(lab, 'Centroid', 'Area');
After this I don't know how to save centroid and pixel size.
Best Answer