- 博客(0)
- 资源 (1)
- 收藏
- 关注
标示路面黄线
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Bitmap bt;
private void Form1_Load(object sender, EventArgs e)
{
findfix();
}
public void findfix()
{
int i = 0, j = 0,x=0;
double pix=0;
int thwid = 0, thhei = 0;
double ccc = 0;
Color c = new Color();
Bitmap p = new Bitmap(pictureBox1 .Image );
ccc = p.Height / 3 * 2;
thhei = Convert .ToInt32(ccc);
int[,] count = new int[p.Width, p.Height];
for (i = 0 ; i < p.Width-1 ; i++)
{
for (j = 0; j < p.Height - 1; j++)
{
c = p.GetPixel(i, j);
if (c.R >= 240 && c.R <= 255 && c.G >= 240 && c.G <= 255 && c.B >= 240 && c.B <= 255)
{
p.SetPixel(i, j, Color.Green);
count[i, j] = 1;
}
if (c.R >= 200 && c.R <= 250 && c.G >= 150 && c.G <= 250 && c.B >= 90 && c.B <= 170)
{
pix = pix + 1;
p.SetPixel(i, j, Color.Green);
for (x = 0; x < 1; x++)
{
if (i + x < p.Width && j + x < p.Height)
{
p.SetPixel(i + x, j + x, Color.Red);
}
}
}
}
}
2014-08-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人