LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw an overlay on a canvas with live video

I modified the Vision color pattern matching example to display the images on a canvas.  I do not want separate windows to open to display the video.  I currently am displaying the live images using the imgGrab.  During the Grab process the video is stored in an array and as an Image it is then displayed on a canvas.  I create a Rect of the center of the image and store this as the search image.  I convert this search image to an array and display it on a canvas.
 
Question 1:
Is there an alternative way to display Vision Images on a canvas instead of separate windows without using the ImageToArray or ArraytoImage functions?
 
Question 2:
I would like to overlay the Rect on the canvas that is displaying the live video.  When I try this I see a solid white rectangle in the center of my image.  The image is not displayed in the center of the rectangle.  I tried changing the rect color to transparent but all it does is show the default canvas color (white).  
 
Jon K.
 
0 Kudos
Message 1 of 4
(4,518 Views)
Hello Jon,
This sounds like an interesting application.
To answer your first question: I do not know of a way to display Vision Images on a canvas without converting these to arrays.
To answer your second question, you may want to try the imaqOverlayClosedContour function.
 
I hope this answers your questions.  Let us know if there is anything else we can help with.
Regards,
Angela M
Applications Engineer
0 Kudos
Message 2 of 4
(4,487 Views)
Hello,
It seems like when using only NI vision function, I can get what I want as far as overlaying goes. For example, overlaying a rectangle gives us the option to have the image still visible within the rectangle. However, most of us want to have a GUI with our application and just a simple external display is not adequate.
 
I cannot get around this problem using user interface functions. Like Jon said, the shape just replaces the image underneath. Is it possible to do the overlaying with NIvision function (using image * types), then convert the overlayed image as a "special" array and then display it on a GUI?
Kaccie
0 Kudos
Message 3 of 4
(4,260 Views)

Hello kaccie,

I do not completely understand the issue you are experiencing.  Are you having problems with the Overlay functions in CVI or are you having issues with getting all of the user interfaces into one window?  The Overlay functions should not replace the image underneath as they perform nondestructive overlays.  The command that does create a destructive overlay is the imaqMergeOverlay function.

Carlton
CLA
0 Kudos
Message 4 of 4
(4,228 Views)