3D Range Image Plane Estimator Edit ControlCognex VisionPro

The 3D Range Image Plane Estimator edit control provides a graphical user interface to the Cog3DRangeImagePlaneEstimatorTool vision tool, which fits a plane in the physical 3D space through three or more points in a 3D range image acquired from a Cognex 3D displacement sensor. The tool offers multiple methods of fitting the plane to the sample points while calculating the ResidualsRMS error.

Cognex Image Processing Cog 3DRange Image Plane Estimator Whole Control

Your vision application can use the fitted plane for other 3D vision tasks. See the topic Estimating a 3D Plane for more information on the 3D Range Image Plane Estimator.

To include the edit control in your custom vision application, you must first add it to your Visual Studio .NET development environment. See the topic Adding Edit Controls to Visual Studio for more information.

The edit control supports the following features:

Control Buttons

The edit control supports the following buttons along the top of the edit control:

Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Button Bar

ButtonDescriptionFunction
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Run
RunUses the current set of discrete points or Region to analyze the image stored in the Current.InputImage buffer to calculate the plane properties.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Electric
Electric modeToggles electric mode, where the Range Image Plane Estimator tool executes automatically when particular configuration parameters change. In electric mode, a lightning bolt appears next to every electric property.

Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Local

Local image display

Opens or closes the local image display window. A Range Image Plane Estimator tool supports the following image buffers:

  • The Current.InputImage buffer contains the current image and (if specified) the overlay of the Region, the overlay of the image mask, and the overlay of the points.
  • The LastRun.InputImage buffer contains (if specified) the overlay of the Region, the overlay of the image mask, and the overlay of the points.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Float
Floating image displayOpens one or more floating image windows, which support the same image buffers as the local image display window.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Open
OpenOpens a VisionPro persistence (.vpp) file that contains a set of saved properties for this vision tool object type. VisionPro reports an error if you try to open a .vpp file for another object type.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Save
SaveSaves the current properties of the vision tool to a VisionPro persistence (.vpp) file. The edit control allows you to choose between saving the vision tool with or without its image buffers and tool results.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Save As
Save AsSaves the current properties of the vision tool to a new VisionPro persistence (.vpp) file.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Reset
ResetResets the vision tool to its default state.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Tool Tips
Show ToolTipsEnables or disables the display of tooltips for individual items in the edit control.
Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Control Help
HelpOpens this VisionPro online help file.
Sampling Tab

Use the Sampling tab to choose whether the tool fits a plane to discrete points or an enclosed region of a 3D range image.

Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Settings Tab

Choose one of the following methods:

Area

Choose Area to perform plane fitting based on a region of the 3D range image you specify:

Cognex Image Processing Cog 3DRange Image Plane Estimator Settings Tab Area

Set the parameters for the region:

ParameterDescription
Region Mode
(RegionMode)
Specifies how the input Region is applied to the input image. Controls whether the optional run time region (mask) is applied to the input image.

Region Shape

Selects the shape of the region. 3D points outside of this region will not be considered during plane fitting.

Select one of the following shapes:

Adjust the various properties of the region with the shape you selected.

Points

Choose Points to perform plane fitting based on discrete points. The Current.InputImage displays point graphics for you to select and reposition on the 3D range image. Use the following feature to add/remove points and provide the tool with additional configuration parameters:

Cognex Image Processing Cog 3DRange Image Plane Estimator Settings Tab Points

ParameterDescription
Points (2D locations)Use the button bar along the top to add and remove points. If you specify fewer than three points the tool will throw an exception when it executes.
Z Lookup Method
(ZLookupMethod)
Selects the method used to determine the z-coordinate (height) of each point. The z-coordinate of a point is derived from one of the following:
  • Single Pixel

    The height value is taken from the pixel with the corresponding (X,Y) coordinate in the 3D range image.

  • Neighborhood Median

    A single value is calculated from the median of an NxM neighborhood around each point with the corresponding (X,Y) coordinate in the 3D range image.

  • Neighborhood

    The height value for all the pixels within an NxM neighborhood are used for plane fitting.

