| Table of Contents / 3D Tools / 3D Object Model | Operators |
project_object_model_3d — Project a 3D object model into image coordinates.
project_object_model_3d( : ModelContours : ObjectModel3DID, CamParam, Pose, GenParamName, GenParamValue : )
The operator project_object_model_3d projects a 3D object model into the image coordinate system and returns the projected contours in ModelContours. This operator is particularly useful for the visualization of 3D object models. The coordinates of the 3D object model are given in the 3D world coordinate system. First, they are transformed into the camera coordinate system using the given Pose. Then, these coordinates are projected into the image coordinate system based on the internal camera parameters CamParam.
The internal camera parameters CamParam describe the projection characteristics of the camera (see write_cam_par). The Pose describes the position and orientation of the world coordinate system with respect to the camera coordinate system.
There are some generic parameters that can optionally be used to influence the projection. If desired, these parameters and their corresponding values can be specified by using GenParamName and GenParamValue, respectively. The following values for GenParamName are possible:
This parameter specifies which geometric data of the 3D object model should be projected. If 'data' is set to 'faces', the faces of the 3D object model are projected. The faces are represented by their border lines in ModelContours. If 'data' is set to 'points', the points of the 3D object model are projected. The projected points can be represented in ModelContours in different ways. The point representation can be selected by using the generic parameter 'point_shape' (see below). Finally, if 'data' is set to 'auto', HALCON automatically chooses the most descriptive geometry data that is available in the 3D object model for visualization.
List of values: 'auto', 'faces', 'points'
Default value: 'auto'
This parameter specifies how points are represented in the output contour ModelContours. Consequently, this parameter only has an effect if the points of the 3D object model are selected for projection (see above). If 'point_shape' is set to 'circle' points are represented by circles, whereas if 'point_shape' is set to 'cross' points are represented by crosses. In both cases the size of the points (i.e., the size of the circles or the size of the crosses) can be specified by the generic parameter 'point_size' (see below). The orientation of the crosses can be specified by the generic parameter 'point_orientation' (see below).
List of values: 'circle', 'cross'
Default value: 'circle'
This parameter specifies the size of the point representation in the output contour ModelContours, i.e., the size of the circles or the size of the crosses depending on the selected 'point_shape'. Consequently, this parameter only has an effect if the points of the 3D object model are selected for projection (see above). The size must be given in pixel units. If 'point_size' is set to 0, each point is represented by a contour that contains a single contour point.
Suggested values: 0, 2, 4
Default value: 4
This parameter specifies the orientation of the crosses in radians. Consequently, this parameter only has an effect if the points of the 3D object model are selected for projection and 'point_shape' is set to 'cross' (see above).
Suggested values: 0, 0.39, 0.79
Default value: 0.79
The following generic parameters only influence the projection of 3d object models that were previously prepared for the 3d shape-based matching, e.g. by using the operator prepare_object_model_3d:
This parameter can be used to switch on or off the removal of hidden surfaces. If 'hidden_surface_removal' is set to 'true', only those projected edges are returned that are not hidden by faces of the 3D object model. If 'hidden_surface_removal' is set to 'false', all projected edges are returned. This is faster than a projection with 'hidden_surface_removal' set to 'true'.
List of values: 'true', 'false'
Default value: 'true'
3D edges are only projected if the angle between the two 3D faces that are incident with the 3D edge is at least 'min_face_angle'. If 'min_face_angle' is set to 0.0, all edges are projected. If 'min_face_angle' is set to PI (equivalent to 180 degrees), only the silhouette of the 3D object model is returned. This parameter can be used to suppress edges within curved surfaces, e.g., the surface of a cylinder or cone.
Suggested values: 0.17, 0.26, 0.35, 0.52
Default value: 0.52
Projected model contours.
Handle of the 3D object model.
Internal camera parameters.
Number of elements: (CamParam == 8) || (CamParam == 12)
3D pose of the world coordinate system in camera coordinates.
Number of elements: Pose == 7
Name of the generic parameter.
Default value: []
List of values: 'true', 'false', 'hidden_surface_removal', 'min_face_angle', 'data', 'point_shape', 'point_size', 'point_orientation'
Value of the generic parameter.
Default value: []
Suggested values: 0.17, 0.26, 0.35, 0.52, 'true', 'false', 'auto', 'points', 'faces', 'circle', 'cross', 1, 2, 3, 4, 0.785398
project_object_model_3d returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised. If the geometric data that was selected for the projection is not available in the 3d object model, the error 9514 is raised.
read_object_model_3d, affine_trans_object_model_3d, prepare_object_model_3d
project_shape_model_3d, object_model_3d_to_xyz
3D Metrology
| Table of Contents / 3D Tools / 3D Object Model | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |