| Customize Help
| Save Settings

MimAugment



Function Map
Synopsis
Perform an augmentation operation on an image.
Syntax
void MimAugment(
MIL_ID AugmentationContextImId, //in
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufOrAugmentationResultImId, //in
MIL_INT64 SeedValue, //in
MIL_INT64 ControlFlag //in
)
Description

This function performs an augmentation operation that allows you to create a plausible variation of an image. This is done by applying a specified ordered set of image processing operations with randomized settings within a specified range. To establish the image processing operations that MimAugment() can perform, call MimControl() with M_AUG_..._OP.

MimAugment() places its results in the specified destination buffer, which can be an image or an augmentation result.

The image processing operations that you specify MimAugment() to perform (M_AUG_..._OP) are prioritized as follows:

1. Affine operations, such as:

2. Structure operations, such as:

3. Geometric operations, such as:

4. Intensity operations, such as:

5. Linear filter operations, such as:

6. Noise operations, such as:

To modify the order in which MimAugment() prioritizes the specified image processing operations, call MimControl() with M_PRIORITY.

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
AugmentationContextImId

Specifies the identifier of the augmentation context. The context must have been allocated using MimAlloc() with M_AUGMENTATION_CONTEXT.

SrcImageBufId

Specifies the identifier of the source image buffer. If you are preprocessing the augmentation context (M_PREPROCESS), set this parameter to M_NULL.

The image buffer can be grayscale or color (1- or 3-bands); it can be a 1-, 8-, or 16-bit unsigned buffer, or a 32-bit floating-point buffer (with values that are normalized between 0.0 and 1.0). You must allocate this buffer using MbufAlloc...() with M_IMAGE + M_PROC.

You can perform any image processing operation (M_AUG_..._OP) on all supported source image buffers, except 1-bit unsigned images or 1-band images.

1-bit unsigned images do not support the following:

1-band images do not support the following:

When specifying a color (3-band) image, MimAugment() assumes an RGB color space by default. Operations that require a different color space (for example, HSV) internally convert the source image color. If your source image is not RGB, the conversion produces erroneous results.

DstImageBufOrAugmentationResultImId

Specifies the identifier of the destination in which to write the result of the augmentation transformation. The identifier must be for an image buffer or an augmentation image processing result buffer. If you are preprocessing the augmentation context (M_PREPROCESS), set this parameter to M_NULL.

The image buffer can be grayscale or color (1- or 3-bands); it can be a 1-, 8-, or 16-bit unsigned buffer, or a 32-bit floating-point buffer. You must allocate this buffer using MbufAlloc...() with M_IMAGE + M_PROC.

The augmentation result buffer must have been allocated on the required system using MimAllocResult() with M_AUGMENTATION_RESULT.

If you specify an image buffer that has an ROI associated with it, the ROI must be in raster format; otherwise, you will get an error.

SeedValue

Specifies the initial value that will generate the randomized settings for the image processing operations used to perform the augmentation. This parameter must be set to one of the following values.

function map For specifying the seed that will generate the randomized settings
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default value. This depends on the seed mode, which is set using MimControl() with M_AUG_SEED_MODE. To use M_DEFAULT, the seed mode must be set to M_RNG_AUTO (default) or M_RNG_INIT_VALUE.

(summarize)
Click to summarize M_NULL

Specifies that you are preprocessing the augmentation context (M_PREPROCESS).

Click to summarize Value >= 0

Specifies a user-defined seed value. You can only specify a user-defined seed if MimControl() with M_AUG_SEED_MODE is set to M_USER_DEFINED_SEED. You cannot specify a value that is greater than the maximum value of a MIL_INT32.

(summarize)
ControlFlag

Specifies whether MimAugment() should perform the augmentation, or should explicitly preprocess the augmentation context. If you do not explicitly preprocess the context (M_PREPROCESS), MimAugment() preprocesses it the first time you call the function.

This parameter must be set to one of the following values.

function map For specifying the operation to perform
Click to summarizeValue Description
Click to summarize M_DEFAULT

Performs the augmentation.

Click to summarize M_PREPROCESS

Preprocesses the specified augmentation context explicitly. In this case, you must set the SrcImageBufId, DstImageBufOrAugmentationResultImId, and SeedValue parameters to M_NULL.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
AUGMENTATION CONTEXT DEFAULT NULL DEFAULT PREPROCESS PROC FLOAT UNSIGNED NULL NULL NULL