object_model_3d_to_xyzT_object_model_3d_to_xyzObjectModel3dToXyzObjectModel3dToXyzobject_model_3d_to_xyz — Transform 3D points from a 3D object model to images.
Three transformation modes are possible. The parameter TypeTypeTypetypetype is
used to select one of them. Note that multiple 3D object models can be
passed in ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d only for the mode 'cartesian_faces'"cartesian_faces""cartesian_faces""cartesian_faces""cartesian_faces".
All other modes expect a single 3D object model.
First, each point is transformed into the camera coordinate system
using the given PosePosePoseposepose. Then, these coordinates are projected
into the image coordinate system based on the internal camera parameters
CamParamCamParamCamParamcamParamcam_param.
The internal camera parameters CamParamCamParamCamParamcamParamcam_param describe the
projection characteristics of the camera (see
Calibration).
The PosePosePoseposepose is in the form ,
where ccs denotes camera coordinate system and
mcs the model coordinate system (which is a 3D world coordinate
system), see Transformations / Poses and
“Solution Guide III-C - 3D Vision”.
Hence, it describes the
position and orientation of the model coordinate system relative
to the camera coordinate system.
The X-, Y-, and Z-coordinates of the transformed point are written into
the corresponding image at the position of the projection.
If multiple points are projected to the same image coordinates, the
point with the smallest Z-value is written (hidden-point removal).
The dimensions of the returned images are defined by the camera
parameters.
The returned images show the object as it would look like when seeing it
with the specified camera under the specified pose.
In order to use this transformation, the input 3D object models need to
contain faces (triangles or polygons), otherwise, the 3D object model
without faces is disregarded.
Note that if the 3D object models have polygon faces, those are converted
internally to triangles. This conversion can be done beforehand to speed
up this operator.
For this, read_object_model_3dread_object_model_3dReadObjectModel3dReadObjectModel3dread_object_model_3d can be called with the
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name'convert_to_triangles'"convert_to_triangles""convert_to_triangles""convert_to_triangles""convert_to_triangles" set to
'true'"true""true""true""true", to convert all faces to triangles.
Alternatively, triangulate_object_model_3dtriangulate_object_model_3dTriangulateObjectModel3dTriangulateObjectModel3dtriangulate_object_model_3d can be called prior
to this operator.
First, each face of the 3D object models ObjectModel3DObjectModel3DObjectModel3DobjectModel3Dobject_model_3d is
transformed into the camera coordinate system
using the given PosePosePoseposepose. Then, these coordinates are projected
into the image coordinate system based on the internal camera parameters
CamParamCamParamCamParamcamParamcam_param, while keeping the 3D information (X-, Y-, and
Z-coordinates) for each of those pixels. For a more detailed explanation
of CamParamCamParamCamParamcamParamcam_param and PosePosePoseposepose please refer to the section
'cartesian'"cartesian""cartesian""cartesian""cartesian".
If multiple faces are projected to the same image coordinates, the
value with the smallest Z-value is written (hidden-point removal).
The dimensions of the returned images are defined by the camera
parameters.
The returned images show the objects as they would look like when seeing
them with the specified camera under the specified pose.
In case that OpenGL 2.1, GLSL 1.2, and the OpenGL
extensions GL_EXT_framebuffer_object and GL_EXT_framebuffer_blit are
available, speed increases.
This transformation mode works in the same way as the method
'cartesian_faces'"cartesian_faces""cartesian_faces""cartesian_faces""cartesian_faces" but does not use OpenGL.
In general, 'cartesian_faces'"cartesian_faces""cartesian_faces""cartesian_faces""cartesian_faces" automatically determines
if OpenGL is available.
Thus, it is usually not required to use
'cartesian_faces_no_opengl'"cartesian_faces_no_opengl""cartesian_faces_no_opengl""cartesian_faces_no_opengl""cartesian_faces_no_opengl" explicitly.
It can make sense, however, to use it in cases where the automatic mode
selection does not work due to, for example, driver issues with OpenGL.
Cameras with hypercentric lenses are not supported.
For displaying large faces with a non-zero distortion
in CamParamCamParamCamParamcamParamcam_param, note that the distortion is only applied to the
points of the model. In the projection, these points are subsequently
connected by straight lines. For a good approximation of the distorted
lines, please use a triangulation with sufficiently small triangles.
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
List of values:
'cartesian'"cartesian""cartesian""cartesian""cartesian", 'cartesian_faces'"cartesian_faces""cartesian_faces""cartesian_faces""cartesian_faces", 'cartesian_faces_no_opengl'"cartesian_faces_no_opengl""cartesian_faces_no_opengl""cartesian_faces_no_opengl""cartesian_faces_no_opengl", 'from_xyz_map'"from_xyz_map""from_xyz_map""from_xyz_map""from_xyz_map"
Number of elements:
Pose == 0 || Pose == 7 || Pose == 12
Result
The operator object_model_3d_to_xyzobject_model_3d_to_xyzObjectModel3dToXyzObjectModel3dToXyzobject_model_3d_to_xyz returns the value
2 (
H_MSG_TRUE)
if the given parameters are correct. Otherwise, an exception
will be raised.