|
软件标签: opencv api手册
opencv api java中文手册是帮助开发者们使用java语言进行opencv编程的帮助手册,能够通过关键词查找的方式搜索到你所想要的各类函数使用方法,属性,定义,以及函数类型等信息,从而更快速的进行opencv编程工作!
数据包介绍
packages:org.opencv.imgproc
这个包中包括模糊,调整图像,金字塔运算,滤波,颜色转换,计算直方图,边缘检测,二值化,大小等等。
介绍几个比较重要和常用的算法。
对图像进行二值化
static void
使用自适应阈值的方式来二值化图像, t(x,y)是对每个像素计算的阈值.
adaptivethreshold(mat src, mat dst, double maxvalue, int adaptivemethod, int thresholdtype, int blocksize, double c)
对于adaptive_thresh_gaussian_c, t(x,y) 是(x, y)的blocksize x blocksize 的领域加权均值 减去 c.
对于 adaptive_thresh_mean_c, t(x,y) 是(x, y)的blocksize x blocksize 的领域均值 减去 c.
属性
blocksize - 对于某个像素,计算其阈值所考虑的元素范围: 3, 5, 7, and so on.
thresholdtype - thresholding type that must be either thresh_binary or thresh_binary_inv.
dst -和原图像相同类型的的目标图像.
c - 从均值中减去的一个常数. 一般是取正值,也可以去0或者负数.
src - 原图像8位单通道图像.
maxvalue - 和thresholdtype相关,如果这一参数为 thresh_binary,那么二值化图像像素大于阈值为maxvalue,反之参数为thresh_binary_inv,则小于阈值的被赋值为maxvalue。
adaptivemethod - 能够使用哪种自适应阈值算法, adaptive_thresh_mean_c oradaptive_thresh_gaussian_c.
用法举例
imgproc.adaptivethreshold(inputframe.gray(), mbyte, 255,imgproc.adaptive_thresh_gaussian_c, imgproc.thresh_binary_inv, 5, 2);
opencv java api 中文文档chm暂未发布,暂提供官网api文档学习入口!

|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|