필터 지우기
필터 지우기

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개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by