openCV 2.4.10 bwlabel - connected components
问题 Here is the original code from matlab: % Calculate each separated object area cDist=regionprops(bwImg, 'Area'); cDist=[cDist.Area]; % Label each object [bwImgLabeled, ~]=bwlabel(bwImg); % Calculate min and max object size based on assumptions on the color % checker size maxLabelSize = prod(size(imageData)./[4 6]); minLabelSize = prod(size(imageData)./[4 6]./10); % Find label indices for objects that are too large or too small remInd = find(cDist > maxLabelSize); remInd = [remInd find(cDist <