06-26-2013 09:32 AM
Hello everyone,
I am writing a vi which finds the coordinates of the corners of a rectangular object in an input image (and uses these points in various production test calculations).
So far, I have modified the pattern matching VI to correctly identify the correct region of the image in which the object lies, however the exact position of the bounding box which the template match outputs varies, so I'm having a bit of trouble using this method alone.
I wrote a VI which uses the 'Position' output of the 'IMAQ match pattern 3' and creates a box around the correct area with the intention of using this to define an ROI for the extract contour VI. Everything wires up fine and placing probes along the inputs to Extract Contour shows that the inputs appear to be correct, but the VI throws me an 'Invalid ROI' every time.
Attatched is a sample image, and my extract contour subVI.
I'm also not opposed to suggestions, if anyone has a better method for finding these corners.
06-28-2013 04:22 PM
Since you already know the correct area in which to define the ROI for the Extract Contour vi, you should be able to use the IMAQ Convert Rectangle to ROI function. This should simplify the ROI descriptor code a little bit and also remove the 'Invalid ROI' error.