How to calculate Geodesic distance of human motion video in matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have (144 x 10800) or (25920 x 60) matrix as attached file.
The matrix was made background subtraction in video.
%// read the video:
reader = VideoReader('lena_side.avi');
vid = {};
while hasFrame(reader)
vid{end+1} = im2single(readFrame(reader));
end
%// simple background estimation using mean:
bg = mean( cat(4, vid{:}), 4 );
%// estimate foreground as deviation from estimated background:
for i=1:60
fIdx(i) = i; %// do it for frame 1 ~ 60
fg{i} = sum( abs( vid{fIdx(i)} - bg ), 3 ) > 0.25;
fg{i} = reshape(fg{i},[],1);
end
D1 = cell2mat(fg);
How can I calculate Geodesic distance in matrix? I wanna use the geodesic distance.
0 comentarios
Respuestas (1)
Pranjal Kaura
el 28 de Sept. de 2021
Hey Kong,
"bwdistgeodesic" accepts a binary image as input, so you would have to transform the frames in your video to binary images. You can use rgb2gray and imbinarize functions for this.
Hope this helps!
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!