creates a list of pixel indices for each blob in a blob image
PixelIndexMatrix = CreatePixelIndexList(BlobImage);
2D matrix of type uint32
Matrix of type int32 (Scilab 5.2.0) or uint32(Scilab 5.2.1 or higher) that has as many columns as BlobImage contains blobs and as many rows as the biggest blob has pixels. If a blob has n pixels, the first n rows contain the n pixel indices.
This function creates a matrix of pixel indices. Each column corresponds to a blob. If a blob has n pixels, the first n rows contain the n pixel indices. AnalyzeBlobs calls this function so you do not need to call it yourself.
global IPD_PATH; RGB = ReadImage(IPD_PATH + 'demos\teaset.png'); Image = RGB2Gray(RGB); ThresholdedImage = SegmentByThreshold(Image, 200); BlobImage = SearchBlobs(ThresholdedImage); FilteredBlobImage = FilterBySize(BlobImage, 100); // Small objects are removed. IsCalculated = CreateFeatureStruct(%f); // Feature struct is generated. IsCalculated.PixelIndexList = %t; // The pixel index list shall be calculated for each blob. SizeHistogram = CreateHistogram(FilteredBlobImage); NumberOfObjects = length(SizeHistogram) - 1; PixelIndexMatrix = CreatePixelIndexList(FilteredBlobImage); for n = 1 : NumberOfObjects PixelIndexList = PixelIndexMatrix(1 : SizeHistogram(n + 1), n); disp(PixelIndexList); end; | ![]() | ![]() |