參考介紹詳解_第1頁(yè)
參考介紹詳解_第2頁(yè)
參考介紹詳解_第3頁(yè)
參考介紹詳解_第4頁(yè)
參考介紹詳解_第5頁(yè)
已閱讀5頁(yè),還剩45頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

Copyright?HiSiliconTechnologiesCo.,Ltd.2018.Allrightsreserved.

NopartofthisdocumentmaybereproducedortransmittedinanyformorbyanymeanswithoutpriorwrittenconsentofHiSiliconTechnologiesCo.,Ltd.

TrademarksandPermissions

,

,andotherHiSiliconiconsaretrademarksofHiSiliconTechnologiesCo.,Ltd.

Allothertrademarksandtradenamesmentionedinthisdocumentarethepropertyoftheirrespectiveholders.

Notice

Thepurchasedproducts,servicesandfeaturesarestipulatedbythecontractmadebetweenHiSiliconandthecustomer.Allorpartoftheproducts,servicesandfeaturesdescribedinthisdocumentmaynotbewithinthepurchasescopeortheusagescope.Unlessotherwisespecifiedinthecontract,allstatements,information,andrecommendationsinthisdocumentareprovided"ASIS"withoutwarranties,guaranteesorrepresentationsofanykind,eitherexpressorimplied.

Theinformationinthisdocumentissubjecttochangewithoutnotice.Everyefforthasbeenmadeinthepreparationofthisdocumenttoensureaccuracyofthecontents,butallstatements,information,andrecommendationsinthisdocumentdonotconstituteawarrantyofanykind,expressorimplied.

HiSiliconTechnologiesCo.,Ltd.

Address:

NewR&DCenter,WuheRoad,Bantian,LonggangDistrict,Shenzhen518129P.R.China

support@

Website:

Email:

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

i

AVSProductionCalibrationLibraryAPIReference

AboutThisDocument

AboutThisDocument

Purpose

Theanyviewstitching(AVS)calibrationlibraryisanefficientandhigh-performance

softwarelibraryonWindows.ThecalibrationlibraryprovidestheproductioncalibrationAPIsandconvertsthecalibrateddatatothelookuptable(LUT)thatcanbedirectlyusedonaboard.Thecalibrationlibraryinternallycompletesthecalibrationandprovidesuserswithflexibleandsimpleapplicationplatforminterfaces(APIs),makingiteasytodeveloptheapplicationsrequiredbythecalibrationofmulti-channelstitchingproducts.

Unlessotherwisestated,Hi3559CV100andHi3559AV100contentsareconsistent.

Unlessotherwisestated,Hi3556AV100andHi3519AV100contentsareconsistent.

RelatedVersion

Thefollowingtableliststheproductversionsrelatedtothisdocument.

IntendedAudience

Thisdocumentisintendedfor:

TechnicalsupportengineersSoftwaredevelopmentengineers

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

ii

ProductName

Version

Hi3559A

V100ES

Hi3559A

V100

Hi3559C

V100

Hi3519A

V100

Hi3556A

V100

AVSProductionCalibrationLibraryAPIReference

AboutThisDocument

SymbolConventions

Thesymbolsthatmaybefoundinthisdocumentaredefinedasfollows.

ChangeHistory

Changesbetweendocumentissuesarecumulative.Thelatestdocumentissuecontainsallthechangesmadeinearlierissues.

Issue00B03(2018-06-15)

Thisissueisthethirddraftrelease,whichincorporatesthefollowingchanges:

Insection3.2,thedescriptionintheMemberfieldHI_AVS_CAL_STITCH_MEASUREMENT_Sismodified.

Insection4.3.2,Table4-3ismodified.Sectionisadded.

Sections2.3,2.4,4.1.3,and4.3.3aremodified.

Issue00B02(2018-05-15)

Thisissueistheseconddraftrelease,whichincorporatesthefollowingchanges:Insection1.1,Table1-2ismodified.

