PixelIndexMatrix = CreatePixelIndexList(BlobImage);
2D matrix of type uint32
Matrix of type int32 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.
RGB = ReadImage('contrib\IPD-3.1\demos\teaset.png'); Image = RGB2Gray(RGB); ThresholdedImage = SegmentbyThreshold(Image, 200); BlobImage = SearchBlobs(ThresholdedImage); FilteredBlobImage = FilterBySize(BlobImage, 100); // Small objects are removed. IsCalculated = GenerateFeatureStruct(%f); // Feature struct is generated. IsCalculated.PixelIndexList = %t; // The pixel index list shall be calculated for each blob. SizeHistogram = CreateHistogram(BlobImage); NumberOfObjects = length(SizeHistogram) - 1; PixelIndexMatrix = CreatePixelIndexList(FilteredBlobImage); for n = 1 : NumberOfObjects PixelIndexList = PixelIndexMatrix(1 : SizeHistogram(n + 1), n); disp(PixelIndexList); end;