Answers for "python filesotrage object to image"

1

werkzeug.datastructures.filestorage to numpy

#read image file string data
filestr = request.files['file'].read()
#convert string data to numpy array
npimg = numpy.fromstring(filestr, numpy.uint8)
# convert numpy array to image
img = cv2.imdecode(npimg, cv2.CV_LOAD_IMAGE_UNCHANGED)
Posted by: Guest on September-06-2020

Code answers related to "python filesotrage object to image"

Python Answers by Framework

Browse Popular Code Answers by Language