[C#] Bitmap to 2D Array
double[,] yarray;
yarray = new double[160,140];
Bitmap LLL = new Bitmap("c:/ProtoA/rL.jpg");
for (ix = 0; ix < 160; ix++)
{
for (iy = 0; iy < 140; iy++)
{
yarray[ix, iy] = .299 * LLL.GetPixel(ix, iy).R + .587 * LLL.GetPixel(ix, iy).G + .114 * LLL.GetPixel(ix, iy).B;
}
}
yarray = new double[160,140];
Bitmap LLL = new Bitmap("c:/ProtoA/rL.jpg");
for (ix = 0; ix < 160; ix++)
{
for (iy = 0; iy < 140; iy++)
{
yarray[ix, iy] = .299 * LLL.GetPixel(ix, iy).R + .587 * LLL.GetPixel(ix, iy).G + .114 * LLL.GetPixel(ix, iy).B;
}
}
댓글
댓글 쓰기