Sections4.1.2,,,andaremodified.Insection4.1.3,Figure4-3ismodified.

Insection4.3.1,Table4-2ismodified.

Insection,specialrequirementsforcollectingdataforfisheyelenscalibrationareadded.Therequirementsforcollectingcalibrationdataaremodified.

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

iii

Symbol

Description

Alertsyoutoahighriskhazardthatcould,ifnotavoided,resultinseriousinjuryordeath.

Alertsyoutoamediumorlowriskhazardthatcould,ifnotavoided,resultinmoderateorminorinjury.

Alertsyoutoapotentiallyhazardoussituationthatcould,ifnotavoided,resultinequipmentdamage,dataloss,performancedeterioration,orunanticipatedresults.

Providesatipthatmayhelpyousolveaproblemorsavetime.

Providesadditionalinformationtoemphasizeorsupplementimportantpointsinthemaintext.

AVSProductionCalibrationLibraryAPIReference

AboutThisDocument

Chapter5isadded.

Issue00B01(2018-01-31)

Thisissueisthefirstdraftrelease.

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

iv

AVSProductionCalibrationLibraryAPIReference

Contents

Contents

AboutThisDocument ii

Overview 1

Introduction 1

FunctionDescriptionConventions 2

FunctionSummary 3

StructureDescriptionConventions 3

APIFunction 4

hiAVS_Version 4

hiAVS_CalProd 5

hiAVS_LutFromCalibration 7

hiAVS_PolyFromCalibration 10

DataTypesandDataStructures 13

GenericDataTypes 13

DataStructures 14

DevelopmentGuide 18

AVSCalibrationSolution 18

Introduction 18

NetworkingEnvironment 19

WorkflowoftheProductionCalibrationLibrary 19

PreparingfortheDevelopment 20

UsingOpenCV 20

DevelopingaProductionCalibrationLibrary 22

UsingtheAVSCalibrationLibrary 24

RunningtheAVSCalibrationLibrary 24

UsingtheAVSCalibrationLibrary 25

PTGuiandHuginCalibration 32

GeneratinganLUTandaBboxList 36

APIApplicationInstances 39

ApplicationProcessoftheCalibrationLibrary 39

ExampleofaCompleteSample 39

DependencyConditionsforSampleCompilationandRunning 42

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

v

AVSProductionCalibrationLibraryAPIReference

Figures

Figures

Figure2-1hiAVS_CalProdworkflow 6

Figure2-2hiAVS_CalProdinputexample 6

Figure2-3FilesrequiredforLUTconversion(example) 9

Figure4-1AVScalibrationsolutiondiagram 18

Figure4-2Productioncalibrationnetworking 19

Figure4-3WorkflowoftheAVScalibrationlibrary 20

Figure4-4ProductioncalibrationintheAVScalibrationworkflow 25

Figure4-5Productioncalibrationenvironment 26

Figure4-6Productioncalibrationenvironmentforthedual-fisheyestructure 27

Figure4-7ConfiguringRadialCROPbeforeproductioncalibrationofthefisheyelens 27

Figure4-8ConfiguringRadialCROPinHiSiliconPQTools 28

Figure4-9Edge-blurredimagethatneedsRadialCROPconfiguration 29

Figure4-10RadialCROPeffectpreviewofimageswithdifferentradiuses 30

Figure4-11Third-partycalibrationintheAVScalibrationworkflow 33

Figure4-12PTGuicalibrationworkflow 33

Figure4-13ExportingthePTGuicalibrationresult 34

Figure4-14Hugincalibrationworkflow 34

Figure4-15LUTandBboxlistgenerationintheAVScalibrationworkflow 36

Figure4-16Maskimageexamples 37

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

vi

AVSProductionCalibrationLibraryAPIReference

Tables

Tables

Table1-1SDKcomponentsoftheAVScalibrationlibrary 1

