示例#1
0
        private bool InitAlg()
        {
            Global.LogServer.Add(new LogInfo("Debug", "main->SP_InitAlg 识别算法初始化开始", (int)EnumLogLevel.DEBUG));
            TH_PlateIDCfg th_PlateIDCfg = new TH_PlateIDCfg();

            th_PlateIDCfg.nMaxPlateWidth = 400;
            th_PlateIDCfg.nMinPlateWidth = 60;

            th_PlateIDCfg.nMaxImageWidth  = 2000;
            th_PlateIDCfg.nMaxImageHeight = 1100;

            th_PlateIDCfg.nFastMemorySize = 16000;                           //DSP内存大小
            th_PlateIDCfg.pFastMemory     = Marshal.AllocHGlobal(16000);     //DSP申请内存
            th_PlateIDCfg.pMemory         = Marshal.AllocHGlobal(100000000); //申请普通内存
            th_PlateIDCfg.nMemorySize     = 100000000;
            th_PlateIDCfg.bUTF8           = 0;
            th_PlateIDCfg.bShadow         = 1;
            th_PlateIDCfg.bCarLogo        = 0;
            th_PlateIDCfg.bLeanCorrection = 1;
            th_PlateIDCfg.bCarModel       = 0;
            //TODO 注意模式切换
            th_PlateIDCfg.bOutputSingleFrame = 1;
            th_PlateIDCfg.bMovingImage       = 0; //0 识别静止图片,1识别动态视频(结果输出延时)


            int lenth = Marshal.SizeOf(th_PlateIDCfg);
            int ret   = SPlate.SP_InitAlg(ref th_PlateIDCfg, lenth);

            Global.LogServer.Add(new LogInfo("Debug", "main->SP_InitAlg 识别算法初始化完成,返回值:" + ret.ToString(), (int)EnumLogLevel.DEBUG));
            if (ret == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public static extern int SP_InitAlg(ref TH_PlateIDCfg pPlateConfig, int lenth);