| MIL 10 Reference
| Customize Help
| Save Settings

MregCalculate



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
Synopsis
Perform the registration operation specified by the registration context on the input images.
Syntax
void MregCalculate(
MIL_ID ContextId, //in
const MIL_ID *ImageArrayPtr, //in
MIL_ID RegResultOrImageId, //in
MIL_INT NumImages, //in
MIL_INT64 ControlFlag //in
)
Description

This function performs the registration operation specified by the registration context on the input images. It can either perform a correlation-stitching registration operation or an extended depth of field registration operation.

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 context to use for the registration; this establishes the operation to perform.

See the Parameter associations section for possible values that can be specified.

ImageArrayPtr

Specifies the address of the array containing the buffer identifiers of the input images.

If unused, set this parameter to M_NULL.

See the Parameter associations section for possible values that can be specified.

RegResultOrImageId

Specifies the identifier of the registration result buffer or image buffer in which to write the results of the registration operation.

If unused, set this parameter to M_NULL.

See the Parameter associations section for possible values that can be specified.

NumImages

Specifies the size of the specified image array.

If unused, set this parameter to M_NULL.

See the Parameter associations section for possible values that can be specified.

ControlFlag

Specifies the operation mode.

See the Parameter associations section for possible values that can be specified.

The table below lists possible values for the ContextId, ImageArrayPtr, RegResultOrImageId, NumImages, and ControlFlag parameters.

Note that except in the case of M_DEFAULT_EXTENDED_DEPTH_OF_FIELD_CONTEXT, if the ImageArrayPtr, RegResultOrImageId, and/or NumImages parameters are not listed, they are not used and should be set to M_NULL.

function map For specifying the operation mode
CollapseContextId Description
ControlFlag
ImageArrayPtr
RegResultOrImageId
NumImages
Collapse M_DEFAULT_EXTENDED_DEPTH_OF_FIELD_CONTEXT

Same as MIL extended depth of field registration context identifier. Specifies the default M_EXTENDED_DEPTH_OF_FIELD registration context with all the controls in the context set to M_DEFAULT.

(summarize)
Collapse MIL correlation-stitching registration
context identifier

Specifies a valid correlation-stitching registration context identifier, previously allocated using MregAlloc() with M_STITCHING.

When this context is passed, a correlation-stitching registration operation is performed. The function calculates the optimal match in the overlapping region between each image and its reference image and then calculates the transformation needed to achieve this match. Once the transformation that maps each image into its reference image's pixel coordinate system is calculated, it is converted so that it maps the image into the global pixel coordinate system.

The correlation-stitching registration context requires that for every input image, there is a registration element in the context that provides the rough location of the image in another input image (reference image) or in the global pixel coordinate system.

(summarize)
Collapse M_DEFAULT

Specifies the default correlation-stitching registration operation mode.

(summarize)
Collapse ImageArrayPtr

Specifies an array containing the buffer identifiers of the input images to use when performing the registration operation.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

Every image in the specified image array is associated with the registration element and registration result element of the same index. For example, the first image is associated with the first registration element and the first registration result element. Therefore, it is important that the number of images supplied in the array be less than or equal to the number of registration elements.

You might not want to perform the optimization step of the correlation-stitching registration calculation when the precise location of one or more images is known. In this case, you have two options. You can replace the image for which you want to skip the optimization step with M_NULL in the image array or you can disable M_OPTIMIZE_LOCATION in the image's registration element using MregControl(). For more information, see the Skipping the optimization step subsection of the Customizing your registration settings section of Chapter 9: Registration.

(summarize)
Collapse RegResultOrImageId

Specifies a valid correlation-stitching result buffer identifier, previously allocated using MregAllocResult() with M_STITCHING_RESULT.

The results of the registration calculation can be retrieved using MregGetResult(). These results can be used to perform other operations supported by the registration module. For example, the results can be used to create a mosaic of the input images using MregTransformImage(); you can also use them with MregTransformCoordinate() or MregTransformCoordinateList() to transform positions between two of the following coordinate systems: the global pixel coordinate system, any registered image's pixel coordinate system, or the mosaic's coordinate system.

(summarize)
Collapse NumImages

Specifies the size of the image array. If the array contains fewer image buffer identifiers than the specified size, the outstanding elements of the array should be set to M_NULL.

(summarize)
Collapse MIL extended depth of field registration
context identifier

Specifies a valid extended depth of field registration context identifier, previously allocated using MregAlloc() with M_EXTENDED_DEPTH_OF_FIELD.

When using an M_EXTENDED_DEPTH_OF_FIELD registration context, this function performs an extended depth of field registration operation. It will preprocess the specified input images and then fuse the images to create an extended depth of field (EDoF) image. The results can be stored in a previously allocated result buffer or an image buffer.

In the M_ACCUMULATE and M_ACCUMULATE_AND_FUSION modes, images must be preprocessed using the same registration context and settings (for example, same maximum radius of the circle of confusion).

You can retrieve preprocessing results from an extended depth of field result buffer using MregGetResult(), and access the EDoF image by drawing it using MregDraw().

(summarize)
Collapse M_DEFAULT
Collapse M_ACCUMULATE

Specifies to preprocess images and add the information to the result buffer. This will not empty the result buffer prior to writing to it, nor calculate the extended depth of field (EDoF) image. To create the EDoF image after accumulating, you must call MregCalculate() with M_ACCUMULATE_AND_FUSION.

(summarize)
Collapse ImageArrayPtr

Specifies an array containing the buffer identifiers of the input images to use when performing the registration operation.

The input images must have the same size, type, and number of bands.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

You can replace images in the array that you do not want to use in the calculations with M_NULL. This allows you to establish the minimum number of focus distances at which to grab the input images and still obtain a good EDoF image. The fewer the number of input images, the faster the operation. For example, you can perform the operation with 10 different focus distances, and then try performing the same operation with every second image set to M_NULL to see if the EDoF image is still acceptable.

(summarize)
Collapse RegResultOrImageId

Specifies the extended depth of field result buffer to fill with the information extracted when preprocessing the input images.

(summarize)
Collapse NumImages

Specifies the size of the image array. If the array contains fewer image buffer identifiers than the specified size, the outstanding elements of the array should be set to M_NULL.

(summarize)
Collapse M_ACCUMULATE_AND_FUSION

Specifies to preprocess additional input images, and then compute the EDoF image using this new information and all of the information previously processed and stored in the result buffer. The EDoF image will only be calculated after the last image has been processed. This will not empty the result buffer of previous entries. If an EDoF image is already in the result buffer prior to MregCalculate(), it will be discarded and replaced with the new EDoF image.

Note that you don't have to pass additional input images. If no input images are specified, the operation calculates the EDoF image using only the preprocessed information in the result buffer.

(summarize)
Collapse ImageArrayPtr

Specifies the input images to use when performing the registration operation.

(summarize)
Collapse M_NULL

Specifies to calculate the EDoF image using only the preprocessed information available in the result buffer.

Collapse Array of image buffer IDs

Specifies the address of an array of MIL image buffer identifiers to use, beside also using the preprocessed information available in the result buffer. The input images must have the same size, type, and number of bands.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

You can replace images in the array that you do not want to use in the calculations with M_NULL. This allows you to establish the minimum number of focus distances at which to grab the input images and still obtain a good EDoF image. The fewer the number of input images, the faster the operation. For example, you can perform the operation with 10 different focus distances, and then try performing the same operation with every second image set to M_NULL to see if the EDoF image is still acceptable.

(summarize)
Collapse RegResultOrImageId

Specifies the result buffer to fill.

You can retrieve preprocessing results from an extended depth of field result buffer using MregGetResult(), and access the EDoF image by drawing it using MregDraw().

(summarize)
Collapse NumImages

Specifies the size of the image array. If the array contains fewer image buffer identifiers than the specified size, the outstanding elements of the array should be set to M_NULL.

If you passed M_NULL to ImageArrayPtr, set this parameter to 0.

(summarize)
Collapse M_FUSION

Specifies to calculate the EDoF image immediately.

If passing a result buffer to RegResultOrImageId, MregCalculate() will clear the result buffer of previous results, and then fill the result with the preprocessing information and the EDoF image.

If passing an image buffer to RegResultOrImageId, the function clears the image buffer of any previous image, and writes the resulting EDoF image in the image buffer; no other results are accessible.

(summarize)
Collapse ImageArrayPtr

Specifies an array containing the buffer identifiers of the input images to use when performing the registration operation.

The input images must have the same size, type, and number of bands.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

You can replace images in the array that you do not want to use in the calculations with M_NULL. This allows you to establish the minimum number of focus distances at which to grab the input images and still obtain a good EDoF image. The fewer the number of input images, the faster the operation. For example, you can perform the operation with 10 different focus distances, and then try performing the same operation with every second image set to M_NULL to see if the EDoF image is still acceptable.

(summarize)
Collapse RegResultOrImageId

Specifies the result buffer or image buffer to fill.

(summarize)
Collapse MIL extended depth of field registration
result buffer identifier

Specifies a valid extended depth of field registration result buffer identifier, previously allocated using MregAllocResult() with M_EXTENDED_DEPTH_OF_FIELD_RESULT.

You can retrieve preprocessing results from an extended depth of field result buffer using MregGetResult(), and access the EDoF image by drawing it using MregDraw().

(summarize)
Collapse MIL image buffer identifier

Specifies a valid image buffer, previously allocated on the required system using MbufAlloc...().

Collapse NumImages

Specifies the size of the image array. If the array contains fewer image buffer identifiers than the specified size, the outstanding elements of the array should be set to M_NULL.

(summarize)
Collapse M_RESET

Specifies to clear the result buffer of all preprocessing information and the EDoF image, if applicable.

(summarize)
Collapse RegResultOrImageId

Specifies the result buffer, previously allocated using MregAllocResult() with M_EXTENDED_DEPTH_OF_FIELD_RESULT, to clear.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milreg.lib.
DLL Requires mil.dll; milreg.dll.
DEFAULT EXTENDED DEPTH OF FIELD CONTEXT DEFAULT DEFAULT ACCUMULATE ACCUMULATE AND FUSION NULL FUSION RESET