MIL_ID Context3dmetId, | //in |
MIL_ID SrcContainerOrImageBufId, | //in |
MIL_INT GeometryType, | //in |
MIL_ID Result3dmetId, | //in |
MIL_DOUBLE OutlierDistance, | //in |
MIL_INT64 ControlFlag | //in |
This function fits a 3D geometry to a point cloud or depth map using an iterative fit operation. The function starts from an initial fit estimate of the size and position of the 3D geometry. The function then internally iterates through better estimates of the correct size and position of the 3D geometry until a specified stop condition is reached. Upon each iteration, the function calculates the average root-mean-square (RMS) error per inlier, until a stop condition is met.
The initial fit estimate is calculated according to the mode specified using M3dmetControl() with M_ESTIMATION_MODE. A set of inlier points is then defined according to OutlierDistance, and a new size and placement for the 3D geometry, which reduces the average RMS error per inlier, is calculated. This process then repeats until a stop condition is met.
If the initial fit estimate mode is set to M_FROM_GEOMETRY, the fit operation will use the specified geometry in the fit 3D metrology context. By default, the context contains an undefined geometry. If you try to initiate the fit operation and use the undefined geometry to determine an initial fit estimate, an error will occur. You can use M3dmetCopy() to copy a defined 3D geometry object into the fit 3D metrology context.
If you perform a fit operation using a depth map, it is possible to specify a ROI in raster format, where only the values inside the ROI will be used in the fit. Note that missing data (or invalid points) in the depth map (or point cloud) are ignored when fitting.
When fitting, it is also possible to specify an outlier distance, beyond which no input data is considered for the fit operation.
After calling M3dmetFit(), you can inquire whether the operation was successful using M3dmetGetResult() with M_STATUS, along with several other metrics. To retrieve the calculated best fit 3D geometry or the inliers, use M3dmetCopyResult().
Note that the fit operation does not support 3D box geometry objects. All other 3D geometry objects are supported.
Specifies the fit 3D metrology context.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to perform the fit operation using all the default settings specified for fit 3D metrology contexts in M3dmetControl(). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the identifier of a fit 3D metrology context. This context must have been previously allocated on the required system using M3dmetAlloc() with M_FIT_CONTEXT. (summarize)Specifies the identifier of a fit 3D metrology context. (more details...) |
Specifies the point cloud or depth map to which to fit the 3D geometry.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the identifier of an image buffer that contains a fully corrected depth map. The image buffer must be a 1-band, 8-bit, 16-bit or 32-bit unsigned buffer and must be fully corrected (that is, if you call McalInquire() with M_DEPTH_MAP, the function returns M_TRUE). This image buffer can have a region of interest (ROI) associated with it, in raster format. Only values inside the ROI will be used in the fit operation. (summarize)Specifies the identifier of an image buffer that contains a fully corrected depth map. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the identifier of the container containing a 3D-processable point cloud. The container must be 3D-processable (that is, if you call MbufInquireContainer() with M_3D_PROCESSABLE, the function returns M_PROCESSABLE). (summarize)Specifies the identifier of the container containing a 3D-processable point cloud. (more details...) |
Specifies the type of 3D geometry object to use in the fit operation. Note that 3D box geometry objects are not supported.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to fit a 3D cylinder geometry to the point cloud or depth map. Fitting a 3D cylinder geometry requires at least 5 valid data points. Note that only the curved surface of the cylinder geometry is used in the fitting process; points on the circular bases are ignored. (summarize)Specifies to fit a 3D cylinder geometry to the point cloud or depth map. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to fit a 3D line geometry to the point cloud or depth map. Fitting a 3D line geometry requires at least 2 valid data points. (summarize)Specifies to fit a 3D line geometry to the point cloud or depth map. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to fit a 3D plane geometry to the point cloud or depth map. Fitting a 3D plane geometry requires at least 3 valid data points. (summarize)Specifies to fit a 3D plane geometry to the point cloud or depth map. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to fit a 3D sphere geometry to the point cloud or depth map. Fitting a 3D sphere geometry requires at least 4 valid data points. (summarize)Specifies to fit a 3D sphere geometry to the point cloud or depth map. (more details...) |
Specifies the identifier of the fit 3D metrology result buffer in which to store the results of the fit operation. The result buffer must have been previously allocated using M3dmetAllocResult() with M_FIT_RESULT. To retrieve statistics for the fit operation, use M3dmetGetResult().
Specifies the distance from the 3D geometry, beyond which points are considered outliers and will be ignored during the fit operation.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Same as M_INFINITE. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that no points in the point cloud are outliers, and all points will be considered inliers in every iteration of the fit operation. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the distance from the 3D geometry, beyond which points are considered outliers and will be ignored during the fit operation. |
Header | Include mil.h. |
Library | Use mil.lib; mil3dmet.lib. |
DLL | Requires mil.dll; mil3dmet.dll. |