PDA

View Full Version : Reduced color palette when using MemorySaveImage



Frederik
June 24, 2016, 11:03:28
I am using a DMK23U274 camera and LabVIEW 2015 64bit. When I save images using MemorySaveImage or MemorySaveImageJpeg, the resulting file contains only very few color values (34 of the 256 availiable in a grayscale image). In the PropertyBrowser of the ActiveX control, the MemoryCurrentGrabberColorFormat is Y8.

However, saving the image using ICCapture works fine. Please compare the attached images.
18561857


Any help would be appreciated.

Stefan Geissler
June 24, 2016, 12:08:57
Hello

"MemoryCurrentGrabberColorFormat is Y8". It should be "Y800". Do you set this format into the property in your VI?

Frederik
June 24, 2016, 17:25:09
Dear Stefan,

thanks for the quick reply! No I never set the format in my code. How would I do this?

Stefan Geissler
June 27, 2016, 09:07:57
No I never set the format in my code. How would I do this?

You set it by
IC.MemoryCurrentGrabberColorformat = ICY800.

If you are used to LabVIEW, I am sure you now, how to invoke a property node, change it to write and create a constant.

This depends on which VIs use at all. I will not start guessing here, what you are doing.

I also see a histogram. I do not see the image itself.

I do not know anything about your computer, e.g. Model, manufacturer, Windows version. I do not know, which camera driver you use.
I do you not which video format you have set.

For more diagnosis, please give me these information.

Frederik
June 27, 2016, 19:47:13
I have tried setting different color formats by using the MemoryCurrentGrabberColorformat Property node, and I have tried setting it before opening the device, after opening it and after calling the IC_LiveStart.vi. I tried out ICY8, ICY800, ICBY8 and ICRGB24, but it did not seem to make a difference, the histogram still looks like before, and no error was thrown even though the camera should not support an RGB colorformat. Please find an example picture attached:
1859

The LabView program structure is roughly as follows: I use an ICImagingControl, in an initialization routine I call IC_GetDevices(ICImagingControl), IC_OpenDevice(ICImagingControl, color=false, live=true), IC_LiveStart(ICImagingControl). After user input I call IC_SetExternalTrigger(ICImagingControl, Trigger=true). Another user input calls IC_MemorySnapImage(ICImagingControl) and IC_MemorySaveImageJpeg(ICImagingControl, filename, quality=100). Then the external trigger is sent to the camera in form of a TTL pulse.

I did not set the video format, the property browser shows n/a and it does not seem to be accessible from NIMAX. I'm using LabVIEW version 15.0f2 (64-bit) with the latest IC Imaging LabVIEW Extension.

Device Driver: The Imaging Source Europe Gmbh DMK 23U274, File Version: 6.1.7600.16385 (win7_rtm.090713-1255)

Some of the output of DxDiag:
------------------
System Information
------------------
Operating System: Windows 7 Enterprise 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_ldr.160408-2045)
Language: German (Regional Setting: German)
System Manufacturer: Dell Inc.
System Model: Latitude E4300
BIOS: Phoenix ROM BIOS PLUS Version 1.10 A26
Processor: Intel(R) Core(TM)2 Duo CPU P9400 @ 2.40GHz (2 CPUs), ~2.4GHz
Memory: 8192MB RAM
Available OS Memory: 8080MB RAM
Page File: 4965MB used, 7112MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 11
DX Setup Parameters: Not found
User DPI Setting: Using System DPI
System DPI Setting: 96 DPI (100 percent)
DWM DPI Scaling: Disabled
DxDiag Version: 6.01.7601.17514 32bit Unicode


Thanks for looking into this!

Frederik
June 29, 2016, 20:55:44
I noticed that NIMAX displays the Colorformat as RGB24, and the value of the MemoryCurrentGrabberFormat property node is 5 (RGB24) as well. This can be changed when writing to the property node in Labview, but it does not resolve the problem.

If I however call the ShowDeviceSettingsDialog method and change the colorformat to Y800 in there, the images are saved correctly afterwards. However, this does not update the MemoryCurrentGrabberFormat property node value nor the entry in NIMAX. After restarting my Labview Program, the colorformat is reset to RGB24.

Is there another way to change the Colorformat programmatically?

Thank you for your time.

Stefan Geissler
June 30, 2016, 08:57:45
The video format sent by the camera is converted automatically into the pixel format set in MemoryCurrentGrabberColorFormat. Thus:
Camera = Y800, MemoryCurrentGrabberColorFormat RGB24 => RGB24 graysscale
Camera = RGB32, MemoryCurrentGrabberColorFormat RGB24 => RGB24 color
Camera = RGB32, MemoryCurrentGrabberColorFormat Y800 => Y800 grayscale
Camera = RGB24, MemoryCurrentGrabberColorFormat Y800 => Y800 grayscale
Camera = Y800, MemoryCurrentGrabberColorFormat Y800 => Y800 grayscale

Thus the colorformat used by the camera does not play such a big role. But I have a question: Which video format do you use without calling ShowDeviceSettingsDialog?

You can set the video format programmatically by passing it to the "VideoFormat" property node of IC, as shown in the ActiveX documentation:http://www.theimagingsource.com/support/documentation/ic-imaging-control-activex/prop_descICImagingControl_VideoFormat.htm

You can pass as string like "RGB24 (640x480)" to the video format property.

Frederik
July 1, 2016, 10:52:05
Thank you Stefan,
setting the video format to "Y800 (1600x1200)" did the trick.