ConnectedComponents cc = Cv2.ConnectedComponentsEx(tempMat);//相当于halcon的connection获取全部连通域
int blobnumber=cc.Blobs.Count;//获取数量
//List
//List
List
List
List
//newblobsRightList.Reverse();
ConnectedComponents.Blob testBlob = newblobsRightList[0];
Mat testMat = Mat.Zeros(grayImage.Height, grayImage.Width, MatType.CV_8UC1);
Mat tmat = new Mat();
//cc.FilterBlobs(tempMat, tmat, newblobsLeft);//生成blob list的mat
cc.FilterByBlob(tempMat, tmat, testBlob);//生成blob的mat
手机扫一扫
移动阅读更方便
你可能感兴趣的文章