PDA

View Full Version : Exposure Number Problem



speedo
September 10, 2008, 14:41:23
Hi,
i use the DMK41BF02 and Visual Studio 2008.
I have a problem with the allowed exposure value.
I saved in DemoApp_vc8 the exposure value with

long curExposure = 0;
curExposure = m_Grabber.getProperty(CameraControl_Exposure);

- The lowest number saved in curExposure is 0 when the bar is on the right side. The picture is dark.
- The highest number saved in curExposure is 1808 when the bar is on the left side(1/10000). The picture is bright.


The problem is that in an other program I load this saved exposure value from a file but with
"m_Grabber.setProperty( CameraControl_Exposure, (long) loadedExposure );"
is only the range -11 to +5 allowed.

Thanks much,
Carsten

Stefan Geissler
September 10, 2008, 17:16:01
Hello Casten,

the DirectShow Inteface, that is accessed by "getProperty" gives only the physical values. IC Capture uses the DCam Absolute Values interface. It is accessible using the VCDProperties of IC Imaging Control. You can find a documented sample at: http://www.imagingcontrol.com/en_US/support/documentation/class/tech_VCDProperties.htm

At least, there are three exposure interfaces:
Register values:
From 4000 to 1, where the exposure time is calculated as 1/n = seconds, e.g. n=30 => 1/30 seconds

Physical values:
-11 to 4, where the exposure time is calucalted as 2^n = seconds, e.g n=-6 =>2^-6 = 1/64 seconds

Absolute values:
This is the interface with the widest range from 0.0001 to 30.0, resp. 0.0001 to 3600.0 for the astronomy cameras. The exposure time is give as float value, e.g 0.3333 = 1/33 seconds.

speedo
September 12, 2008, 11:16:00
Thanks. I have finished this problem.

speedo
September 25, 2008, 09:31:00
Hello Casten,

the DirectShow Inteface, that is accessed by "getProperty" gives only the physical values. IC Capture uses the DCam Absolute Values interface. It is accessible using the VCDProperties of IC Imaging Control. You can find a documented sample at: http://www.imagingcontrol.com/en_US/support/documentation/class/tech_VCDProperties.htm

At least, there are three exposure interfaces:
Register values:
From 4000 to 1, where the exposure time is calculated as 1/n = seconds, e.g. n=30 => 1/30 seconds

Physical values:
-11 to 4, where the exposure time is calucalted as 2^n = seconds, e.g n=-6 =>2^-6 = 1/64 seconds

Absolute values:
This is the interface with the widest range from 0.0001 to 30.0, resp. 0.0001 to 3600.0 for the astronomy cameras. The exposure time is give as float value, e.g 0.3333 = 1/33 seconds.


Stefan, why is on my application the maximum value 1808?
I think I have the "register values" with the frontier to 1808. But why :)
By the side, my range goes from 0 to 1808.

Stefan Geissler
September 25, 2008, 09:54:38
Carsten,

This is a good question. In our checks of the camera firmware it is 4000 to 0. 1808 is a weird value, I guess.
What driver is installed?
Is the data type correct?

speedo
September 25, 2008, 16:28:24
The Imaging Source Europe GmbH DMx 41BF02
General:
Device type: Imaging devices
manufacturer: The Imaging Source Europe GmbH
Location: on OHCI Compliant IEEE 1394 Host Controller

Driver:
Driver Proider: The Imaging Source Europe GmbH
Driver Date: 09.10.2006
Driver Version: 4.0.0.77
Digital Signer: Not digitally signed

The data type is Integer (int).

This range iss not realy a problem but I am interested in this reason.

speedo
September 27, 2008, 17:43:09
Okay, at yesterday I have a problem.

At yesterday the minimum and the maximum has changed.
The minimum that i get is 1808 and the maximum is 0.

That is realy confusing.


My Code in GraphicOverlay_vc8:

long curExposure = 0;
curExposure = m_Grabber.getProperty(CameraControl_Exposure);


