| Operators |
vector_angle_to_rigid — Compute a rigid affine transformation from points and angles.
vector_angle_to_rigid computes a rigid affine transformation, i.e., a transformation consisting of a rotation and a translation, from a point correspondence and two corresponding angles and returns it as the homogeneous transformation matrix HomMat2D. The matrix consists of 2 components: a rotation matrix R and a translation vector t (also see hom_mat2d_rotate and hom_mat2d_translate):
The coordinates of the original point are passed in (Row1,Column1), while the corresponding angle is passed in Angle1. The coordinates of the transformed point are passed in (Row2,Column2), while the corresponding angle is passed in Angle2. The following equation describes the transformation of the point using homogeneous vectors:
In particular, the operator vector_angle_to_rigid is useful to construct a rigid affine transformation from the results of the matching operators (e.g., find_shape_model ), which transforms a reference image to the current image or (if the parameters are passed in reverse order) from the current image to the reference image.
HomMat2D can be used directly with operators that transform data using affine transformations, e.g., affine_trans_image.
Row coordinate of the original point.
Column coordinate of the original point.
Angle of the original point.
Row coordinate of the transformed point.
Column coordinate of the transformed point.
Angle of the transformed point.
Output transformation matrix.
create_shape_model (ImageReduced, 0, rad(-45), rad(180), 0, \
'none', 'use_polarity', 30, 10, ModelID)
get_shape_model_contours (ModelXLD, ModelID, 1)
find_shape_model (SearchImage, ModelID, rad(-45), rad(180), \
0.5, 1, 0.5, 'interpolation', \
0, 0, Row, Column, Angle, Score)
* Create transformation matrix
vector_angle_to_rigid (0, 0, 0, Row, Column, Angle, HomMat2DObject)
* Transform model contours for visualization
affine_trans_contour_xld (ModelXLD, ObjectXLD, HomMat2DObject)
* Calculate true position of the model origin in the search image
affine_trans_pixel (HomMat2DObject, 0, 0, RowObject, ColObject)
clear_shape_model(ModelID)
hom_mat2d_invert, affine_trans_image, affine_trans_region, affine_trans_contour_xld, affine_trans_polygon_xld, affine_trans_point_2d
Foundation
| Operators |