Video Stabilization of shaky video. Please help me solve the timing issues
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
I'm trying to stabilize a shaky video. Here is my code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
filename = 'xyz.avi';
hVideoSrc = vision.VideoFileReader(filename, ...
'ImageColorSpace', 'Intensity',...
'VideoOutputDataType', 'single');
hVPlayer = vision.VideoPlayer;
imgB=step(hVideoSrc);
while ~isDone(hVideoSrc)
imgA=imgB;
imgB=step(hVideoSrc);
ptsIn=detectSURFFeatures(imgA);
ptsOut=detectSURFFeatures(imgB);
[featuresIn validPtsIn]=extractFeatures(imgA,ptsIn);
[featuresOut validPtsOut]=extractFeatures(imgB,ptsOut);
index_pairs=matchFeatures(featuresIn,featuresOut);
matchedPtsIn=validPtsIn(index_pairs(:,1));
matchedPtsOut=validPtsOut(index_pairs(:,2));
gte=vision.GeometricTransformEstimator;
gte.Transform='Nonreflective similarity';
[tform inlierIdx]=step(gte,matchedPtsOut.Location,matchedPtsIn.Location);
agt=vision.GeometricTransformer;
imgB1=step(agt,imgB,tform);
step(hVPlayer,[imgB imgB1]);
end
release(hVideoSrc);
release(hVPlayer);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
the problem I'm facing is that original video and stabilized video are being run at lower framerate step(hVPlayer,[imgB imgB1]) so that i'm unable to notice any difference between original shaky video and stabilized video. howto make it faster.
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!