How to resize an image to a specific size in OpenCV?

前端 未结 5 1406
北荒
北荒 2020-12-05 13:19
IplImage* img = cvLoadImage(\"something.jpg\");
IplImage* src = cvLoadImage(\"src.jpg\");
cvSub(src, img, img);

But the size of the source image is

5条回答
  •  爱一瞬间的悲伤
    2020-12-05 14:07

    You can use cvResize. Or better use c++ interface (eg cv::Mat instead of IplImage and cv::imread instead of cvLoadImage) and then use cv::resize which handles memory allocation and deallocation itself.

提交回复
热议问题