6. AF¶
6.1. Overview¶
CVI AF moduleimplement functionis: according tohardwarestatistical informationmoduleoutput imagesharpnessvalue FV (Focus Value), throughautomaticfocusalgorithmfindtomostoptimalfocusposition, andControlfocusmotormovementtotheposition, usingobtainobtainmostclear image.
AF algorithmcaptureusethreesegmentformfocusSearchstrategy: firstfirstcorrectsetfocusdirection, thenafterusingrelativelylargestep sizeperformcoarseSearchfindto FV peakvalueadditionalnearregion, mostafterusingsmallstep sizeperformprecisesetposition. at the same timesupportfocus tracking (zoomafterautomaticagainnewfocus) , real-timefocus tracking (detectionimagechangeautomaticagainnewfocus) , backlashcompensationetc.function.
AF module workoperationneed tomotordriver support, customeruserneedimplementmotorControlcallback functionandRegisterto AF modulein.
6.2. Key Concepts¶
sharpnessvalue (FV, Focus Value) : throughanalysisimage heightfrequencycomponenttotablecharacteristicimagesharpness. imagethe moreclear, FV the larger the value.
focusSearchthreestage: AF algorithmwillfocusprocesspartisthreestage——initialstep sizeSearch (InitStep) , coarseSearch (FindStep) , fine positioning (LocateStep) .
focus tracking (Chasing Focus) : whenlenszoomcausefocuspositionbiasmovewhen, according to Zoom-Focus look uptableautomaticAdjustfocuspositionusingrestoreclearimage.
real-timefocus tracking (Real-Time Focus) : throughcontinuousmonitormeasure FV valueandbrightnesschange, indetectiontoimagechangewhenautomatictriggersendagainnewfocus.
backlashcompensation (Backlash) : motorpositivereverserotateswitchwhenstoreinmechanicalintervalgap, AF algorithmthroughreversetopremoveonesetstep sizetoeliminatetheintervalgap affects.
zoomfocustrackingtable (Zoom-Focus Table) : recorddifferentzoompositioncorresponding mostoptimalfocuspositionrange, total 9 captureformpoint, useinzoomwhenfastspeedestimatecalculatefocusposition.
VCM (Voice Coil Motor) : voice coilmotor, throughelectricalflowdriverlensmovement, Nonemechanicalbacklash.
stepmotor (Stepper Motor) : throughstepdriver motor, storeinmechanicalbacklashneedcompensation.
6.3. Functional Description¶
AF modulemainlyby ISP hardwarestatistical informationmoduleand AF Controlalgorithmtwopartconsists of.
ISP hardwarestatistical informationmodulenegativeresponsibilityforInputimageperformfilteringprocessingandsystemstatisticaleachregionblock heightfrequencycomponentvalue, provide H0, H1, V0 threekindfilter systemstatisticalresultandheightbrightpointstatisticalnumber (HlCnt) .
AF Controlalgorithmcaptureusehavelimitstatusmachineimplement, mainlyflowinclude: motorreturnpositionInitialize, triggersendfocus, directiondetection, coarseSearch, fine positioning, focuscomplete. thisoutsidealsosupportfocus tracking (Chasing Focus) , real-timefocus (Real-Time Focus) andmotordirectionswitchwhen backlashcompensation.
6.4. API Reference¶
6.4.1. AF library interface¶
all AF library interfaceallonlyisfor CVI AF library, ifcustomeruserownimplement AF library, notneed toconcernthissomeinterface, andcannotusethissomeinterface.
CVI_AF_Register : to ISP Register AF library.
CVI_AF_UnRegister : to ISP unregister AF library.
CVI_AF_MOTOR_Register : RegistermotorControlcallback function.
CVI_AF_MOTOR_UnRegister : unregistermotorControlcallback function.
6.4.1.1. CVI_AF_Register¶
[Description]
to ISP Register AF library.
[Syntax]
CVI_S32 CVI_AF_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAfLib);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfLib |
AF algorithm librarystructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.1.2. CVI_AF_UnRegister¶
[Description]
to ISP unregister AF library.
[Syntax]
CVI_S32 CVI_AF_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAfLib);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfLib |
AF algorithm librarystructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.1.3. CVI_AF_MOTOR_Register¶
[Description]
RegistermotorControlcallback function. customeruserneed toimplementmotorControlrelated callback function, includemotorInitialize, positiverotate, reverserotate, speedSet, lensinformationGetetc..
[Syntax]
CVI_S32 CVI_AF_MOTOR_Register(VI_PIPE ViPipe, ISP_AF_MOTOR_FUNC_S *pstAfMotorCb);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfMotorCb |
motorControlcallback functionstructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
thefunctionmustincall AF algorithmofbeforeRegister.
customeruserneedimplement ISP_AF_MOTOR_FUNC_S in allcallback function, include pfn_af_motor_init, pfn_af_motor_deinit, pfn_af_set_focus_in, pfn_af_set_focus_out, pfn_af_set_focus_speed, pfn_af_set_zoom_in, pfn_af_set_zoom_out, pfn_af_set_zoom_speed, pfn_af_set_zoom_focus, pfn_af_get_len_info.
pfn_af_get_len_info callbackneedcorrectReturnlens hardwarecharacteristicinformation, includefocusrange, zoomrange, backlashvalue, maximumspeedetc..
[Related Topics]
6.4.1.4. CVI_AF_MOTOR_UnRegister¶
[Description]
unregistermotorControlcallback function.
[Syntax]
CVI_S32 CVI_AF_MOTOR_UnRegister(VI_PIPE ViPipe, ISP_AF_MOTOR_FUNC_S *pstAfMotorCb);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfMotorCb |
motorControlcallback functionstructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2. AF control module¶
CVI_ISP_AFAutoFocus : triggersendautomaticfocus.
CVI_ISP_AFGetFv : Getcurrentframe FV value.
CVI_ISP_SetAFAttr / CVI_ISP_GetAFAttr : Set/Get AF attribute.
CVI_ISP_SetAFVcmAttr / CVI_ISP_GetAFVcmAttr : Set/Get VCM lensattribute.
CVI_ISP_SetAFStatisticsConfig / CVI_ISP_GetAFStatisticsConfig : Set/Get AF statistical information configuration.
CVI_ISP_SetAFZoneFocusAttr / CVI_ISP_GetAFZoneFocusAttr : Set/Get ROI focusregionattribute.
CVI_ISP_AFQueryFocusInfo : queryfocusstatusinformation.
CVI_ISP_AFSetFocus / CVI_ISP_AFSetFocusSpeed : manualfocusControl.
CVI_ISP_AFSetZoom / CVI_ISP_AFSetZoomSpeed : manualzoomControl.
CVI_AF_GetMotorCB : GetmotorControlcallback function pointer.
6.4.2.1. CVI_ISP_AFAutoFocus¶
[Description]
triggersendautomaticfocus. callthisfunctionafter AF algorithmopenstartexecutelinethreesegmentformfocusSearch (directiondetection → coarseSearch → fine positioning) .
[Syntax]
CVI_S32 CVI_ISP_AFAutoFocus(VI_PIPE ViPipe);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
callbeforeneedcorrectprotect AF alreadycorrectInitializeandRegistermotorcallback.
focusprocessin AE willistemporarilywhensuspend (locksetexposure) , focuscompleteafterautomaticrestore.
[Related Topics]
6.4.2.2. CVI_ISP_AFGetFv¶
[Description]
Getcurrentframe AF sharpnessvalue (Focus Value) . FV the larger the valueindicatesimagethe moreclear.
[Syntax]
CVI_S32 CVI_ISP_AFGetFv(VI_PIPE ViPipe, CVI_U32 *pFv);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pFv |
indicateto FV value pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
FV valueneed toinverticalremovehidden intervalintervalGet, recommendedmatchcombine
CVI_ISP_GetVDTimeOutuseusingGetsynchronous systemstatisticalvalue.
[Related Topics]
6.4.2.3. CVI_ISP_SetAFAttr¶
[Description]
Set AF algorithmControlparameternumber. includeEnableopenclose, workoperationmode, Searchstep size, focus trackingconfiguration, ratioratethresholdetc..
[Syntax]
CVI_S32 CVI_ISP_SetAFAttr(VI_PIPE ViPipe, const ISP_FOCUS_ATTR_S *pstFocusAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstFocusAttr |
AF attributestructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
modify AF attributewhenif AF positiveinRun, newparameternumberwillincurrentfocusperiodendaftertakes effect.
u8RunInterval The value range is [0x1, 0x10].
threestep sizeparameternumber (u8InitStep/u8FindStep/u8LocateStep) Value Rangeaverageis [0x1, 0xFF].
ratiorateparameternumber (DiffRatio systemcolumn) basein AF_RATIO_BASE (1024) calculate.
[Related Topics]
6.4.2.4. CVI_ISP_GetAFAttr¶
[Description]
Getcurrent AF algorithmControlparameternumber.
[Syntax]
CVI_S32 CVI_ISP_GetAFAttr(VI_PIPE ViPipe, ISP_FOCUS_ATTR_S *pstFocusAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstFocusAttr |
AF attributestructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2.5. CVI_ISP_SetAFVcmAttr¶
[Description]
Set VCM lenscalibrationattribute, includeNonefar limitposition, mostnearfocuspositionandinpointposition.
[Syntax]
CVI_S32 CVI_ISP_SetAFVcmAttr(VI_PIPE ViPipe, const ISP_AF_VCM_ATTR_S *pstVCMAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstVCMAttr |
VCM attributestructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
thissomevalueneed tothroughactualcalibrationobtainobtain. recommendeduse AF_ENTER_CAILB_FLOW calibrationtoolin AF_RANGE_OFFSET_CALIB modeGet.
u32InfinitePos indicatesNonefar limit (far areaobjectclearfocus) when lensposition.
u32MacroPos indicatesmostnearfocus (slightdistance) when lensposition.
u32MediumPos indicatesinintervalposition lensposition.
[Related Topics]
6.4.2.6. CVI_ISP_GetAFVcmAttr¶
[Description]
Get VCM lenscalibrationattribute.
[Syntax]
CVI_S32 CVI_ISP_GetAFVcmAttr(VI_PIPE ViPipe, ISP_AF_VCM_ATTR_S *pstVCMAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstVCMAttr |
VCM attributestructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2.7. CVI_ISP_SetAFStatisticsConfig¶
[Description]
Set AF hardwarestatistical information configuration, includefiltersystemnumber, windowlargesmall, cropregion, weighttableetc..
[Syntax]
CVI_S32 CVI_ISP_SetAFStatisticsConfig(VI_PIPE ViPipe, const ISP_FOCUS_STATISTICS_CFG_S *pstAfStatCfg);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfStatCfg |
AF statistical information configurationstructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
systemstatisticalregionlargesmallrecommendedSetis 17 (horizontal) x 15 (vertical) .
cropregion X coordinatesrangeis [0x8, imagewidth-8], Y coordinatesrangeis [0x2, imageheight-2].
weighttablelargesmallis 15 x 17, eachweightvalueThe value range is [0x0, 0xF].
FIR filtersystemnumberneed toaccording tolenslightlearncharacteristicperformAdjust. Referenceconfigurationcanparametersee 3A Developer User Guide in FV calculateReferencecode.
[Related Topics]
6.4.2.8. CVI_ISP_GetAFStatisticsConfig¶
[Description]
Get AF hardwarestatistical information configuration.
[Syntax]
CVI_S32 CVI_ISP_GetAFStatisticsConfig(VI_PIPE ViPipe, ISP_FOCUS_STATISTICS_CFG_S *pstAfStatCfg);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfStatCfg |
AF statistical information configurationstructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2.9. CVI_ISP_SetAFZoneFocusAttr¶
[Description]
Set ROI focusregionattribute. canindicatesetfocusregion coordinates, largesmallandweight, useinlocalregionfocus.
[Syntax]
CVI_S32 CVI_ISP_SetAFZoneFocusAttr(VI_PIPE ViPipe, const ISP_AF_ZONE_FOCUS_ATTR_S *pstAfZoneFocusAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfZoneFocusAttr |
ROI focusregionattributestructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
enable is CVI_FALSE whenuseglobalweighttableperformfocus.
u8ZoneWeight The value range is [0, 255].
[Related Topics]
6.4.2.10. CVI_ISP_GetAFZoneFocusAttr¶
[Description]
Get ROI focusregionattribute.
[Syntax]
CVI_S32 CVI_ISP_GetAFZoneFocusAttr(VI_PIPE ViPipe, ISP_AF_ZONE_FOCUS_ATTR_S *pstAfZoneFocusAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAfZoneFocusAttr |
ROI focusregionattributestructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2.11. CVI_ISP_AFQueryFocusInfo¶
[Description]
query AF algorithmRunstatusinformation, includecurrentfocusstatus, FV value, motorpositionandspeedetc..
[Syntax]
CVI_S32 CVI_ISP_AFQueryFocusInfo(VI_PIPE ViPipe, ISP_FOCUS_Q_INFO_S *pstFocusQInfo);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstFocusQInfo |
focusstatusinformationstructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
canuseinDebugandmonitor AF algorithmRunstatus.
eStatus charactersegmentreversemapcurrent AF statusmachine status.
[Related Topics]
6.4.2.12. CVI_ISP_AFSetFocus¶
[Description]
Setfocusmotormovementdirectionandstep size, useinmanualfocusmode.
[Syntax]
CVI_S32 CVI_ISP_AFSetFocus(VI_PIPE ViPipe, CVI_BOOL direct, CVI_U16 step);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
direct |
movementdirection, CVI_TRUE is FAR (far) , CVI_FALSE is NEAR (near) |
Input |
step |
movementstep size |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
thefunctioninmanualfocusmodeunderuse, automaticfocusprocessinnotrecommendedcall.
[Related Topics]
6.4.2.13. CVI_ISP_AFSetFocusSpeed¶
[Description]
Setfocusmotormovementspeed.
[Syntax]
CVI_S32 CVI_ISP_AFSetFocusSpeed(VI_PIPE ViPipe, ISP_AF_MOTOR_SPEED_E eSpeed);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
eSpeed |
motorspeed: 4X / 2X / 1X / halfspeed |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.4.2.14. CVI_ISP_AFSetZoom¶
[Description]
Setzoommotormovementdirectionandstep size.
[Syntax]
CVI_S32 CVI_ISP_AFSetZoom(VI_PIPE ViPipe, CVI_BOOL direct, CVI_U16 step);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
direct |
movementdirection |
Input |
step |
movementstep size |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
zoomoperateoperationcancantriggersendfocus tracking (if bChasingFocus alreadyEnable) .
[Related Topics]
6.4.2.15. CVI_ISP_AFSetZoomSpeed¶
[Description]
Setzoommotormovementspeed, Generallynotneed toSet.
[Syntax]
CVI_S32 CVI_ISP_AFSetZoomSpeed(VI_PIPE ViPipe, ISP_AF_MOTOR_SPEED_E eSpeed);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
eSpeed |
motorspeed: 4X / 2X / 1X / halfspeed |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_af.h
[Note]
thefunctionGenerallynotneed tocall, useDefaultspeedthen.
[Related Topics]
6.4.2.16. CVI_AF_GetMotorCB¶
[Description]
GetmotorControlcallback function pointer.
[Syntax]
ISP_AF_MOTOR_FUNC_S *CVI_AF_GetMotorCB(VI_PIPE ViPipe);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
[Return Value]
Return Value |
Description |
|---|---|
non- NULL |
motorControlcallback function pointer. |
NULL |
Failure, not yetRegisteror ViPipe invalid. |
[Requirements]
Header File: cvi_af.h
[Note]
None.
[Related Topics]
6.5. Data Types¶
6.5.1. Enumeration Types¶
6.5.1.1. AF_STATUS¶
[Description]
Define AF algorithmstatusmachinestatus.
[Definition]
typedef enum _AF_STATUS {
AF_NOT_INIT,
AF_INIT_POSITION,
AF_INIT,
AF_TRIGGER_FOCUS,
AF_DETECT_DIRECTION,
AF_SERACH_BEST_POS,
AF_LOCATE_BEST_POS,
AF_FOCUSED,
AF_REVERSE_DIRECTION,
AF_CHASING_FOCUS
} AF_STATUS;
[Members]
Member Name |
Description |
|---|---|
AF_NOT_INIT |
not yetInitializestatus. |
AF_INIT_POSITION |
initialposition, motorreturnpositionstage. willfocus/zoommotormovementtophysicaledgeboundaryperformrepeatposition. |
AF_INIT |
idlestatus. etc.pendingfocustriggersend, processingexternalzoom/focuscommand. |
AF_TRIGGER_FOCUS |
triggersendfocus. suspend AE, openstartfocusSearch. |
AF_DETECT_DIRECTION |
directiondetection. movementfocuslensandmonitormeasure FV valuetrendusingcorrectsetmostoptimalSearchdirection. |
AF_SERACH_BEST_POS |
coarseSearch. usingrelativelylargestep sizeperformfocusSearch, trackingmaximum FV value. |
AF_LOCATE_BEST_POS |
fine positioning. usingrelativelysmallstep sizeperformprecisiondetailSearch, correctconsiderpeakvalueposition. |
AF_FOCUSED |
focuscomplete. Searchend, restore AE, morenewstable FV value. |
AF_REVERSE_DIRECTION |
directionreverserotate. processingmotordirectionswitchwhen backlashcompensation. |
AF_CHASING_FOCUS |
focus tracking. zoomafteraccording to Zoom-Focus look uptablefastspeedagainnewseekfindfocuspoint. |
[Precautions]
AF_STATUS mainlyusein ISP_FOCUS_Q_INFO_S eStatus charactersegment, reversemap AF currentRunstatus.
[Related Data Types and Interfaces]
6.5.1.2. AF_DIRECTION¶
[Description]
Define focusmotormovementdirection.
[Definition]
typedef enum _AF_DIRECTION {
AF_DIR_NEAR,
AF_DIR_FAR,
} AF_DIRECTION;
[Members]
Member Name |
Description |
|---|---|
AF_DIR_NEAR |
nearprocessdirection. motortoneardistancedirectionmovementlens. |
AF_DIR_FAR |
far areadirection. motortofardistancedirectionmovementlens. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.1.3. AF_CHASINGFOCUS_MODE¶
[Description]
Define focus trackingmodetype.
[Definition]
typedef enum _AF_CHASINGFOCUS_MODE {
AF_CHASINGFOCUS_FAST_MODE,
AF_CHASINGFOCUS_NORMAL_MODE,
} AF_CHASINGFOCUS_MODE;
[Members]
Member Name |
Description |
|---|---|
AF_CHASINGFOCUS_FAST_MODE |
fastspeedfocus trackingmode. usingmorefast speedagainnewfocus, adaptcombinedynamicscene. |
AF_CHASINGFOCUS_NORMAL_MODE |
normalfocus trackingmode. standard speedagainnewfocus. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.1.4. AF_MANUAL_TYPE¶
[Description]
Manual Definitionoperateoperationtype.
[Definition]
typedef enum _AF_MANUAL_TYPE {
OP_TYPE_ZOOM,
OP_TYPE_FOCUS,
OP_TYPE_AUTO_FOCUS,
OP_TYPE_ZOOM_POS,
OP_TYPE_FOCUS_POS,
OP_TYPE_AF_BUTT
} AF_MANUAL_TYPE;
[Members]
Member Name |
Description |
|---|---|
OP_TYPE_ZOOM |
manualzoomoperateoperation. |
OP_TYPE_FOCUS |
manualfocusoperateoperation. |
OP_TYPE_AUTO_FOCUS |
automaticfocusoperateoperation. |
OP_TYPE_ZOOM_POS |
Setzoomposition. |
OP_TYPE_FOCUS_POS |
Setfocusposition. |
OP_TYPE_AF_BUTT |
edgeboundaryvalue, indicatesvalidtype quantity. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.1.5. ISP_AF_MOTOR_SPEED_E¶
[Description]
Define AF motorspeedlevel.
[Definition]
typedef enum _ISP_AF_MOTOR_SPEED_E {
AF_MOTOR_SPEED_4X,
AF_MOTOR_SPEED_2X,
AF_MOTOR_SPEED_1X,
AF_MOTOR_SPEED_HALF,
} ISP_AF_MOTOR_SPEED_E;
[Members]
Member Name |
Description |
|---|---|
AF_MOTOR_SPEED_4X |
4 xspeed. highest speed level. |
AF_MOTOR_SPEED_2X |
2 xspeed. |
AF_MOTOR_SPEED_1X |
1 xspeed. standard speed. |
AF_MOTOR_SPEED_HALF |
halfspeed. mostlowspeedlevel. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.1.6. AF_MOTOR_TYPE¶
[Description]
Define motortype.
[Definition]
typedef enum _AF_MOTOR_TYPE {
AF_MOTOR_STEPPER,
AF_MOTOR_VCM,
} AF_MOTOR_TYPE;
[Members]
Member Name |
Description |
|---|---|
AF_MOTOR_STEPPER |
stepmotor. throughstepdriver, storeinmechanicalbacklashneedcompensation. |
AF_MOTOR_VCM |
voice coilmotor (Voice Coil Motor) . throughelectricalflowdriver, Nonemechanicalbacklash. |
[Precautions]
motortypethrough pfn_af_get_len_info callbackin ISP_AF_LEN_INFO_S Return.
VCM lensbacklashcompensationis 1 framevibrationmovecompensation, stepmotorneedaccording toactualmeasureamountSet focus_backlash.
[Related Data Types and Interfaces]
6.5.2. Structure Types¶
6.5.2.1. ISP_FOCUS_ATTR_S¶
[Description]
Define AF mainconfigurationattribute. contain AF Enable, workoperationmode, Searchstep size, focus trackingconfiguration, ratioratethreshold, manualfocusetc.parameternumber.
[Definition]
typedef struct _ISP_FOCUS_ATTR_S {
CVI_BOOL bEnable;
CVI_U8 u8DebugMode;
ISP_OP_TYPE_E enOpType;
CVI_U8 u8RunInterval;
CVI_BOOL bRealTimeFocus;
CVI_BOOL bChasingFocus;
CVI_BOOL bReFocus;
CVI_BOOL bMixHlc;
CVI_U8 u8RtFocusStableFrm;
CVI_U16 u16RtMaxDiffFvRatio;
CVI_U16 u16MaxDiffFvRatio;
CVI_U16 u16MaxDiffLumaRatio;
CVI_U16 u16DetectDiffRatio;
CVI_U16 u16SearchDiffRatio;
CVI_U16 u16LocalDiffRatio;
CVI_U8 u8InitStep;
CVI_U8 u8FindStep;
CVI_U8 u8LocateStep;
AF_DIRECTION enInitDir;
CVI_U16 u16MaxRotateCnt;
AF_CHASINGFOCUS_MODE enChasingFocusMode;
ISP_FOCUS_MANUAL_ATTR_S stManual;
} ISP_FOCUS_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
AF Enable. is CVI_TRUE whenEnable AF, is CVI_FALSE whennotEnable. |
u8DebugMode |
Debugmode. useinSet AF Debuglevel. |
enOpType |
operateoperationtype. automaticormanualfocusmodeswitch. |
u8RunInterval |
AF algorithmRunframeintervalinterval. The value range is [0x1, 0x10]. |
bRealTimeFocus |
real-timefocusEnable. is CVI_TRUE whenopenenablereal-timefocus tracking, detectiontoimagechangeautomaticagainnewfocus. |
bChasingFocus |
focus trackingEnable. is CVI_TRUE whenopenenablezoomfocus tracking, zoomafterautomaticaccording to Zoom-Focus look uptableAdjustfocusposition. |
bReFocus |
againnewfocusEnable. is CVI_TRUE whenimagechangeafterautomaticagainnewfocus. |
bMixHlc |
blendheightbrightpointmaskEnable. use HlCnt informationsuppresslight sourcefor FV value affects. |
u8RtFocusStableFrm |
real-timefocusstableframenumber. FV changecontinuousexceedthroughthisframenumberaftertriggersendfocus tracking. The value range is [0x1, 0xFF], The default value is 5. |
u16RtMaxDiffFvRatio |
real-timefocusmaximum FV differenceratioexample. basein AF_RATIO_BASE (1024). The value range is [0x400, 0x1000]. |
u16MaxDiffFvRatio |
maximum FV differenceratioexample. useindetectionimagewhethersendgeneratesignificantchange. The value range is [0x400, 0x4000]. |
u16MaxDiffLumaRatio |
maximumbrightnessdifferenceratioexample. useinbrightnesschangedetection. The value range is [0x400, 0x1000]. |
u16DetectDiffRatio |
directiondetectiondifferenceratioexample. useindeterminedirectiondetectionstage FV changewhethersignificant. The value range is [0x400, 0x1000]. |
u16SearchDiffRatio |
Searchdifferenceratioexample. useincoarseSearchstagedeterminewhetheralreadythe morethrough FV peakvalue. The value range is [0x400, 0x1000]. |
u16LocalDiffRatio |
setpositiondifferenceratioexample. useinfine positioningstagecorrectconsiderpeakvalue. The value range is [0x400, 0x1000]. |
u8InitStep |
initialSearchstep size. focusSearchfirststageuse motormovementstep size. The value range is [0x1, 0xFF]. |
u8FindStep |
preciseSearchstep size. focusSearchsecondstage (coarseSearch) use motormovementstep size. The value range is [0x1, 0xFF]. |
u8LocateStep |
setpositionstep size. focusSearchthirdstage (fine positioning) use motormovementstep size. The value range is [0x1, 0xFF]. |
enInitDir |
initialSearchdirection. focusSearchopenstartwhen motormovementdirection (NEAR or FAR) . |
u16MaxRotateCnt |
maximumrepeatpositiontimenumber. motorrepeatposition (returnpositiontophysicaledgeboundary) maximumagaintesttimenumber. The value range is [0x400, 0x4000]. |
enChasingFocusMode |
focus trackingmode. fastspeedmodeornormalmode. |
stManual |
manualfocusattribute. containmanualoperateoperationtype, direction, step sizeandposition. |
[Precautions]
allratiorateparameternumberaverageusing AF_RATIO_BASE (1024) isbaseline. For example u16DetectDiffRatio = 1024 indicates 100% differencethreshold.
threestep sizeparameternumber (InitStep/FindStep/LocateStep) shouldaccording tolenscharacteristicAdjust. stepmotorrecommended InitStep=16, FindStep=8, LocateStep=2; VCM lenscanadaptwhenreducesmall.
[Related Data Types and Interfaces]
6.5.2.2. ISP_FOCUS_Q_INFO_S¶
[Description]
Define AF queryinformation/Runwhenstatus. useinGet AF currentRunstatus, FV value, motorpositionetc.information.
[Definition]
typedef struct _ISP_AF_Q_INFO_S {
AF_STATUS eStatus;
CVI_U32 u32PreFv;
CVI_U32 u32CurFv;
CVI_U32 u32MaxFv;
CVI_U8 u8PreLuma;
CVI_U8 u8CurLuma;
AF_DIRECTION eZoomDir;
CVI_U16 u16ZoomStep;
CVI_U16 u16ZoomPos;
AF_DIRECTION eFocusDir;
CVI_U16 u16FocusStep;
CVI_U16 u16FocusPos;
CVI_U16 u16MaxFvPos;
CVI_U16 u16ZoomMinPos;
CVI_U16 u16ZoomMaxPos;
CVI_U16 u16FocusMinPos;
CVI_U16 u16FocusMaxPos;
ISP_AF_MOTOR_SPEED_E eZoomSpeed;
ISP_AF_MOTOR_SPEED_E eFocusSpeed;
} ISP_FOCUS_Q_INFO_S;
[Members]
Member Name |
Description |
|---|---|
eStatus |
current AF status. reversemap AF_STATUS enumerationvalue. |
u32PreFv |
ononeframe FV value. |
u32CurFv |
currentframe FV value. |
u32MaxFv |
Searchprocessinrecord maximum FV value. |
u8PreLuma |
ononeframeaveragebrightness. |
u8CurLuma |
currentframeaveragebrightness. |
eZoomDir |
currentzoommovementdirection. |
u16ZoomStep |
currentzoomstep size. |
u16ZoomPos |
currentzoomposition. |
eFocusDir |
currentfocusmovementdirection. |
u16FocusStep |
currentfocusstep size. |
u16FocusPos |
currentfocusposition. |
u16MaxFvPos |
maximum FV valuecorresponding focusposition (mostoptimalfocuspoint) . |
u16ZoomMinPos |
zoomminimumposition. |
u16ZoomMaxPos |
zoommaximumposition. |
u16FocusMinPos |
focusminimumposition. |
u16FocusMaxPos |
focusmaximumposition. |
eZoomSpeed |
currentzoommotorspeed. |
eFocusSpeed |
currentfocusmotorspeed. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.2.3. ISP_FOCUS_MANUAL_ATTR_S¶
[Description]
Manual Definitionfocusattribute. useinmanualfocusmodeunder parameternumberconfiguration.
[Definition]
typedef struct _ISP_FOCUS_MANUAL_ATTR_S {
AF_MANUAL_TYPE enManualOpType;
AF_DIRECTION enManualDir;
CVI_U16 u16ManualStep;
CVI_U16 u16ManualPos;
} ISP_FOCUS_MANUAL_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
enManualOpType |
manualoperateoperationtype. zoom, focus, automaticfocusetc.. Value Rangeparametersee AF_MANUAL_TYPE . |
enManualDir |
manualoperateoperationdirection. NEAR or FAR. Value Rangeparametersee AF_DIRECTION . |
u16ManualStep |
manualoperateoperationstep size. The value range is [0x0, 0x400]. |
u16ManualPos |
manualoperateoperationtargetposition. The value range is [0x0, 0x8000]. |
[Precautions]
None.
[Related Data Types and Interfaces]
6.5.2.4. ISP_AF_VCM_ATTR_S¶
[Description]
Define VCM lenscalibrationattribute. useinrecordlens Nonefar limitposition, mostnearfocuspositionandinpointposition.
[Definition]
typedef struct _ISP_AF_VCM_ATTR_S {
CVI_U32 u32InfinitePos;
CVI_U32 u32MacroPos;
CVI_U32 u32MediumPos;
} ISP_AF_VCM_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
u32InfinitePos |
Nonefar limitposition. far areaobjectclearfocuswhen lensposition, in steps (step) . |
u32MacroPos |
mostnearfocusposition. slightdistancecapturewhen lensposition, in steps (step) . |
u32MediumPos |
inpointposition. Nonefar limitandmostnearfocusofinterval inintervalposition, in steps (step) . |
[Precautions]
thissomevalueneed tothroughactualcalibrationobtainobtain. recommendedusecalibrationtool AF_ENTER_CAILB_FLOW in AF_RANGE_OFFSET_CALIB mode.
calibrationcompleteafter, AF algorithmbenefitusethissomevaluecorrectsetfocusSearch reasonablerange.
[Related Data Types and Interfaces]
6.5.2.5. ISP_AF_ZONE_FOCUS_ATTR_S¶
[Description]
Define ROI focusregionattribute. useinindicatesetlocalfocusregion coordinates, largesmallandweight.
[Definition]
typedef struct _ISP_AF_ZONE_FOCUS_ATTR_S {
CVI_BOOL enable;
CVI_U8 u8ZoneWeight;
CVI_U32 u32ZoneX;
CVI_U32 u32ZoneY;
CVI_U32 u32ZoneWidth;
CVI_U32 u32ZoneHeight;
} ISP_AF_ZONE_FOCUS_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
enable |
Enableopenclose. is CVI_TRUE whenenableuse ROI focusregion, is CVI_FALSE whenuseglobalweighttable. |
u8ZoneWeight |
regionweight. The value range is [0, 255]. |
u32ZoneX |
region X coordinates (leftonangle) . |
u32ZoneY |
region Y coordinates (leftonangle) . |
u32ZoneWidth |
regionwidth. |
u32ZoneHeight |
regionheight. |
[Precautions]
ROI focusregioncanuseinimplementpointclickfocusetc.function, userindicatesetimageina certainregionafter AF willpriorityfortheregionperformfocus.
[Related Data Types and Interfaces]
6.5.2.6. ISP_AF_ZOOM_FOCUS_TAB¶
[Description]
Define Zoom-Focus look uptablesingletableitem. recordspecialsetzoompositioncorresponding focuspositionrange.
[Definition]
typedef struct _ISP_AF_ZOOM_FOCUS_TAB {
CVI_U32 zoom_pos;
CVI_U32 focus_pos_min;
CVI_U32 focus_pos_max;
} ISP_AF_ZOOM_FOCUS_TAB;
[Members]
Member Name |
Description |
|---|---|
zoom_pos |
zoomposition. |
focus_pos_min |
thezoompositionunderfocuspositionminimum value. |
focus_pos_max |
thezoompositionunderfocuspositionmaximum value. |
[Precautions]
Zoom-Focus tabletotal ZOOM_FOCUS_TAB_SIZE (9) tableitem, cover the wholezoomrange.
thetablethroughcalibrationtool AF_ZOOM_FOCUS_TABLE_CALIB modegeneratebecome, indifferentzoompositionrecordmostoptimalfocuspositionrange.
focus trackingwhenuselinearinsertvalueintableitemofintervalestimatecalculatefocusposition.
[Related Data Types and Interfaces]
6.5.2.7. ISP_AF_LEN_INFO_S¶
[Description]
Define lenshardwarecharacteristicinformation. throughmotordrivercallback pfn_af_get_len_info provide, containlens mechanicalandelectricalelectricalcharacteristicparameternumber.
[Definition]
typedef struct _ISP_AF_LEN_INFO_S {
ISP_AF_ZOOM_FOCUS_TAB zoom_focus_table[ZOOM_FOCUS_TAB_SIZE];
CVI_U32 focus_range;
CVI_U32 zoom_range;
CVI_U32 focus_offset;
CVI_U32 zoom_offset;
CVI_U32 focus_backlash;
CVI_U32 zoom_backlash;
CVI_U32 focus_max_speed;
CVI_U32 zoom_max_speed;
CVI_U32 focus_time_cost_one_step;
CVI_U32 zoom_time_cost_one_step;
CVI_U32 focus_max_step;
CVI_U32 zoom_max_step;
AF_MOTOR_TYPE motor_type;
} ISP_AF_LEN_INFO_S;
[Members]
Member Name |
Description |
|---|---|
zoom_focus_table |
Zoom-Focus look uptable. total 9 tableitem, recordzoompositionandfocuspositionrange mapprojectclosesystem. |
focus_range |
focusmovementrange, in steps (step) . |
zoom_range |
zoommovementrange, in steps (step) . |
focus_offset |
focusbiasmoveamount, in steps (step) . indicateslenstoreachedgeboundaryafterstillhaveblur distance. |
zoom_offset |
zoombiasmoveamount, in steps (step) . |
focus_backlash |
focusbacklashvalue, hardwarelimit, in steps (step) . motorreversetomotionwhenneedpremove compensationstep size. |
zoom_backlash |
zoombacklashvalue, hardwarelimit, in steps (step) . |
focus_max_speed |
focusmaximumspeed. thevalueoperationis MOTOR_SPEED_4X actualspeed. |
zoom_max_speed |
zoommaximumspeed. thevalueoperationis MOTOR_SPEED_4X actualspeed. |
focus_time_cost_one_step |
focussinglestepwhenintervalbecomethis, in microseconds (us) . |
zoom_time_cost_one_step |
zoomsinglestepwhenintervalbecomethis, in microseconds (us) . |
focus_max_step |
focusmaximumstepnumber. |
zoom_max_step |
zoommaximumstepnumber. |
motor_type |
motortype. stepmotoror VCM. parametersee AF_MOTOR_TYPE . |
[Precautions]
thestructurebymotordrivercallback function pfn_af_get_len_info fill, customeruserneedcorrectimplementthecallback.
focus_backlash and zoom_backlash canthroughcalibrationtool AF_BACK_LASH_CALIB modemeasureamount.
focus_time_cost_one_step and zoom_time_cost_one_step canthroughcalibrationtool AF_ONE_STEP_TIME_COST_CALIB modemeasureamount.
[Related Data Types and Interfaces]
6.5.2.8. ISP_AF_MOTOR_FUNC_S¶
[Description]
Define motorControlcallback functioncollectcombine. customeruserneedimplementallcallback functionusingdriverfocus/zoommotor.
[Definition]
typedef struct _ISP_AF_MOTOR_CTL_FUNC_S {
CVI_S32 (*pfn_af_motor_init)(VI_PIPE ViPipe);
CVI_S32 (*pfn_af_motor_deinit)(VI_PIPE ViPipe);
CVI_S32 (*pfn_af_set_zoom_in)(VI_PIPE ViPipe, CVI_U8 step);
CVI_S32 (*pfn_af_set_zoom_out)(VI_PIPE ViPipe, CVI_U8 step);
CVI_S32 (*pfn_af_set_zoom_speed)(VI_PIPE ViPipe, CVI_U8 speed);
CVI_S32 (*pfn_af_set_focus_in)(VI_PIPE ViPipe, CVI_U8 step);
CVI_S32 (*pfn_af_set_focus_out)(VI_PIPE ViPipe, CVI_U8 step);
CVI_S32 (*pfn_af_set_focus_speed)(VI_PIPE ViPipe, CVI_U8 speed);
CVI_S32 (*pfn_af_set_zoom_focus)(VI_PIPE ViPipe, AF_DIRECTION eDirz, AF_DIRECTION eDirf, CVI_U8 zoomStep, CVI_U8 focusStep);
CVI_S32 (*pfn_af_get_len_info)(VI_PIPE ViPipe, ISP_AF_LEN_INFO_S *info);
} ISP_AF_MOTOR_FUNC_S;
[Members]
Member Name |
Description |
|---|---|
pfn_af_motor_init |
motorInitializecallback. useinInitializemotorhardwareandstatus. |
pfn_af_motor_deinit |
motorreverseInitializecallback. useinreleaseplacemotorresourcesource. |
pfn_af_set_zoom_in |
Setzoommotortoinsidemovementindicatesetstep size. |
pfn_af_set_zoom_out |
Setzoommotortooutsidemovementindicatesetstep size. |
pfn_af_set_zoom_speed |
Setzoommotorspeedlevel. |
pfn_af_set_focus_in |
Setfocusmotortoinsidemovementindicatesetstep size. |
pfn_af_set_focus_out |
Setfocusmotortooutsidemovementindicatesetstep size. |
pfn_af_set_focus_speed |
Setfocusmotorspeedlevel. |
pfn_af_set_zoom_focus |
at the same timeSetzoomandfocusmotor movementdirectionandstep size. useinimplementzoomandfocusat the same timemotion. |
pfn_af_get_len_info |
Getlenshardwarecharacteristicinformation. needfill ISP_AF_LEN_INFO_S structure. |
[Precautions]
allcallback functionallmustcorrectimplement, whetherthen AF algorithmcannotnormalworkoperation.
through CVI_AF_MOTOR_Register Registerto AF module.
pfn_af_set_zoom_focus returncallinimplementzoomandfocus linkmove, caninzoomprocessinat the same timeAdjustfocusposition.
[Related Data Types and Interfaces]
6.5.2.9. ISP_FOCUS_STATISTICS_CFG_S¶
[Description]
Define AF hardwarestatistical information configuration. containfilterconfiguration, windowlargesmall, weighttableetc.parameternumber.
[Definition]
#define AF_WEIGHT_ZONE_ROW 15
#define AF_WEIGHT_ZONE_COLUMN 17
#define FIR_H_GAIN_NUM (5)
#define FIR_V_GAIN_NUM (3)
typedef struct _ISP_FOCUS_STATISTICS_CFG_S {
ISP_AF_CFG_S stConfig;
ISP_AF_H_PARAM_S stHParam_FIR0;
ISP_AF_H_PARAM_S stHParam_FIR1;
ISP_AF_V_PARAM_S stVParam_FIR;
CVI_U8 au8Weight[AF_WEIGHT_ZONE_ROW][AF_WEIGHT_ZONE_COLUMN];
} ISP_FOCUS_STATISTICS_CFG_S;
[Members]
Member Name |
Description |
|---|---|
stConfig |
AF basicconfiguration. containEnable, windowlargesmall, lowpassfilteringsystemnumber, cropregion, heightpassfiltering coting valueetc.. parametersee ISP_AF_CFG_S . |
stHParam_FIR0 |
horizontaldirection FIR filter 0 parameternumber (heightpassfilter) . 5 tapsystemnumber. parametersee |
stHParam_FIR1 |
horizontaldirection FIR filter 1 parameternumber (heightpassfilter) . 5 tapsystemnumber. parametersee |
stVParam_FIR |
verticalhistogramto FIR filterparameternumber (heightpassfilter) . 3 tapsystemnumber. parametersee |
au8Weight |
regionblockweighttable. largesmallis 15 x 17, eachweightThe value range is [0x0, 0xF]. useinfordifferentregion FV valueperformaddweight. |
[Precautions]
systemstatisticalregionlargesmallrecommendedSetis 17 (horizontal) x 15 (vertical) , andweighttablelargesmallconsistent.
FIR filtersystemnumberneed toaccording tolenslightlearncharacteristicAdjust.
Referenceconfigurationcanparametersee 3A Developer User Guide in FV calculateReferencecode.
[Related Data Types and Interfaces]
CVI_ISP_SetAFStatisticsConfigCVI_ISP_GetAFStatisticsConfigISP_AF_CFG_S
6.5.2.10. ISP_AF_CFG_S¶
[Description]
Define AF systemstatisticalbasicconfiguration. containEnable, windowlargesmall, filteringconfiguration, cropregion, heightbrightpointthresholdetc..
[Definition]
typedef struct _ISP_AF_CFG_S {
CVI_BOOL bEnable;
CVI_U16 u16Hwnd;
CVI_U16 u16Vwnd;
CVI_U8 u8HFltShift;
CVI_S8 s8HVFltLpCoeff[FIR_H_GAIN_NUM];
ISP_AF_RAW_CFG_S stRawCfg;
ISP_AF_PRE_FILTER_CFG_S stPreFltCfg;
ISP_AF_CROP_S stCrop;
CVI_U8 H0FltCoring;
CVI_U8 H1FltCoring;
CVI_U8 V0FltCoring;
CVI_U16 u16HighLumaTh;
CVI_U8 u8ThLow;
CVI_U8 u8ThHigh;
CVI_U8 u8GainLow;
CVI_U8 u8GainHigh;
CVI_U8 u8SlopLow;
CVI_U8 u8SlopHigh;
} ISP_AF_CFG_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
Enableopenclose. is CVI_TRUE whenEnable AF systemstatistical. |
u16Hwnd |
horizontaldirectionregionblockwindowquantity. The value range is [0x2, 0x11] (that is 2~17) . |
u16Vwnd |
verticalhistogramtoregionblockwindowquantity. The value range is [0x2, 0xF] (that is 2~15) . |
u8HFltShift |
horizontalfilteringmovepositionamount. The value range is [0x0, 0xF]. |
s8HVFltLpCoeff |
horizontal/verticallowpass FIR filteringsystemnumber. 5 tap, The value range is [0x0, 0x1F]. |
stRawCfg |
RAW domainbeforeprocessingconfiguration. contain PreGamma Enableand 256 item Gamma look uptable. |
stPreFltCfg |
prefilteringconfiguration. useineliminatesalt-and-peppernoiseforsystemstatisticalvalue affects. |
stCrop |
imagecropconfiguration. useinlimit AF systemstatistical regionrange. parametersee ISP_AF_CROP_S . |
H0FltCoring |
H0 filter Coring value. useinremovesmallamplitudenoise. The value range is [0x0, 0xFF]. |
H1FltCoring |
H1 filter Coring value. The value range is [0x0, 0xFF]. |
V0FltCoring |
V0 filter Coring value. The value range is [0x0, 0xFF]. |
u16HighLumaTh |
heightbrightpointbrightnessthreshold. useinsuppresslight sourcefor FV value affects. The value range is [0x0, 0xFF]. |
u8ThLow |
lowthreshold. useingainanddiagonalratecalculate. |
u8ThHigh |
heightthreshold. useingainanddiagonalratecalculate. |
u8GainLow |
lowgainvalue. The value range is [0x0, 0xFE]. |
u8GainHigh |
heightgainvalue. The value range is [0x0, 0xFE]. |
u8SlopLow |
lowdiagonalratevalue. The value range is [0x0, 0xF]. |
u8SlopHigh |
heightdiagonalratevalue. The value range is [0x0, 0xF]. |
[Precautions]
AF window X regionmustin [0x8 ~ image xsize - 8] ofinterval, Y regionmustin [0x2 ~ image ysize - 2] ofinterval.
[Related Data Types and Interfaces]
6.5.2.11. ISP_AF_CROP_S¶
[Description]
Define AF statistical informationInputimagecropconfiguration. usercanthrough X, Y, W, H tolimit AF systemstatisticalregion.
[Definition]
typedef struct _ISP_AF_CROP_S {
CVI_BOOL bEnable;
CVI_U16 u16X;
CVI_U16 u16Y;
CVI_U16 u16W;
CVI_U16 u16H;
} ISP_AF_CROP_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
Enableopenclose. is CVI_TRUE whenenableusecrop. |
u16X |
cropregion X startcoordinates. The value range is [0x8, 0xFFF]. |
u16Y |
cropregion Y startcoordinates. The value range is [0x2, 0xFFF]. |
u16W |
cropregionwidth. The value range is [0x110, 0xFFF]. |
u16H |
cropregionheight. The value range is [0xF0, 0xFFF]. |
[Precautions]
X coordinatesminimumvalueis 0x8, Y coordinatesminimumvalueis 0x2, thisishardwarelimit.
cropregionnotcanexceedoutputimagevalidregion.
[Related Data Types and Interfaces]
6.5.2.12. ISP_FOCUS_ZONE_S¶
[Description]
Define singleregionblock AF statistical informationoutput. containheightpassfilteringvalueandheightbrightpointstatisticalnumber.
[Definition]
typedef struct _ISP_FOCUS_ZONE_S {
CVI_U16 u16HlCnt;
CVI_U64 u64h0;
CVI_U64 u64h1;
CVI_U32 u32v0;
} ISP_FOCUS_ZONE_S;
[Members]
Member Name |
Description |
|---|---|
u16HlCnt |
heightbrightpointpixelstatisticalnumber. useindetectionwindowin throughexposurebrightpointquantity, auxiliarydeterminelight sourcefocus affects. |
u64h0 |
horizontaldirection FIR filter 0 outputaccumulatevalue. |
u64h1 |
horizontaldirection FIR filter 1 outputaccumulatevalue. |
u32v0 |
verticalhistogramto FIR filter outputaccumulatevalue. |
[Precautions]
None.
[Related Data Types and Interfaces]
ISP_FE_FOCUS_STATISTICS_SISP_AF_STATISTICS_S
6.5.2.13. ISP_AF_STATISTICS_S¶
[Description]
Define AF statistical informationnumberdatastructure. encapsulateinstallbeforeend (FE) AF systemstatisticaloutput.
[Definition]
typedef struct _ISP_AF_STATISTICS_S {
ISP_FE_FOCUS_STATISTICS_S stFEAFStat;
} ISP_AF_STATISTICS_S;
[Members]
Member Name |
Description |
|---|---|
stFEAFStat |
beforeend AF statistical information. contain 15 x 17 regionblock degreeamountnumberdata. parametersee |
[Precautions]
thenumberdatastructurein ISP Runwhenbyhardwareautomaticmorenew, userthrough CVI_ISP_GetFocusStatistics Get.
currently AF onlysupport Bayer domain statistical information.
[Related Data Types and Interfaces]
CVI_ISP_GetFocusStatisticsISP_FOCUS_ZONE_SISP_FE_FOCUS_STATISTICS_S