bmoyer Posted May 10, 2008 Report Share Posted May 10, 2008 I'm acquiring 16-bit images and displaying them using the IMAQ display control. I allow the user to choose different lookup tables (LUTs) so that the grayscale image is displayed in pseudo color in the IMAQ display. When the images are saved to disk they are saved in their native grayscale format. I'd like to give an option to save the images in display format as well. Has anyone ever done something like this before? I have an idea of how this could be done (by using the Interpolate 1D Array function and the LUT to convert each pixel to obtain values for each color), but this seems like a very slow way to do this since there may be 100s of images to convert. Any ideas? Thanks, Bruce Quote Link to comment
Neville D Posted May 13, 2008 Report Share Posted May 13, 2008 Cast the image to RGB, using IMAQ Cast Image use IMAQ ColorUserLookup to manipulate the pixels in the three planes as you want, save the RGB buffer to file as a PNG. Manipulating pixels by extracting out arrays will be slow. it is best to work with the canned IMAQ functions that don't extract data out into LabVIEW, but deal directly with the image buffer(s). Neville. Quote Link to comment
bmoyer Posted May 14, 2008 Author Report Share Posted May 14, 2008 Neville, Thanks for the tip. I tried implementing what you suggested and it works really fast, but the IMAQ ColorUserLookup only works with 32bit color images (no support for 64bit color) which means the 16bit image is truncated to 8bits before the lookup table is applied making the conversion less accurate. I've included some test code if you want to take a look (the subVI "Convert Image Ref to IMAQ Display Color Image Ref.vi" has a conditional disable to select the 2 different code methods). Any suggestions? Thanks, Bruce Quote Link to comment
Neville D Posted May 14, 2008 Report Share Posted May 14, 2008 QUOTE (bmoyer @ May 13 2008, 06:36 AM) Neville,Thanks for the tip. I tried implementing what you suggested and it works really fast, but the IMAQ ColorUserLookup only works with 32bit color images (no support for 64bit color) which means the 16bit image is truncated to 8bits before the lookup table is applied making the conversion less accurate. I've included some test code if you want to take a look (the subVI "Convert Image Ref to IMAQ Display Color Image Ref.vi" has a conditional disable to select the 2 different code methods). Any suggestions? Thanks, Bruce Hi Bruce, try reading up Pg 2-2 of the NI http://www.ni.com/pdf/manuals/372916f.pdf' target="_blank">Vision concepts Manual. It has some info on mapping methods.. looks like you will have to pull data out column by column and manually apply a mapping function. This will probably be slow. Can you ignore the least significant bytes ? Can you also upload a 64-bit image as well? N. Quote Link to comment
bmoyer Posted May 14, 2008 Author Report Share Posted May 14, 2008 QUOTE (Neville D @ May 13 2008, 12:28 PM) Can you ignore the least significant bytes ?Can you also upload a 64-bit image as well? I'd prefer not to, but I guess I could make it an option. A conversion speed or quality option. I'm not sure what 64-bit image you are asking for. A 64-bit RGB ramping image? With same value in each color? What will you try and do with it? Thanks, Bruce Quote Link to comment
Neville D Posted May 14, 2008 Report Share Posted May 14, 2008 QUOTE (bmoyer @ May 13 2008, 11:00 AM) I'm not sure what 64-bit image you are asking for. A 64-bit RGB ramping image? With same value in each color? What will you try and do with it?Thanks, Bruce A 16bit image that your working with. N. Quote Link to comment
bmoyer Posted May 14, 2008 Author Report Share Posted May 14, 2008 QUOTE (Neville D @ May 13 2008, 02:44 PM) A 16bit image that your working with.N. http://lavag.org/old_files/monthly_05_2008/post-4985-1210707604.png' target="_blank"> 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.