11-23-2005 04:49 PM
11-26-2005 12:23 PM
Convert a 16 bit gray scale image to 8 bit is easy. No IMAQ needed.
Simply divide the U16 array by 0xFFFF, and multiple by 0xFF, then convert double to U8.
The color table is (array of U32): 0x010101, 0x020202, ..., 0xFFFFFF.
You are loosing a lot gray scales, from 65335 to 256. Lots of gray level merged into the same level. Therefore, you might want to do a contrast strentch before convert:
Use array max/min to get the max and min of the array. Substract the min from the array, and then divid the array by (max - min), multiple the array by 0xFFFF. That will make your lowest gray level to black, and hightest level to white.
Depend on the gray level you use, you might need to do a histogram equlization to avoid all levels merged into the same level.
George Zou
11-26-2005 07:25 PM
11-28-2005 02:53 PM
11-28-2005 04:08 PM
11-28-2005 08:53 PM