-
February 13th, 2010, 06:24 PM
#1
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
#2
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:
Code:
FOR every pixel
FOR every channel
ACCUMULATE the square difference in pixel channel intensity
DIVIDE by the number of pixels*channels
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|