Table1-2DevelopmentandoperatingenvironmentsoftheAVScalibrationlibrary 2

Table1-3Functiondescriptionconventions 2

Table1-4Functionsummary 3

Table1-5Structuredescriptionconventions 3

Table4-1CommonconfigurationitemsofaVS2015project 23

Table4-2DynamiclibrariesthattheAVScalibrationlibrarydependson 24

Table4-3Evaluatingtheproductioncalibrationresult 32

Table4-4Differencesbetweentheconversionresults 32

Table4-5Differencesbetweentheconversionresults 35

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

vii

AVSProductionCalibrationLibraryAPIReference

1Overview

1

Overview

1.1Introduction

TheAVScalibrationlibraryisanefficientandhigh-performancesoftwarelibraryonWindows.TheAVScalibrationlibraryinternallycompletestheproductioncalibrationandconvertsthecalibrateddataintotheLUTthatcanbedirectlyusedontheboard.ItalsoprovidesuserswithflexibleandsimpleAPIsforrapidapplicationdevelopment,facilitatingthecalibrationofmulti-channelstitchingproducts.

YoucanusetheAVScalibrationlibraryonWindowsintwoforms,thestaticlibraryandthedynamiclibrary,makingiteasyforapplicationdevelopment.Table1-1describesthemaincomponentsoftheAVScalibrationlibrary.

Table1-1SDKcomponentsoftheAVScalibrationlibrary

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

1

Component

Name

Description

API

hi_type.h

hi_avs_prod_calib

.h

Inauserproject,hi_type.hmustbeincludedbeforehi_avs_prod_calib.h.

Staticlibrary

HiAVSCalibrationLib_release.lib

HiAVSCalibrationLib_release.libmustbelinkedtotheuserproject.Forexample,ifyouuseVisualStudio2015(VS2015,forshort),HiAVSCalibrationLib_release.libmustbeaddedtotheProject/Properties/Linker/Inputdirectory.

Dynamiclibrary

HiAVSCalibrationLib_release.lib

HiAVSCalibrationLib_release.dll

HiAVSCalibrationLib_release.libmustbelinkedtotheuserproject.Fordetailsofthelinkingmethod,seetheprecedingdescriptionofthestaticlibrary.

Afterthecompilationiscomplete,savetheHiAVSCalibrationLib_release.dllfileintheexecutiondirectoryorsystemdirectory.

Other

OpenCV3.4.0

Thethird-partyopen-sourcedevelopmentlibraryrequiredisnotincludedinthereleasepackage.Youcandownloadthelibraryat

.

AVSProductionCalibrationLibraryAPIReference

1Overview

ApplicationsbasedontheAVScalibrationlibrarycanbedevelopedinvariouscompilationenvironments,compatiblewithWindows7orlatermainstreamWindowsoperatingsystems(OSs)fromMicrosoftandmainstreamCPUchipsetsfromIntelandAMD.Table1-2describestheprimarydevelopmentandoperatingenvironments.

Table1-2DevelopmentandoperatingenvironmentsoftheAVScalibrationlibrary

1.2FunctionDescriptionConventions

Table1-3Functiondescriptionconventions

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

2

ParameterField

Description

Description

DescribesthefunctionofanAPI.

Syntax

DescribesthesyntaxofanAPI.

Description

DescribestheworkflowofanAPI.

Parameter

DescribestheparametersandattributesofanAPI.

Returnvalue

DescribesthereturnvaluesofanAPI.

Errorcode

Describesthefunctionerrorcodes.

Requirement

Describestheheaderfiledependencyofafunction.

Note

DescribestheprecautionsforusinganAPI.

Example

Describesacodeimplementationsample.

Seealso

Listsrelevantdatastructuresandfunctions.

Category

CompatibleEnvironment

RecommendedEnvironment

Description

Compiler

VisualStudioseries

VisualStudio2015

OnlyVS2015,VS2017,ora

