文件名称:标示路面黄线
文件大小:4.26MB
文件格式:RAR
更新时间:2017-09-10 09:12:29
标示路面黄线
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); } } } } }
【文件预览】:
WindowsFormsApplication1
----WindowsFormsApplication1()
--------bin()
--------Form1.Designer.cs(4KB)
--------pic()
--------Program.cs(505B)
--------obj()
--------Form1.cs(2KB)
--------Form1.resx(295KB)
--------WindowsFormsApplication1.csproj(4KB)
--------Properties()
--------LUMIAN()
----WindowsFormsApplication1.sln(914B)
----WindowsFormsApplication1.suo(24KB)