I am trying to circular crop the video that is recorded. I don't understand the ci command line and the gray_frame line.
clear all
close all
clc
v = VideoReader("SquareWaveWithPlasticBall_90SLPM_Ceramic_16Hz_2.5G_10FPS.mp4");
i = 0;
while hasFrame(v)
frame = readFrame(v);
%imtool(frame)
%imhist(frame);
gray_frame = rgb2gray(frame);
%imhist(gray_frame)
binary_frame = imbinarize(gray_frame,0.3) ;
ci = [638, 484, 512.75];
gray_frame = grey_frame((xx.^2 + yy.^2)<ci(1)^2);
file = sprintf("a_frame_%d",i);
myFolderpath = 'D:\MichaelJ\test4\BinarizedImages\';
FILENAME = string(strcat(myFolderpath, file, '.png'));
imwrite(binary_frame, FILENAME);
%imshow(G3)
i = i + 1;
%imshow(binary_frame)
%writeVideo(binary_frame, double(BW));
end
clear reader
%close(writer)
Assuming that ci variable is a vector containing parameters for a circle,
Problems :
try this