MATLAB Answers

0

Why my Differential Total Variation (DTV) code doesn't working correctly?

Asked by Mohammad Al Nagdawi on 24 Oct 2018
Latest activity Edited by Mohammad Al Nagdawi on 28 Oct 2018
I try to implement Differential total variation (DTV) as described in (Wu, Y. et al 2017) or (Li, Y. et al 2015).
I implemented (Wu, Y. et al 2017) since it simpler:
function E = DTV_wu(r_img,f_img)
% r_img and f_img: images we try to calc. the similarity between them.
%%find grandiant domain for the images-> (forward finite difference)
[rx ry] = imgradientxy(r_img,'intermediate');
[fx fy] = imgradientxy(f_img,'intermediate');
%%L2 norm as (wu, y. et al, 2017)
gradR_r = (rx.^2 + ry.^2 ).^0.5;
gradR_f = (fx.^2+ fy.^2).^0.5;
subplot(2,2,1)
imshow(r_img);title('fix')
subplot(2,2,2);
imshow(f_img);title('flt')
subplot(2,2,[3 4])
imshow(mat2gray(abs(gradR_r - gradR_f));
%%residual image r
% vector L1 norm
E = sum(abs(gradR_r(:) - gradR_f(:))); %eq. 1
end
The output is not working correctly.
What is the mistake I did?

  0 Comments

Sign in to comment.

0 Answers