Using Dimensioning ToolsCognex VisionPro

This topic provides an overview of how to use the dimensioning tools to solve dimensioning applications.

Develop the Conceptual Approach to Solving the Application

Before beginning to develop your application, analyze the problem you are trying to solve and develop a conceptual approach to solving the problem. Once you understand the high-level steps to solving the application, select, configure, and apply the appropriate dimensioning tools.

In this example, the application is to verify that the indicator needle on a dial thermometer is pointed in the correct direction. (This application might be used to verify the accuracy of the thermometers by placing them in a chamber of known temperature, then verifying that their readings are correct.) The following figure shows an image of the part:

Measurement General Walkthrough Use Dimensioning howto conceptual problem

The following list gives one conceptual approach to solving the problem of verifying that the needle is pointing in the correct direction.

  • Fixture the part. Since the thermometers may appear at any angle or offset within the image, start by identifying a distinctive pattern on the part and using that to create a fixture. Once the fixture is established, subsequent vision tools will operate in that fixtured space.

    Measurement General Walkthrough Use Dimensioning howto conceptual 1

  • Locate the center of the dial.

    Measurement General Walkthrough Use Dimensioning howto conceptual 2

  • Establish a baseline. Defining a baseline that passes through the center of the dial will provide a reference line from which to measure the angle of the needle.

    Measurement General Walkthrough Use Dimensioning howto conceptual 3

  • Locate a point on the center line of the needle.

    Measurement General Walkthrough Use Dimensioning howto conceptual 4

  • Establish a line that passes through the center point and the point on the needle. The angle between this line and the baseline gives the needle angle.

    Measurement General Walkthrough Use Dimensioning howto conceptual 5

  • Measure the angle between the two lines.

    Measurement General Walkthrough Use Dimensioning howto conceptual 6

Implement the Conceptual Approach

Once you have established the approach you will use, apply VisionPro vision tools and dimensioning tools to implement the application. The following sections show how the application described above could be implemented in VisionPro. This example uses QuickBuild.

Note: There are many conceptual approaches and implementations that can be used to solve dimensioning applications. The approach shown here may not be appropriate for all applications.

Step 1: Fixture the Part

In this application, the CogPMAlignTool is used to locate each part for fixturing. You create, configure, and link a CogPMAlignTool by following these steps:

  • Add a CogPMAlignTool to the toolgroup and link the Job's Image Source's output image to the CogPMAlignTool's input image:

    Measurement General Walkthrough Use Dimensioning howto 1 1

  • Grab a training image and train the logo as a pattern:

    Measurement General Walkthrough Use Dimensioning howto 1 2

    Note: Aligning the pattern origin with an easily recognizable feature in the image can make it easier to detect problems with the pattern location step.

  • Since the thermometers may be rotated, enable rotation in the CogPMAlignTool's Run Params tab (in this case, the default range of -45° to +45° is sufficient to handle the expected rotation):

    Measurement General Walkthrough Use Dimensioning howto 1 3

  • Create a CogFixtureTool and link the CogPMAlignTool's output pose to the CogFixtureTool's input transformation (make sure to link your image source's output image to the CogFixtureTool's input image):

    Measurement General Walkthrough Use Dimensioning howto 1 4

    Note: The approach shown, of linking the CogPMAlignTool's output pose directly to the CogFixtureTool's input transformation will work correctly as long as you do not enable independent X- and Y- scale degrees of freedom in the CogPMAlignTool. Note that you can also link the individual translation and rotation properties instead of the pose.

Running the toolgroup should cause the CogPMAlignTool to display its result graphics on the found logo:

Measurement General Walkthrough Use Dimensioning howto 1 verify

Step 2: Locate the Center of the Dial

