【发布时间】:2015-02-15 12:50:17
【问题描述】:
我在内存中有一个上传的文件。我想用 cv2 操作文件。目前,我将文件写入磁盘,然后使用 cv2 读取它。如何跳过写入文件并直接使用 cv2 加载?
file = request.files['file']
# if file and allowed_file(file.filename):
# save file
filename = secure_filename(file.filename)
file_path = os.path.join(dressrank.config['SHOW_IMG_FOLDER'], filename);
file.save(file_path)
img_path = file_path
# COLOR FATURE EXTRACTION
img = read_img(img_path)
img =img_resize(img, 500)
【问题讨论】: