| MIL 10 Reference
| Customize Help
| Save Settings

McolTransform



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Next
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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
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
CollapseValue Description
Collapse

Specifies the index of a color-sample.

(summarize)
Parameters

Specifies an index value greater than or equal to 0.

Collapse

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