JMak Posted March 24, 2011 Report Share Posted March 24, 2011 I want to extract red, green and blue as separate 16-bit greyscale images from a 64-bit unsigned RGB image (TIFF format, 16-bit per channel). There is an example of a program that does something similar here, http://decibel.ni.com/content/docs/DOC-5003 but I find I cannot get UNSIGNED images to output, only SIGNED. This means half of the dynamic range is lost. I need to keep the unsigned dynamic range because this is for an accurate colour measurement application. This should be a trivial task, but for some reason Labview by default can only extract signed 16-bit data, and there is no option as far as I can see, to change this. I have used a histograph on the greyscale images, and this confirms the image has been truncated, with half of the data being rewritten to the highest signed integer value. If anyone knows a workaround or solution, please let me know! J Quote Link to comment
bmoyer Posted March 24, 2011 Report Share Posted March 24, 2011 What version of NI-IMAQ are you using? Only recent versions have support for "U16"s (maybe IMAQ 4.4 and later?). Bruce Quote Link to comment
JMak Posted March 24, 2011 Author Report Share Posted March 24, 2011 What version of NI-IMAQ are you using? Only recent versions have support for "U16"s (maybe IMAQ 4.4 and later?). Bruce I think it's NI-IMAQ 4.3! Hmmm, so is there no workaround? Quote Link to comment
Antoine Chalons Posted March 24, 2011 Report Share Posted March 24, 2011 Hi, I have IMAQ 4.5 and here's what I can do. Not sure which version of IMAQ introduced the grey U16... [screenshot won't upload , probably related to that, anyway it works fine for me with IMAQ 4.5] If you just need to extract a color pane top display it and don't need to have a greyscale u16 to do processing on it then you can create a second RGB U64 and use the "color image to array" function and extract only the red pand from the 2D array (by replacing the other panes with 0). Just an idea... hope this helps Quote Link to comment
bmoyer Posted March 24, 2011 Report Share Posted March 24, 2011 I think it's NI-IMAQ 4.3! Hmmm, so is there no workaround? Upgrade to IMAQ 4.5, I've used this version for a few months now and it's seems reliable. It's compatible with LV8.5 and up. Bruce Quote Link to comment
JMak Posted March 25, 2011 Author Report Share Posted March 25, 2011 (edited) Upgrade to IMAQ 4.5, I've used this version for a few months now and it's seems reliable. It's compatible with LV8.5 and up. Bruce I went on the NI website, and I can only find the file for IMAQ 3.1.3, not 4.5. SEE LINK: http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/ps/20/sn/catnav:du,n8:5506,ssnav:sup/q/imaq%204-PERIOD-5/ I am getting a new version of Labview eventually but I will have to wait a long time :-( Thanks for the suggestion Antoine, the colour image to array may be possible... I tried but it didn't work when outputting the values to a table (all blank). If you could send an example vi and show me how to change the values, it would be very helpful! James Edited March 25, 2011 by JMak Quote Link to comment
Antoine Chalons Posted March 25, 2011 Report Share Posted March 25, 2011 If you send me your email address via PM I can email you an example since LAVA apparently ran out of disk space... What version of LabVIEW are you using? (I have 8.5, 8.6 and 2010) Quote Link to comment
JMak Posted March 25, 2011 Author Report Share Posted March 25, 2011 If you send me your email address via PM I can email you an example since LAVA apparently ran out of disk space... What version of LabVIEW are you using? (I have 8.5, 8.6 and 2010) OK, I'll PM you. I have Labview 2009. Quote Link to comment
Antoine Chalons Posted March 25, 2011 Report Share Posted March 25, 2011 Ok, sent. As soon as this is fixed I'll post the VI here. Quote Link to comment
ShaunR Posted March 25, 2011 Report Share Posted March 25, 2011 I went on the NI website, and I can only find the file for IMAQ 3.1.3, not 4.5. SEE LINK: http://search.ni.com...q%204-PERIOD-5/ It's bundled as part if the Vision Acquisition Software Quote Link to comment
JMak Posted March 25, 2011 Author Report Share Posted March 25, 2011 Antoine - I loaded your VI and tried to replace the image generator with an image reader, but I get the error message that I have not enough memory to perform the operation... I have 4GB RAM, surely this should be enough? There must be an error in how I wired it. If you like I can upload the image somewhere, but it is an 86MB tiff. If there is another format that supports 64-bit RGB I'll try that. The raw *.CR2 Canon image format is smaller (18MB) but you might not have software that can use it or convert it...? Shaun - Will this work only with Labview 2010, or will it work with my 2009 version? Thanks for the help Quote Link to comment
Antoine Chalons Posted March 25, 2011 Report Share Posted March 25, 2011 your image is pretty big, so to avoid the error maybe you can use the function "IMAQ get file info" to get the size of the image and pre-allocate the right size when you use the IMAQ create. Quote Link to comment
JMak Posted March 25, 2011 Author Report Share Posted March 25, 2011 your image is pretty big, so to avoid the error maybe you can use the function "IMAQ get file info" to get the size of the image and pre-allocate the right size when you use the IMAQ create. Thanks for the help Antoine. It is working as-is on a PC with 12GB ram, but I'll try your suggestion to see if it works on my laptop. I wanted to attach an image to show you what I want to do next, but I can't seem to upload! I will try to get as far as I can on my own but if I get stuck I'll reply here. Quote Link to comment
ShaunR Posted March 26, 2011 Report Share Posted March 26, 2011 Antoine - Shaun - Will this work only with Labview 2010, or will it work with my 2009 version? Thanks for the help Yes. It supports 2009 x32 & x64 Quote Link to comment
Antoine Chalons Posted March 27, 2011 Report Share Posted March 27, 2011 Yes. It supports 2009 x32 & x64 Here's the link to NI's web site for VDM / LabVIEW compatibility : http://digital.ni.com/public.nsf/allkb/244E6DDF9A92A6CD8625730100629047 Quote Link to comment
ShaunR Posted March 27, 2011 Report Share Posted March 27, 2011 (edited) Here's the link to NI's web site for VDM / LabVIEW compatibility : http://digital.ni.co...625730100629047 And here's the one for IMAQ Edited March 27, 2011 by ShaunR Quote Link to comment
JMak Posted March 27, 2011 Author Report Share Posted March 27, 2011 Ok, I'll give it a try this week and let you know what happens. Thanks for all the help! Quote Link to comment
JMak Posted March 28, 2011 Author Report Share Posted March 28, 2011 I am trying to pre-allocate the memory, but I don't know how to do this. There is a "read file size" operation, but how do I use this to prepare the memory? I am downloading the update now, it will probably take all day. Quote Link to comment
Antoine Chalons Posted March 28, 2011 Report Share Posted March 28, 2011 Like this : And now that LAVA has been upgraded, here is the VI I was talking about earlier : u64_generate or load.vi Hope this helps Quote Link to comment
JMak Posted March 28, 2011 Author Report Share Posted March 28, 2011 Like this : And now that LAVA has been upgraded, here is the VI I was talking about earlier : u64_generate or load.vi Hope this helps The "get file info" thing seems to do the trick, thanks Antoine! I'm still downloading the update, I'll let you know what happens when I try the VI... 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.