Omar Mussa Posted March 25, 2008 Report Share Posted March 25, 2008 I recently 'discovered' a way to copy an IMAQ image without using 'IMAQ Copy'. The problem -- using only 'IMAQ VIs' (ie, not using anything that comes with Vision Builder) there is no 'IMAQ Copy' available so if you want to acquire images in a loop and have another loop to say, store them to disk, you are sort of stuck (unless you can save the image in the same loop because your camera will overwrite the image reference on the next Grab). The workaround -- using 'IMAQ Merge Overlay' you can essentially copy an image that has no overlays onto a new blank image. In my snippet below, you can see exactly what I mean. Once I've used the new reference to save the image to disk, I destroy the reference. Quote Link to comment
crelf Posted March 25, 2008 Report Share Posted March 25, 2008 QUOTE (Omar Mussa @ Mar 24 2008, 11:30 AM) ...using 'IMAQ Merge Overlay' you can essentially copy an image that has no overlays onto a new blank image... :thumbup: Nice workaround Omar! Quote Link to comment
bmoyer Posted March 25, 2008 Report Share Posted March 25, 2008 I don't think this works for non-color images. From the help: IMAQ Merge Overlay Makes a nondestructive overlay part of the image content. This process creates a destructive overlay. The VI then removes the nondestructive overlay. The resulting image is an RGB image. Any workarounds you can think of? Bruce Quote Link to comment
jdunham Posted March 25, 2008 Report Share Posted March 25, 2008 Are you using the IMAQ driver for acquisition? If so, that's what IMAQ Copy Acquired Buffer.vi is for. You also should be using a Ring or Sequence Grab, so that you can make a buffer large enough to let your program recover if it falls behind a bit. Did I understand your issue correctly? Quote Link to comment
bmoyer Posted March 25, 2008 Report Share Posted March 25, 2008 I use the IMAQ copy when saving snapshots of live images so that the image displayed when the user clicks the "save" button is the image stored (not what the image is after they finish typing in the filename). You'll notice that when you save images in MAX, you can't actually get the image when you click the Save Image button, it's the current image when you acknowledge the File Dialog (not what one would expect). Bruce Quote Link to comment
Omar Mussa Posted March 25, 2008 Author Report Share Posted March 25, 2008 QUOTE (jdunham @ Mar 24 2008, 10:55 AM) Are you using the IMAQ driver for acquisition? If so, that's what IMAQ Copy Acquired Buffer.vi is for. You also should be using a Ring or Sequence Grab, so that you can make a buffer large enough to let your program recover if it falls behind a bit. Did I understand your issue correctly? I'm not using an NI Camera nor am I using the NI Grab or acquisition functions so IMAQ Copy Acquired Buffer.vi is useless in my case (I'm using a 3rd party camera/driver). QUOTE (bmoyer @ Mar 24 2008, 09:08 AM) I don't think this works for non-color images. From the help: IMAQ Merge Overlay Makes a nondestructive overlay part of the image content. This process creates a destructive overlay. The VI then removes the nondestructive overlay. The resulting image is an RGB image. Any workarounds you can think of? Bruce I may have to do a bit more testing. I was able to do this without errors but what I don't know is whether or not the images are good because I left the lens cap on :headbang: I will test this again tonight. The main thing I do know is that I wasn't getting any LabVIEW errors, my output files are readable and the IMAQ refs were Grayscale (U8). Quote Link to comment
shoneill Posted March 26, 2008 Report Share Posted March 26, 2008 QUOTE The problem -- using only 'IMAQ VIs' (ie, not using anything that comes with Vision Builder) there is no 'IMAQ Copy' available Are you saying that this VI Is only included when the VIsion builder is installed? That's a bit weak from NI. What are we supposed to be able to do without a simply copy function? Are these VIs at least included in the run-time licence for the vision module? Shane. Quote Link to comment
Omar Mussa Posted March 26, 2008 Author Report Share Posted March 26, 2008 QUOTE (shoneill @ Mar 25 2008, 01:08 AM) Are you saying that this VI http://lavag.org/old_files/monthly_03_2008/post-3076-1206436029.png' target="_blank"> Is only included when the VIsion builder is installed? Yes, and I agree it is weak. I did testing and realized that my black and white images are coming out as RGB now (so they are 3x the size). So, I'm now using 'IMAQ Write String.VI' and queueing the file string of the image so that I can dequeue and write it to disk in another loop (basically I'm passing the value by value instead of by reference). It works fine this way so I guess my original workaround is only good if you're capturing RGB images to begin with. Quote Link to comment
JeremyMarquis Posted August 10, 2014 Report Share Posted August 10, 2014 Ran into this and was hoping to find a solution besides the ugly and slow "IMAQ ArrayToImage" and "IMAQ ImageToArray" functions. This does work with B/W images though. Resurrected for others also searching. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.