Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert a camera acquisition in a XYgraph

Hi everybody, I really need your help.

I explain: in on hand I have a XYgraph with a plot (a circle), in the other hand I have a camera acquisition which is a "Vision Acquisition" v.i. I would like now to combine the both.

So either, putting the real time image of the camera in the background of the XYgraph or putting the plot on the front of the Vision Acquisition with an adapted scale.. but I don't really know if it's the good v.i.

I want this because I should be able to choose a location on my circle grabbing the cursor, that match very precisely with a location on the video.

Any Idea?


Best regards
MartinO.

0 Kudos
Message 1 of 13
(4,670 Views)

The best solution in this case, is place the paint the XY graph transparent and place it on top of the image display control. A lot can be done in UI design in LabVIEW by using the transparent color and the Z-order of the different controls to achieve the result you want.

If you want to be able to use the scrollbar and zooming on the image, you'll have to programmatically respond to these event and adjust the scales of the graph to display the correct beginning and end values for the visible area.

See attached VI.

 

Christophe

0 Kudos
Message 2 of 13
(4,658 Views)

Hi ChristopheC, and thanks for your answer

your idea seems to be a good alternative, I just don't understand how do you change the "Z-order" of your different elements. For exemple on the attached vi, is it works the same way on "Image2" ?

Best regards.

0 Kudos
Message 3 of 13
(4,629 Views)

The Z-Order determines which control is on top of the other one. You can change it by selecting the control and choosing one of the elements of the Reorder menu on the toolbar (see attached image). In your case, since you want to move the cursor of the graph, you want to make sure the graph is on top of the image display control.

 

It would work also on the other image display control. See attached VI. In the original one that I sent, I chose to hide the scroll bars and paint it transparent for estetic purposes.

Download All
0 Kudos
Message 4 of 13
(4,619 Views)

Hi CrhistopheC,

Thank you for explanations, I understand now how to manage the Z-order.
Now that I can put my camera acquisition behind the transparent XYgraph, do you know if there is a way to join the both? I mean, fix the position of the graph (no grabbing allowed), then "calibrate" the image .. adapt the size of the image with the size of the graph.. I know that it's another issue (pixel management etc..), but if you have an idea, i would be glad you share it !

Thanks,
MartinO.

0 Kudos
Message 5 of 13
(4,605 Views)

Yes, LabVIEW allows to do that. Select both controls (draw a region emcompassing them both), then select group from the same Z-Order menu.

This will prevent you from changing the relative position from one to the other.

If you want to go one step further and not allow to move them on the front panel, you can also "lock" them through the same menu.

 

Hope this helps.

 

Best regards,

 

Christophe

0 Kudos
Message 6 of 13
(4,591 Views)

I thought I answered this question recently.  Is this a double post?

 

My suggestion is to use the IMAQ Image Display as the XY graph.  You can draw on the image using overlays, and everything will match perfectly.  No scaling, transparency, or other complications.  Overlays run pretty fast, so you can redraw the graph on each frame of video just before it is displayed.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 13
(4,582 Views)

Hi bruce,

Actually I'm new on LabView, I use a firewire CCD camera for my application and in my block diagram I put the Vision Acquisition VI and this is how I can have a video.. I don't really understand how the other IMAQ functions work (Create, Getfile, WriteFile, ReadFile etc..), and all the Overlays examples only use this on LV.
Your solution seems to have many advantages, so I want to try it. but I need to understand a few things before and what do you mean by "you can redraw the graph on each frame of video just before it is displayed" .. do you mean in a loop ?

Best regards,
MartinO.

0 Kudos
Message 8 of 13
(4,545 Views)

In a loop, you acquire an image, draw the overlay on it, then display it.  Each time through the loop you do the same thing.

 

It sounds like you want to plot an XY graph, so you will have a series of XY points that you want to connect with a line.  There is an overlay function that will connect a series of points, which creates your graph.  The XY points just need to be in terms of image coordinates.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 13
(4,523 Views)

Ok. is the overlay function transform the graph you draw in a "real" XY graph or not? I mean, I need it to be accurate. If I put a cursor on it for example, does it permitt me to see its coordinates precisely as well as the LV XYgraph? Because you told me to join points with lines, so I feel that there are only these points that will be referenced on the graph...


Thanks,

MartinO.

0 Kudos
Message 10 of 13
(4,490 Views)