摘要: 一、圆 public static void cvCircle( IntPtr img, System.Drawing.Point center, //Center of the circle int radius, //Radius of the circle MCvScalar color, //Color of the circle int thickness, if negative indicates that a filled circle has to be drawn Emgu.CV.CvEn... 阅读全文
posted @ 2014-02-17 15:16 胡炜 阅读(1778) 评论(0) 推荐(0) 编辑
摘要: 一、cvApproxPoly 使用多边形逼近一个轮廓,使得顶点数目变少。算法先从轮廓选择2个最远的点,然后将2个连成一个线段,然后再查找轮廓上到线段距离最远的点,添加到逼近后的新轮廓。算法反复迭代,不断将最远的点添加到结果中。直到所有的点到多边形的最短距离小于parameter参数指定的精度。二、cvArcLength、cvContourPerimeter 作用于一个轮廓并返回其长度。三、cvContourArea 计算轮廓的面积。四、cvBoundingRect 描述矩形边界框,返回一个包围轮廓的CvRect,CvRect只能表示一个方正的长方形。五、cvMinAreaRect2 ... 阅读全文
posted @ 2014-01-21 16:15 胡炜 阅读(5919) 评论(0) 推荐(0) 编辑
摘要: 一、介绍 OTSU算法也称最大类间差法,有时也称之为大津算法,被认为是图像分割中阈值选取的最佳算法,计算简单,不受图像亮度和对比度的影响,因此在数字图像处理上得到了广泛的应用。它是按图像的灰度特性,将图像分成背景和前景两部分。背景和前景之间的类间方差越大,说明构成图像的两部分的差别越大,当部分前景错分为背景或部分背景错分为前景都会导致两部分差别变小。因此,使类间方差最大的分割意味着错分概率最小。二、公式推导: 记t为前景与背景的分割阈值,前景点数占图像比例为w0,平均灰度为u0;背景点数占图像比例为w1,平均灰度为u1。 则图像的总平均灰度为:u=w0*u0+w1*u1。 前景和背景图... 阅读全文
posted @ 2014-01-18 11:07 胡炜 阅读(864) 评论(0) 推荐(0) 编辑
摘要: 一、public static double cvThreshold( IntPtr src, IntPtr dst, double threshold, double maxValue, //Maximum value to use with CV_THRESH_BINARY and CV_THRESH_BINARY_INV thresholding types Emgu.CV.CvEnum.THRESH thresholdType ) thresholdType有如下几种: CV_THRESH_BINARY,表示dsti=(sr... 阅读全文
posted @ 2014-01-18 10:59 胡炜 阅读(1023) 评论(0) 推荐(1) 编辑
摘要: 一、先是在程序中图像的导入,我是根据图像路径实现,其中path是string类型,是图像路径。IntPtr img=CvInvoke.cvLoadImage(path, Emgu.CV.CvEnum.LOAD_IMAGE_TYPE.CV_LOAD_IMAGE_ANYCOLOR);二、图像灰度化处理,先创建一幅尺寸大小为为原图的8位图像GrayImg1:Rectangle cr = CvInvoke.cvGetImageROI(img1); int width = cr.Width; int height = cr.Height;IntPtr GrayImg1 = CvInvoke.cvCrea 阅读全文
posted @ 2014-01-18 10:27 胡炜 阅读(3163) 评论(0) 推荐(0) 编辑
摘要: 一、相关函数 public static void cvDrawContours( IntPtr img, IntPtr contour, MCvScalar externalColor, MCvScalar holeColor, int maxLevel, int thickness, Emgu.CV.CvEnum.LINE_TYPE lineType, //EIGHT_CONNECTED、FOUR_CONNECTED、CV_AA System.Drawing.Point offset ) cvDrawC... 阅读全文
posted @ 2014-01-17 16:58 胡炜 阅读(2552) 评论(1) 推荐(0) 编辑
摘要: The EMD is based on the minimal cost that must be paid to transform one distribution into the other.Intuitively,given two distributions,one can be seen as a mass of earth properly spread in space,the other as a collection of holes in that same space.Then,the EMD measures the least amount of work nee 阅读全文
posted @ 2014-01-12 22:25 胡炜 阅读(1049) 评论(2) 推荐(0) 编辑
摘要: 一、创建一个Color对象: Color c=Color.FromKnownColor(KnownColor.colorname);二、四种同样颜色的不同方式: Color c1=Color.FromArgb(32,178,170); Color c2=Color.FromKnownColor(KnownColor.LightSeaGreen); Color c3 = Color.AliceBlue; Color c4 = Color.FromArgb(0x20B2AA);三、颜色名称对照表 阅读全文
posted @ 2014-01-12 20:59 胡炜 阅读(4610) 评论(0) 推荐(0) 编辑
摘要: 一、根目录 .// 或者直接给出文件名称,是找根目录的路径如:path = "test.xml" 与 path = ".//test.xml"是一个意思二、根目录的上级目录,在C#中是指定到bin文件夹里面 ..// 应用程序的根目录的上两级三、指定到根目录上面的三级目录,也就是C#中与bin同目录中 ..//..//test.xml 这个意思是在根目录的三级目录的gs.mdb文件如果在这级目录中你要指定到指定文件夹中的某个文件,应该这样: ..//..//xml//test.xml意思在这个目录中的xml文件下面的test.xml文件四、指定到根目录的 阅读全文
posted @ 2014-01-12 20:41 胡炜 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 一、ColorImageFormat:彩色图像帧的格式 RawYuvResolution640x480Fps15 原始YUV格式,分辨率是640x480,每秒15帧; RgbResolution1280x960Fps12 RGB格式,分辨率是1280x960,每秒12帧; RgbResolution640x480Fps30 RGB格式,分辨率是640x480,每秒30帧; Undefined 未定义的格式; YuvResolution640x480Fps15 原始YUV,分辨率是640x480,每秒15帧;二、DepthImageForma... 阅读全文
posted @ 2014-01-07 21:57 胡炜 阅读(713) 评论(0) 推荐(0) 编辑