| Customize Help
| Save Settings

MblobReconstruct



Function Map
Synopsis
Reconstruct blobs (or blob holes) in an image buffer.
Syntax
void MblobReconstruct(
MIL_ID SrcImageBufId, //in
MIL_ID SeedImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 Operation, //in
MIL_INT64 ProcMode //in
)
Description

This function copies (or reconstructs) blobs or blob holes from the source to the destination buffer, according to the specified operation and processing mode. By default, all non-zero pixels in the source buffer are considered to be part of a blob. Use the M_FOREGROUND_ZERO processing mode to inverse this behavior.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
SrcImageBufId

Specifies the identifier of the source image buffer. The source buffer must be a single band, packed binary, 8- or 16-bit unsigned buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

SeedImageBufId

Specifies the identifier of the image buffer to use as a seed image. The seed image buffer must be a single band, packed binary, 8- or 16-bit unsigned buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

A seed image is needed to perform an M_RECONSTRUCT_FROM_SEED type of operation. For any other operation type, set this parameter to M_NULL.

DstImageBufId

Specifies the identifier of the destination (processed blobs) image buffer. The destination buffer must be a single band, packed binary, 8- or 16-bit unsigned buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

Operation

Specifies the type of operation to perform. This parameter can be set to one of the following values:

function map For specifying the type of operation to perform
Click to summarizeValue Description
Click to summarize M_ERASE_BORDER_BLOBS

All blobs that do not touch the borders of the source image are copied to the destination image buffer according to the selected processing mode. Pixels of the blobs that touch the border are replaced according to the selected processing mode.

Note that when the M_GRAYSCALE and M_FOREGROUND_ZERO processing modes are selected, the border blobs are filled with the average grayscale pixel value of the background. This operation is similar to a "border kill".

(summarize)
Click to summarize M_EXTRACT_HOLES

All holes within the blobs of the source buffer are copied to the destination buffer with their pixel values set to their corresponding blob's pixel values, according to the selected processing mode. A hole cannot touch any image border to be considered a hole.

Note that, in the M_GRAYSCALE processing mode, the pixel values of holes copied to the destination buffer are set to the blob's average grayscale pixel value in the source buffer. Also, when the M_GRAYSCALE and M_FOREGROUND_ZERO processing modes are selected, the blobs are filled with the average grayscale pixel value of the background.

(summarize)
Click to summarize M_FILL_HOLES

All blobs in the source buffer are copied to the destination buffer according to the selected processing mode, and those blobs with holes are filled according to the processing mode. A hole must not touch the border of the image to be considered a hole.

Note that when the M_GRAYSCALE processing mode is selected, holes are filled with the average grayscale pixel value of the corresponding blob.

(summarize)
Click to summarize M_RECONSTRUCT_FROM_SEED

All blobs in the source buffer that have at least one corresponding foreground seed pixel in the seed buffer are copied to the destination buffer, according to the selected processing mode. Blobs that are not seeded are replaced according to the selected processing mode.

Note that when the M_GRAYSCALE and M_FOREGROUND_ZERO processing modes are selected, blobs in the source image that are not seeded are filled with the average grayscale value of the background. Also, the value of the seed pixels must be strictly zero for this operation to be performed properly.

Note that the seed image and the destination image must have identical dimensions.

(summarize)
ProcMode

Specifies the processing mode to use.

This parameter should be set to one of the following values:

function map For specifying the processing mode to use
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default processing mode (which corresponds to M_BINARY + M_8_CONNECTED).

Click to summarize M_BINARY +

Specifies that non-zero pixel values will be treated as ones (1) during processing, and the resulting non-zero pixels copied to the destination buffer will be set to the maximum value of that buffer (for example, 0xff for an 8-bit buffer). Note, in general, the M_BINARY processing mode is faster.

(summarize)
Click to summarize M_GRAYSCALE +

Specifies that the values of pixels copied to the destination buffer will be changed to the values of corresponding pixels in the source buffer.

Combination values for the values listed in For specifying the processing mode to use.

You can add one of the following values to the above-mentioned values to set the type of connectivity (lattice).

function map For selecting the type of connectivity
Click to summarizeCombination value Description
Click to summarize M_4_CONNECTED

Specifies that blobs are computed on a four connected lattice.

Click to summarize M_8_CONNECTED

Specifies that blobs are computed on an eight connected lattice.

This is the default value.

(summarize)
Combination value for the values listed in For specifying the processing mode to use.

You can add the following value to the above-mentioned values to set the value of the foreground pixels.

function map For selecting the foreground pixels
Click to summarizeCombination value Description
Click to summarize M_FOREGROUND_ZERO

Specifies that the pixel values of blobs will consist of zero values and the pixels of the background will consists of non-zero values; that is, the inverse of the usual blob pixel value definition.

Combination value for the values listed in For specifying the processing mode to use.

You can add the following value to the above-mentioned values to set whether to accelerate blob reconstruction with seed images.

function map For accelerating blob reconstruction with seed images
Click to summarizeCombination value Description
Click to summarize M_SEED_PIXELS_ALL_IN_BLOBS

Optimizes the reconstruction process. Use this value in cases when all seed pixels in the seed buffer have corresponding blob pixels in the source buffer. This condition often exists when the seed buffer is an eroded (see MimErode()) version of the source buffer.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milblob.lib.
DLL Requires mil.dll; milblob.dll.
UNSIGNED PROC NONE UNSIGNED PROC NONE UNSIGNED PROC NONE ERASE BORDER BLOBS EXTRACT HOLES FILL HOLES RECONSTRUCT FROM SEED DEFAULT BINARY GRAYSCALE 4 CONNECTED 8 CONNECTED FOREGROUND ZERO SEED PIXELS ALL IN BLOBS