PDA

View Full Version : AutoReference && auto Max Value



vzv55
August 25, 2010, 09:35:06
I need set Auto Reference to 100, Auto Max Value to 1/20 ,
(exposure to auto).
Can't find any sample to help me(from help file i don't undestend wthat to do).
I need a code by C language.

please help me resolve this problem!

Stefan Geissler
August 26, 2010, 14:37:31
Hello,

please see following functions:


void SetAutoReference(Grabber *pGrabber, long Value)
{
if( pGrabber->isDevValid() )
{
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
{
tIVCDRangePropertyPtr pRange;
pItems->findInterfacePrt(VCDID_Expsoure,VCDElement_AutoRef erence,pRange);

if( pRange != NULL )
{
pRange->setValue(Value );
}
}
}
}

void SetAutoMax(Grabber *pGrabber, float Value)
{
if( pGrabber->isDevValid() )
{
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
{
tIVCDSwitchPropertyPtr pSwitchAuto;
pItems->findInterfacePrt(VCDID_Expsoure,VCDElement_AutoMax ValueAuto,pSwitchAuto);
if( pSwitchAuto != NULL )
{
pSwitchAuto->setSwitch(false);
}

tIVCDAbsoluteValuePropertyPtr pAbsVal;

pItems->findInterfacePrt(VCDID_Expsoure,VCDElement_AutoMax Value,pAbsVal);

if( pAbsVal != NULL )
{
pAbsVal->setValue(Current -1 );
}
}
}
}

vzv55
August 29, 2010, 08:23:03
Hello,

1.I have an error message (Visual C++ 7.1)

error C2039: 'findInterfacePrt' : is not a member of 'DShowLib::IVCDPropertyItems'

error C2065: 'Current' : undeclared identifier

error C3861: 'VCDID_Expsoure': identifier not found, even with argument-dependent lookup



2.I try to use code
m_Grabber.loadDeviceStateFromFile( "c:\\device1.xml" );
m_Grabber.saveDeviceStateToFile( "c:\\device.xml" );


/*c:\\device1.xml */
<device_state libver="3.1" filemajor="1" fileminor="0">
<device name="DMx 41AUC02" base_name="DMx 41AUC02" unique_name="DMx 41AUC02 18010038">
<videoformat>Y800 (1280x1024)</videoformat>
<fps>20.</fps>
<vcdpropertyitems>
<item guid="{284C0E0F-010B-45BF-8291-09D90A459B28}" name="Gain">
<element guid="{B57D3000-0AC6-4819-A609-272A33140ACA}" name="Value">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E03}" value="20" />
</element>
<element guid="{B57D3001-0AC6-4819-A609-272A33140ACA}" name="Auto">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E04}" value="0" />
</element>
</item>
<item guid="{90D5702E-E43B-4366-AAEB-7A7A10B448B4}" name="Exposure">
<element guid="{B57D3001-0AC6-4819-A609-272A33140ACA}" name="Auto">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E04}" value="1" />
</element>
<element guid="{6519038C-1AD8-4E91-9021-66D64090CC85}" name="Auto Reference">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E03}" value="128" />
</element>
<element guid="{6519038F-1AD8-4E91-9021-66D64090CC85}" name="Auto Max Value">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E08}" value="4.7500000000000001e-002" />
</element>
<element guid="{65190390-1AD8-4E91-9021-66D64090CC85}" name="Auto">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E04}" value="0" />
</element>
</item>
</vcdpropertyitems>
</device>
</device_state>


/*c:\\device.xml */


<device_state libver="3.1" filemajor="1" fileminor="0">
<device name="DMx 41AUC02" base_name="DMx 41AUC02" unique_name="DMx 41AUC02 18010038">
<videoformat>Y800 (1280x1024)</videoformat>
<fps>20.</fps>
<vcdpropertyitems>
<item guid="{284C0E0F-010B-45BF-8291-09D90A459B28}" name="Gain">
<element guid="{B57D3000-0AC6-4819-A609-272A33140ACA}" name="Value">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E03}" value="20" />
</element>
<element guid="{B57D3001-0AC6-4819-A609-272A33140ACA}" name="Auto">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E04}" value="0" />
</element>
</item>
<item guid="{90D5702E-E43B-4366-AAEB-7A7A10B448B4}" name="Exposure">
<element guid="{B57D3001-0AC6-4819-A609-272A33140ACA}" name="Auto">
<itf guid="{99B44940-BFE1-4083-ADA1-BE703F4B8E04}" value="1" />
</element>
</item>
</vcdpropertyitems>
</device>
</device_state>


as you can see i lost ="Auto Reference"and "Auto Max Value"


???
please help me to set "Auto Reference" and " Auto Max Value" in my program.

Stefan Geissler
August 30, 2010, 07:09:34
Which version of IC Imaging Control do you use?

vzv55
August 30, 2010, 11:16:04
I use version 3.1 .

Stefan Geissler
August 30, 2010, 11:43:26
Next question:
Did you use the same application for creating c:\\device1.xml as for c:\\device.xml? If not, could you please compare the uvc_driver*.VDA files?

vzv55
August 31, 2010, 12:30:37
Hello,Stefan


now this o.k , thank you .
the problem was in uvc_driver*.VDA .

now i have the new problem.
i have 2 cameras and grab image(to the buffer for image processing)
from one and next from other.
i get code:

dwStart = GetTickCount();
m_Grabber.startLive( false );
pSink->snapImages( 1 );
m_Grabber.suspendLive();
dwEnd = GetTickCount();//94 msec(from dwStart to dwEnd )

dwStart = GetTickCount();
m_Grabber2.startLive( false );//700 msec!!!
pSink2->snapImages( 1 );
m_Grabber2.suspendLive();
dwEnd = GetTickCount();//828 msec!!!(from dwStart to dwEnd )


all the time get m_Grabber2.startLive( false );

what i have to do???I need grab operation in loop many times(and fast)

thank you .

Stefan Geissler
August 31, 2010, 14:44:41
Hello,

I suppose, you use m_Grabber1.prepareLive() and m_Grabber2.prepareLive() somehwere in your program, otherwise suspendLive has no sense. This should be faster thatn 828ms in both cases. I do not now, why it is slower for your second grabber.
You can speed up the process, if you simply start both grabbers and let them run all the time. This is possible, if there is enough bandwith on the USB bus. (BTW. 20 fps is not supported, it should be 15 fps).

If this does not work, please let me know.

vzv55
September 6, 2010, 07:15:37
Hello,

Now program work very fast .
1.Start both grabbers and let them run all the time
2.Set FPS = 15
3.When I need I simply get data from the buffer without snap.

Thank you very much for your help!

alikad
January 27, 2016, 11:41:04
hi
And what is the function for getting these properties?

Stefan Geissler
January 27, 2016, 11:49:52
And what is the function for getting these properties?
See the code sample above.

alikad
July 18, 2016, 07:34:11
the sample is about setting the properties, not getting them ( or i cant see it)

Stefan Geissler
July 18, 2016, 08:16:07
Hello

pAbsVal->getValue()
returns the value. Please refer to http://www.theimagingsource.com/support/documentation/ic-imaging-control-cpp/IVCDAbsoluteValueProperty.htm

alikad
July 18, 2016, 11:18:03
tnx a lot stefan