<?xml version="1.0" encoding="utf-8"?>
<MagicLivephotoConfig version="2.0.3.0">
    <ByPass description="0: Not bypass, 1: magic-full-bypass, 2: magic-sd-bypass">0</ByPass>
    <Align description="align information">
        <FeatureTrack description="feature track information">
            <MaxCorners>1000</MaxCorners>
            <MaxCandidateCorners>32768</MaxCandidateCorners>
            <MinDistance>16</MinDistance>
            <HarrisK use='0'>0.04</HarrisK>
            <QualityLevel>0.01</QualityLevel>
        </FeatureTrack>
        <GlobalAlign description="global align information">
            <LKEpsilon>0.01</LKEpsilon>
            <LKMaxIter>20</LKMaxIter>
            <LKNumRatio>0.7</LKNumRatio>
            <RansacMaxIter>100</RansacMaxIter>
            <RansacConfidence>0.9950</RansacConfidence>
            <RansacThreshold>3</RansacThreshold>
            <MinPointsNum>50</MinPointsNum>
            <UseRegion>0</UseRegion>
            <Ratio>0.5</Ratio>
            <SwitchRegionDigitalZoom>4</SwitchRegionDigitalZoom>
            <DeltaPad>32</DeltaPad>
            <RandomDisturbDigitalZoom use="1">1</RandomDisturbDigitalZoom>
            <HMat02_s_es>28.0</HMat02_s_es>
            <HMat12_s_es>28.0</HMat12_s_es>
        </GlobalAlign>
    </Align>
    <Brain description="live brain information">
        <ModelsInfo descrption="live brain model info">
            <AimeModelInfo>
                <ModelPath use="1" eng="10" dev="4">livephoto_aime.vdnn</ModelPath>
                <ModelInputNodes>x1,x2</ModelInputNodes>
                <ModelOutputNodes>depth/to/space</ModelOutputNodes>
            </AimeModelInfo>
        </ModelsInfo>
        <maxIqeType>0</maxIqeType>
        <eisCropRatio>0.1</eisCropRatio>
        <frameBlurPixelThreshold>20.0</frameBlurPixelThreshold>
        <iqaThreshold>0.6</iqaThreshold>
        <warpOverlapThreshold>0.6</warpOverlapThreshold>
        <localInlierThreshold>0.9</localInlierThreshold>
        <secondInlierThreshold>0.7</secondInlierThreshold>
        <maxGetBlockNum>20</maxGetBlockNum>
        <globalInlierThreshold>0.7</globalInlierThreshold>
        <blockSimilarityThreshold>0.6</blockSimilarityThreshold>
        <blockSimilarityThresholdLowerBound>0</blockSimilarityThresholdLowerBound>
        <passRateThreshold>0.5</passRateThreshold>
        <zoomRatioThreshold>15</zoomRatioThreshold>
    </Brain>
    <Tone description="tone information">
        <ModelsInfo descrption="tone model info">
            <CommonModelInfo>
                <ModelPath use="1">livephoto_tone_common.vdnn</ModelPath>
            </CommonModelInfo>
            <PortraitModelInfo>
                <ModelPath use="1">livephoto_tone_portrait.vdnn</ModelPath>
            </PortraitModelInfo>
        </ModelsInfo>
        <lut3dDataInfo>
            <commonlut3dPath>livephoto_tone_common_lut.bin</commonlut3dPath>
            <portraitlut3dPath>livephoto_tone_portrait_lut.bin</portraitlut3dPath>
            <lut3dDataSize>3234330</lut3dDataSize>
        </lut3dDataInfo>
        <highLightK>1.2</highLightK>
    </Tone>
    <DR description="dr information">
        <bypassDR>1</bypassDR>
        <warpOverLapThres>0.9</warpOverLapThres>
        <OverexpDetectA description="Target video frame over exposure detect">
            <isOverexp>1</isOverexp>
            <chOverexpThres>0.98</chOverexpThres>
            <yOverexpThres>0.9</yOverexpThres>
            <areaThres1>21</areaThres1>
            <areaThres2>31</areaThres2>
            <openKernelSize>3</openKernelSize>
            <closeKernelSize>5</closeKernelSize>
            <overexpAreaThres>200</overexpAreaThres>
        </OverexpDetectA>
        <OverexpDetectB description="Reference video frame over exposure detect">
            <isOverexp>1</isOverexp>
            <chOverexpThres>0.9</chOverexpThres>
            <yOverexpThres>0.8</yOverexpThres>
            <areaThres1>21</areaThres1>
            <areaThres2>31</areaThres2>
            <openKernelSize>3</openKernelSize>
            <closeKernelSize>5</closeKernelSize>
            <overexpAreaThres>200</overexpAreaThres>
        </OverexpDetectB>
        <GhostDetect description="Ghost detect">
            <isGhostDetect>1</isGhostDetect>
            <areaThres>13</areaThres>
            <openKernelSize>3</openKernelSize>
            <closeKernelSize>5</closeKernelSize>
            <totalGhostAreaThres>3000</totalGhostAreaThres>
        </GhostDetect>
        <ModelsInfo descrption="dr model info">
            <SingleModelInfo>
                <ModelPath use="1" overlap="16" overlapFusion="1">livephoto_dr.vdnn</ModelPath>
            </SingleModelInfo>
        </ModelsInfo>
    </DR>
    <Fusion description="fusion information">
        <ModelsInfo descrption="fusion model info">
            <SingleModelInfo>
                <ModelPath use="1" overlap="8" overlapFusion="1">livephoto_fusion.vdnn</ModelPath>
                <SessionNum>2</SessionNum>
            </SingleModelInfo>
        </ModelsInfo>
    </Fusion>
    <Get description="get information">
        <ModelsInfo descrption="get model info">
            <SingleModelInfo>
                <ModelPath use="1" overlap="8" overlapFusion="1">livephoto_get.vdnn</ModelPath>
            </SingleModelInfo>
        </ModelsInfo>
    </Get>

    <Single description="single frame enhance">
        <ModelsInfo descrption="single model info">
            <SrModelInfo>
                <ModelPath use="1" overlap="16" overlapFusion="1">livephoto_sr.vdnn</ModelPath>
            </SrModelInfo>
            <DictModelInfo>
                <ModelPath use="1" overlap="16" overlapFusion="1">livephoto_dict.vdnn</ModelPath>
            </DictModelInfo>
        </ModelsInfo>
        <dictWidth>2816</dictWidth>
        <dictHeight>2112</dictHeight>
        <!-- <MagicPraam>
            <ModelDir>/vendor/camera3rd/nti/nice_magic</ModelDir>
            <XmlPath>/vendor/camera3rd/nti/nice_magic/NiceMagicConfig.xml</XmlPath>
        </MagicPraam> -->
    </Single>

    <Tdr description="tdr frame transform">
        <VNiceTCDECreateArg>
            <tcdeConfigRoot>/vendor/camera3rd/nti/nice_tcde/xml</tcdeConfigRoot>
            <tcdeModelDir>/vendor/camera3rd/nti/nice_tcde/model</tcdeModelDir>
            <tcdeSceneConfigXmlName>/sceneconfig/NiceTCDESceneConfig_Common.xml</tcdeSceneConfigXmlName>
            <tcdeGpuBinPath>/vendor/camera3rd/nti/nice_tcde/model</tcdeGpuBinPath>
        </VNiceTCDECreateArg>
        <VNiceTCDEInitArg>
            <digitalZoomRatio>1</digitalZoomRatio>
        </VNiceTCDEInitArg>
    </Tdr>

    <SPE description="Scene Perception Engine">
        <ModelPath>/vendor/camera3rd/nti/nice_magic/bokeh.vdnn</ModelPath>
    </SPE>
</MagicLivephotoConfig>