版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 园林环保材料应用方案
- 公司固定资产条码管理系统
- 人力资源转租赁合同范本2026
- 2025-2030年私募投资行业跨境出海战略分析研究报告
- 互联网内容审核职业道德承诺书
- 新形势下布贴行业顺势崛起战略制定与实施分析研究报告
- 2025-2030年高效节水灌溉系统行业跨境出海战略分析研究报告
- 2025-2030年热熔机行业跨境出海战略分析研究报告
- 企业竞业限制协议管理与提醒系统
- 2025-2030年激光划片机行业跨境出海战略分析研究报告
- 半导体光电子器件PPT完整全套教学课件
- 七年级期中考试家长会课件
- 糖尿病的中医分类与辩证施治
- 造价咨询投标服务方案
- 特殊疾病儿童预防接种问题探讨
- 英语 Unit9Wherewillyougo的教学反思
- GB/T 3292.1-2008纺织品纱线条干不匀试验方法第1部分:电容法
- 突发环境事件应急隐患排查治理制度
- 第6章双离合器变速器结构与原理课件
- 新版抗拔桩裂缝及强度验算计算表格(自动版)
- 硫化成型日报点检表(橡胶)
评论
0/150
提交评论