Пример #1
0
        public static void Test(string imgName, bool isGpu = true)
        {
            i++;
            //Bitmap ratedBmp;
            Bitmap orgBmp;

            orgBmp = Globles.NewReleasedBitmap(path + imgName + ".bmp");
            if (orgBmp == null)
            {
                Console.WriteLine("NULL");
                return;
            }
            //ratedBmp = Globles.NewBitmap(orgBmp.Width, orgBmp.Height);
            try
            {
                //ImageProcess.Ratezation(orgBmp, ratedBmp, isGpu);
                //ratedBmp.Save(path + isGpu.ToString()+ "_Rate.bmp");
                CppColorRange [] crA = new CppColorRange[1];
                CppColorRange    cr  = Init();
                crA[0] = cr;
                //ImageProcess.Binaryzation(ratedBmp, orgBmp, cr, isGpu);
                ImageProcess.BinaryzationsShow__CPU(orgBmp, cr, false);
                orgBmp.Save(path + i + isGpu.ToString() + "_ShowCPU.bmp");
            }
            catch (Exception ex)
            {
                //ratedBmp.Dispose();
                //ratedBmp = null;
                Console.WriteLine(ex + "");
            }
            //ratedBmp.Dispose();
            //ratedBmp = null;
            orgBmp.Dispose();
            orgBmp = null;
        }