Exemplo n.º 1
0
        private static SerializeObject ProcessPhoto(SerializeObject anprInfo)
        {
            var anpr  = new cmAnpr("default");
            var image = new gxImage("default");

            image.Load(anprInfo.PhotoPath);

            if (!anpr.FindFirst(image))
            {
                throw new NotFoundPhotoException($"Nie znaleziono zdjęcia o ścieżce: {anprInfo.PhotoPath}");
            }
            var frame = anpr.GetFrame();

            anprInfo.Vehicles.First().PlateLPR   = anpr.GetText();
            anprInfo.Vehicles.First().Confidence = anpr.GetConfidence();
            anprInfo.Vehicles.First().PlateX     = frame.x1;
            anprInfo.Vehicles.First().PlateY     = frame.y1;
            //anprInfo.Vehicles.First().PlateHeight = ;
            //anprInfo.Vehicles.First().PlateWidth = ;

            //while (anpr.FindNext())
            //{
            //    frame = anpr.GetFrame();
            //    anprInfo.Vehicles.Add(new Vehicle
            //    {
            //        PlateLPR = anpr.GetText(),
            //        Confidence = anpr.GetConfidence(),
            //        PlateX = frame.x1,
            //        PlateY = frame.y1,
            //        //PlateHeight =
            //        //PlateWidth =
            //    });
            //}

            return(anprInfo);
        }
Exemplo n.º 2
0
        private void initANPR(cmAnpr anpr, int timeout, int size)
        {
#if OLD_ENGINE
            anpr.SetProperty("anprname", "cmanpr-7.2.7.68:kor");
            anpr.SetProperty("size", size);       // default 25  (20-->15)
            anpr.SetProperty("size_min", "6");    //"8"); // Default 6
            anpr.SetProperty("size_max", "35");   //"40"); // Default 93

            anpr.SetProperty("nchar_min", "7");   // "7"); // Default 8
            anpr.SetProperty("nchar_max", "9");   // Default 9

            anpr.SetProperty("slope", "9");       // "-5"); // Default -22
            anpr.SetProperty("slope_min", "-22"); //-20"); // Default -22
            anpr.SetProperty("slope_max", "34");  // "10"); // Default 34

            anpr.SetProperty("slant", "10");      // "0"); // Default 10
            anpr.SetProperty("slant_min", "-55"); // "-10"); // Default -55
            anpr.SetProperty("slant_max", "27");  // "10"); // Default 27

            anpr.SetProperty("timeout", timeout); // default 100

            anpr.SetProperty("contrast_min", "30");
            anpr.SetProperty("xtoyres", "0");
            anpr.SetProperty("colortype", "0");
            anpr.SetProperty("gaptospace", "0");
            anpr.SetProperty("unicode_in_text", "0");
            anpr.SetProperty("general", "1");
            anpr.SetProperty("depth", "137");
            anpr.SetProperty("adapt_environment", "1");
            anpr.SetProperty("unit", "1");
            anpr.SetProperty("analyzecolors", "0");
            anpr.SetProperty("whitebalance", "100");

            /*anpr.SetProperty("posfreqhalflife", "0");
             * anpr.SetProperty("posfreqweight", "61");
             * anpr.SetProperty("posfreqhistxs", "16");
             * anpr.SetProperty("posfreqhistys", "16");
             * anpr.SetProperty("posfreq", "1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000");*/
#endif
            anpr.SetProperty("anprname", "cmanpr-7.3.9.5:kor");
            anpr.SetProperty("size", size);       // default 25  (20-->15)
            anpr.SetProperty("size_min", "8");    //"8"); // Default 6
            anpr.SetProperty("size_max", "40");   //"40"); // Default 93

            anpr.SetProperty("nchar_min", "4");   // "7"); // Default 8
            anpr.SetProperty("nchar_max", "9");   // Default 9

            anpr.SetProperty("slope", "4");       // "-5"); // Default -22
            anpr.SetProperty("slope_min", "-31"); //-20"); // Default -22
            anpr.SetProperty("slope_max", "37");  // "10"); // Default 34

            anpr.SetProperty("slant", "4");       // "0"); // Default 10
            anpr.SetProperty("slant_min", "-13"); // "-10"); // Default -55
            anpr.SetProperty("slant_max", "56");  // "10"); // Default 27

            anpr.SetProperty("timeout", timeout); // default 100

            anpr.SetProperty("contrast_min", "9");
            anpr.SetProperty("xtoyres", "100");
            anpr.SetProperty("colortype", "0");
            anpr.SetProperty("gaptospace", "0");
            anpr.SetProperty("unicode_in_text", "0");
            anpr.SetProperty("depth", "205");
            anpr.SetProperty("adapt_environment", "1");
            anpr.SetProperty("unit", "1");
            anpr.SetProperty("analyzecolors", "0");
            anpr.SetProperty("whitebalance", "100");
            anpr.SetProperty("general", "13");
            anpr.SetProperty("plateconf", "0");
        }
