Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

16-Bit Image Rendering not consistent in MAX and Camera File Generator

When grabbing images with the Camera File Generator (CFG), the CFG displays 16-bit images other than the Measurement and Automation Explorer (MAX) does. In CFG, images appear brighter than in MAX. When saving images to disk (PNG-format), the image taken with CFG behaves correctly, i.e. the 16-bit number is interpreted as unsigned integer. The image saved by MAX does not convert the 16-bit signed integer correctly, so there seems to be an overflow. (I have two example images, which I can send on request.) How can I save (and display) 16-bit unsigned integer images with CFG and MAX? I have no software other than what was supplied with the NI Vision Aquisition 8.5 CD-ROM plus CFG. Software versions are: MAX 4.3.0f0 IMAQ 3.8.0 CFG 2.0.2
Message 1 of 11
(5,085 Views)
Hello vtypke,

the camera file generator is for generating a icd file.
And you are able to copy the icd file in the Imaq folder to use it in MAX.
So that you can choose the icd file from MAX for the cam.
So if you display the image correctly in the cfg the image should be the same in max.
If you save the icd file in the cfg and choose the file in MAX.

Kind regards,

Elmar
0 Kudos
Message 2 of 11
(5,067 Views)
Thanks for your reply. Well, I did use CFG to generate the Camera File and I did save the file such that MAX uses exactly that icd file. The ICD file is in folder ..\NI-IMAQ\Data, just like all other camera configuration files. Both CFG and MAX can display grabbed images (both snapshot and video). In CFG, this feature is supposed to immediately test your settings. Once you are sure your settings are OK, you save the file to the IMAQ/Data directory. In MAX, you can also view snapshots and video. But MAX renders images differently than CFG does. And MAX also stores image files differently. When I save an image in CFG, the image looks OK (data looks like unsigned images). When I save images in MAX, there is an overflow (signed integer) and portions that should look white are black (monochrome greylevel images). The two programs render images differenty and save images differently, even though I use the SAME camera configuration file...
0 Kudos
Message 3 of 11
(5,062 Views)
Hey vtypke,

if you can send use the cam and the icd file i could try to reproduce the behaviour.
And contact the developer in US if nessecary.
Because you can not do anything wrong in MAX.
Only choose the correct icd file and press snap or grap that´s it.
And if the image is different between MAX and the cfg (with the same icd file) its a question for the developer in US.
But i only able to contat US if i am able to reproduce the behaviour.

Kind regards,

Elmar
0 Kudos
Message 4 of 11
(5,058 Views)
Thanks again for your support. Well I can send the icd file, no problem, but I am not authorized by my employer to send a CAM.
0 Kudos
Message 5 of 11
(5,055 Views)
Hello vtypke,

if you post the different printscreens (MAX and CFG) as well as the icd file.
I am going to contact the developer without the cam.

Kind regards,

Elmar
0 Kudos
Message 6 of 11
(5,035 Views)
Here are the camera configuration file and the two different PNG files from MAX and CFG. The Test Image is supposed to consist of 8 vertical grey level bars starting with a value of 0, ending with a value of FFFC (the two LSB are always zero). The CFG converts the image to eight vertical bars starting with 0 and ending with 0xFF. My original pixel values seem to get interpreted as unsigned integer, just the way I want it to be. MAX converts the image to eight vertical bars but maps the wrong way. It maps numbers exceeding 0x8000 to negative numbers. 0x8000 is therefore black, 0x0000 is medium grey and 0x7FFF is white.
0 Kudos
Message 7 of 11
(5,030 Views)
Hello vtypke,

i get a feedback from the US:

Hi Elmar,

This issue is a result of how MAX displays 16 bit images or more specifically how it maps 16 bit grayscale levels. Tell the customer that there is nothing wrong with the camera file. Now as far as the display goes, we do get complaints about it from time to time and we do have a LabVIEW based solution for it:

http://digital.ni.com/public.nsf/allkb/3C727E03F004EA528625714900706CA0?OpenDocument

There is no wrong or right way to display 16 bit images. The PNG standard chooses to store them as 16 bit unsigned int and we chose a 16 bit signed representation to allow for bit manipulation resulting from image subtraction.

Please let me know if I can help explain this better,

Jaidev Amrite

NIC, SR 1152723


Kind regards,

Elmar


0 Kudos
Message 8 of 11
(5,013 Views)
Hi Elmar, thanks once more for your support. I already noticed the knowledge base article the US colleagues refer to. Trouble is, I don't have LabView, so I can't use the LabView Solution provided. Anyways, I think it's a pity that CFG and MAX behave differently. If they would both render images the same way, OK. As a customer, I would suggest to include a means to select the rendering method in both CFG and MAX. I am thinking of a menu item "View/Bit Mapping" or "View/Rendering Method" where you may then select "unsigned greylevel / signed greylevel" as well as an option whether you like to map for maximum dynamic range (map min -> 0, max -> 0xFF) or not (map min -> min, max -> max). This should be easy to implement and would enhance the use of MAX and CFG a lot. I see it from the point of a customer who only wants to display images/video the most comfortable way, with no custom image processing and so on. So I don't want to configure/program some LabView stuff, I just want to see whether my camera is operating or not. I also miss a means to save video to disk in MAX and CFG... Anyways, thank you so far. Regards...
0 Kudos
Message 9 of 11
(4,999 Views)
Hello vtypke,

i get a feedback from the US.

Hi Elmar,
 
We do get the same feedback from customers. But like I said there is no right or wrong way to represent 16 bit grayscale images. We do give people an option for mapping 16 bit images in LV. The reason you dont see the same option in MAX is because MAX is supposed to be just a troubleshooting and configuration utility.
 
Having said that, I agree such a feature would be useful. I will try to make a product suggestion for it.
 
-Jaidev

0 Kudos
Message 10 of 11
(4,986 Views)