// DShowLib::tsPropertyRange TPR;
// TPR = m_Grabber.getPropertyRange(CameraControl_Exposure) ;
//// TPR.min value is 1 and the TPR.max value is 4000

speedo
September 30, 2008, 16:05:49
Why is the exposure value wrong? Is this a bug?

When I choose the exposure value to the left side(= 1/10000sec), I get the value 1808.

For 1/8850 sec I get the integer value 657
For 1/7813 sec I get the integer value 3778

...

For 30.000 sec I get the integer value 0

So how I can fix this?
I have 2 picture enclosed!

Stefan Geissler
September 30, 2008, 16:14:46
The m_Grabber.getProperty(CameraControl_Exposure); function uses the physical values interface with a range from -13 to 4 only. Also it is not possible to run different interfaces at the same time.

If you want to use the correct absolute values for exposure, please do following



//////////////////////////////////////////////////////////////////////
// Set exposure using the range interface. For the AF/BF cameras
// the exposure range is 0.00001 to 30.0.
//
// In order to set 1/2000 seconds, call:
// SetExposureAbsolute( pGrabber, 0.002);
//
bool SetExposureAbsolute( DShowLib::Grabber *pGrabber, double dExposure )
{
bool bOK = false;
DShowLib::tIVCDAbsoluteValuePropertyPtr pExposureRange;
DShowLib::tIVCDSwitchPropertyPtr pExposureAuto;

pExposureRange = NULL;
pExposureAuto = NULL;

tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
{
// Try to find the exposure item.
tIVCDPropertyItemPtr pExposureItem = pItems->findItem( VCDID_Exposure );
if( pExposureItem != 0 )
{
// Try to find the value and auto elements
tIVCDPropertyElementPtr pExposureValueElement = pExposureItem->findElement( VCDElement_Value );
tIVCDPropertyElementPtr pExposureAutoElement = pExposureItem->findElement( VCDElement_Auto );

// If an auto element exists, try to acquire a switch interface
if( pExposureAutoElement != 0 )
{
pExposureAutoElement->getInterfacePtr( pExposureAuto );
pExposureAuto->setSwitch(false); // Disable auto, otherwise we can not set exposure.
}


// If a value element exists, try to acquire a range interface
if( pExposureValueElement != 0 )
{
pExposureValueElement->getInterfacePtr( pExposureRange );

double min = pExposureRange->getRangeMin();
double max = pExposureRange->getRangeMax();

if ( dExposure < min )
{
dExposure = min;
}
else if( dExposure > max )
{
dExposure = max;
}

// Here we set the the exposure value.
pExposureRange->setValue( dExposure);
bOK = true;
}
}
}
return bOK;
}


Simply copy this function into your code. It should work "out of the box".

speedo
October 1, 2008, 16:09:22
I'm confused over your answer. I don't try to set the exposure value in GraphicOverlay_vc8-Program. The "SetExposureAbsolute"-Function is to set an exposure value.

I try to get the exposure value in Physical values(-11...4).

"curExposure = m_Grabber.getProperty(CameraControl_Exposure);"
gives me values from 4000...0 in the GraphicOverlay_vc8-Example!!
I enclosed an image in my last post "showDebugger.JPG" that shows a value of 1808.

Stefan Geissler
October 1, 2008, 16:31:19
Hi,

Then you should use the VCD Properties "Mapstrings" interface instead.

The handling of these interfaces in DirectShow is a little bit strange. You may use the "VCDPropertyInspector" of IC Imaging Control, that shows the different interfaces.

speedo
October 9, 2008, 12:13:23
I find it really circumstantial. Why doesn't exist a ".setInterface(...)" function?

And what is the advantage of three different existing interfaces?

Stefan Geissler
October 9, 2008, 12:41:47
Hi,

this function exists and is shown in the source code some posts above and looks a little bit differend. Please keep in mind, the interfaces are provided by the cameras, not by IC Imaging Control. We can only check, which interfaces are supported.

I agree, live would me much easier for me, if there is only one interface. :-)