laterversionofOpenCV3.4.0canbeused.Theofficially-releasedOpenSourceComputerVisionLibrary(OpenCV)versioninformationisusedasthestandard.

OS

Windows7

Windows10

Windows7

Windows10

Onlythe64-bitversionsoftheWindowsOSaresupportedtoguaranteetheperformance.

Hardware

IntelCoreseries

AMDAthlonseries

HighPerformanceWorkstation(HPW)

None

AVSProductionCalibrationLibraryAPIReference

1Overview

1.3FunctionSummary

Table1-4Functionsummary

1.4StructureDescriptionConventions

Table1-5Structuredescriptionconventions

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

3

ParameterField

Description

Description

Describesthefunctionofadatastructure.

Syntax

Describesthesyntaxofadatastructure.

Member

Describesthemembersofadatastructure.

Note

Describestheprecautionsforusingadatastructure.

Seealso

ListsrelevantdatastructuresandAPIs.

Function

Description

Page

hiAVS_Version

ObtainstheversionnumberofanAVScalibrationlibrary.

2.1

hiAVS_CalProd

DefinesthealgorithmAPIforproductioncalibration.

2.2

hiAVS_LutFromCalibration

ConvertsthegeneratedcalibrationfileintoanLUTthatcanbedirectlyused.

2.3

hiAVS_PolyFromCalibration

Convertsthegeneratedcalibrationfileintoaboundingbox(Bbox)list,requiredonlybytheHi3559AV100ES.

2.4

AVSProductionCalibrationLibraryAPIReference

2APIFunction

2

2.1hiAVS_Version

[Description]

ObtainstheversionIDofanAVScalibrationlibrary.[Syntax]

APIFunction

HI_S32hiAVS_Version(HI_CHAR

cAVSCalibVersion[128]),

[Parameter]

[ReturnValue]

[ErrorCode]

[Requirement]

Headerfiles:hi_type.h,hi_avs_prod_calib.h

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

4

APIReturnValue

Description

HI_SUCCESS

Success

HI_FAILURE

Failure

ReturnValue

Description

0

Success

Othervalues

Failure

Parameter

Description

Input/Output

cAVSCalibVersion

StorestheobtainedversionIDofanAVScalibrationlibrary.

Input

AVSProductionCalibrationLibraryAPIReference

2APIFunction

Libraryfile:HiAVSCalibrationLib_release.lib[Note]

Includehi_type.hbeforehi_avs_prod_calib.h.[Example]

HI_CHARcAVSCalibVersion[128];hiAVS_Version(cAVSCalibVersion);

cout<<"WelcometoHisiAVSCalibration

"<<cAVSCalibVersion<<endl;

[SeeAlso]

None

2.2hiAVS_CalProd

[Description]

DefinesthealgorithmAPIforproductioncalibration.[Syntax]

HI_AVS_STATUS_E

pcInputCalFile,

hiAVS_CalProd(HI_U32u32Camera,constHI_CHAR*

constHI_CHAR

pcCalImage[],

*pcOutputCalFile,HI_FLOATfFixtureRadius,

constHI_CHAR

*

HI_AVS_CAL_STITCH_MEASUREMENT_S

&stResult),

[Parameter]

[ReturnValue]

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

5

Parameter

Description

Input/Output

u32Camera

NumberofAVSlensesValuerange:[2,6]

Input

pcInputCalFile

Calibrationfile(.cal)generatedbasedonthelensmodel

Input

pcOutputCalFile

Calibrationfile(.cal)outputfromtheproductioncalibrationalgorithm

Output

fFixtureRadius

Radiusoftheproductioncalibrationenvironment(unit:m)

Valuerange:[0.2,20]

Input

pcCalImage

ImagestobecalibratedandthefullfilepathsTheimagecountequalsthevalueof

u32Camera.

Input

stResult

Datausedtoreviewtheevaluationofalgorithmcalibration

Output

