Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert numpy array to cv2 image

PIL.Image.fromarray(img)
Comment

how to convert numpy array to cv2 image

# cv2 images are already numpy arrays. So you do not need to convert it.
# Simply pass it to cv2 as a normal cv2 image.
import cv2
import numpy

imgarray = yourarrayhere # This would be your image array

cv2img = cv2.imshow(imgarray) # This work the same as passing an image
Comment

PREVIOUS NEXT
Code Example
Python :: System.Windows.Forms.DataGridView.CurrentRow.get returned null. c# 
Python :: loop over twodimensional array python 
Python :: pandas nan to none 
Python :: get value and key from dict python 
Python :: strip all elements in list python 
Python :: count a newline in string python 
Python :: how to remove items from list in python 
Python :: rc.local raspberry pi 
Python :: python lambda function map 
Python :: split string by spaces python 
Python :: python regex 
Python :: Using python permutations function on a list 
Python :: for i 
Python :: copy list python 
Python :: how to sort a dictionary using pprint module in python 
Python :: python save image to pdf 
Python :: python elasticsearch put index 
Python :: python series to list of string 
Python :: add x=y line to scatter plot python 
Python :: rmse python 
Python :: python cmd exec 
Python :: string to binary python 
Python :: replace nan numpy array 
Python :: abc python 
Python :: Accessing elements from a Python Dictionary 
Python :: python code to exe file 
Python :: unittest skip 
Python :: get the current date and time in python 
Python :: python how to get the last element in a list 
Python :: relative path django 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =