Skip to content

project_shape_model_3dProjectShapeModel3dProjectShapeModel3dproject_shape_model_3dT_project_shape_model_3dπŸ”—

Short descriptionπŸ”—

project_shape_model_3dProjectShapeModel3dProjectShapeModel3dproject_shape_model_3dT_project_shape_model_3d β€” Project the edges of a 3D shape model into image coordinates.

SignatureπŸ”—

project_shape_model_3d( out xld_cont ModelContours, shape_model_3d ShapeModel3DID, campar CamParam, pose Pose, string HiddenSurfaceRemoval, angle.rad MinFaceAngle )void ProjectShapeModel3d( HObject* ModelContours, const HTuple& ShapeModel3DID, const HTuple& CamParam, const HTuple& Pose, const HTuple& HiddenSurfaceRemoval, const HTuple& MinFaceAngle )static void HOperatorSet.ProjectShapeModel3d( out HObject modelContours, HTuple shapeModel3DID, HTuple camParam, HTuple pose, HTuple hiddenSurfaceRemoval, HTuple minFaceAngle )def project_shape_model_3d( shape_model_3did: HHandle, cam_param: Sequence[Union[int, float, str]], pose: Sequence[Union[int, float]], hidden_surface_removal: str, min_face_angle: Union[int, float] ) -> HObject

Herror T_project_shape_model_3d( Hobject* ModelContours, const Htuple ShapeModel3DID, const Htuple CamParam, const Htuple Pose, const Htuple HiddenSurfaceRemoval, const Htuple MinFaceAngle )

HXLDCont HShapeModel3D::ProjectShapeModel3d( const HCamPar& CamParam, const HPose& Pose, const HString& HiddenSurfaceRemoval, const HTuple& MinFaceAngle ) const

HXLDCont HShapeModel3D::ProjectShapeModel3d( const HCamPar& CamParam, const HPose& Pose, const HString& HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HShapeModel3D::ProjectShapeModel3d( const HCamPar& CamParam, const HPose& Pose, const char* HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HShapeModel3D::ProjectShapeModel3d( const HCamPar& CamParam, const HPose& Pose, const wchar_t* HiddenSurfaceRemoval, double MinFaceAngle ) const (Windows only)

HXLDCont HCamPar::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HPose& Pose, const HString& HiddenSurfaceRemoval, const HTuple& MinFaceAngle ) const

HXLDCont HCamPar::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HPose& Pose, const HString& HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HCamPar::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HPose& Pose, const char* HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HCamPar::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HPose& Pose, const wchar_t* HiddenSurfaceRemoval, double MinFaceAngle ) const (Windows only)

HXLDCont HPose::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HCamPar& CamParam, const HString& HiddenSurfaceRemoval, const HTuple& MinFaceAngle ) const

HXLDCont HPose::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HCamPar& CamParam, const HString& HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HPose::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HCamPar& CamParam, const char* HiddenSurfaceRemoval, double MinFaceAngle ) const

HXLDCont HPose::ProjectShapeModel3d( const HShapeModel3D& ShapeModel3DID, const HCamPar& CamParam, const wchar_t* HiddenSurfaceRemoval, double MinFaceAngle ) const (Windows only)

HXLDCont HShapeModel3D.ProjectShapeModel3d( HCamPar camParam, HPose pose, string hiddenSurfaceRemoval, HTuple minFaceAngle )

HXLDCont HShapeModel3D.ProjectShapeModel3d( HCamPar camParam, HPose pose, string hiddenSurfaceRemoval, double minFaceAngle )

HXLDCont HCamPar.ProjectShapeModel3d( HShapeModel3D shapeModel3DID, HPose pose, string hiddenSurfaceRemoval, HTuple minFaceAngle )

HXLDCont HCamPar.ProjectShapeModel3d( HShapeModel3D shapeModel3DID, HPose pose, string hiddenSurfaceRemoval, double minFaceAngle )

HXLDCont HPose.ProjectShapeModel3d( HShapeModel3D shapeModel3DID, HCamPar camParam, string hiddenSurfaceRemoval, HTuple minFaceAngle )

HXLDCont HPose.ProjectShapeModel3d( HShapeModel3D shapeModel3DID, HCamPar camParam, string hiddenSurfaceRemoval, double minFaceAngle )

DescriptionπŸ”—

The operator project_shape_model_3dProjectShapeModel3d projects the edges of the 3D object model that was used to create the 3D shape model ShapeModel3DIDshapeModel3DIDshape_model_3did into the image coordinate system and returns the projected edges in ModelContoursmodelContoursmodel_contours. The coordinates of the 3D object model are given in the 3D world coordinate system (mcs). First, they are transformed into the camera coordinate system (ccs) using the external camera parameters given in Poseposepose. Then, these coordinates are projected into the image coordinate system based on the internal camera parameters CamParamcamParamcam_param.

The internal camera parameters CamParamcamParamcam_param describe the projection characteristics of the camera (see Calibration). The Poseposepose is in the form \(\mvPoseVar{{ccs}}{mcs}\), see Transformations / Poses and β€œSolution Guide III-C - 3D Vision”. Hence, it describes the position and orientation of the model coordinate system defined by the 3D object model relative to the camera coordinate system.

The parameter HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal can be used to switch on or to switch off the removal of hidden surfaces. If HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal is set to 'true'"true", only those projected edges are returned that are not hidden by faces of the 3D object model. If HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal is set to 'false'"false", all projected edges are returned. This is faster than a projection with HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal set to 'true'"true".

If the system variable (see set_systemSetSystem) 'opengl_hidden_surface_removal_enable'"opengl_hidden_surface_removal_enable" is set to 'true'"true" (which is default if it is available) and HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal is set to 'true'"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 CamParamcamParamcam_param 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 MinFaceAngleminFaceAnglemin_face_angle. If MinFaceAngleminFaceAnglemin_face_angle is set to 0.00.0, all edges are projected. If MinFaceAngleminFaceAnglemin_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.

If for the model creation with create_shape_model_3dCreateShapeModel3d the parameter 'union_adjacent_contours'"union_adjacent_contours" was activated, adjacent contours are joined.

project_shape_model_3dProjectShapeModel3d and project_object_model_3dProjectObjectModel3d return the same result if the 3D object model that was used to create the 3D shape model is passed to project_object_model_3dProjectObjectModel3d.

project_shape_model_3dProjectShapeModel3d is especially useful in order to visualize the matches that are returned by find_shape_model_3dFindShapeModel3d in the case that the underlying 3D object model is no longer available.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

ModelContoursmodelContoursmodel_contours (output_object) xld_cont-array β†’ objectHObjectHXLDContHObjectHobject *

Contour representation of the model view.

ShapeModel3DIDshapeModel3DIDshape_model_3did (input_control) shape_model_3d β†’ (handle)HTuple (HHandle)HShapeModel3D, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the 3D shape model.

CamParamcamParamcam_param (input_control) campar β†’ (real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Internal camera parameters.

Poseposepose (input_control) pose β†’ (real / integer)HTuple (double / Hlong)HPose, HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

3D pose of the 3D shape model in the world coordinate system.

HiddenSurfaceRemovalhiddenSurfaceRemovalhidden_surface_removal (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Remove hidden surfaces?

Default: 'true'"true"
List of values: 'false', 'true'"false", "true"

MinFaceAngleminFaceAnglemin_face_angle (input_control) angle.rad β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Smallest face angle for which the edge is displayed

Default: 0.5235990.523599
Suggested values: 0.17, 0.26, 0.35, 0.520.17, 0.26, 0.35, 0.52

ResultπŸ”—

If the parameters are valid, the operator project_shape_model_3dProjectShapeModel3d returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

create_shape_model_3dCreateShapeModel3d, read_shape_model_3dReadShapeModel3d, get_shape_model_3d_paramsGetShapeModel3dParams, find_shape_model_3dFindShapeModel3d

Alternatives

project_object_model_3dProjectObjectModel3d

See also

convert_point_3d_cart_to_spherConvertPoint3dCartToSpher, convert_point_3d_spher_to_cartConvertPoint3dSpherToCart, create_cam_pose_look_at_pointCreateCamPoseLookAtPoint, trans_pose_shape_model_3dTransPoseShapeModel3d

ModuleπŸ”—

3D Metrology