04-02-2012 12:21 PM
Hi!
I want to overlay a 2D plot of the function f(x)=a*x^2+b*c+c, where the user can change the values of the constants a,b,c, over a videostream captured by an USB-cam.
I can get the plot via m. script and show it in a new window or direct on the screen via Waveform Chart. But the problem is, that these charts are not transparent, so that is impossible to save these charts as Bitmap and overlay these Bitmap-Files which the video I get via NI-IMAQdx Vision Assistant.
Is there a way to make the plot-background transparent or does anybody know an smarter way to solve my problem?
Greetings,
Schaefchen
04-02-2012 12:33 PM
Use the Set Color tool to change the color of the chart to Transparent
04-03-2012 04:52 AM
Hi,
I´d recommend to use the IMAQ-Overlay functions. You can overlay certain primitives and also an array of points which could be your functions.
Look into the Vision shipping examples.
Best regards
Marco Brauner NIG
04-03-2012 07:16 AM
What indicator are you using? Imaq display or a Plot.
If you use the Imaq display, you can try to convert your plot to an overlay
or if you use a graph you can covert your image stream to a LV picture and display it as the graph.PlotImages.Back property which lets you paint a picture in the background of the graph.
A third option is to make a transparent graph, size it the same as the imaq control and place it infront of the imaq image. This requires the least programming but prevents event handling of the bottom control.
04-06-2012 05:39 AM
Hi,
thanks for helping! Actually I'm using Imaq display and overlay the graph with a transparent background.
That works but it is not really great.
So I'm actually trying to use the plot display and display the IMAQ picture as background. But I'm not able to convert the ImaqImage.ctl data into a graph.PlotImages.Back datatype. So this way did not work yet.
Do you know, how I can transform the video, which I become from IMAQ as .ctl, into a 2-D-graph, so that the background property node accept the video as background for the graph?
04-06-2012 07:14 AM
To convert IMAQ to a picture you have to convert ImaqToArray, then use a draq an unflattened pixel map into an empty picture constant then apply it to the background (a little awkward). The other option is making freehand roi to model your function and doing an roi to overlay and apply the overlay to the image.
Which control has the features you are interested in, Imaq has nice tools for roi and zoom and palettes where graphs have scales and cursors that can be used.