Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to scale a float image in an IMAQ display control?

Hi all!

I have written an application that uses the IMAQ display control (not the external display window!) to show 16 bit images and float images to the user.
Via the property node of the display control it is possible to set a minimum and maximum value for the scaling of 16 bit images. All pixels with gray values between the limits are expanded and the remaining ones are cropped to black and white. It works great.
Unfortunately this does not work for float images!
I need this same functionality for float images,too , but can't find out how to do it!
Any ideas?

Thanks

Ingo Bartsch
0 Kudos
Message 1 of 3
(3,328 Views)
You have to use the image typecast function :

IMAQ Cast Image

Converts the current image type to the image type specified by Image Type. If you specify a lookup table, IMAQ Cast Image converts the image using a lookup table. If converting from a 16-bit image to an 8-bit image, the VI executes this conversion by shifting the 16-bit pixel values to the right by the specified number of shift operations and then truncating to get an 8-bit value.

Cheers
DOC
It would be nice if you take the time to rate this answer
http://www.machinevision.ch
0 Kudos
Message 2 of 3
(3,317 Views)
Hi DOC!

Thanks for your answer. This is the way I ended in the meantime.
But it is not the perfect solution, because the user of my application needs to examine the pixels often by looking to the grey values shown in the information indicator of the display control (If you move the mouse over the image).
By doing a typecast I'm loosing the fractional part of the numbers and I am limited to +/- 32768 (int16)

It would be really great if the display control would work the same regardless of what image type is shown. At least the minimum and maximum functionality should work!

Hello NI?!

Ingo
0 Kudos
Message 3 of 3
(3,306 Views)