Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

resize numpy array image

import cv2
import numpy as np

img = cv2.imread('your_image.jpg')
res = cv2.resize(img, dsize=(54, 140), interpolation=cv2.INTER_CUBIC)
Comment

NumPy resize Example

# welcome to softhunt.net
# importing the python module numpy
import numpy as np

# Making a random array
softhunt = np.array([0, 1, 3, 5, 7, 9, 11, 13, 15])

# Reshape the array permanently
softhunt.resize(3, 3)

print(softhunt)
Comment

NumPy resize Syntax

numpy.resize(a, new_shape)
Comment

PREVIOUS NEXT
Code Example
Python :: django bootstrap 
Python :: raw input py 
Python :: subset in python 
Python :: how to specify variable type in python 
Python :: python select from list by condition 
Python :: for if else one line python 
Python :: python multiply 2 variables 
Python :: print(int()) 
Python :: pandas write image to excel 
Python :: device gpu pytorch 
Python :: global variable python 
Python :: geodataframe change crs 
Python :: get ticks pygame 
Python :: sum of multiples of 3 or 5 python 
Python :: open file with python 
Python :: Creating Python Sets 
Python :: break line in string python 
Python :: a sigmoid function 
Python :: Check np.nan value 
Python :: how to find unique values in numpy array 
Python :: Link In Django 
Python :: how to make a username system using python 
Python :: django override delete 
Python :: python remove by index 
Python :: python anytree 
Python :: change python version in colab 
Python :: how to install ffmpeg_streaming in python 
Python :: different dataframe name with for loop 
Python :: python __lt__ 
Python :: pickled list 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =