| Customize Help
| Save Settings

MregSetLocation



Function Map
Synopsis
Sets the rough location of the specified registration element's image with respect to another registration element's image or the global pixel coordinate system.
Syntax
void MregSetLocation(
MIL_ID ContextId, //in
MIL_INT Index, //in
MIL_INT Target, //in
MIL_INT64 ParamType, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2, //in
MIL_DOUBLE Param3, //in
MIL_DOUBLE Param4, //in
MIL_INT64 ControlFlag //in
)
Description

This function sets the rough location of the specified registration element's image with respect to another registration element's image or the global pixel coordinate system. The MregCalculate() function uses this location to find the transformations that optimally position the images in the global pixel coordinate system.

You can explicitly specify the rough location or you can copy it from a registration element of another registration context or a result element of a registration result buffer. When copying the rough location, you can use the same reference index as the element from which you are copying the rough location. Alternatively, you can specify a different reference index.

The more precise the information, the faster the registration calculation will be. If you know the exact position of the image, you can bypass the optimization step of the calculation by either disabling the MregControl() M_OPTIMIZE_LOCATION control type or replacing the image in the array by M_NULL (see the Skipping the optimization step subsection of the Customizing your registration settings section of Chapter 11: Correlation stitching registration and mosaicing). In this case, the transformation that you specify using MregSetLocation() becomes the optimal transformation. Upon calling MregCalculate(), this transformation will be converted so that it maps the image into the global pixel coordinate system without first converting it into its reference image's pixel coordinate system.

Some restrictions apply when selecting the image's reference. The settings cannot be circularly defined. If you take a specific image and look at its reference, and then at its reference image's reference, and continue through the series of images linked in this manner, the first image must never appear as another image's reference. Furthermore, there should only be one image with its reference set to the global pixel coordinate system.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MregSetLocation() internally calls the MIL_DOUBLE version of this function (MregSetLocationDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MregSetLocationInt64()).
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 registration context of the registration element to affect. The registration context must have been previously allocated on the required system using MregAlloc().

Index

Specifies the index of the registration element. This parameter can be set to one of the following:

function map For specifying the index
Click to summarizeValue Description
Click to summarize M_ALL

Specifies that all of the registration elements will have their location set.

Click to summarize 0 <= Value < Number of source elements

Specifies the index of the registration element.

Target INQ

Specifies the reference of the registration element's image. The coordinate system associated with this reference is used as the reference coordinate system.

function map For specifying the reference
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_PREVIOUS.

Click to summarize M_COPY

Uses the same index as the reference of the element from which positional information is being copied. This setting is only available if the ParamType parameter is set to either M_COPY_REG_CONTEXT or M_COPY_REG_RESULT.

(summarize)
Click to summarize M_NEXT

Specifies the reference to be the image associated with the registration element whose index follows the specified registration element's index. When the registration element's image is the last one in the input sequence, the reference is set to M_REGISTRATION_GLOBAL, the global pixel coordinate system.

(summarize)
Click to summarize M_PREVIOUS

Specifies the reference to be the image associated with the registration element whose index precedes the specified registration element's index. When the registration element has an index 0, the reference is set to M_REGISTRATION_GLOBAL, the global pixel coordinate system.

(summarize)
Click to summarize M_REGISTRATION_GLOBAL

Specifies that the reference is the global pixel coordinate system.

Click to summarize M_UNCHANGED

Specifies that only the rough locations are changed; the same reference is used.

Click to summarize 0 <= Value < Number of source elements

Specifies the index of the registration element of the reference image.

ParamType INQ

Specifies the type of transformation to use to set the location of the registration element's image.

Set this parameter to M_DEFAULT if not used.

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

Param1 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param2 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param3 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param4

Reserved for future expansion and must be set to M_DEFAULT.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

The table below lists possible values for the ParamType, Param1, Param2, and Param3 parameters.

Note that any unused parameters should be set to M_DEFAULT.

function map For specifying the transformation type
Click to summarizeParamType Description
Param1
Param2
Param3
Click to summarize M_COPY_REG_CONTEXT

Specifies that the rough locations are copied from another registration context.

(summarize)
Click to summarize Param1

Specifies the identifier of the registration context from which to copy the transformation settings.

(summarize)
Click to summarize Param2

Specifies the registration element index from which to copy the transformation settings.

(summarize)
Click to summarize M_DEFAULT

Specifies the default index. The default index is the same as the one specified for the Index parameter.

If the Index parameter is set to M_ALL, the function copies each rough location from the source context into the corresponding index in the destination context. In this case, the number of elements in the source registration context passed to Param1 must be greater than or equal to the number of elements in the destination registration context. Any extra elements in the source context will not be copied.

(summarize)
Click to summarize 0 <= Value < Number of source elements

Specifies the registration element's index.

Click to summarize M_COPY_REG_RESULT

Specifies that the transformation between two registration result elements is copied.

(summarize)
Click to summarize Param1

