PDA

View Full Version : Problems DFK 23F455, WhiteBalance Green



vmchura
February 10, 2015, 21:29:00
Hello, I tried many things, please help me.


I'm trying to build an application wich works in 2 modes:

-Live mode to adjust Exposure and Gain manually and WhiteBalance in Auto.

-Trigger mode, wich utilizes properties saved from the previous one.


All is working fine, except the WhiteBalance, and I think the green one.

So I turned WhiteBalance On in the Live mode. And before to go to Trigger mode I saved the values, turning off WhiteBalance and assigning the values to the Balances before taking an image.

Is not working, it looks like the WhiteBalance Auto is not disabled. Because the first image using the trigger is too green, the second one is lesser, and the third image is better.


I'm doing this.

private TIS.Imaging.VCDPropertyItem[] WhiteBalance = null;
private TIS.Imaging.VCDSwitchProperty[] WhiteBalanceSwitch;

private TIS.Imaging.VCDRangeProperty[] WhiteBalanceGreen = null;
private TIS.Imaging.VCDRangeProperty[] WhiteBalanceRed = null;
private TIS.Imaging.VCDRangeProperty[] WhiteBalanceBlue = null;
private int[] WhiteBalanceGreen_value = null;
private int[] WhiteBalanceRed_value = null;
private int[] WhiteBalanceBlue_value = null;



...


WhiteBalance = new VCDPropertyItem[4];
WhiteBalanceSwitch = new VCDSwitchProperty[4];

WhiteBalanceBlue = new VCDRangeProperty[4];
WhiteBalanceGreen = new VCDRangeProperty[4];
WhiteBalanceRed = new VCDRangeProperty[4];

WhiteBalanceBlue_value = new int[4];
WhiteBalanceRed_value = new int[4];
WhiteBalanceGreen_value = new int[4];



...


for (int i = 0; i < 4; i++) {
if (Camaras[i].DeviceValid)
{


VCDProp = VCDSimpleModule.GetSimplePropertyContainer(Camaras[i].VCDPropertyItems);

if (VCDProp.AutoAvailable(VCDIDs.VCDID_WhiteBalance))
{
VCDProp.Automation[VCDIDs.VCDID_WhiteBalance] = false;


}


WhiteBalance[i]=Camaras[i].VCDPropertyItems.FindItem(TIS.Imaging.VCDIDs.VCDI D_WhiteBalance);
WhiteBalanceSwitch[i] = (TIS.Imaging.VCDSwitchProperty)WhiteBalance[i].Elements.FindInterface(
TIS.Imaging.VCDIDs.VCDElement_Auto + ":" +
TIS.Imaging.VCDIDs.VCDInterface_Switch);

WhiteBalanceGreen[i] = (TIS.Imaging.VCDRangeProperty)WhiteBalance[i].Elements.FindInterface(TIS.Imaging.VCDIDs.VCDElem ent_WhiteBalanceGreen + ":" + TIS.Imaging.VCDIDs.VCDInterface_Range);
WhiteBalanceBlue[i] = (TIS.Imaging.VCDRangeProperty)WhiteBalance[i].Elements.FindInterface(TIS.Imaging.VCDIDs.VCDElem ent_WhiteBalanceBlue + ":" + TIS.Imaging.VCDIDs.VCDInterface_Range);
WhiteBalanceRed[i] = (TIS.Imaging.VCDRangeProperty)WhiteBalance[i].Elements.FindInterface(TIS.Imaging.VCDIDs.VCDElem ent_WhiteBalanceRed + ":" + TIS.Imaging.VCDIDs.VCDInterface_Range);

if (WhiteBalanceSwitch[i] == null) {
txt_Debug.AppendText("Automation of WhiteBalance is not supported by the current device!\n");
//this message is not being showing

}

}
}

...

button: Go to Trigger Mode




for (int i = 0; i < 4; i++)
{

Camaras[i].LiveCaptureContinuous = true;
Camaras[i].LiveDisplayDefault = false;
Camaras[i].LiveDisplay = false;

VCDProp = VCDSimpleModule.GetSimplePropertyContainer(Camaras[i].VCDPropertyItems);
if (VCDProp.AutoAvailable(VCDIDs.VCDID_WhiteBalance))
{

//at this poin the images are good so I want to save them.
WhiteBalanceBlue_value[i] = WhiteBalanceBlue[i].Value;
WhiteBalanceRed_value[i] = WhiteBalanceRed[i].Value;
WhiteBalanceGreen_value[i] = WhiteBalanceGreen[i].Value;

VCDProp.Automation[VCDIDs.VCDID_WhiteBalance] = false;

}
}


...

Before taking an image I do this:

for (int i = 0; i < 4; i++)
{

VCDProp = VCDSimpleModule.GetSimplePropertyContainer(Camaras[i].VCDPropertyItems);
if (VCDProp.AutoAvailable(VCDIDs.VCDID_WhiteBalance))
{
VCDProp.RangeValue[VCDIDs.VCDElement_WhiteBalanceRed]=WhiteBalanceRed_value[i];
VCDProp.RangeValue[VCDIDs.VCDElement_WhiteBalanceBlue] = WhiteBalanceBlue_value[i];
if (WhiteBalanceGreen[i] != null)
{
WhiteBalanceGreen[i].Value = WhiteBalanceGreen_value[i]; ;

}
else {

}



}
...
}

Stefan Geissler
February 11, 2015, 10:23:37
Hello

I tested this on my own. There is no problem when disabling the white balance automatic. The values for red, green and blue will be unchanged and you should received a balanced image. Thus I point to the used driver version and IC version. Please update them:
http://www.theimagingsource.com/en_US/support/downloads/details/icwdm1394btis/
http://www.theimagingsource.com/en_US/support/downloads/details/icimagingcontrol/

Also it is a good idea to check this with either the Sample Demo App, by disabling the white balance automatic and have a look on the image. You can use IC Capture for testing too.

Stefan Geissler
February 11, 2015, 10:23:38
Hello

I tested this on my own. There is no problem when disabling the white balance automatic. The values for red, green and blue will be unchanged and you should received a balanced image. Thus I point to the used driver version and IC version. Please update them:
http://www.theimagingsource.com/en_US/support/downloads/details/icwdm1394btis/
http://www.theimagingsource.com/en_US/support/downloads/details/icimagingcontrol/

Also it is a good idea to check this with either the Sample Demo App, by disabling the white balance automatic and have a look on the image. You can use IC Capture for testing too.