PDA

View Full Version : Autofocus OnePush



BioVendorIns
January 6, 2015, 16:04:14
Hi,
we have a DFK 72AUC02-F camera with autofocus.
When I call a method OnePush for autofocus everything is OK and camera is focusing, but i dont know when it ends.
Is there any handle or way how can I get information about end of focusing?



private TIS.Imaging.VCDButtonProperty m_focusAuto;
this.m_focusAuto = (TIS.Imaging.VCDButtonProperty)this.m_focus.Elemen ts.FindInterface(
TIS.Imaging.VCDIDs.VCDElement_OnePush + ":" +
TIS.Imaging.VCDIDs.VCDInterface_Button);
this.m_focusAuto.Push();

Stefan Geissler
January 6, 2015, 17:03:31
Hello

The focus item has a "OnePushRunning" swith element. It is true, as long as the aufo focus runs.



TIS.Imaging.VCDSwitchProperty SwitchItf;
SwitchItf = (TIS.Imaging.VCDSwitchProperty)IC.VCDPropertyItems .FindInterface(TIS.Imaging.VCDIDs.VCDID_Focus,
"{07D2DD39-3F10-4E0F-8EE5-3EED067A53C6}",
TIS.Imaging.VCDIDs.VCDInterface_Switch);
if( SwitchItf != null )
{
int i = 40;
while(SwitchItf.Switch == true && i > 0)
{
System.Threading.Thread.Sleep(100);
i--; // For time out
}
}

singerinst_ben
January 22, 2015, 13:07:21
Hello

The focus item has a "OnePushRunning" swith element. It is true, as long as the aufo focus runs.



TIS.Imaging.VCDSwitchProperty SwitchItf;
SwitchItf = (TIS.Imaging.VCDSwitchProperty)IC.VCDPropertyItems .FindInterface(TIS.Imaging.VCDIDs.VCDID_Focus,
"{07D2DD39-3F10-4E0F-8EE5-3EED067A53C6}",
TIS.Imaging.VCDIDs.VCDInterface_Switch);
if( SwitchItf != null )
{
int i = 40;
while(SwitchItf.Switch == true && i > 0)
{
System.Threading.Thread.Sleep(100);
i--; // For time out
}
}


I also have the same problem.

I couldn't get the above code to work, it always returns false even though the camera is autofocusing.

In my original code I used:



// get the focus property
TIS.Imaging.VCDPropertyItem focusProperty = this.TISDeviceControl.VCDPropertyItems.FindItem(TI S.Imaging.VCDIDs.VCDID_Focus);

// expose switch
TIS.Imaging.VCDSwitchProperty focusSwitch = (TIS.Imaging.VCDSwitchProperty)focusProperty.Eleme nts.FindInterface(TIS.Imaging.VCDIDs.VCDElement_On ePushRunning + ":" + TIS.Imaging.VCDIDs.VCDInterface_Switch);

// if found
if (focusSwitch != null)
{
// return if focuisng
focusInProgress = focusSwitch.Switch;
}
else
{
// false
focusInProgress = false;
}


Is this valid? Again, this always returns false but I can see the camera focusing.

Stefan Geissler
January 22, 2015, 14:33:15
Which camera model? This depends on the used camera model and not all of them return a valid value. E.G. the 13MP wont do this as far as I know.

singerinst_ben
January 26, 2015, 17:59:18
Hi Stefan - it is a DFK AFU130-L53.

Regards,

Ben

singerinst_ben
January 26, 2015, 17:59:29
Hi Stefan - it is a DFK AFU130-L53.

Regards,

Ben

Stefan Geissler
January 27, 2015, 09:47:58
Hi Ben

The DFK AFU130-L53 has no auto focus running property. Unfortunately we do not know, how long the sensor and lens combination run the auto focus procedure. We have no access to this process, therefore, this property can not be implemented.
The simple work around is waiting two seconds after you called the one push.