display result of max() function with imshow in opencv

asked 2013-08-02 07:37:33 -0600

N-5 gravatar image

I have 2 Mat of 1 image with a little differences in some pixels. I want to find max for each pixel and show them. I wrote this code in Visual C++ 2010 (Console):

Mat dst;
max(result0, result1, dst);
imshow("dst", dst);

and the dst image was displayed perfectly, but when I copied this code in windows form I received this error: "error C2440: '?' : cannot convert from 'cv::MatExpr' to 'bool'" so I changed the code to this:

Mat dst;
max(&result0, &result1, &dst);
imshow("dst", dst);

but in run time this error was appeared: "An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in OpenCVProject.exe Additional information: External component has thrown an exception."

please help me to display the image. thanks in advance

edit retag flag offensive close merge delete