bufospro 0 Junior Poster

Hi,
I use matlab for image processing.
I have compressed some images and I would like to find the mse (mean square error)

My code is :

main.m
[MseRose4]  = MseCompute(Rose,indexedRose4);
MseCompute.m
function [MSE] = MseCompute(image1,image2)
   MSE = sum( sum((image1 - image2).^2));
   MSE = MSE/(size(image1, 1)* size(image2, 2));
end

Rose is 256*256*3uint8
indexedRose4 is 256*256

As a result, the program is not working
MSE = sum( sum((Rose - indexedRose4).^2));
??? Error using ==> minus
Integers can only be combined with integers of the same class, or scalar doubles.

Could someone help me please ??
Thanks a lot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.