Exemplo n.º 3
0
        private void initANPR(cmAnpr anpr, int timeout, int size)
        {
            #if OLD_ENGINE
            anpr.SetProperty("anprname", "cmanpr-7.2.7.68:kor");
            anpr.SetProperty("size", size); // default 25  (20-->15)
            anpr.SetProperty("size_min", "6"); //"8"); // Default 6
            anpr.SetProperty("size_max", "35"); //"40"); // Default 93

            anpr.SetProperty("nchar_min", "7"); // "7"); // Default 8
            anpr.SetProperty("nchar_max", "9"); // Default 9

            anpr.SetProperty("slope", "9"); // "-5"); // Default -22
            anpr.SetProperty("slope_min", "-22"); //-20"); // Default -22
            anpr.SetProperty("slope_max", "34"); // "10"); // Default 34

            anpr.SetProperty("slant", "10"); // "0"); // Default 10
            anpr.SetProperty("slant_min", "-55"); // "-10"); // Default -55
            anpr.SetProperty("slant_max", "27"); // "10"); // Default 27

            anpr.SetProperty("timeout", timeout); // default 100

            anpr.SetProperty("contrast_min", "30");
            anpr.SetProperty("xtoyres", "0");
            anpr.SetProperty("colortype", "0");
            anpr.SetProperty("gaptospace", "0");
            anpr.SetProperty("unicode_in_text", "0");
            anpr.SetProperty("general", "1");
            anpr.SetProperty("depth", "137");
            anpr.SetProperty("adapt_environment", "1");
            anpr.SetProperty("unit", "1");
            anpr.SetProperty("analyzecolors", "0");
            anpr.SetProperty("whitebalance", "100");
            /*anpr.SetProperty("posfreqhalflife", "0");
            anpr.SetProperty("posfreqweight", "61");
            anpr.SetProperty("posfreqhistxs", "16");
            anpr.SetProperty("posfreqhistys", "16");
            anpr.SetProperty("posfreq", "1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000;1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000");*/
            #endif
            anpr.SetProperty("anprname", "cmanpr-7.3.9.5:kor");
            anpr.SetProperty("size", size); // default 25  (20-->15)
            anpr.SetProperty("size_min", "8"); //"8"); // Default 6
            anpr.SetProperty("size_max", "82"); //"40"); // Default 93

            anpr.SetProperty("nchar_min", "4"); // "7"); // Default 8
            anpr.SetProperty("nchar_max", "9"); // Default 9

            anpr.SetProperty("slope", "4"); // "-5"); // Default -22
            anpr.SetProperty("slope_min", "-31"); //-20"); // Default -22
            anpr.SetProperty("slope_max", "37"); // "10"); // Default 34

            anpr.SetProperty("slant", "4"); // "0"); // Default 10
            anpr.SetProperty("slant_min", "-13"); // "-10"); // Default -55
            anpr.SetProperty("slant_max", "56"); // "10"); // Default 27

            anpr.SetProperty("timeout", timeout); // default 100

            anpr.SetProperty("contrast_min", "9");
            anpr.SetProperty("xtoyres", "100");
            anpr.SetProperty("colortype", "0");
            anpr.SetProperty("gaptospace", "0");
            anpr.SetProperty("unicode_in_text", "0");
            anpr.SetProperty("general", "1");
            anpr.SetProperty("depth", "205");
            anpr.SetProperty("adapt_environment", "1");
            anpr.SetProperty("unit", "1");
            anpr.SetProperty("analyzecolors", "0");
            anpr.SetProperty("whitebalance", "100");
            anpr.SetProperty("general", "13");
            anpr.SetProperty("plateconf", "0");
        }