
Python
C_ROOKIES
总结技术点点滴滴。沉着冷静专注。
展开
-
Python 代码加速
查了半天说的需要numba优化。结果查看有支持python3.5的。继续查找发现,根本不支持,换python3.8 一切顺利运行,完美加入。原创 2020-06-23 17:02:30 · 159 阅读 · 0 评论 -
python处理图片
# 引入cv库import cv2import osimport numpy as np#定义函数读取图片位置 提取数据 读取数据def rgb888_to_rgb565(r,g,b): r1 = (r >> 3) << 11 g1 = (g >> 2) << 5 b1 = (b >> 3) c = r1|g1|b1 # 对调高低字节 c_h = (c << 8)&0.原创 2020-06-20 17:58:30 · 209 阅读 · 0 评论 -
python 读取png图片 透明度
import matplotlib.pyplot as plt # plt 用于显示图片import numpy as npimport cv2img = cv2.imread("c:/456.png",cv2.IMREAD_UNCHANGED)h,w,g = (img.shape)print(h)f = open("c:/111.bin",'wb')a = np.array(img)print(np.shape(img));#print(img)print(img[0][0][0].原创 2020-06-20 14:40:25 · 7101 阅读 · 0 评论 -
python 操作串口
pip3 install pyserial python3 安装串口包原创 2019-05-03 13:46:06 · 909 阅读 · 0 评论