Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq count object and coordinate system

I use the function Imaq count object to find a rectangle in a picture. After that I want to assign a coordinate system to the center of this rectangle. How can I do this?
help me please!!
thanks
0 Kudos
Message 1 of 5
(4,268 Views)
Hi,

If what you're trying to do is express the position of other points in the image relative to the center of the bounding box, I would suggest calibrating the image using IMAQ Set Simple Calibration, then IMAQ Convert Pixel to Real World to get the new coordinate of the pixel expressed in the coordinate system you just defined.

If you want to update the position other regions of interest in the image based the position of the object, build a coordinate system by computing the center of the bounding box, then use IMAQ TransformROI.
Refer to Examples\Vision\3. Applications\Rotating Part Example.vi for an example that uses this VI.

-Christophe Caltagirone
IMAQ R&D
Message 2 of 5
(4,252 Views)
hi!
If you want to update the position other regions of interest in the image based the position of the object, build a coordinate system by computing the center of the bounding box, then use IMAQ TransformROI.
Refer to Examples\Vision\3. Applications\Rotating Part Example.vi for an example that uses this VI.


My issue is that I don't know how to compute the center of the bounding box
And I didn't have the example that you say can you gime me the link please? thanks.

The problem is that Imaq find coordSys ask a search rectangle and in Imaq count object there is no output like rectangle.

Message Edited by sole on 06-29-2005 02:16 AM

0 Kudos
Message 3 of 5
(4,248 Views)
IMAQ Count Object also returns the center of mass of the object. Just unbundle that output.
If you want the center of the rectangle (which is different), you have to compute it manually. See attached VI.

The example is located in C:\Program Files\National Instruments\LabVIEW 7.1\Examples\Vision\3. Applications\Rotating Part Example.llb\Rotating Part Example.vi

-Christophe Caltagirone
IMAQ R&D
Message 4 of 5
(4,226 Views)
thanks a lot!
I have an other question and it is very important for my program:
I have created coordinate system now.
I create after a roi(with my mouse) in a first picture
then I want to say that this roi is attached to the coordinate system.
So if the object move, the repere move and the roi also move;
How can I don this???

thanks
0 Kudos
Message 5 of 5
(4,219 Views)