OpenCvSharpをつかう その18(ラベリング・改)詳細は上記の作者BLOGを参照のこと。(これ、意外と影響大きい気がします。。)
書き方は、下記のようになります。以前は、IplImageクラスでラベリング情報をかんりしていましたが、CvBlobsクラスで管理できるようになったということですね。コメントアウトしているのが以前の書き方です。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private CvBlobs blobsLabelling(IplImage binSrc) { | |
CvBlobs blobs = new CvBlobs(); | |
//ラベリング処理 | |
//IplImage imgLabel = new IplImage(binSrc.Width, binSrc.Height, CvBlobLib.DepthLabel, 1); | |
//blobs.Label(binSrc, imgLabel); | |
blobs.Label(binSrc); | |
return blobs; | |
} |