How to calculate Geodesic distance of human motion video in matrix
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Pranjal Kaura
2021 年 9 月 28 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!