LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ 3D picture control overlay

I’m trying to write an application in LV that overlays a transparent 3D CAD image onto a video image (for comparison purposes). I’m using IMAQ vision for the camera and I’m using the 3D picture control to import an STL file (CAD file) which I can manipulate etc. However, I’m having issues trying to overlay the two. I can use the ‘render image’ invoke node from the 3D picture control to create an image for the CAD file. I then use the ‘create mask VI’ and strip out the white background. Combining this with a another picture file works (other than the wireframe image, everything else is stripped out, i.e. tranparent) and the two images are overlayed. However, putting the ‘unflatten pixmap VI’ after the create mask, and wiring this into the IMAQ ‘Overlay bitmap’ along with the video image seems to ignore the transparency of the CAD image. The closest I’ve come to solve this is to use the ‘IMAQ colorimage to array’ and essentially export the IMAQ image into picture control. Using this I do get an overlay, however the framerate drops significantly from using the ‘IMAQ colorimage to array VI’. Does anybody know how to overlay a 3D picture control image into IMAQ or any other possible alternative?

0 Kudos
Message 1 of 10
(5,242 Views)
Hi Marc,
 
Is there any chance you could put your code and some example files onto the forum for me to have a look at.
I'm sure there is a way of doing this but I need to fully understand the pictures and processes you are trying to use.
 
Waht camera are you using?
What bus type? (1394/USB/CameraLink/Analogue/Parallel Digital)
and what is the frame rate you are hoping to see?
 
Thanx
 
AdamB
 
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 10
(5,227 Views)

Message Edited by marcbrookes on 12-01-2006 09:50 AM

0 Kudos
Message 3 of 10
(5,218 Views)
Hi Adam,

I'm using a COHU 7822 camlink camera using the NI PCI-1428. I'm expecting to get around the 25-30 fps and the process requires it (it attached to an optical microscpe with precison stages alinging parts to micron prcesions). The VI i've almost got to work (with the slowdowns) is at work so I'll need to wait until Monday to post it. However, the attched VI almost replicates what I'm trying to achive. In the VI, a pixmap rendered by the 3D picture control is used as the bitmap overlay on a JPG imported thru IMAQ. If i dont use IMAQ, the tranparency of the STL file works, (if i just use picture control), however it doesnt with IMAQ?

The Overlay.vi is contained within the overlay.llb. The files part1.stl and test.jpg need to be placed on the c drive root, i.e. c:\part1.stl (it wont let me u/l the stl file, so i changed the extension the jpg, therefore the extension needs to be changed back to STL.

Since I'm kinda new to LV i guess I'm just missing somthing obvious. Hope someone can help!

Cheers

Marc
Download All
0 Kudos
Message 4 of 10
(5,217 Views)

Hi Marc,

 

Well it took me a while (sorry for that) but I have the program uyou are looking for.

The best way to deal with this is to create the image from the image array (I've had to split it out so that you have a grey image data). Then threshold and then mask.

This works fine for my pictures. It might be worth you having a look at my (very messy because it's the end of the day (half 5) ) code and seeing if you understand it.

Post back if you don't and I'll explain in more detail for you

Thanx

 

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 5 of 10
(5,198 Views)
Hi Adam,

Your a star! I'll look at the code in more detail tomorrow (when I'm back at work) and try to incorporate it into my IMAQ version of the code.

Thanks

M
0 Kudos
Message 6 of 10
(5,193 Views)
Hi Adam,

I've combined the 'IMAQ threashold/ Mask' technique into my video overlay which now works and with no lag. All I need to do now is to figure out how to make the black overlay lines into a bright green (to make it more visable).

I've attached my VI incase anybody is interested.

Cheers

Marc


0 Kudos
Message 7 of 10
(5,182 Views)
Hey,
 
Well the green colour can only be acheived by an overlay.
Sooooo...
(dramatic drum roll)
 
Here is another version.
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 8 of 10
(5,166 Views)

The main problem with the above code though is that you are again forced down to a lower frame rate.

I get about 7 or 8 frames a second.  (I am running a dual core 2.13GHz processor with 2Gb or DDR RAM)

What do you get?  Is this quick enough.. I'm afraid there isn't any other way of doing this.

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 9 of 10
(5,162 Views)
Adam,

I solved it using the ROI overlay and mask to ROI (see attachment). I then played around with the 3D picture settings to give me a silhouette
of the STL file. This reduces the number of lines that the ROI needs to draw (if you have outline only enabled) and hence the speed. This VI pretty much does what I need it to now, cheers.
0 Kudos
Message 10 of 10
(5,157 Views)