Evaluation of 2 frames after encoding/decoding
Hi everyone,
Another question, I capture 2 frames and then I obtain the absolute error of them:
//// After capturing 2 frames
Mat frame1, frame2;
absdiff(frame1,frame2,error);
Everything ok at this point. But later I need to encoder/decoder the image and the evaluate that result with the first error (for obtain the PSNR for example) imwrite("error.jpeg",error); Mat error2 = imread("error.jpeg");
The problem here is error2 and error1 are different. I tried everything without success, but I cant understand why for example
Mat error3 = error2 - error1; //// Show an error of not equal size of the matrix.
I dont know what yo do. Did someone could help me? Thank you very much.
Can you give some more information? Specifically, what version of OpenCV? What language (C++, Java, Python)? What size does error1 say it is, and what size does error2 say, if you print rows and cols?
Also, if you open error.jpg in an image editing program like paint, what does it say there?
What pixel format are both images? Is one CV_8UC1 and one CV_8UC3?