Skip to content

Commit

Permalink
fixed bug in gradient constancy optical flow
Browse files Browse the repository at this point in the history
added Huber data term and operator
  • Loading branch information
HendrikMuenster committed Mar 13, 2017
1 parent e5f24fd commit 8a77281
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion terms/data/basicOpticalFlow.m
Expand Up @@ -186,6 +186,9 @@ function warpDataterm(obj,vTilde,varargin)
end
end

%['interpn(image2',idxI2w1,',''spline'');']
%['interpn(image2',idxI2w2,',''spline'');']

dI2w{i} = eval(['interpn(image2',idxI2w1,',''spline'');']) - eval(['interpn(image2',idxI2w2,',''spline'');']);
dI1{i} = eval(['interpn(image1',idxI11,',''spline'');']) - eval(['interpn(image1',idxI12,',''spline'');']);

Expand All @@ -212,7 +215,9 @@ function warpDataterm(obj,vTilde,varargin)
end

for j=1:numSpatial
ddI2w{i}{j} = eval(['interpn(dI2w{',num2str(j),'}',idxI2w1,',''spline'');']) - eval(['interpn(dI2w{',num2str(j),'}',idxI2w2,',''spline'');']);
%['interpn(dI2w{',num2str(j),'}',idxI2w1,',''spline'');']
%['interpn(dI2w{',num2str(j),'}',idxI2w2,',''spline'');']
ddI2w{j}{i} = eval(['interpn(dI2w{',num2str(j),'}',idxI2w1,',''spline'');']) - eval(['interpn(dI2w{',num2str(j),'}',idxI2w2,',''spline'');']);
end
end

Expand Down
8 changes: 8 additions & 0 deletions terms/data/huberDataTerm.m
@@ -0,0 +1,8 @@
%term for \alpha |u-f|_{H_epsi}
classdef huberDataTerm < huberDataTermOperator & HuberDataProxDual
methods
function obj = huberDataTerm(alpha,f,epsi,varargin)
obj = obj@huberDataTermOperator(alpha,identityOperator(numel(f)),f,epsi);
end
end
end
2 changes: 1 addition & 1 deletion terms/data/huberDataTermOperator.m
@@ -1,4 +1,4 @@
%term for \alpha |Au-f|_H_eps
%term for \alpha |Au-f|_{H_epsi}
classdef huberDataTermOperator < basicDualizedDataterm & HuberDataProxDual
properties
epsi
Expand Down

0 comments on commit 8a77281

Please sign in to comment.