ClassifyPattern AddTrainItem Method (String, String)Cognex VisionPro 9.25 SR1

Creates a ClassifyTrainItem object and adds it to the LabeledImages collection.

Namespace: Cognex.Vision.ViDiEL
Assembly: Cognex.Vision.ViDiELClassify.Net (in Cognex.Vision.ViDiELClassify.Net.dll) Version: 9.25.1.0
Syntax

public void AddTrainItem(
	string imageId,
	string classId
)
Exceptions

ExceptionCondition
ArgumentExceptionIf a train item with the image id and the class id already exists.
ArgumentExceptionIf the image id is already in the LabeledImages.
ArgumentOutOfRangeExceptionIf the class id is not found in the Classes collection.
ArgumentOutOfRangeExceptionIf the image id is not found in the Images collection.
Remarks

The method assigns a class to an image using the ids from the Classes and the Images collections.

If the pattern is trained, the pattern will become untrained.

Changed Raised when the value of this property changes. The following state flags may be affected:

See Also