CogFindCircle NumCalipers Property Cognex VisionPro
Number of calipers used to find the Circle. NumCalipers - NumToIgnore must be greater than or equal to the minimum number of points required to find the shape. For example, minimum points for a line = 2, circle = 3, & ellipse = 5.

Namespace: Cognex.VisionPro.Caliper
Assembly: Cognex.VisionPro.Caliper (in Cognex.VisionPro.Caliper.dll) Version: 65.1.0.0
Syntax

public int NumCalipers { get; set; }

Property Value

Type: Int32
Events

Event TypeReason
CogFindCircle Changed

Fires when the value of this property changes.

The following state flag may be affected:

CogFindCircle Changed

Fires when both this property and NumToIgnore change.

The following state flags may be affected:

Exceptions

ExceptionCondition
ArgumentException

A value of less than 3 was supplied.

Remarks

Number of calipers used to find the Circle. The number of calipers minus the number of points to ignore must be greater than or equal to the minimum number of points required to fit a circle (3).

If the value of this property is changed such that the number of calipers minus the number of points to ignore is less than 3, NumToIgnore will be changed so that the difference is 3 and the change event will indicate that both properties have changed.

Default Value: 6

Examples

Imports Cognex.VisionPro
Imports Cognex.VisionPro.Caliper
Imports Cognex.VisionPro.ImageProcessing

' Create a CogFindCircle operator and a results object
Dim myFCO As New CogFindCircle
Dim myArc As New CogCircularArc
Dim myFCOResults As New CogFindCircleResults
Dim i As Integer

' Configure the CogFindCircle Object
myFCO.ExpectedCircularArc = myArc
myFCO.CaliperRunParams.FilterHalfSizeInPixels = 3
myFCO.NumCalipers = 10
myFCO.CaliperProjectionLength = 25
myFCO.CaliperSearchLength = 35
myFCO.CaliperSearchDirection = CogFindCircleSearchDirectionConstants.Inward
myFCO.DecrementNumToIgnore = True
myFCO.RadiusConstraint = myArc.Radius
myFCO.RadiusConstraintEnabled = True

' Execute it
myFCOResults = myFCO.Execute(CType(myAFT.OutputImage, CogImage8Grey))
  ' Display the found circle
CogDisplay1.StaticGraphics.Clear()
CogDisplay1.StaticGraphics.Add(myFCOResults.GetCircle.CopyBase(CogCopyShapeConstants.All), "")

' Display some information about the result
lblRes.text = "Points found; " & myFCOResults.NumPointsFound _
                & " points used; " & myFCOResults.NumPointsUsed _
                & " RMS error: " & myFCOResults.RMSError

' And display some information about each individual result

For i = 0 To myFCOResults.Count - 1
  LstRes.Items.Add("Point (" & myFCOResults(i).X.ToString & ", " & myFCOResults(i).Y.ToString _
            & ") Found: " & myFCOResults(i).Found & " Used: " & myFCOResults(i).Used _
            & " is " & myFCOResults(i).DistanceToCircle & " from found shape.")
Next i
using Cognex.VisionPro;
using Cognex.VisionPro.Caliper;
using Cognex.VisionPro.ImageProcessing;


// Create a CogFindCircle operator and a results object
  CogFindCircle myFCO = new CogFindCircle();
  CogCircularArc myArc = new CogCircularArc();
  CogFindCircleResults myFCOResults = new CogFindCircleResults();
  int i;

// Configure the CogFindCircle Object
myFCO.ExpectedCircularArc = myArc;
myFCO.CaliperRunParams.FilterHalfSizeInPixels = 3;
myFCO.NumCalipers = 10;
myFCO.CaliperProjectionLength = 25;
myFCO.CaliperSearchLength = 35;
myFCO.CaliperSearchDirection = CogFindCircleSearchDirectionConstants.Inward;
myFCO.DecrementNumToIgnore = true;
myFCO.RadiusConstraint = myArc.Radius;
myFCO.RadiusConstraintEnabled = true;

// Execute it
myFCOResults = myFCO.Execute((CogImage8Grey)myAFT.OutputImage );
// Display the found circle
CogDisplay1.StaticGraphics.Clear();
CogDisplay1.StaticGraphics.Add(myFCOResults.GetCircle().CopyBase(CogCopyShapeConstants.All), "");

// Display some information about the result
lblRes.Text = "Points found; " + myFCOResults.NumPointsFound  
                + " points used; " + myFCOResults.NumPointsUsed  
                + " RMS error: " + myFCOResults.RMSError;

// And display some information about each individual result 

for (i = 0; i < myFCOResults.Count; i++)
  {
  LstRes.Items.Add("Point (" + myFCOResults[i].X  + ", " + myFCOResults[i].Y   
            + ") Found: " + myFCOResults[i].Found + " Used: " + myFCOResults[i].Used  
            + " is " + myFCOResults[i].DistanceToCircle + " from found shape.");
  }
See Also