project_shape_model_3d — Project the edges of a 3D shape model into image coordinates.
The operator project_shape_model_3d projects the edges of the 3D object model that was used to create the 3D shape model ShapeModel3DID into the image coordinate system and returns the projected edges in ModelContours. 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.
The parameter HiddenSurfaceRemoval can be used to switch on or to switch off the removal of hidden surfaces. If HiddenSurfaceRemoval is set to 'true', only those projected edges are returned that are not hidden by faces of the 3D object model. If HiddenSurfaceRemoval is set to 'false', all projected edges are returned. This is faster than a projection with HiddenSurfaceRemoval set to 'true'.
If the system variable (see set_system) 'opengl_hidden_surface_removal_enable' is set to 'true' (which is default if it is available) and HiddenSurfaceRemoval is set to 'true', the projection of the model is accelerated using the graphics card. Depending on the graphics card this is significantly faster than the non accelerated algorithm. Be aware that the results of the OpenGL projection are slightly different compared to the analytic projection. Notable, only the contours visible through CamParam are projected in this mode.
3D edges are only projected if the angle between the two 3D faces that are incident with the 3D edge is at least MinFaceAngle. If MinFaceAngle is set to 0.0, all edges are projected. If MinFaceAngle is set to (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.
If for the model creation with create_shape_model_3d the parameter 'union_adjacent_contours' was activated, adjacent contours are joined.
project_shape_model_3d and project_object_model_3d return the same result if the 3D object model that was used to create the 3D shape model is passed to project_object_model_3d.
project_shape_model_3d is especially useful in order to visualize the matches that are returned by find_shape_model_3d in the case that the underlying 3D object model is no longer available.
Contour representation of the model view.
Handle of the 3D shape model.
Internal camera parameters.
Number of elements: CamParam == 8 || CamParam == 10 || CamParam == 12 || CamParam == 14
3D pose of the 3D shape model in the world coordinate system.
Remove hidden surfaces?
Default value: 'true'
List of values: 'false', 'true'
Smallest face angle for which the edge is displayed
Default value: 0.523599
Suggested values: 0.17, 0.26, 0.35, 0.52
If the parameters are valid, the operator project_shape_model_3d returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.
create_shape_model_3d, read_shape_model_3d, get_shape_model_3d_params, find_shape_model_3d
convert_point_3d_cart_to_spher, convert_point_3d_spher_to_cart, create_cam_pose_look_at_point, trans_pose_shape_model_3d