If I have an image called inImg
and an image named outImg
how can I resize outImg
so that it is 75% the size of inImg
?
Use cv::resize
. Following code will resize outImg to 0.75 times the dimensions of inImg with CV_INTER_LINEAR type of interpolation.
cv::resize(outImg, outImg, cv::Size(inImg.cols * 0.75,inImg.rows * 0.75), 0, 0, CV_INTER_LINEAR);
4th and 5th argument should be left 0 or not assigned to take 3rd argument as size otherwise it will scale according to 4th and 5th arguments. (OpenCV3 resize)