




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度公司車輛租賃與車隊管理服務合同
- 2025版建筑工程質量保修服務協(xié)議
- 2025版廣告設計承包合同協(xié)議書
- 二零二五年度建筑勞務木工分包合同綠色施工技術與材料范本
- 二零二五年度綠色建筑評價體系設計合同示范文本GF
- 2025版建筑工程造價咨詢居間服務合同(甲方范本)
- 二零二五年度家庭財產(chǎn)分割與子女撫養(yǎng)合同范本
- 二零二五年度創(chuàng)新型企業(yè)廠房轉租合同
- 2025版離婚協(xié)議書與子女撫養(yǎng)及財產(chǎn)分割執(zhí)行協(xié)議
- 二零二五年度汽車行業(yè)勞務派遣合同終止模板
- 買房尾款結清合同范本
- 2024屆貴州省遵義市紅花崗區(qū)小升初數(shù)學高頻考點檢測卷含解析
- 小學體育訓練記錄表
- 高中政治必刷題 高考真題 必修3《政治與法治》(原卷版)
- 知識題庫-人社勞動知識競賽測試題及答案(十一)
- 2024年四川省南充市道鑫雙語學校小升初必考題語文檢測卷含答案
- 《政治學概論》教學課件(總)
- 2024年昆山國創(chuàng)投資集團有限公司招聘筆試參考題庫附帶答案詳解
- 【真題】2023年淮安市中考道德與法治試卷(含答案解析)
- 中國慢性腎臟病患者高血壓管理指南(2023年版)解讀
- 工業(yè)污水處理廠項目經(jīng)濟效益和社會效益分析報告
評論
0/150
提交評論