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 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!