AVSProductionCalibrationLibraryAPIReference

2APIFunction

[Requirement]

Headerfiles:hi_type.h,hi_avs_prod_calib.h[Note]

Includehi_type.hbeforehi_avs_prod_calib.h.

ThisAPIdependsonthemodelcalibrationinputs,andthecalibrationresultneedstobeconvertedbeforeapplication.Figure2-1showstheworkflowofthisAPI.

Figure2-1hiAVS_CalProdworkflow

Productioncalibrationrequiresthemodelcalibrationfileandtheimagestobecalibrated(imagesattheoverlappingareaofthelenses),asshowninFigure2-2.

Figure2-2hiAVS_CalProdinputexample

ThemodelcalibrationfilerequiredisthecalibrationfileoutputfromHiSiliconPQToolsaftermodelcalibration.Theimagestobecalibratedneedtobecapturedincertainenvironments.

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

6

Modelcalibration:HiSiliconPQTools

AVScalibrationlibrary

LUTgeneration:

hiAVS_LutFromCalibration

Bboxlistgeneration:

hi_avs_poly_from_calibration(RequiredonlybytheHi3559AV100ES)

Productioncalibration:hiAVS_CalProd

ReturnValue

Description

0

Success

Othervalues

Failure.Fordetails,seeHI_AVS_STATUS_E

AVSProductionCalibrationLibraryAPIReference

2APIFunction

Fordetailsabouttheevaluationofthecalibrationresult,seeHI_AVS_CAL_STITCH_MEASUREMENT_S.

Anewcalibrationfile(.cal)isgeneratedafterproductioncalibration.Next,callhiAVS_LutFromCalibrationtoconvertthegenerated.calfiletoaLUTandhiAVS_PolyFromCalibrationtoconvertthegenerated.calfiletoaBboxlist.(TheBboxlistisrequiredonlybytheHi3559AV100ES.)Then,importtheLUT(andtheBboxlist)tothecameradevicethroughtheSDKMPI.

[Example]

constHI_CHAR*pcCalImage[2];

HI_AVS_CAL_STITCH_MEASUREMENT_S

stResult;

pcCalImage[0]pcCalImage[1]HI_S32s32Ret

2,

"..\\..\\test\\for_prod_cal\\camera_0.jpg";

=

="..\\..\\test\\for_prod_cal\\camera_1.jpg";

=

hiAVS_CalProd(

"..\\..\\test\\for_prod_cal\\prod_step1.cal","..\\..\\test\\for_prod_cal\\prod_step1_V4.cal",(HI_FLOAT)1.1,

pcCalImage,

stResult);

cout

coutcout

<<"ret="<<s32Ret<<endl;

<<"maximum_reproj_err:"<<stResult.dMaxReprojErr<<endl;

<<"average_reproj_err:"<<stResult.dAverageReprojErr<<endl;

cout<<"total_matched_points:"<<stResult.dTotalMatchedPoints<<endl;

[SeeAlso]

HI_AVS_CAL_STITCH_MEASUREMENT_S

hiAVS_LutFromCalibrationhiAVS_PolyFromCalibration

2.3hiAVS_LutFromCalibration

[Description]

ConvertsthegeneratedcalibrationfileintoanLUTthatcanbedirectlyused.Therearethreesourceoptionsforthecalibrationfile:modelcalibration,thehiAVS_CalProdAPI,andthird-partycalibrationtoolsPTguiandHugin.

[Syntax]

HI_AVS_STATUS_EhiAVS_LutFromCalibration(constHI_CHAR*

pcCalibrationFile,constHI_CHAR*pcMaskPrefix,

constHI_CHAR*

pcOutputPrefix,HI_FLOATfStitchDistance,HI_AVS_LUT_ACCURACY_E

enLutAccuracy,HI_BOOLbIsHiAvsCal),

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

7

AVSProductionCalibrationLibraryAPIReference

2APIFunction

[Parameter]

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

