Why my Differential Total Variation (DTV) code doesn't working correctly?
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!