-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathNullStereoVideoStabilizer.m
More file actions
executable file
·45 lines (32 loc) · 1.36 KB
/
NullStereoVideoStabilizer.m
File metadata and controls
executable file
·45 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
classdef NullStereoVideoStabilizer < VideoStabilizer
%StereoVideoStabilizer stablize stereo sequence.
properties
currentPairInd;
end
methods
function obj = NullStereoVideoStabilizer(sd, cfg,pairs)
obj = obj@VideoStabilizer(sd,cfg,pairs);
obj.currentPairInd=1;
end
function res = HasNext(obj)
res = obj.currentPairInd<=size(obj.frame_inds,1);
end
function [stable_left,stable_right] = StabilizeNextPair(obj)
if obj.HasNext()==0
error('No next frame to process!');
end
if obj.useVideo==1
% Read from video reader..
right = read(obj.reader,obj.frame_inds(obj.currentPairInd,1));
left = read(obj.reader,obj.frame_inds(obj.currentPairInd,2));
else
% Read from dump dir..
f = obj.cfg.get('baseDumpFrameFileName');
right = imread(sprintf(f,obj.frame_inds(obj.currentPairInd,1)));
left = imread(sprintf(f,obj.frame_inds(obj.currentPairInd,2)));
end
stable_right = rgb2gray(right);
stable_left = rgb2gray(left);
end
end
end