You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, following wiki, I wanted to define luminance ( l ), contrast ( c ) and structure ( s), for that I need the standard deviation: square root of the variance (sigma1_ below). But I also tested the formula $E((X-E(X))^2)$ and it gives me two different results.
Below is the code for $sigma1_= (sigma1_sq)^.5=E(X^2)-E(X)^2$ and $sigma1=E((X-E(X))^2)$ that can be added to here.
@Rubiel1 Your implementation of the second way is wrong. You should be aware of the block-based calculation for SSIM map.
It is not (img1-mu1).pow(2), actually, you need to calculate E[(img1_block_ij-mu1_ij).^2] for all i,j. So the first way is the right way.
So, following wiki, I wanted to define luminance ( l ), contrast ( c ) and structure ( s), for that I need the standard deviation: square root of the variance (sigma1_ below). But I also tested the formula$E((X-E(X))^2)$ and it gives me two different results.
Below is the code for$sigma1_= (sigma1_sq)^.5=E(X^2)-E(X)^2$ and $sigma1=E((X-E(X))^2)$ that can be added to here.
Is there a problem with my code?
Is there any reason to choose one of the two formulas? I assume it has to do with numerical stability.
The text was updated successfully, but these errors were encountered: