aforge 学习-基本图像处理要用的类库

1.图像灰度化:Grayscale.CommonAlgorithms.BT709(3种)

FiltersSequence =new  FiltersSequence(数组处理函数);

2.二值化(阈值化)将灰度图像转换为黑白图像,用于识别轮廓。

Threshold 等类 t filter = new Thd( 颜色值 );

filter.ApplyInPlace( image );

3.二值图像后,再用BLOB处理法检测 要处理的区域分离出来

BlobCounter 对象

BlobCounter 类数和提取图像中独立对象使用连接组件标记算法。
    注意:算法对所有像素值小于等于BackgroundThreshold为背景,但较高的像素值作为对象的像素。
    blob的搜索类支持8 bpp索引灰度图像和24/32   bpp至少两个像素的彩色图像。图像的一个像素宽可以处理如果他们先旋转,或与RecursiveBlobCounter处理它们。

// create an instance of blob   counter algorithm
    BlobCounter bc = new BlobCounter( );
    // process binary image
    bc.ProcessImage( image );
    Rectangle[] rects = bc.GetObjectsRectangles( );
    // process blobs
    foreach ( Rectangle rect in rects )
    {
        // ...
    }
   

 

 对象.FilterBlobs =true;

MinWidth ,MinHeight MaxWidth MaxHeight设定。

GetObjectsInformation()方法得到所有图块的信息(边缘点、矩形区域、中心点、面积、完整度,等等),

GetBlobsEdgePoints(blob);PointsCloud

利用Set of tools for processing collection of points in 2D space.The static class contains set of routines, which provide different operations
with collection of points in 2D space. For example, finding the furthest point
from a specified point or line.(在二维空间中处理点集合的工具集。静态类包含一组例程,它们提供不同的操作在二维空间中收集点。例如,找到最遥远的点从指定的点或线。)

如果只需要图块的边缘点来计算矩形区域中心点,并通过调用PointsCloud.FindQuadriteralCorners函数来计算之。

图像进行矫正变换  ResizeBilinear

Resize image using bilinear interpolation algorithm.

 

posted on 2018-01-13 09:17  努力的毛毛虫  阅读(2229)  评论(0编辑  收藏  举报

导航