共 99 篇文章 |
|
numpy.flatnonzero.Output array, containing the indices of the elements of a.ravel() that are non-zero.nonzeroReturn the indices of the non-zero elements of the input array.flatnonzero(x)array([0, 1, 3, 4])Use the indices of the non-zero elements as an index array to extract these elements:flatnonzero(x)]array([-2, -1,... 阅129 转0 评0 公众公开 17-08-29 15:02 |
python ProgressBar 进度条 基本用法: 高级一点的用法: 在运行.py文件时,得到的使动态的,这里只展示最终状态。 阅221 转0 评0 公众公开 17-08-29 14:09 |
Python列表,元祖及字典的区别list(列表) 用方括号列表是Python的一种内置数据类型,list是一种有序的集合,可以随时添加和删除其中的元素。 阅274 转1 评0 公众公开 17-08-10 17:23 |
工作电脑,无法上网时,安装常用包的方法。工作电脑一般是不能上网的,保密嘛。如何在没有网的状态下,安装常用包呢?1、先下载要安装的包这里下载的是pypng-0.0.18.tar.gz包2、使用pip install 包名这里为:sudo pip install pypng-0.0.18.tar.gz. 阅18 转0 评0 公众公开 17-08-10 16:10 |
/usr/bin/env python # encoding: utf-8 import cv2 import numpy as np image = cv2.imread("D:/histTest.jpg", 0) hist = cv2.calcHist([image], [0], #使用的通道 None, #没有使用mask [256], #HistSize [0.0,255.0]) #直方图柱的范围。'''''' hi... 阅595 转2 评0 公众公开 17-08-08 19:29 |
[python] view plain copy img = cv2.line(img,(0,0),(511,511),(255,0,0),5) cv2.line有五个参数,图片名称、起点坐标、终点坐标、颜色、线宽。画多边形cv2.polylines()[python] view plain copy pts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32) pts = pts.reshape((-1,1,2)) img = cv2.polylines(img,[pts],True,(0,255,255)... 阅166 转1 评0 公众公开 17-08-03 13:42 |
def line(img, #图像文件 pt1, pt2, color,#形状的颜色 thickness=None,#默认值是1,线条的粗细 lineType=None,#线条的类型 shift=None)def rectangle(img, pt1, pt2, color, thickness=None, lineType=None, ... 阅60 转0 评0 公众公开 17-08-03 11:24 |