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
|
對象.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.