🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# RMOS / resmin arkaplanını silme OCR için iyi olabilir

1-) C# RMOS - resmin arkaplanını silme OCR için iyi olabilir

anahtar kelimeler :
--
C# remove background from image and leave text

--Remove background noise from image to make text more clear for OCR

--Binarisation

kaynak : https://stackoverflow.com/questions/33096826/c-sharp-how-to-remove-all-color-except-black-from-an-image

 

 

 public string neyi = @"C:\Users\ramazan\Desktop\resmim.jpg";

        public string nereye = @"C:\Users\ramazan\Desktop\resmim1.jpg";

        private void Form1_Load(object sender, EventArgs e)

        {

            Bitmap myBitmap = new Bitmap(neyi);

            const float limit = 0.5f;

            for (int i = 0; i < myBitmap.Width; i++)

            {

                for (int j = 0; j < myBitmap.Height; j++)

                {

                    Color c = myBitmap.GetPixel(i, j);

                    if (c.GetBrightness() > limit)

                    {

                        myBitmap.SetPixel(i, j, Color.White);

                    }

                }

            }

            myBitmap.Save(nereye);

        }

 

 2021 Ocak 18 Pazartesi
 445