LensCorrect
Top  Previous  Next

Description

Enables/disables the lens distortion correction. Used in combination with SetLensDistortion.


Syntax


[VB]
objActiveUSB.LensCorrect [= Value]


[C/C++]
HRESULT get_LensCorrect ( bool *pCorrect);
HRESULT put_LensCorrect( bool Correct );


Data Type
[VB]

Boolean


Parameters
[C/C++]

pCorrect [out,retval]  
Pointer to the Boolean that is TRUE if the lens distortion correction is enabled, or FALSE otherwise  
Correct [in]  
Set to TRUE to enable the lens distortion correction, or set to FALSE to disable it  
 

Return Values


S_OK  
Success  
E_FAIL  
Failure.  

Example


The following VB examples activates the lens distortion correction and uses two scroll bars to adjust the distortion parameters in real time :

Private Sub
 Form_Load()
ActiveUSB1.Acquire=
True

HScroll1.Min = -1000
HScroll1.Max = 1000
HScroll2.Min = -1000
HScroll2.Max = 1000
ActiveUSB1.SetLensDistortion 0,0,
False

ActiveUSB1.LensCorrect=
True

ActiveUSB1.Acquire=
True
End Sub

Private Sub HScroll1_Scroll()
ActiveUSB1.SetLensDistortion HScroll1.Value/1000., HScroll2.Value/1000., 
False
End Sub

Private Sub
 HScroll2_Scroll()
ActiveUSB1.SetLensDistortion HScroll1.Value/1000., HScroll2.Value/1000., 
False
End Sub


Remarks

The lens distortion correction is used to compensate for the barrel or pincushion image distortion caused by camera lenses. The barrel distortion makes straight lines at the edges of the image bow outwards and it is commonly seen on wide angle lenses with short focal length. The pincushion distortion makes straight lines at the edges of the image bow inwards, and it is commonly seen on telephoto lenses with long focal length. Before activating the lens distortion correction, you must set up the distortion parameters by calling SetLensDistortion
.