My idea is to detect an object using Matching and then send the coordinates of the object to the AnomalyDetection function. I use this for cropping my images in preparation for the training of the neural network.
It goes well during the first execution.
This is an example of my raw image being analyzed by the matching function:
I successfully trained my model using the cropped images from my initial execution. However, when testing my application, the incorrect placement of the ROI results in all images being detected with anomalies.
It appears there has been an incorrect use of the Alignment input in the Matching function. After training the model within the Matching function, it is necessary to perform the Matching function with an Alignment input of 1 (SetReference). Subsequently, switch the Alignment input to 2 (GenerateAlignmentData) and run the Matching function again. Then, transition to the Anomaly Detection function, correctly align the ROI on the object, and execute the Anomaly Detection function. Following these steps, save the Vision application to ensure that the alignment parameters are stored for future use.
Any subsequent execution of functions, including those from AR using I/O, should be performed with the Alignment input set to 2 (GenerateAlignmentData). This should result in proper alignment on the desired object.