Neighborhood Size In Pixels
(NeighborhoodSizeXInPixels)
(NeighborhoodSizeYInPixels)
The x and y sizes of the neighborhood, in pixels. The same neighborhood size is used for each point.
Fitting Tab

Use the Fitting tab to specify parameters for how the tool will generated the fitted plane.

CognexImageProcessing_Cog3DRangeImagePlaneEstimator_FittingTab

The tab supports the following features:

Robust Fit Technique

You can choose between two methods of fitting a plane to the available input points:

  • AllPoints: Fit the best possible plane to all 3D points made available to the tool.
  • AdaptiveRANSAC: Cognex uses a custom version of the RANSAC algorithm to determine the best fit plane given the input 3D points. See the topic The RANSAC Algorithm for more information on the algorithm, which is used by several Cognex vision tools.

    The AdaptiveRANSAC technique uses the following parameters:

    ParameterDescription

    Distance Threshold
    (DistanceThreshold)

    For each iteration of the fitting algorithm, measure the distance between the candidate plane and the distance to each 3D input point in the client coordinate system. Points farther away than this threshold are considered outliers.

    Assurance
    (Assurance)

    Specify the likelihood that the computed fit contains only inliers.

    Use Assurance to balance the execution time of the tool with with the accuracy of the fitted plane. Reducing this value can lower the execution time but make the fitted plane less accurate to the desired features in your 3D range images.

    Be aware that the default value of 1.0 forces the tool to exhaustively evaluate all inliers and outliers for every possible model, which can take a considerable amount of time. Cognex recommends you set a Timeout value so the application will not become unresponsive.

    Worst Case Proportion Outliers
    (WorstCaseProportionOutliers)

    Specify a worst case proportion of outliers expected in the 3D points used for plane fitting. A value of 0.7 reflects that your expect 70% of the 3D points being processed to be outliers.

    Be aware that the default setting of 0 forces the tool to use the AllPoints fitting method regardless of whether you choose to use the AdaptiveRANSAC technique.

In addition, you can specify a Timeout value, in milliseconds, to have the application throw an exception if the tool exceeds the timeout period.

Plane Direction

Choose positive or negative PlaneDirection, specifying the direction in which the estimated plane's Normal should point. If PositivePixelSpaceZ is selected, the z component of the estimated plane's Normal (in selected space) points towards the positive z-axis of the 3D Pixel Space. If NegativePixelSpaceZ is selected, the z component of the estimated plane's Normal (in selected space) points towards the negative z-axis of the 3D Pixel Space.

Graphics Tab

Use the Graphics tab to control which graphics the tool displays:

Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Graphics Tab

ParameterDescription
Inputs
  • Show Input Region displays the input region you specified based on which type of plane fitting is performed.
  • Show Input Image Mask displays any input image mask over the input image. See the topic Using a LineMax Tool for information on using an image mask.
  • Show Input Points displays the input points you specified based on which type of plane fitting is performed.

Diagnostics

Show Input Image: Determine whether or not the input image is recorded as part of the diagnostic record, and whether the image is copied to the record or saved in the record as a reference.

  • Show Diagnostics Input Region: Displays the diagnostic input region if you are creating a fitted plane based on an input region.
  • Show Diagnostic Input Image Mask: Show a graphic representing the run-time mask, if you supplied one, and are creating a fitted plane based on an input region. The graphic is shown on the LastRun.InputImage.
  • Show Diagnostic Input Points: Displays the diagnostic input region if you are creating a fitted plane based on a set of input points.
Results Tab

The Results tab displays information about the fitted plane:

Cognex Image Processing Cog 3DRange Image Plane Estimator Plane Estimator Result Tab

The tool returns the following data:

  • The ResidualsRMS error of the fitting. This error should be small (less than 0.1) to indicate that the plane is properly fitted.
  • The NumberOfPointsUsedInEstimation is returned. If a point (or its whole neighborhood) falls on an area with missing pixels, the point will not be used in plane fitting.
  • An (x, y, z) value to describe the normal vector whose origin is the origin of the 3D coordinate system.
  • The offset, or distance of the plane from the origin of the 3D coordinate system along the direction of the normal vector.
  • The tilt and rotation of the fitted plane as described in the topic Estimating a 3D Plane.