LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

U64 rgb to u16 greyscale

Solved!
Go to solution

Hi, I am having problems using U64 RGB images (raw images from a Canon DSLR camera). I want to extract UNSIGNED 16-bit greyscale information from each colour channel and compare the intensity in each channel. I want to use the full dynamic range of the camera, and I don't want to truncate or compress the images. Colour accuracy and dynamic range is essential because I am measuring light absorption of pigments in polymers. 

 

Using the example VI, "1394 Color-to-Greyscale.vi" from this website, here:

https://forums.ni.com/t5/Example-Code/IMAQ-Color-Image-to-Grayscale/ta-p/3535022

 

The default setting is to convert the U64 image to a SIGNED 16-bit greyscale image. What this does is it removes half of the dynamic range, so I lose half the information. I want it to be UNSIGNED, and I can't make it do this. Does anyone know how to do this?

 

My only other option seems to be to convert the image to a string, but this is far from ideal as I want to use the vision tools. 

 

Thanks for any help!

0 Kudos
Message 1 of 8
(4,893 Views)
Solution
Accepted by MadScientist

Hiya MadScientist (good avatar name, by the way!)

 

Im afraid that the ease of this application may depend on the version of LabVIEW you are using. I am using LabVIEW 2010, and I was aware that native support U16 images had recently been introduced to the Vision developemnet module - although, Im afraid, I am unable to confirm exactly which version of the module introduced the U16 support.

 

I opened your .vi, deleted the image type enum constants and recreated them directly from the SubVI terminals. Sure enough, U16 is now a selectable option.

 

Please see my Front panel, and check out the difference between the U16 and I16 luminance plane.

 

U64 to U16.jpg

 

 

U64 to U16 (BD).jpg

 

Please forgive the image I am converting... I did not have a U64 image available, so I had to create my own.

I hope this has been useful,

Best wishes,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
0 Kudos
Message 2 of 8
(4,848 Views)

Hi RER,

 

Thanks for the reply! Your example shows exactly like what I want to do.

 

I recently found out about the U16 support problems, someone on another forum told me about it so I downloaded the update, here:

https://www.ni.com/en/support/downloads/drivers/download.vision-acquisition-software.html#306457

 

Hopefully it should work now. If not, I'll reply to this thread. There is a workaround involving removing the data pixels you don't want using "colour image to array", but I had to output a U64 to view the result (looked like a monochrome red, green or blue image).

 

MadScientist

0 Kudos
Message 3 of 8
(4,842 Views)

I just tried the file, but my version of Labview is 2009 so it won't open 😞 

0 Kudos
Message 4 of 8
(4,834 Views)

Hey MadScientist,

 

I wouldnt worry about opening the .vi anyway. It was very simple, and easy to replicate from the  block diagram screen capture I attached in a previous post. If LabVIEW (and the Vision Devleopement module) 2009 are able to support U16 images, you should be able to right click on "Image Type" terminal of a "IMAQ create" SubVI and select create constant. If the resulting enum includes an option for GreyScale U16, you should easily be able to replicate the rest of the code with ease.

 

U16.jpg

 

Im afraid that I only have access to LV 2010 at the moment, so I am unable to explicitely confirm whether 2009 supports the U16 format. But, it should only take a few moments to comfirm this yourself.

 

I hope this has been useful.

Best wishes,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
0 Kudos
Message 5 of 8
(4,823 Views)

Hi Rich,

I downloaded your solution and loaded a U64 RGB image.

I am unable to see the U64 RGB image in the image indicator. It is black, however when I hover with my mouse, I can read the pixel values. I can see the images in the Luminance Plane(U16) and Luminance plane(I16) image indicator. I know its a very old post, just hoping that you would see this reply.

 

Thanks

Regards

Aveo

0 Kudos
Message 6 of 8
(4,280 Views)

Hi,

was this ever resolved?  I'm having the same problem now with LV 2016 and IMAQ.

 

0 Kudos
Message 7 of 8
(4,097 Views)

HI Rich,

 

Please let me know if this is sorted out? I have the same the issue RGB64 image looking black / dark in image viewer. 

 

Regards

Sandy

0 Kudos
Message 8 of 8
(3,886 Views)