Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I draw an ellipse in IMAQ?

Hello,

 

I would like to draw an ellipse over an image that already exists, like using the IMAQ Draw VI, but it only offers ovals. I can imagine possibly using the oval function and giving it coordinates that correspond to its major and minor axis, but how can I implement the tilt angle? Rotating the coordinates just reshapes the oval.

 

Thanks, Arron

0 Kudos
Message 1 of 4
(4,427 Views)

Hi Arron,

 

Unfortunately, this is not easy to do.  This code will do it:

 

Rotate Oval.png

 

You basically have to cause the oval to rotate with the image, rotate the image, then make the oval not rotate with the image, and rotate the image back.  Unfortunately, this also messes with the location of it.  You can shift the location of the overlay the same way.

 

This may also be able to be done with rotating the coordinate system that the overlay is associated with, but I'm not quite sure if that can be done.

 

Have a great day,


Chris V

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,418 Views)

Assuming the image rotation concept works, it seems like it would be simpler to rotate the image, draw the oval, then rotate both back.  A lot less math figuring out where to put the oval, etc.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 4
(4,412 Views)

Bruce,

 

That's a great point!  I definitely agree.

 

Chris V

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,407 Views)