Ask Your Question

N-5's profile - activity

2013-08-02 07:37:33 -0600 asked a question display result of max() function with imshow in opencv

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

2013-07-19 07:51:33 -0600 commented answer Displaying Grayscale in PictureBox/PixelFormat

Unfortunately I didn't use anything like that. I just used this code: Mat src_gray (src.size(), CV_8U); cvtColor( src, src_gray, CV_BGR2GRAY );

2013-07-19 06:11:44 -0600 commented answer Displaying Grayscale in PictureBox/PixelFormat

Hi, I have wrote some code like your "DrawCVImageDetect" and I have exactly the problem you said. Is it possible to write the code that solve your problem?