
opencv
AIOT魔法师
这个作者很懒,什么都没留下…
展开
-
opencv四坐标区域裁剪
图像区域裁剪原创 2023-01-14 19:59:51 · 319 阅读 · 0 评论 -
lpr指定3.4版本的opencv
opencv-python-3.4.9.31原创 2022-05-01 11:23:42 · 1869 阅读 · 0 评论 -
Python二值化照片
import cv2import numpy as npimport matplotlib.pylab as plt img = cv2.imread('img.jpg',0)ret,thresh1 = cv2.threshold(img,127,255,cv2.THRESH_BINARY)ret,thresh2 = cv2.threshold(img,127,255,cv2.THRESH_BINARY_INV)ret,thresh3 = cv2.threshold(img,127,255,原创 2022-02-09 11:25:09 · 162 阅读 · 0 评论 -
opencv图像Base64相互转换
将普通opencv图像转换成base64:def image_to_base64(image_np): image = cv2.imencode('.jpg',image_np)[1] image_code = str(base64.b64encode(image))[2:-1] return image_code将Bse64转换成Openc图像:def base64_to_image(base64_code): # base64解码 img_data原创 2021-08-09 18:10:02 · 1993 阅读 · 0 评论 -
Opencv压缩图像的长宽python
import cv2img = cv2.imread('test.jpg')img = cv2.resize(img, (img.shape[1]//2, img.shape[0]//2), interpolation=cv2.INTER_CUBIC)cv2.imwrite('lena2.jpg', img)cv2.imshow('image2', img)cv2.waitKey(0)原创 2021-08-09 10:52:49 · 352 阅读 · 0 评论