Cognex.VisionPro.Inspection
This class represents an annotation category.
An annotation category consists of two pieces of information: a name and color.
Annotation categories are defined and used in the Image Grading Utility.
State flag for the Name property.
State flag for Color the property.
Next state flag to be used in derived classes.
Constructor for annotation category.
Name of the annotation category, must be unique.
The annotation category's color that is used for drawing the graphics
Get and set the name of this annotation category.
Set and set the color of this annotation category.
string key of ExpectedOutput's epsilon value
CogRecord structure version identifier 1.0
RecordKey for CogRecord's AdvancedGrade field name
RecordKey for "ExpectedResult" field
RecordKey for "ActualResult" field
RecordKey for "ExpectedOutputs" field
RecordKey for "ExpectedRunStatus" field
RecordKey for "Inputs" field
RecordKey for "Params" field
RecordKey for "Results" field
RecordKey for "OverallVerificationResult" field
RecordKey for "VerificationTimestamp" field
RecordKey for "VerifiedOutputs" field
RecordKey for "VerifiedRunStatus" field
RecordKey for "LastRunRecord" field
RecordKey for "SimpleResult" field
RecordKey for "VerificationResult" field
RecordKey for "ResultType" field
RecordKey for "InputImage" field
String representation of the value NULL;
Interface for verifier in the verification framework.
Run the verifier synchronously.
Run the verifier asynchronously.
Cancel an asynchronous run of the verifier.
Pause an asynchronous run of the verifier.
Resume an asynchronous run of the verifier.
Setup the VisionTool's inputs using the specified verificationData object.
Get and set the input database.
Get and set the input subset array.
Get and set the output database.
Get and set the vision tool under test.
Get and set the behavior of the verifier when it encounters an Unknown SimpleResult.
Get the current state of the verifier.
Get the statistics object associated with the verifier.
Get and set the flags which control what gets stored into the output database.
Raised when the verifier starts running.
Raised when the verifier completes one iteration.
Raised when the verifier has completely finished running.
Raised when the verifier is paused.
Raised when the verifier is resumed.
This class contains an ICogDatabase and adds additional methods that
are specific to the verification framework. This class should be
used whenever interacting with a verification database.
Constructor using the specifed ICogDatabase reference.
The underlying database object to contain within the newly constructed CogVerificationDatabase.
Thrown if the specified database is null.
Serialization constructor.
Standard SerializationInfo argument.
Standard StreamingContext argument.
Add a new data object to this verification database.
The data records's key must be unique.
The new data object to add.
Thrown if not currently connected.
Fires at the start of a call to this method.
Fires at the end of a call to this method.
Removes the specified data object from the verification database.
The key of the data object to remove.
Thrown if not currently connected.
Fires at the start of a call to this method.
Fires at the end of a call to this method.
Replaces data inside the verification database using the specified data.
The key of the replacementData record is used to find which data object to replace.
The replacement CogVerificationData.
Thrown if not currently connected.
Fires at the start of a call to this method.
Fires at the end of a call to this method.
Create a CogVerificationData that duplicates the item specified
by the supplied key. Note that a new ICogRecord is
created every time this method is called.
Specifies the item to fetch from the database.
Thrown if not currently connected.
A newly created instance of the requested database item.
Create a CogVerificationData that duplicates the item specified
by the supplied index. Note that a new ICogRecord is
created every time this method is called.
This index specifies the item to fetch from the database.
Indexing is with respect to the list of keys returned by
the GetKeys method.
A newly created instance of the requested database item.
Adds the specified image to this verification database.
If the image cannot be loaded, this method stops and throws an exception.
The full path to the image to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the added images
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if imageFilanem is null.
Thrown if the imageFilename is not found.
Thrown if the image cannot be added to the database.
Adds the specified image to this verification database.
If the image cannot be loaded, this method stops and throws an exception.
The full path to the image to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the added images
The default advanced grade for all the added images. If NULL then verificationData.Params.ExpectedOutputs.Grade.Value will not be set
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if imageFilanem is null.
Thrown if the imageFilename is not found.
Thrown if the image cannot be added to the database.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub Init()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
' Add image to the database with no grade
mInputDatabase.AddImage("C:\Images\sample.bmp", True, CogVerificationSimpleResultConstants.Accept, "Excellent")
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private Init()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
// Add image to the database with no grade
mInputDatabase.AddImage(@"C:\Images\sample.bmp",true,CogVerificationSimpleResultConstants.Accept,"Excellent");
mInputDatabase.Disconnect();
}
Adds all the images in the specified image directory to this verification database.
If any image in the image directory cannot be loaded, this method stops and throws an exception.
The full path to the directoy that holds the images to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the add images
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if imageDirectory is null.
Thrown if imageDirectory is not found.
Adds all the images in the specified image directory to this verification database.
If any image in the image directory cannot be loaded, this method stops and throws an exception.
The full path to the directoy that holds the images to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the add images
The default advanced grade for all the added images. If NULL then verificationData.Params.ExpectedOutputs.Grade.Value will not be set
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if imageDirectory is null.
Thrown if imageDirectory is not found.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub Init()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
' Add image to the database with no grade
mInputDatabase.AddImage("C:\Images", True, CogVerificationSimpleResultConstants.Accept, "Excellent")
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private Init()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
// Add image to the database with no grade
mInputDatabase.AddImage(@"C:\Images",true,CogVerificationSimpleResultConstants.Accept,"Excellent");
mInputDatabase.Disconnect();
}
Adds all the images in the specified array to this verification database.
If any image in the specified array cannot be loaded, this method stops and throws an exception.
An array that holds the full path to the images to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the added images
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if images is null.
Thrown if images is zero length.
Adds all the images in the specified array to this verification database.
If any image in the specified array cannot be loaded, this method stops and throws an exception.
An array that holds the full path to the images to be added.
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The default simple result for all the added images
The default advanced grade for all the added images. If NULL then verificationData.Params.ExpectedOutputs.Grade.Value will not be set
An array of all the images that were added to the database.
Thrown if not currently connected.
Thrown if images is null.
Thrown if images is zero length.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub Init()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
' Create an array which contains the full path for the images
Dim images As String() = New String() {"C:\Images\sample1.bmp", "C:\Images\sample2.bmp"}
' Add image to the database with no grade
mInputDatabase.AddImage(images, True, CogVerificationSimpleResultConstants.Accept, "Excellent")
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private Init()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
// Create an array which contains the full path for the images
string[] images = new string[]{@"C:\Images\sample1.bmp",@"C:\Images\sample2.bmp"};
// Add image to the database with no grade
mInputDatabase.AddImage(images,true,CogVerificationSimpleResultConstants.Accept,"Excellent");
mInputDatabase.Disconnect();
}
Adds the specified image to this verification database.
If the image cannot be loaded, this method stops and throws an exception.
The ICogImage object that will be added to tha database
Set this to true if the images should be referenced by their full path.
Set this to false if the images should be embedded (copied) into the database.
The full path to the image to be added. (only needed if referenceImage is set to true)
The value of the record key the CogRecord should be created with
The default grade for the added image
The index of the image if it will be a referenced image coming from a container has multimple images inside
The default simple result for the added image
A key of the image that were added to the database.
Thrown if not currently connected.
Thrown if imageFilanem is null.
Thrown if the imageFilename is not found.
Thrown if the defaultKey is null.
Thrown if the image cannot be added to the database.
Adds the specified image to this verification database.
The ICogImage object that will be added to tha database
The default simple result for the added image
A key of the image that were added to the database.
Thrown if not currently connected.
Thrown if image is null.
Thrown if the image cannot be added to the database.
Adds the specified image to this verification database.
The ICogImage object that will be added to tha database
The default simple result for the added image
The default grade for the added image
A key of the image that were added to the database.
Thrown if not currently connected.
Thrown if image is null.
Thrown if the image cannot be added to the database.
Adds the specified images to this verification database.
The array of ICogImage objects that will be added to tha database
The default simple result for all the added images
The keys of the images that were added to the database.
Thrown if not currently connected.
Thrown if any of the images is null.
Thrown if the image cannot be added to the database.
Adds the specified images to this verification database.
The array of ICogImage objects that will be added to tha database
The default simple result for all the added images
The default grade for all the added images
The keys of the images that were added to the database.
Thrown if not currently connected.
Thrown if any of the images is null.
Thrown if the image cannot be added to the database.
Gets all the annotation categories in this verification database.
An array of defined annotation categories.
Thrown if not currently connected.
Adds the specified annotatation category to the database.
The new annotation category to add.
Thrown if not currently connected.
Thrown if newAnnotationCategory Name is null.
Thrown if newAnnotationCategory Name is not unique.
Fires at the end of a call to this method.
Removes the specified annotation category definition from the verification database.
Note, this method does not remove any defined defects using the removed category, it
just removes the definition of the annotation category. Users wanting to remove any
defects using the removed annotation category need to do this themselves manually.
Annotation category to remove.
Thrown if not currently connected.
Thrown if annoationCategoryToRemove is null.
Thrown if annoationCategoryToRemove not found.
Fires at the end of a call to this method.
Gets all the grades in this verification database.
An array of defined string grades.
Thrown if not currently connected.
Adds the specified grade to the database.
The new grade to add.
Thrown if not currently connected.
Thrown if newGrade is null.
Thrown if newGrade is not unique.
Fires at the end of a call to this method.
Removes the specified string grade from the verification database.
Note, this method does not remove any set grades from individual records, it
just removes the grade from the list of possible grades. Users wanting to remove the
grade from any database record need to do this themselves.
Grade to remove.
Thrown if not currently connected.
Thrown if gradeToRemove is null.
Thrown if gradeToRemove not found.
Fires at the end of a call to this method.
Gets the statistics object from this database.
A reference to the statistics object.
Thrown if not currently connected.
Sets the statistics object for this database. Internal use only.
Thrown if not currently connected.
Connect to the underlying ICogDatabase.
Disconnect from the underlying contained ICogDatabase.
Clear the underlying contained ICogDatabase.
Raise the Adding event.
Raise the Added event.
Raise the Removing event.
Raise the Removed event.
Raise the Replacing event.
Raise the Replaced event.
Raise the Clearing event.
Raise the Cleared event.
Raise the AddedAnnotationCategory event.
Raise the RemovedAnnotationCategory event.
Raise the AddedAnnotationCategory event.
Raise the RemovedAnnotationCategory event.
Raise the StatisticsSet event.
Create a strongly typed enumerator to facilitate
iterating through the items in this database. Note that
enumerators are fragile - externally adding or removing items
from this database will invalidate the enumerator. Also note
that modifying a CogVerificationData returned by (the Current property of)
this enumerator will have absolutely no affect on the database
since it is a freshly created copy of the database item, just
as with the Fetch method.
An enumerator whose Current property is of type CogVerificationData.
Thrown if not currently connected.
Create a strongly typed enumerator to facilitate
iterating through the items in this database. Note that
enumerators are fragile - externally adding or removing items
from this database will invalidate the enumerator. Also note
that modifying a CogVerificationData returned by (the Current property of)
this enumerator will have absolutely no affect on the database
since it is a freshly created copy of the database item, just
as with the Fetch method.
An enumerator whose Current property is of type Object.
Thrown if not currently connected.
Get the unerlying contained ICogDatabase object.
Raised before adding data to the verification database.
Raised after data has been added to the verification database.
Raised before removing data from the verification database.
Raised after data has been removed from the verification database.
Raised before replacing data in the verification database.
Raised after data has been replaced in the verification database.
Raised before clearing the verification database.
Raised after the verification database has been cleared.
Raised after an annotation category has been added to the verification database.
Raised after an annotation category has been removed from the verification database.
Raised after a grade has been added to the verification database.
Raised after a grade has been removed from the verification database.
Raised after a statistics object has been set for the verification database.
This class is used to implement a CogRecord that references an image instead of
embedding. The image is referenced via a full path and index (if the referenced image
contains multiple images).
This bit will be set in the EventArgs of a Changed event every
time the value returned by ImageFilename may have changed.
Verifies that the referenced image exists. If there is a problem loading the image,
an exception is thrown, otherwise this method just returns.
Thrown if the ImageFilename is null.
Thrown if the ImageIndex is out of range.
Gets the record's content. This is a read-only property, even though it has a setter.
The record's content.
///
Thrown if the setter of this property is called.
Get/set the filename of the referenced image.
Get/set the image index, if the referenced image is a multi-image container.
Default unitialized value is -1, but should be set to zero in the constructor if the index is not used.
This enumeration holds the expected value for the VisionTool.RunStatus.Result property.
The expected RunStatus.Result from the Vision Tool is Accept.
The expected RunStatus.Result from the Vision Tool is Reject.
The expected RunStatus.Result from the Vision Tool is Unknown.
The verifier has a property called UnknownResultBehavior which controls what happens during
verification when this enumeration is encountered.
This enumeration is used by the verifier's UnknownResultBehavior property to control what the
result of the verification when the CogVerificationSimpleResultConstants.Unknown is encountered.
Always fail/mismatch the verification.
Always pass/match the verification.
This enumeration is the ResultType category for verification results.
The expected result was Accept and the actual result from the VisionTool was Accept.
The expected result was Reject and the actual result from the VisionTool was Reject.
The expected result was Reject and the actual result from the VisionTool was Accept.
The expected result was Accept and the actual result from the VisionTool was Reject.
The expected result was Unknown and the verifier's UnknownResultBehavior property was set to AlwaysMismatch.
The expected result was Unknown and the verifier's UnknownResultBehavior property was set to AlwaysMatch.
The VisionTool's result was either Warning or Error.
This enumeration is a set of OR-able flags that control what gets stored into the output database.
when the verifier is running.
None of the user controllable data is stored into the output database.
The LastRunRecord is stored into the output database.
All user controllable data is stored into the output database.
This class is an implementation of the ICogVerifier interface. This class
takes as input an input database, an output database, and a CogToolBlock under test. After given
these inputs, this verifier goes through the input database, setting up inputs to
the CogToolBlock, runs the CogToolBlock, and then compares the expected values in the input
database to the actaul values generated by the CogToolBlock. The results of this comparison is
finally stored in the output database.
State flag for the InputDatabase property.
State flag for the OutputDatabase property.
State flag for the VisionTool property.
State flag for the InputDatabaseSubset property.
State flag for the UnknownResultBehavior property.
State flag for the OutputDatabaseEnable property.
Default constructor. You will need to provide the vision tool (CogToolBlock), input database, and output database
via the properties on this class if you use this constructor.
Constructor which takes all necessary inputs to the verifier.
The CogToolBlock under test.
The input database where the golden/known results are stored.
The output database where the results of the verification will be stored.
Serialization Constructor.
Standard SerializationInfo argument.
Standard StreamingContext argument.
Runs the verifier synchronously. This method will block until the entire input database is iterated over.
This method should not be called from a GUI callback handler (such as a button click handler)
since it can take a very long time to run. Please use the RunAsync() method instead (and subscribe
to the various verifier events).
Thrown if the verifier is already running.
Runs the verifier asynchronously. As the verifier runs, various events are fired which
the user should be subscribed to.
Thrown if the verifier is already running.
Cancels an asynchronous run of the verifier.
Pauses an asynchronous run of the verifier.
Thrown if the verifier is currently idle.
Resumes a currently paused verifier.
Thrown if the verifier is not paused.
Sets up the various inputs on the CogToolBlock from the specified data object.
The data object that contains the inputs to the CogToolBlock
An output data object to receive a copy of the inputs. Should be set to null for normal usage. Internal Use only.
Raise the RunStarted event.
Raise the RunCompleted event.
The exception if any was thrown during verification, null otherwise.
True if verification was cancelled, false otherwise.
Not used.
Raise the RunProgress event.
The percentage the verifier has completed running (0-100).
The output data object that was generated from the last iteration that was completed.
Not used.
Raise the RunPaused event.
Raise the RunResumed event.
Get and set the input database.
Fires when this property changes.
Thrown if the verifier is busy.
Get and set the subset of keys that the verifier should run against. The specified
keys must exist in the input database, otherwise the verifier will thrown an exception
during runtime.
Fires when this property changes.
Thrown if the verifier is busy.
Get and set the output database where the results of verification will be stored.
Fires when this property changes.
Thrown if the verifier is busy.
Get and set the CogToolBlock under test. Note, the type of this property is ICogTool, but
the input must be of type CogToolBlock.
Fires when this property changes.
Thrown if the verifier is busy.
Get and set the behavior of the verifier (either match or mismatch) when an Unknown SimpleResult is encountered.
Fires when this property changes.
Thrown if the verifier is busy.
Get the current state of the verifier. Returns true if the verifier is busy, otherwise returns false.
No properties can be changed when the verifier is busy.
Get the statistics object associated with this verifier object.
Get and set the various flags that control what gets stored into the output database when the
verifier runs.
Fires when this property changes.
Thrown if the verifier is busy.
Raised when the verifier starts running.
Raised when the verifier completes one iteration.
Raised when the verifier has completely finished running.
Raised when the verifier is paused.
Raised when the verifier is resumed.
Class that defines a image annotation in the verification framework.
An image annotation is a graphic (rectangle) that encompasses some region of interest on an image.
The image annotation also has additional information associated with it including a unique name, a category, and a free form description string.
This image annotation is currently not used in any vision tool algorithm, but rather it is just used for visual identification of interesting regions on an image.
State flag for the AnnotationName property.
State flag for Category the property.
State flag for Description the property.
State flag for Graphic the property.
Next state flag to be used in derived classes.
Constructor for an image annotation
The name of the image annotation, must be unique
The category for the image annotation.
A free form description of the image annotation
A graphic that encompasses a region on an image. The derived type must be of type CogRectangle.
Get and set the annotation name.
Get and set the annotation category.
Get and set the description of this annotation.
Get and set the annotation graphic. Note, this graphic must be of type CogRectangle.
Interface for data which is contained inside a verification database
Returns the contained ICogRecord.
Invalid structure exception class.
Constructor which takes an human readable string that states what went wrong.
Non-change event implementation of ICogVerificationData.
Constructor.
The ICogRecord to be contained by this object.
Returns a boolean if the specified SubRecord (via key parameter) is contained in the record this class holds.
A string which is the key to be search for in the contained record.
True if the contained record contains key, false otherwise.
Returns the contained ICogRecord.
Change event implementation of ICogVerificationData.
Constructor
The ICogRecord to be contained by this object.
Returns a boolean if the specified SubRecord (via key parameter) is contained in the record this class holds.
A string which is the key to be search for in the contained record.
Returns the contained ICogRecord
Container class that provides generic type Value API.
This bit will be set in the EventArgs of a Changed event every
time the value returned by Value may have changed.
Constructor.
The ICogRecord to be contained by this object.
Get and set the Contents of the ICogRecord that is contained in this object.
Container class for verified output results.
Constructor.
The ICogRecord to be contained by this object.
Method which returns whether or not the "VerificationResult" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "VerificationResult" SubRecord.
Method which returns whether or not the "ActualResult" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "ActualResult" SubRecord.
Method which returns whether or not the "Expected" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Expected" SubRecord.
Get the verification result for this verified output.
The verification result is a boolean that indicates if the expected value matched the actual value.
Get the actual result from the vision tool under test for this verified output.
Get the expected result from the vision tool under test for this verified output.
Data class that contains all attributes, params, and results used and generated by the verifier.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Constructor using a key. A brand new CogRecord is constructed using the specified key.
All necessary SubRecords necessary for use with the verification framework are added to the new CogRecord.
The key that is used by the contained ICogRecord.
Method which returns whether or not the "Attributes" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Attributes" SubRecord.
Method which returns whether or not the "Params" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Params" SubRecord.
Method which returns whether or not the "Results" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Results" SubRecord.
Checks the structure of the contained ICogRecord to make sure that it contains the necessary SubRecords for use in the verification framework.
This method will throw various exceptions describing any found errors. This method does not check the "Results" SubRecord since it may not be present.
If no errors are found, no exception is thrown and this method just returns.
Thrown if the contained record is null.
Thrown if the contained record's key is null.
Thrown if the contained record does not have the Attributes SubRecord.
Thrown if the contained record does not have the Attributes.CreationTimestamp SubRecord.
Thrown if the contained record does not have the Attributes.Description SubRecord.
Thrown if the contained record does not have the Attributes.Name SubRecord.
Thrown if the contained record does not have the Attributes.Version SubRecord.
Thrown if the contained record does not have the Params SubRecord.
Thrown if the contained record does not have the Params.ExpectedOutputs SubRecord.
Thrown if the contained record does not have the Params.ExpectedRunStatus SubRecord.
Thrown if the contained record does not have the Params.Inputs SubRecord.
Thrown if the contained record does not have the Params.ExpectedRunStatus.SimpleResult SubRecord.
Thrown if the contained record does not have the Params.ExpectedOutputs.Grade SubRecord.
Thrown if the contained record's InputImage SubRecord is invalid.
Returns the container object for the Attributes collection.
Returns the container object for the Params collection.
Returns the container object for the Results collection.
Note, only data objects that are outputs from the verifier will have this collection.
Class that contains all attributes used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "Name" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Name" SubRecord.
Method which returns whether or not the "Description" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Description" SubRecord.
Method which returns whether or not the "Version" SubRecord exists in the contained ICogRecord.
Method which returns whether or not the "CreationTimestamp" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "CreationTimestamp" SubRecord.
Returns the value container object for the Name collection.
Returns the value container object for the Description collection.
Returns the value container object for the Version collection.
Returns the value container object for the CreationTimestamp collection.
Class that contains all params used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "Inputs" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "Inputs" SubRecord.
Method which returns whether or not the "ExpectedOutputs" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "ExpectedOutputs" SubRecord.
Method which returns whether or not the "ExpectedRunStatus" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "ExpectedRunStatus" SubRecord.
Returns the container object for the Inputs collection.
Returns the container object for the ExpectedOutputs collection.
Returns the container object for the ExpectedRunStatus collection.
Class that contains inputs used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "InputImage" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "InputImage" SubRecord.
Adds an input record with the given key and inputValue to the record.
The key to be added to the record's Inputs parameters. The key has to be unique
The value to be assigned with the given key
Thrown if the key is not unique.
Removes subrecord with the given key from this record.
The key of the subrecord to remove
Thrown if the key is null.
Thrown if the key is not found.
Returns the container object for the InputImage collection.
Gets all the expected keys added to this record.
Returns null if there are no records.
Note: this will always return at least string[] { "InputImage" } since that was added to the records by default.
Class that contains the InputImage used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Gets all the annotations associated with this InputImage.
An array of image annotations
Adds the specified annotation to this InputImage.
The annotation to be added.
Thrown if the new annotation name is not unique.
Thrown if the new annotation graphic is not a CogRectangle.
Removes the specified annotation from this InputImage.
The name of the annotation to remove
Thrown if the specified annotation name is not found.
Class that contains the ExpectedOutputs used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "Grade" SubRecord exists in the contained ICogRecord. Internal Use Only.
Returns true if the contained ICogRecord contains a "Grade" SubRecord.
Adds an expected output with the given key and expectedValue to the record.
The key to be added to the Record's ExpectedOutput parameters. The key has to be unique
The value to be assigned with the given key
Thrown if the key is not unique.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub AddProperty()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' Add additional property to the record with the name "Area" and a value of 3.1415
mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415)
' Change the additional property "Area"
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords("Area").Content = 2.7182
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private AddProperty()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0);
// Add additional property to the record with the name "Area" and a value of 3.1415
mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415);
// Change the additional property "Area"
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords["Area"].Content = 2.7182;
// Update the record in the database
mInputDatabase.Replace(mCurrentRecord);
mInputDatabase.Disconnect();
}
Adds an expected output with the given key, an expectedValue and a range to the record.
The key to be added to the Record's ExpectedOutput parameters. The key has to be unique
The value to be assigned with the given key
The range to be assigned with the given expectedValue. The range is used by the verifier during verification to allow the expectedValue to vary by +/- the range
Thrown if the key is not unique.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub AddProperty()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' Add additional property to the record with the name "Area", a value of 3.1415 and a range of +-0.5
mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415, 0.5)
' Change the additional property "Area"
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords("Area").Content = 2.7182
' Change the range for the additional property "Area"
' WARNING: Works only if the additional property was created with a range
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords("Area").SubRecords(CogFieldNameConstants.RkRange).Content = 0.2
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private AddProperty()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0);
// Add additional property to the record with the name "Area", a value of 3.1415 and a range of +-0.5
mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415 , 0.5);
// Change the additional property "Area"
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords["Area"].Content = 2.7182;
// Change the range for the additional property "Area"
// WARNING: Works only if the additional property was created with a range
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords["Area"].SubRecords[CogFieldNameConstants.RkRange].Content = 0.2;
// Update the record in the database
mInputDatabase.Replace(mCurrentRecord);
mInputDatabase.Disconnect();
}
Removes subrecord with the given key from this record.
The key of the subrecord to remove
Thrown if the key is null.
Thrown if the key is not found.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub New()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' Remove additional property "Area" from the record
mCurrentRecord.Params.ExpectedOutputs.Remove("Area")
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private RemoveProperty()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0);
// Remove additional property "Area" from the record
mCurrentRecord.Params.ExpectedOutputs.Remove("Area");
// Update the record in the database
mInputDatabase.Replace(mCurrentRecord);
mInputDatabase.Disconnect();
}
Adds an expected output with the given key and expectedValue.
The key to be added to the Record's ExpectedOutput parameters. The key has to be unique
The value to be assigned with the given key
Thrown if the key is not unique.
Returns the created ICogRecord
Returns the value container object for the Grade collection.
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub SetGrade()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' The grade which will be added
Dim grade As String = "Good"
' Step one: add this grade to the metadata
' WARNING: If the metadata already contains this grade an exception will be thrown.
mInputDatabase.AddGrade(grade)
' Step two: set the record's grade
mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;
private SetGrade()
{
CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
mInputDatabase.Connect();
CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0);
// The grade which will be added
string grade = "Good";
// Step one: add this grade to the metadata
// WARNING: If the metadata already contains this grade an exception will be thrown.
mInputDatabase.AddGrade(grade);
// Step two: set the record's grade
mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade;
// Update the record in the database
mInputDatabase.Replace(mCurrentRecord);
mInputDatabase.Disconnect();
}
Gets all the expected keys added to this record.
Returns null if there are no records.
Note: this will always return at least string[] { "Grade" } since that was added to the records by default.
Class that contains the ExpectedRunStatus used by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "SimpleResult" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "SimpleResult" SubRecord.
Returns the value container object for the SimpleResult collection.
Class that contains the results used and generated by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "OverallVerificationResult" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "OverallVerificationResult" SubRecord.
Method which returns whether or not the "VerificationTimestamp" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "VerificationTimestamp" SubRecord.
Method which returns whether or not the "VerifiedOutputs" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "VerifiedOutputs" SubRecord.
Method which returns whether or not the "VerifiedRunStatus" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "VerifiedRunStatus" SubRecord.
Method which returns whether or not the "LastRunRecord" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "LastRunRecord" SubRecord.
Returns the value container object for the OverallVerificationResult collection.
Returns the value container object for the VerificationTimestamp collection.
Returns the container object for the VerifiedOutputs collection.
Returns the container object for the VerifiedRunStatus collection.
Returns the container object for the LastRunRecord collection.
Class that contains the VerifiedOutputs generated by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "Grade" SubRecord exists in the contained ICogRecord. Internal Use Only.
Returns true if the contained ICogRecord contains a "Grade" SubRecord.
Returns the value container object for the Grade collection. Internal Use Only.
Class that contains the VerifiedRunStatus generated by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "SimpleResult" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "SimpleResult" SubRecord.
Returns the value container object for the SimpleResult collection.
Class that contains the VerifiedSimpleResult generated by the verification framework.
Constructor using an ICogRecord.
The ICogRecord to be contained by this object.
Method which returns whether or not the "ResultType" SubRecord exists in the contained ICogRecord.
Returns true if the contained ICogRecord contains a "ResultType" SubRecord.
Returns the value container object for the ResultType collection.
This class holds various statistics that are generated when verification is run.
State flag for the TotalCount property.
State flag for the MatchesCount property.
State flag for the MismatchesCount property.
State flag for the TrueAcceptCount property.
State flag for the TrueRejectCount property.
State flag for the FalseAcceptCount property.
State flag for the FalseRejectCount property.
State flag for the UnknownCount property.
State flag for the UndefinedCount property.
State flag for the StartTime property.
State flag for the StopTime property.
State flag for the TotalTime property.
Constructor.
Serialization Constructor.
Standard SerializationInfo argument.
Standard StreamingContext argument.
Reset all the statistics to zero (or the equivalent).
Initalize this object from the other object. Internal Use Only.
The other object that will provide the statistics values for this object.
Get and set the total number of items verified.
Get and set the number of items that matched after verification has run.
Get and set the number of items that mismatched after verification has run.
Get and set the number of items that were categorized as true accept after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the number of items that were categorized as true reject after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the number of items that were categorized as false accept after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the number of items that were categorized as false reject after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the number of items that were categorized as unknown after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the number of items that were categorized as undefined after verification has run.
This statistics is only set when doing comparison with the SimpleResult item.
Get and set the time when the verification started.
Get and set the time when the verification stopped.
Get and set the total verification time.
This EventArgs object is used by the CogVerificationData class hierarchy when a
CogVerificationData object needs to be passed as part of firing an event.
Constructor that takes a data object.
Data object to associate with this EventArgs object
Get the CogVerificationData object associated with this EventArgs object.
This EventArgs object is used by the CogVerificationData class hierarchy when a
key string needs to be passed as part of firing an event.
Constructor that takes a key string.
Get the string key associated with this EventArgs object.
This EventArgs object is used by the CogVerificationData class hierarchy when a
CogAnnotationCategory object needs to be passed as part of firing an event.
Constructor that takes a CogAnnotationCategory object.
Get the CogAnnotationCategory object associated with this EventArgs object.
This EventArgs object is used by the CogVerificationDatabase class when a
grade needs to be passed as part of firing an event.
Constructor that takes a grade string.
Get the string grade associated with this EventArgs object.
This EventArg class is used when the verifier fires the RunCompleted event.
The exception if any was thrown during verification, null otherwise.
True if verification was cancelled, false otherwise.
Not used.
This EventArg class is used when the verifier fires the RunProgress event.
The percentage the verifier has completed running (0-100).
The output data object that was generated from the last iteration that was completed.
Not used.
Gets the CogVerificationData object associated with this EventArgs object.