Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ ArrayToImage (U8, I16, U16)

I am practically new to image processing.

I would like to display acquired data from a digitizer by using IMAQ ArrayToImage VI.

 

The digitizer can take measurements in several different forms but I mainly choose 2D I8 and 2D I16 data types for the fastest acquisition speed.

 

IMAQ can display U8 grayscale and I16 grayscale. But, I am not sure how they work.

U8 values of each element is from 0 to 255 and I16 values of each element is from -32768 to +32767.

I assume in U8 grayscale, 0 is the darkest(complete black) and 255 is the brightest(complete white).

But, I do not understand how I16 grayscale works. I thought -32768 would be the darkest and -32767 would be the brightest. However, after running some simple codes.

It would be fantastic how I16 grayscale  values are displayed by ArrayToImage VI such as the darkest values, the brightest values.

 

I would also like to how to convert I8 to U8 most efficiently (from -128 ~ +127 to 0 ~ 255).

I tried a couple of codes I wrote but they were not efficient so that they slowed down the whole program.

 

Thank you.

 

0 Kudos
Message 1 of 4
(4,355 Views)

Hi,

 

In the functions palette, if you go to programming>>numeric>>conversion there is a function to convert to U8 and I8.  These work on arrays as well.  So you can connect an array of I8 to the function that converts to U8.  This is going to be the best way to convert the data type.

 

Regards,

 

Greg H. 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,339 Views)

I tried U8 conversion but it did not convert -128 ~ +127 to 0 ~ 255 but gave 128 ~ 255 / 0 ~ 127 which is not correct. 

0 Kudos
Message 3 of 4
(4,328 Views)

Hi,

 

Please see this forum.  It shows how to convert I8 to U8 without using the LabVIEW functions for the conversion.  What were the incorrect results you were getting when using the LabVEW functions?

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,320 Views)