Resize an image type “Mat” opencv C++

前端 未结 2 2164
终归单人心
终归单人心 2021-01-13 04:39

I want to resize my image the code below works when the image is an IplImage but when i change it into Mat i get these errors: -Cannot convert \'cv::Mat::depth\' from type \

2条回答
  •  情歌与酒
    2021-01-13 04:58

    You can also use the code given below:

     Mat3b groupres;
     cvtColor(img, groupres, COLOR_GRAY2BGR);
     imshow("Grouped Result", groupres);
     Size size1(400, 450);
     resize(groupres, groupres, size1);
     waitKey();
    

    the waitKey(); helps the image to stay and wait for a response.

提交回复
热议问题