234234234

随笔分类 -  python

摘要:import scanpy as sc import scipy # from scipy.sparse import csr_matrix # import scipy.sparse import numpy as np import time # 记个运行时长 start = time.perf 阅读全文
posted @ 2022-10-01 13:51 你若愿意,我一定去 阅读(200) 评论(0) 推荐(0) 编辑
摘要:import osimport cv2img = cv2.imread("./test.bmp")# 转成透明度图片img = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA)width, height, channel = img.shapefor i in range( 阅读全文
posted @ 2021-06-16 09:39 你若愿意,我一定去 阅读(2039) 评论(0) 推荐(0) 编辑
摘要:描述:用来执行定时任务(异步),点个赞不过分吧 # 计时器类(异步) # time: 间隔时间(秒), 毫秒请使用小数(0.1xxxx) # handle: 要进行的异步处理器(名称) # arg: 异步处理器的参数(元组) class setInteval(threading.Thread): d 阅读全文
posted @ 2021-03-07 20:11 你若愿意,我一定去 阅读(748) 评论(0) 推荐(0) 编辑
摘要:思想:跟家里铺瓷砖的想法是一样的 给出大矩形的宽高:width, height 切块的宽高:span(width, height) def slice_rectangle(width, height, span): shape = [0, 0] # 高宽 blocks = [] # (lx,ly) 阅读全文
posted @ 2021-03-07 16:26 你若愿意,我一定去 阅读(98) 评论(0) 推荐(0) 编辑
摘要:def getConnectedNum(mat): cnt = 0 h = len(mat) for i in range(h): w = len(mat[i]) for j in range(w): if mat[i][j] == 0: cnt = cnt + 1 seekConnected(ma 阅读全文
posted @ 2021-02-22 21:58 你若愿意,我一定去 阅读(104) 评论(0) 推荐(0) 编辑
摘要:参考博客: https://www.cnblogs.com/zhangjiansheng/p/6925722.html # coding=gbk from PIL import Image # 灰度策略 def strategy_avg(r, g, b): return int((r + g + b 阅读全文
posted @ 2021-01-14 11:58 你若愿意,我一定去 阅读(299) 评论(0) 推荐(0) 编辑

23423423423
点击右上角即可分享
微信分享提示