Specifies the identifier of the registration result buffer from which to copy the transformations.

(summarize)
Click to summarize Param2

Specifies the registration result element's index from which to copy the transformation settings.

(summarize)
Click to summarize M_DEFAULT

Specifies the default index. The default index is the same as the one specified for the Index parameter.

(summarize)
Click to summarize 0 <= Value < Number of source elements

Specifies the registration result element's index.

Click to summarize Param3

Specifies the registration result element's index of the target transformation element.

(summarize)
Click to summarize M_DEFAULT

Specifies that the target registration result element's index is the same as the one that is specified in the Target parameter.

Click to summarize M_REGISTRATION_GLOBAL

Specifies that the target registration result element's reference is the global pixel coordinate system.

Click to summarize Value >= 0

Specifies the target registration result element's index.

Click to summarize M_POSITION_XY

Specifies the coordinates of the origin of the registration element's image in the coordinate system of its reference. Note that when the reference is an image, the specified coordinates need not lie within the reference image.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the image's origin in its reference coordinate system.

Click to summarize Param2

Sets the Y-coordinate of the image's origin in its reference coordinate system.

Click to summarize M_POSITION_XY_ANGLE

Specifies the coordinates of the origin and the angle of the registration element's image in the coordinate system of its reference. Note that when the reference is an image, the specified coordinates need not lie within the reference image.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the image's origin in its reference coordinate system.

Click to summarize Param2

Sets the Y-coordinate of the image's origin in its reference coordinate system.

Click to summarize Param3

Sets the angle of the image in its reference coordinate system. The angle is measured in degrees in counter-clockwise direction.

(summarize)
Click to summarize M_WARP_4_CORNER

Specifies the transformation that transforms an arbitrary quadrilateral in the current image's pixel coordinate system into a rectangle in its reference coordinate system. You specify the transformation by supplying 4 points in the current image and 2 points in the reference image.

(summarize)
Click to summarize Param1

Specifies the MIL identifier of the buffer to use to store the coordinates of the 6 points. This buffer should have an M_ARRAY attribute. For more information on the buffer and its contents, see MgenWarpParameter().

(summarize)
Click to summarize M_WARP_4_CORNER_REVERSE

Specifies the transformation that transforms a rectangle in the current image's pixel coordinate system into an arbitrary quadrilateral in its reference coordinate system. You specify the transformation by supplying 2 points in the current image and 4 points in the reference image.

(summarize)
Click to summarize Param1

Specifies the MIL identifier of the buffer to use to store the coordinates of the 6 points needed to warp the image. This buffer should have an M_ARRAY attribute. For more information on the buffer and its contents, see MgenWarpParameter().

(summarize)
Click to summarize M_WARP_POLYNOMIAL

Specifies the transformation matrix that transforms points in the reference coordinate system into points in the current image's pixel coordinate system.

(summarize)
Click to summarize Param1

Specifies the MIL identifier of the buffer containing the transformation matrix. For more information on the buffer and its contents, see MimWarp().

(summarize)
Type-specific versions of the function when using a C compiler under 64-bit
void MregSetLocationInt64 (MIL_ID ContextId, MIL_INT Index, MIL_INT Target, MIL_INT64 ParamType, MIL_INT64 Param1, MIL_DOUBLE Param2, MIL_DOUBLE Param3, MIL_DOUBLE Param4, MIL_INT64 ControlFlag)
Parameters

ContextId

See ContextId of the main function for a description.

Index

See Index of the main function for a description.

Target

See Target of the main function for a description.

ParamType

See ParamType of the main function for a description.

Param1

See Param1 of the main function for a description.

Param2

See Param2 of the main function for a description.

Param3

See Param3 of the main function for a description.

Param4

See Param4 of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

void MregSetLocationDouble (MIL_ID ContextId, MIL_INT Index, MIL_INT Target, MIL_INT64 ParamType, MIL_DOUBLE Param1, MIL_DOUBLE Param2, MIL_DOUBLE Param3, MIL_DOUBLE Param4, MIL_INT64 ControlFlag)
Parameters

ContextId

See ContextId of the main function for a description.

Index

See Index of the main function for a description.

Target

See Target of the main function for a description.

ParamType

See ParamType of the main function for a description.

Param1

See Param1 of the main function for a description.

Param2

See Param2 of the main function for a description.

Param3

See Param3 of the main function for a description.

Param4

See Param4 of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; milreg.lib.
DLL Requires mil.dll; milreg.dll.
ALL DEFAULT COPY NEXT PREVIOUS REGISTRATION GLOBAL UNCHANGED COPY REG CONTEXT DEFAULT COPY REG RESULT DEFAULT DEFAULT REGISTRATION GLOBAL POSITION XY POSITION XY ANGLE WARP 4 CORNER WARP 4 CORNER REVERSE WARP POLYNOMIAL FLOAT COPY REG CONTEXT COPY REG RESULT