
画图
npupengsir
新手程序员
展开
-
在图像上画框
def draw_mask(img, x1, x2, y1, y2, thickness): max_value = np.iinfo(img.dtype).max img[max(0, x1-thickness//2): min(img.shape[0], x1+thickness//2), max(0, y1-thickness//2): min(img.shape[1], y2+thickness//2)] = max_value img[max(0, x2-thickness//原创 2021-06-13 07:25:51 · 244 阅读 · 0 评论 -
plotly使用指南
plotly是开挂的作图神器,可以供js, python, R, DB等使用。具体见官网plotly官网1. 安装pip install plotly更新pip install plotly --upgrade2. 在线使用,画的图会存入云账户中import plotly#设置用户名和API-Keyplotly.tools.set_credentials_file(username='DemoAc原创 2017-09-05 22:27:47 · 57089 阅读 · 9 评论 -
python读取图片的方式
1. opencv-python包opencv的像素值在[0,1][0,1]之间,存储的时候转换到[0,255][0,255],show的时候转换到[0,255]import cv2img = cv2.imread("imgfile")cv2.imshow("img_win_name", img)cv2.waitKey(0) # 无限期等待输入cv2.imwrite("write_file_原创 2017-12-17 21:27:01 · 6914 阅读 · 0 评论