图像二值化 python
2016-05-10 22:00
411 查看
import cv2.cv as cv image = cv.LoadImage('e:/aa/train/26/1.bmp') new = cv.CreateImage(cv.GetSize(image), image.depth, 1) for i in range(image.height): for j in range(image.width): #new[i,j] = max(image[i,j][0], image[i,j][1], image[i,j][2]) new[i,j] = max(image[i,j][0], image[i,j][1], image[i,j][2]) cv.Threshold(new, new, 35, 255, cv.CV_THRESH_BINARY_INV) cv.ShowImage('a_window', new) cv.WaitKey(0)
https://segmentfault.com/a/1190000003755115
相关文章推荐
- python classmethod,staticmethod实现
- python strip lstrip rstrip用法
- 收集了一些python的文章
- 十个Python程序员易犯的错误
- k近邻算法识别手写数字Python实现
- 开发中常遇到的Python陷阱和注意点
- Python单例模式
- python删除安装的模块
- python删除安装的模块
- python删除安装的模块
- python with用法
- python的disutils创建分发包
- python的disutils创建分发包
- python的disutils创建分发包
- python random 生成随机数
- 关于python中将py文件转换成exe文件的问题(使用py2exe)
- 模块sys
- Python NumPy-快速处理数据
- python学习笔记2—python文件类型、变量、数值、字符串、元组、列表、字典
- 感知哈希算法--python实现