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!