Ask Your Question

Revision history [back]

Basically what you do is add a button to your form, doubleclick the button to create a button handler, then in that function you do the following steps:

cv::Mat img = pictureBox.image() //Check the exact function to retrieve the image
cv::Mat outputImg;
cv::cvCvtColor( img, outputImg, CV_RGB2GRAY );
pixtureBox.setImage = outputImg; //Again check the correct setter for this

Then if an error returns, it is that the pictureBox cannot take a Mat element. I am not sure of that. Get back to me if it errors out and ill look for a solution. Probably you will need a type conversion.