8

Parameter

Description

Input/Output

pcCalibrationFile

Pathofthecalibrationfilegeneratedbymodelcalibration,hiAVS_CalProd,orthird-partycalibrationtoolsPTguiandHugin

Input

pcMaskPrefix

Prefixofthemaskfiledefiningtheeffectiveimagingregionforeachlens

Thefilenameofeachmaskimageissuffixedwith_naftertheprefix.Thecameraindexedbynusesthemaskfilenamedprefix_n.png.Theindexstartsat0.Theresolutionofthemaskimageshouldbethesameasthatofthecamera.Inamaskimage,regionscoveredwithwhitepixelsaretheeffectivedisplayregions,whileregionscoveredwithblackpixelsarethemaskedregions.Forthenon-fisheyelens,themaskimagecanexclusivelyusewhitepixels.Forthefisheyelens,thecircularregioninthemaskimagecoveredwithwhitepixelsisthesameastheeffectivedisplayregionofthelens.Amaskfilecanonlybea.pngimage.

Input

pcOutputPrefix

PrefixoftheLUTfileoutputfromeachlens

ThefilenameofeachLUTissuffixedwith_naftertheprefixasprefix_n.bin,where,nindicatestheindexofacameraandtheindexstartsat0.

Output

fStitchDistance

OptimalstitchingdistanceforaHiSiliconcalibrationresultgeneratedwithhiAVS_CalorhiAVS_CalProd(unit:m)AcorrespondingLUTcanbegeneratedaccordingtothisparameter.Thevaluemustbegreaterthan0.5.

Forthird-partycalibration,thisparameterisinvalid,andthecalibrationeffectdependsonthecalibration.

Input

enLutAccuracy

LUTprecision

0:Hi_AVS_LUT_ACCURACY_HIGH

1:Hi_AVS_LUT_ACCURACY_LOW

Highprecisionrequireshighperformance.Therefore,youareadvisedtoconfigurethisparameterbasedontheactualperformanceoftheproduct.

Input

bIsHiAvsCal

WhethertousethecalibrationfilegeneratedwithhiAVS_CalorhiAVS_CalProdbytheHiSiliconAVScalibrationlibrary

IftheHiSiliconAVScalibrationlibraryisnotused,thecalibrationfilecomesfromthethird-partycalibration(a*.ptofile).

Input

AVSProductionCalibrationLibraryAPIReference

2APIFunction

[ReturnValue]

[Requirement]

Headerfiles:hi_type.h,hi_avs_prod_calib.hLibraryfile:HiAVSCalibrationLib_release.lib

[Note]

ThisAPIappliestoallcalibrationresults(includingthecalibrationresultsgeneratedbymodelcalibration,hiAVS_CalProd,andthird-partycalibration)forLUTconversion.

Figure2-3showsthefilesrequiredforLUTconversion.

Figure2-3FilesrequiredforLUTconversion(example)

Amaskfilemustbeconfiguredwithitsfullpathprefix.Currently,maskfilesinPNGformataresupportedonly.Youcanuseanimageprocessingtool(suchasMicrosoftPaintandPhotoshop)asrequiredtosaveanimageasa.pngfile.Fordetailsabouthowtogenerateamaskfile,seesection4.3.4"GeneratinganLUTandaBboxList."

[Example]

HI_CHAR

