Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

resize imshow opencv python

import cv2
cv2.namedWindow("output", cv2.WINDOW_NORMAL)        # Create window with freedom of dimensions
im = cv2.imread("earth.jpg")                        # Read image
imS = cv2.resize(im, (960, 540))                    # Resize image
cv2.imshow("output", imS)                            # Show image
cv2.waitKey(0)                                      # Display the image infinitely until any keypress
Comment

opencv imshow resize

import cv2
 
img = cv2.imread('/home/img/python.png', cv2.IMREAD_UNCHANGED)
 
print('Original Dimensions : ',img.shape)
 
scale_percent = 60 # percent of original size
width = int(img.shape[1] * scale_percent / 100)
height = int(img.shape[0] * scale_percent / 100)
dim = (width, height)
  
# resize image
resized = cv2.resize(img, dim, interpolation = cv2.INTER_AREA)
 
print('Resized Dimensions : ',resized.shape)
 
cv2.imshow("Resized image", resized)
cv2.waitKey(0)
cv2.destroyAllWindows()
Comment

PREVIOUS NEXT
Code Example
Python :: python random true false 
Python :: clear outpur jupyter 
Python :: WARNING: There was an error checking the latest version of pip. 
Python :: pandas read tab separated file 
Python :: how to change pygame window icon 
Python :: python check if has attribute 
Python :: tensorflow version check 
Python :: python download image 
Python :: python windows notification 
Python :: python for file in dir 
Python :: how to print hostname in python 
Python :: python how to count the lines in a file 
Python :: pandas remove timezone info 
Python :: get screen size python 
Python :: remove ticks matplotlib 
Python :: code how pandas save csv file 
Python :: what skills do you need to master pvp in minecraft 
Python :: python flip a coin 
Python :: convert date time to date pandas 
Python :: python subprocess.run output 
Python :: min max scaler sklearn 
Python :: how to take list of integer as input in python 
Python :: s3fs download file python 
Python :: remove extension from filename python 
Python :: networkx remove nodes with degree 
Python :: Can only use .dt accessor with datetimelike values 
Python :: python write to json with indent 
Python :: how to import csv in pandas 
Python :: remove all 0 from list python 
Python :: python auto module installer 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =