Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize image OpenCV

Tags:

c++

opencv

resize

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?

like image 763
Clip Avatar asked Jun 01 '14 20:06

Clip


People also ask

How does cv2 resize work?

Again, the width of the new image will be 150 pixels. The height is then calculated by multiplying the old height by our ratio and converting it to an integer. By performing this operation, we preserve the image's original aspect ratio. The actual resizing of the image takes place on Line 23.

Which function is used to resize an image in OpenCV?

resize() Function. To resize images with OpenCV, use the cv2. resize() function. It takes the original image, modifies it, and returns a new image.

What is scale in OpenCV?

Introduction to OpenCV scale image Open CV scale image is a Function present in the open CV library, which enables the images entered by the user to be upscaled in terms of the dimension and size of the original image provided.


1 Answers

If you want 75% along each axis, you should be able to use cv::resize to do:

cv::resize(inImg, outImg, cv::Size(), 0.75, 0.75); 
like image 113
Yeraze Avatar answered Sep 20 '22 23:09

Yeraze