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!