You are here: Start » Function Reference » Image » Image Spatial Transforms Maps » ConvertMatrixMapsToSpatialMap

ConvertMatrixMapsToSpatialMap
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | Calibration |
Joins two matrices of coordinates to produce a SpatialMap for use in RemapImage.
Syntax
void fil::ConvertMatrixMapsToSpatialMap ( const fil::ImageFormat& inImageFormat, const fil::Matrix& inMatrixX, const fil::Matrix& inMatrixY, fil::InterpolationMethod::Type inInterpolationMethod, bool inRoundingOpenCV, fil::SpatialMap& outSpatialMap, ftl::Optional<fil::Region&> outOutputRegion = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inImageFormat | const ImageFormat& | Information about dimensions, depth and pixel type of the image | |
![]() |
inMatrixX | const Matrix& | Map of real X coordinates | |
![]() |
inMatrixY | const Matrix& | Map of real Y coordinates | |
![]() |
inInterpolationMethod | InterpolationMethod::Type | Bilinear | |
![]() |
inRoundingOpenCV | bool | Use same interpolation convention as cvRemap | |
![]() |
outSpatialMap | SpatialMap& | Output spatial map | |
![]() |
outOutputRegion | Optional<Region&> | NIL | Pixels set by the spatial map application |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outOutputRegion.
Read more about Optional Outputs.
Remarks
The two source matrices contain real-valued coordinates - if inMatrixX[a, b] = x and inMatrixY[a, b] = y, then the RemapImage filter applied with this map will generate the outImage[a, b] pixel based on pixels around (x, y) in inImage.
One example of application of this filter is the conversion of matrix maps generated with the OpenCV filter OpenCV InitUndistortRectifyMap function.
The inRoundingOpenCV parameter should be set to true if the matrices passed to this filter were obtained from an OpenCV function, like OpenCV InitUndistortRectifyMap function. This ensures that the results of RemapImage will be identical to OpenCV Remap function used with the same interpolation.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Format of an empty image on input in ConvertMatrixMapsToSpatialMap. |
DomainError | Input matrices must have equal sizes in ConvertMatrixMapsToSpatialMap. |
See Also
- RemapImage – Applies a precomputed image transform, defined by a spatial map object.
- ConvertSpatialMapToMatrixMaps – Splits a spatial map into two matrices of source coordinates.