February 13th, 2010, 06:24 PM
MSE of an image
How can I calculate the Mean Square Error (MSE) of two RGB images (having 3 channels)? I am using the Opencv Library and it does not appear to have a function for this. Is there any formula? Please help..
February 13th, 2010, 11:17 PM
Re: MSE of an image
Are you assuming they're aligned, or are you using the MSE to try and align them? (There are better ways to align images, but MSE is a conceptually simple one.)
If the former, then pseudocode would be:
Using OpenCV, this may actually be easier if you convert your IplImage into a CvMat, because finding the squared difference of two matrices is very straightforward, as is accumulating an array. But the problem is trivial enough that a simple series of loops is probably about the same amount of code.
FOR every pixel
FOR every channel
ACCUMULATE the square difference in pixel channel intensity
DIVIDE by the number of pixels*channels
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!