iT邦幫忙

0

C# 影像字元切割無畫面

各位大大~
有一張影像上面有N個字元,要將字元逐一切割(類似車牌辨識字元切割),code如下,編譯的時候沒有畫面顯示,請問大家是哪裡有問題~謝謝!!!

 private void cutImg()
    {
        Bitmap img = (Bitmap)this.pictureBox3.Image;
        List<List<int>> mylist = new List<List<int>>();
        //int _w = img.Width;
        //int _h = img.Height;
        for (int i = 0; i < img.Width; i++)
        {
            for (int j = 0; j < img.Height; j++)
            {
                Color _C = img.GetPixel(i, j);
                //x軸水平
                for (int x = 0; x <= img.Width; x++)
                {
                    if (_C.R == 0 && _C.G == 0 && _C.B == 0)
                    {
                        int temp = mylist[x][0];
                        temp++;
                        //_start_x = _start_x + 1;

                        if (_C.R == 255 && _C.G == 255 && _C.B == 255)
                        {  
                            for (int y = 0; y <= img.Height; y++)
                            {
                                int _idex = mylist[x][0];
                                _idex++;
                                if (_C.R == 0 && _C.G == 0 && _C.B == 0)
                                {
                                    int _p = mylist[x][0];
                                    int w = _p - _idex;
                                    Bitmap bml_recipe = img.Clone(new Rectangle(w,y,img.Width, img.Height), img.PixelFormat);
                                    this.pictureBox4.Image = bml_recipe;
                                }
                             
                            }

                        }
                    }
               
                }
			}
		
		}
	}		

尚未有邦友回答

立即登入回答