I'm using NI Vision Assistant 8.5 and I'm trying to calculate the distance between two edges in a video frame. I know how to do it for one picture but I have over 200 frames that I want to analyze. Is there a way to detect two edges in a region of interest instead of manually drawing the edge detector line every time. Also the region that I'm interested in is rotating (see attached picture). I tried pattern matching to locate the A on the wheel and it worked somewhat but I want the edge detector to give me the distance between the two edges right next to the A.
If you are using Vision assistant by itself you are out of luck. Vision assistant can be part of either a LabView or a Vision Builder AI app. Either of those programs can create/modify the region of interest for you. If you are new to this stuff, get a copy of Vision Builder for Automated Inspection (VBAI). It will be easier to use, and you will still be able to log your data.
Actually Vision Assistant has a Set Coordinate System on the first tab. If you can get a point and angle (i.e. from pattern matching) and create a coordinate system from this, all subsequent steps can use this coordinate system so the ROI you draw rotates/shifts with the coordinate system. This is very similar to how you would solve this problem in VBAI or LV using the vision tools.
You can check out an example of the coordinate system by opening up an example script. Go to Help>>Solution Wizard and choose Pharmaceuticals>>Dental Floss Inspection for an example of using the coordinate system with subsequent steps dynamically updating their ROI based on the position changes.
If you are trying to detect defects between the first image (let's call it Golden template), and subsequent images, then look at the Label Inspection example located in the Manufacturing section of the Solutions Wizard.
As Brad mentioned, you would use the pattern matching function to locate your template, a coordinate system step to reposition the region on interest on further images, and the defect inspection step, to compute the defects between the golden template and the image under inspection.
The pattern matching score in itself is not the best way to identify defects between the template and the image under inspection. In the case of Optical Character Verification, the verification score provided by the OCR function is made for that. For other applications, the defect inspection function I suggested can be another way to detect defects.