| Customize Help
| Save Settings

McolTransform



Function Map
Synopsis
Transform color data using relative color calibration.
Syntax
void McolTransform(
MIL_ID ContextId, //in
MIL_INT SampleIndexOrLabel, //in
MIL_ID SrcImageBufId, //in
MIL_ID DestImageBufId, //in
MIL_INT64 ControlFlag //in
)
Description

This function transforms a source image's color data according to the mapping associated with a color-sample in a relative color calibration context. The transformed image is written in the destination image buffer.

This function supports in-place processing; you can specify the identifier of the same image buffer for both the source and the destination.

The mapping associated with the color-sample (SampleIndexOrLabel) is established with McolDefine() and McolPreprocess(). McolDefine() defines the color-samples, and reference color-sample. McolPreprocess() establishes the mapping with which to interpret the color data of each color-sample so it is similar to the color data of the reference color-sample (for example, similar color temperature and distribution). By applying the color-sample mapping, McolTransform() corrects the color data of its source images to resemble the color data of the reference color-sample. You can then use these transformed source images, which now resemble each other, to perform other color operations, such as color matching (McolMatch()).

To influence the transformation, you can alter how MIL establishes the color-sample mapping by changing the processing strategy with McolSetMethod(). Such changes require you to call McolPreprocess() before McolTransform().

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
ContextId

Specifies the identifier of the relative color calibration context containing the color-sample and its associated mapping. The relative color calibration context must have been previously allocated on the required system using McolAlloc() with M_COLOR_CALIBRATION_RELATIVE. The relative color calibration context must also have been previously preprocessed using McolPreprocess().

MIL assumes all color data you use with a relative color calibration context is 8-bit RGB (3-band). If color data is inconsistent (for example, between the source image and the color-sample), MIL still processes it all as 8-bit RGB, which can produce misleading results.

SampleIndexOrLabel

Specifies the index or label of a color-sample in the specified relative color calibration context. This function transforms the color of the source image according to the mapping associated to the color-sample. Ensure the color-sample is appropriate for the specified source image.

function map For specifying a color-sample
Click to summarizeValue Description
Click to summarize

Specifies the index of a color-sample.

(summarize)
Parameters

Specifies an index value greater than or equal to 0.

Click to summarize

Specifies the label of a color-sample.

(summarize)
Parameters

Specifies a label value greater than 0.

SrcImageBufId

Specifies the identifier of the source image with which to perform the relative color calibration. The buffer must be an 8-bit color (3-band) unsigned image buffer (same as the destination).

DestImageBufId

Specifies the identifier of destination image in which to write the transformed color. The buffer must be an 8-bit color (3-band) unsigned image buffer (same as the source).

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcolor.lib.
DLL Requires mil.dll; milcolor.dll.
UNSIGNED PROC UNSIGNED PROC