cCalibrationFile[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye.cal";

HI_CHARcMaskPrefix[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye_mask";

HI_CHAR

cOutputPrefix[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye_Poly;

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

9

ReturnValue

Description

0

Success

Othervalues

Failure.Fordetails,seeHI_AVS_STATUS_E

AVSProductionCalibrationLibraryAPIReference

2APIFunction

HI_FLOATfStitchDistance

=

4;

HI_AVS_LUT_ACCURACY_EenLutAccuracyHI_BOOLbIsHiAvsCal=HI_TRUE;

HI_S32s32Ret=

=HI_AVS_LUT_ACCURACY_HIGH;

hiAVS_LutFromCalibration(cCalibrationFile,cMaskPrefix,cOutputPrefix,fStitchDistance,enLutAccuracy,bIsHiAvsCal);

if(s32Ret!=HI_SUCCESS)

{

coutcoutcoutcoutcoutcout

cout

<<

<<

<<

<<

<<

<<

<<

"!!Error:"<<LINE<<",ret="<<s32Ret<<endl;"\t\tcCalibrationFile:"<<cCalibrationFile<<endl;"\t\tcMaskPrefix:"<<cMaskPrefix<<endl;"\t\tcOutputPrefix:"<<cOutputPrefix<<endl;"\t\tfStitchDistance:"<<fStitchDistance<<endl;"\t\tfenLutAccuracy:"<<enLutAccuracy<<endl;

"\t\tbIsHiAvsCal:"<<bIsHiAvsCal<<endl;

}

else

{

cout

<<

"\tsuceess"<<endl;

}

[SeeAlso]

HI_AVS_STATUS_EHI_AVS_LUT_ACCURACY_E

hiAVS_CalProd

2.4hiAVS_PolyFromCalibration

[Description]

ConvertsthegeneratedcalibrationfileintoaBbox,requiredonlybytheHi3559AV100ES.[Syntax]

HI_AVS_STATUS_EhiAVS_PolyFromCalibration(constHI_CHAR*pcCalibrationFile,constHI_CHAR*pcMaskPrefix,constHI_CHAR*

pcOutputPrefix,HI_FLOATfStitchDistance,HI_BOOLbIsHiAvsCal);

[Parameter]

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

10

Parameter

Description

Input/Output

pcCalibrationFile

Pathofthecalibrationfilegeneratedbymodelcalibration,hiAVS_CalProd,orthird-partycalibrationtools

Input

AVSProductionCalibrationLibraryAPIReference

2APIFunction

[ReturnValue]

[Requirement]

Headerfiles:hi_type.h,hi_avs_prod_calib.hLibraryfile:HiAVSCalibrationLib_release.lib

[Note]

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

11

ReturnValue

Description

0

Success

Othervalues

Failure.Fordetails,seeHI_AVS_STATUS_E

Parameter

Description

Input/Output

pcMaskPrefix

Prefixofthemaskfiledefiningtheeffectiveimagingregionforeachlens

Thecameraindexedbynusesthemaskfilenamedprefix_n.png.Thefilenameofeachmaskimageissuffixedwith_naftertheprefix.Theresolutionofthemaskimageshouldbethesameasthatofthecamera.Inamaskimage,regionscoveredwithwhitepixelsaretheeffectivedisplayregions,whileregionscoveredwithblackpixelsarethemaskedregions.Forthenon-fisheyelens,themaskimagecanexclusivelyusewhitepixels.Forthefisheyelens,thecircularregioninthemaskimagecoveredwithwhitepixelsisthesameastheeffectivedisplayregionofthelens.Amaskfilecanonlybea.pngimage.

Input

pcOutputPrefix

PrefixoftheLUTfileoutputfromeachlens

ThefilenameofeachLUTissuffixedwith_naftertheprefixasprefix_n.bin,where,nindicatestheindexofacameraandtheindexstartsat0.

Output

fStitchDistance

OptimalstitchingdistanceforaHiSiliconcalibrationresultgeneratedwithhiAVS_CalorhiAVS_CalProd(unit:m)AcorrespondingLUTcanbegeneratedaccordingtothisparameter.Thevaluemustbegreaterthan0.5.

Forthird-partycalibration,thisparameterisinvalid,andthecalibrationeffectdependsonthecalibration.

Input

bIsHiAvsCal

WhethertousethecalibrationfilegeneratedwithhiAVS_CalorhiAVS_CalProdbytheHiSiliconAVScalibrationlibrary.

IftheHiSiliconAVScalibrationlibraryisnotused,thecalibrationfilecomesfromthethird-partycalibration(a*.ptofile).

Input

AVSProductionCalibrationLibraryAPIReference

2APIFunction

ThisMPIappliesonlytotheHi3559AV100ES.[Example]

HI_CHAR

cCalibrationFile[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye.cal";

HI_CHARcMaskPrefix[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye_mask";

HI_CHAR

cOutputPrefix[]="D:\\WORK\\AVS\\AVSPCalibrationLib\\PQT\\test\\for_mesh_poly\\2fisheye_Poly";

HI_FLOATfStitchDistance

=

4;

HI_BOOLbIsHiAvsCal=HI_TRUE;HI_S32s32Ret=

hiAVS_PolyFromCalibration(cCalibrationFile,cMaskPrefix,cOutputPrefix,fStitchDistance,bIsHiAvsCal);

if(s32Ret!=HI_SUCCESS)

{

coutcoutcoutcoutcout

cout

"!!Error:"<<LINE<<",ret="<<s32Ret<<endl;"\t\tcCalibrationFile:"<<cCalibrationFile<<endl;"\t\tcMaskPrefix:"<<cMaskPrefix<<endl;

"\t\tcOutputPrefix:"<<cOutputPrefix<<endl;

<<

<<

<<

<<

<<

<<

"\t\tfStitchDistance:"<<fStitchDistance<<

endl;

"\t\tbIsHiAvsCal:"<<

bIsHiAvsCal

<<

endl;

}

else

{

cout

<<

"\tsuceess"<<endl;

}

[SeeAlso]

HI_AVS_STATUS_EHI_AVS_LUT_ACCURACY_E

hiAVS_CalProd

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

12

AVSProductionCalibrationLibraryAPIReference

3DataTypesandDataStructures

3

DataTypesandDataStructures

3.1GenericDataTypes

OnWindows,thegenericdatatypesaredefinedinthehi_type.hfile.BeforeyoucallanMPI,includehi_type.hfirst.Thedefinitionisasfollows:

typedeftypedeftypedeftypedeftypedeftypedeftypedef#ifndeftypedeftypedef#elsetypedeftypedef#endiftypedeftypedeftypedeftypedeftypedeftypedef

typedef

unsignedunsignedunsigned

unsigned

charcharshort

int

HI_U8;HI_UCHAR;HI_U16;HI_U32;HI_S8;

HI_S16;

HI_S32;

signedshortint

_M_IX86

unsignedlonglong

char

long

long

HI_U64;

HI_S64;

int64

int64

HI_U64;

HI_S64;

charchar*floatdoublevoidunsigned

unsigned

HI_CHAR;HI_PCHAR;HI_FLOAT;HI_DOUBLE;HI_VOID;

HI_SIZE_T;

HI_LENGTH_T;

long

long

/*

*

*const

*

defination

*

*/

typedef

enum

{HI_FALSE=0,

HiSiliconProprietaryandConfidentialCopyright?HiSiliconTechnologiesCo.,Ltd.

Issue00B03(2018-06-15)

13

AVSProductionCalibrationLibraryAPIReference

3DataTypesandDataStructures

HI_TRUE

}HI_BOOL;

=

1,

#ifndef#define#endif#define#define#define

#define

NULL

NULL

0L

HI_NULLHI_NULL_PTRHI_SUCCESS

HI_FAILURE

0L

0L

0

(-1)

3.2DataStructures

HI_AVS_STATUS_E:DefinesthereturnstatusoftheMPIfortheAVScalibrationalgorithmlibrary.

HI_AVS_CAL_STITCH_MEASUREMENT_S:Definesthedatausedtoevaluatetheresultofthecalibrationalgorithm.

HI_AVS_LUT_ACCURACY_E:DefinestheLUTprecision.

HI_AVS_STATUS_E

[Description]

Definestheret

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論