Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

opencv python shrink image

import cv2
 
src = cv2.imread('D:/cv2-resize-image-original.png', cv2.IMREAD_UNCHANGED)

#percent by which the image is resized
scale_percent = 50

#calculate the 50 percent of original dimensions
width = int(src.shape[1] * scale_percent / 100)
height = int(src.shape[0] * scale_percent / 100)

# dsize
dsize = (width, height)

# resize image
output = cv2.resize(src, dsize)

cv2.imwrite('D:/cv2-resize-image-50.png',output) 
Comment

python opencv imresize

im = cv2.resize(im, None, fx=1/3, fy=1/3, interpolation=cv2.INTER_AREA)
Comment

opencv resize image

cv2.resize(src, dsize[, dst[, fx[, fy[, interpolation]]]])
Comment

PREVIOUS NEXT
Code Example
Python :: seconds in a month 
Python :: convert bytes to numpy array python 
Python :: how to set gui position tkinter python 
Python :: python cube root 
Python :: rotatable list python 
Python :: connect to mysql database jupyter 
Python :: update windows wallpaper python 
Python :: pygame left click 
Python :: rerun file after change python 
Python :: python send email outlook 
Python :: python print without space 
Python :: rename files in folder python 
Python :: add download directory selenium python 
Python :: middle value of a list in python 
Python :: How to normalize the data to get to the same range in python pandas 
Python :: fill a list with random numbers 
Python :: decision tree gridsearchcv 
Python :: qtextedit get text 
Python :: pandas read_csv multiple separator 
Python :: python print dict new line 
Python :: python download file from web 
Python :: remove turtle 
Python :: pandas to tensor torch 
Python :: char list to string python 
Python :: how to set icon in tkinter 
Python :: plotly hide trace 
Python :: playsound 
Python :: Python find max in list of dict by value 
Python :: python previous answer 
Python :: python sorting array without inbuilt sort 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =