IS this right or not about calculation of Total Variation (TV) for image y?
古いコメントを表示
for a natural image it is difficult to calculate SNR so total variation (TV) will be calculated as an evaluation to noise.
for y(i,j)
TV=(sqrt(y(i,j)-y(i-1,j))^2+(y(i,j)-y(i+1,j))^2+(y(i,j)-y(i,j-1))^2+(y(i,j)-y(i,j+1))^2);
how can this implemented for a whole image ?
2 件のコメント
VINSHI KK
2017 年 11 月 19 日
What indicates the variation of i and j .Is it image size?
Image Analyst
2017 年 11 月 19 日
Yes, i and j range over the image dimensions. So i = 1 : rows and j = 1 : columns.
採用された回答
その他の回答 (2 件)
David Young
2012 年 1 月 14 日
I don't know, but an easy initial check is to see whether it gives the same answer as
var(y(:))
or possibly
var(y(:), 1)
(See the documentation for var.)
Image Analyst
2012 年 1 月 14 日
That's just the sum of the squares of a differences of a pixel value with its 3 nearest neighbors values plus the difference of one pair not squared. How is that a variance? Who says the center pixel is the mean of the 4 neighbors? Plus you didn't divide by (N-1) even if it were the mean. And I don't know what "Total" Variance is - how does it differ from the regular variance that everyone is familiar with? And your first term:
sqrt(y(i,j)-y(i-1,j))^2
is identical to y(i,j)-y(i-1,j) since you're just taking the square root and squaring it. So you're adding a linear term to two squared terms.
I think you need to think this through some more.
カテゴリ
ヘルプ センター および File Exchange で Read, Write, and Modify Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!