The molded features and many reflections near the center of the thermometer dial make it difficult to use a pattern location tool to find the center of the dial directly. Because the thermometer dial has several strong circular features, the CogFindCircleTool is an appropriate choice for locating the center of the dial indirectly.

  • Add a CogFindCircleTool to the toolgroup and link the CogFixtureTool's output image to the CogFindCircleTool's input image (keep in mind that the CogFixtureTool sets the selected space of its output image to be the fixtured space; all the subsequent tools should to run in this fixtured space):

    Measurement General Walkthrough Use Dimensioning howto 2 1

    Note: At this point you can also create a link from the CogFixtureTool's output image to the tool group's outputs collection. You can do this by simply dragging a link from the CogFixtureTool's OutputImage terminal to the ToolGroup Outputs collection. Creating this link will cause the tool group edit control's display to show the result graphics from all of the tools that use the fixtured image as input.

    Measurement General Walkthrough Use Dimensioning howto 2 2

  • Now configure the CogFindCircleTool by placing the expected arc graphic on one of the circular features in the image. You should position the arc and the caliper regions so that a high-contrast circular feature is near the center of each caliper region and so that there are a minimal number of extraneous features within the caliper regions, and you should adjust the number of calipers to provide good coverage across the expected arc:

    Measurement General Walkthrough Use Dimensioning howto 2 3

Running the toolgroup should now display both the found pattern and the found circle:

Measurement General Walkthrough Use Dimensioning howto 2 verify

Step 3: Create a Baseline Through the Dial Center

In this application, the angle of the needle is measured relative to the dial face. This step shows how to create a horizontal baseline that passes through the dial center.

  • Create a CogCreateLineTool and link the CogFixtureTool's output image along with the CogFindCircleTool x and y center points:

    Measurement General Walkthrough Use Dimensioning howto 3 2

    Note: Not linking to the CogCreateLineTool's InputLine.Rotation property means the tool will use its default value of 0° for the rotation. You can specify a different value for this property using the tool's edit control.

Running the toolgroup should now display the baseline (in addition to the other tool results):

Measurement General Walkthrough Use Dimensioning howto 3 verify

Step 4: Find a Point on the Needle Centerline

The simplest method of locating the center of the indicator needle is to use a CogCaliperTool.

Note: The methods described in this step assume that the needle angle will only vary by a few degrees. The application assumes that if the needle lies outside of the caliper input region, the part is automatically bad.

  • Create a CogCaliperTool and link the CogFixtureTool's output image to the CogCaliperTool's input image:

    Measurement General Walkthrough Use Dimensioning howto 4 1

  • Now configure the CogCaliperTool's input region so that it lies across the needle. Keep in mind that since you have linked the CogFixtureTool's output image to the CogCaliperTool's input image the input region will move with the part:

    Measurement General Walkthrough Use Dimensioning howto 4 2

  • Now configure the CogCaliperTool to expect an edge pair of appropriate polarity and size:

    Measurement General Walkthrough Use Dimensioning howto 4 3

Running the toolgroup should now display the edge pairs (in addition to the other tool results):

Measurement General Walkthrough Use Dimensioning howto 4 verify

Step 5: Establish a Line from Dial Center through the Needle

Given two points (the dial center and the needle point located in the previous step), you can easily create a line along the needle.

  • Right-click on the CogCaliperTool and choose Add Terminals. Select the (X,Y) coordinates of the result and click Add Output.

    Measurement_General_Walkthrough_UseDimensioning_AddOutputTerminals

  • Create a CogCreateSegmentTool and link the CogFixtureTool's output image along with the links as shown:

    Measurement General Walkthrough Use Dimensioning howto 5 2

Running the toolgroup should now display the new segment (in addition to the other tool results):

Measurement General Walkthrough Use Dimensioning howto 5 verify

Step 6: Measure the Angle from the Baseline to the Needle

Now that you have established the two lines, you can measure the angle between them.

Note: The CogAngleLineLineTool measures the angle between lines, not segments or segments and line. To use the line segment created in the previous step, you must link its GetOutputSegment.CreateLine property.

  • First create a CogAngleLineLineTool and link the CogFixtureTool's output image along with the baseline from the CogCreateLineTool (step 3) and the line output of the CogCreateSegmentTool :

    Measurement General Walkthrough Use Dimensioning howto 6 2

Running the toolgroup should now display the new line (in addition to the other tool results):

Measurement General Walkthrough Use Dimensioning howto 6 verify 1

To view the measured angle, simply open the CogAngleLineLineTool and click on its Results tab:

Measurement General Walkthrough Use Dimensioning howto 6 verify 2

Using a Dimensioning Application

Once you have created a dimensioning application using QuickBuild, you can save the application as a .VPP file develop it further with the VisionPro Application Wizard. You can also reimplement your application using the native CogMath interface.