Commit ece74f1c authored by Bruce's avatar Bruce

version 1.1

parent 57963494
...@@ -10,10 +10,12 @@ namespace ETC_App1 ...@@ -10,10 +10,12 @@ namespace ETC_App1
{ {
public class BndBox : Panel public class BndBox : Panel
{ {
int dotSize = 10; //需要被 2 整除 int dotSize = 6; //需要被 2 整除
List <Color> colors=new List<Color> { Color.Red,Color.Orange,Color.Yellow,Color.Green,Color.Blue,Color.Brown,Color.Purple}; List <Color> colors=new List<Color> { Color.Red,Color.Orange,Color.Yellow,Color.Green,Color.Blue,Color.Brown,Color.Purple};
int Color_ind; int Color_ind;
public int Num; public int Num;
public int black_left_width;
public int black_top_height;
public BndBox(Point location, Size size , int color) public BndBox(Point location, Size size , int color)
{ {
InitializeComponent(); InitializeComponent();
...@@ -66,58 +68,119 @@ namespace ETC_App1 ...@@ -66,58 +68,119 @@ namespace ETC_App1
{ {
if (e.Button == System.Windows.Forms.MouseButtons.Left) if (e.Button == System.Windows.Forms.MouseButtons.Left)
{ {
if (MouseDownLocation.X <= dotSize && MouseDownLocation.Y <= dotSize && this.Width >= dotSize * 3 && this.Height >= dotSize * 3) //左上點 PictureBox perent = this.Parent as PictureBox;
if (MouseDownLocation.X <= dotSize && MouseDownLocation.Y <= dotSize) //左上點
{ {
this.Left += e.X - MouseDownLocation.X; if (this.Top + e.Y - MouseDownLocation.Y - black_top_height > 0)
this.Top += e.Y - MouseDownLocation.Y; {
this.Width -= e.X - MouseDownLocation.X; this.Height -= e.Y - MouseDownLocation.Y;
this.Height -= e.Y - MouseDownLocation.Y; this.Top += e.Y - MouseDownLocation.Y;
} }
else if (MouseDownLocation.X <= dotSize && MouseDownLocation.Y >= this.Height - dotSize && this.Width >= dotSize * 3 && this.Height >= dotSize * 3) //左下點 else
this.Top = 0+black_top_height;
if (this.Left + e.X - MouseDownLocation.X > 0)
{
this.Left += e.X - MouseDownLocation.X;
this.Width -= e.X - MouseDownLocation.X;
}
else
this.Left = 0;
if(this.Width < dotSize * 3)
this.Width += dotSize;
if (this.Height < dotSize * 3)
this.Height += dotSize;
}
else if (MouseDownLocation.X <= dotSize && MouseDownLocation.Y >= this.Height - dotSize) //左下點
{ {
this.Left += e.X - MouseDownLocation.X; if (this.Left + e.X - MouseDownLocation.X > 0)
this.Width -= e.X - MouseDownLocation.X; {
this.Height += e.Y - MouseDownLocation.Y; this.Left += e.X - MouseDownLocation.X;
MouseDownLocation.Y = e.Y; this.Width -= e.X - MouseDownLocation.X;
}
else
this.Left = 0;
if (this.Top + this.Height + e.Y - MouseDownLocation.Y <= perent.Height - black_top_height)
{
this.Height += e.Y - MouseDownLocation.Y;
MouseDownLocation.Y = e.Y;
}
else
this.Height = perent.Height - black_top_height - this.Top;
if (this.Width < dotSize * 3)
this.Width += dotSize;
if (this.Height < dotSize * 3)
this.Height += dotSize;
} }
else if (MouseDownLocation.X >= this.Width - dotSize && MouseDownLocation.Y <= dotSize && this.Width >= dotSize * 3 && this.Height >= dotSize * 3) //右上點 else if (MouseDownLocation.X >= this.Width - dotSize && MouseDownLocation.Y <= dotSize) //右上點
{ {
this.Top += e.Y - MouseDownLocation.Y; if (this.Left + this.Width + e.X - MouseDownLocation.X <= perent.Width)
this.Width += e.X - MouseDownLocation.X; {
this.Height -= e.Y - MouseDownLocation.Y; this.Width += e.X - MouseDownLocation.X;
MouseDownLocation.X = e.X;
}
else
this.Width = perent.Width - this.Left;
if (this.Top + e.Y - MouseDownLocation.Y > black_top_height)
{
this.Top += e.Y - MouseDownLocation.Y;
this.Height -= e.Y - MouseDownLocation.Y;
}
else
this.Top = 0+black_top_height;
if (this.Width < dotSize * 3)
this.Width += dotSize;
if (this.Height < dotSize * 3)
this.Height += dotSize;
MouseDownLocation.X = e.X;
} }
else if (MouseDownLocation.X >= this.Width - dotSize && MouseDownLocation.Y >= this.Height - dotSize && this.Width >= dotSize * 3 && this.Height >= dotSize * 3) //右下點 else if (MouseDownLocation.X >= this.Width - dotSize && MouseDownLocation.Y >= this.Height - dotSize && this.Width >= dotSize * 3 && this.Height >= dotSize * 3) //右下點
{ {
this.Width += e.X - MouseDownLocation.X; if (this.Left + this.Width + e.X - MouseDownLocation.X <= perent.Width)
this.Height += e.Y - MouseDownLocation.Y; {
this.Width += e.X - MouseDownLocation.X;
MouseDownLocation.X = e.X;
}
else
this.Width = perent.Width - this.Left;
if (this.Top + this.Height + e.Y - MouseDownLocation.Y <= perent.Height - black_top_height)
{
this.Height += e.Y - MouseDownLocation.Y;
MouseDownLocation.Y = e.Y;
}
else
this.Height = perent.Height - black_top_height - this.Top;
MouseDownLocation.X = e.X; if (this.Width < dotSize * 3)
MouseDownLocation.Y = e.Y; this.Width += dotSize;
this.Left += 1;
this.Left -= 1; if (this.Height < dotSize * 3)
} this.Height += dotSize;
else if (this.Width >= dotSize * 3 && this.Height >= dotSize * 3)
{
this.Left = e.X + this.Left - MouseDownLocation.X;
this.Top = e.Y + this.Top - MouseDownLocation.Y;
} }
else else //移動
{ {
this.Width += 1; if (e.X + this.Left - MouseDownLocation.X < 0)
this.Height += 1; this.Left = 0;
else if (e.X + this.Left + this.Width - MouseDownLocation.X <= perent.Width)
this.Left = e.X + this.Left - MouseDownLocation.X;
if (e.Y + this.Top - MouseDownLocation.Y < black_top_height)
this.Top = black_top_height;
else if (e.Y + this.Top+this.Height - MouseDownLocation.Y<=perent.Height-black_top_height)
this.Top = e.Y + this.Top - MouseDownLocation.Y;
} }
if (this.Top < 0) //防止破圖
this.Top = 0; this.Left += 1;
if (this.Left < 0) this.Left -= 1;
this.Left = 0; this.Top += 1;
PictureBox perent = this.Parent as PictureBox; this.Top -= 1;
if (perent.Height < this.Top + this.Height)
this.Top = perent.Height - this.Height;
if (perent.Width < this.Left + this.Width)
this.Left = perent.Width - this.Width;
} }
} }
...@@ -140,5 +203,6 @@ namespace ETC_App1 ...@@ -140,5 +203,6 @@ namespace ETC_App1
{ {
this.BringToFront(); this.BringToFront();
} }
} }
} }
...@@ -174,21 +174,21 @@ namespace ETC_App1 ...@@ -174,21 +174,21 @@ namespace ETC_App1
break; break;
} }
else if (fuzzy > 0.1) //else if (fuzzy > 0.1)
{ //{
// 辨識成功,比對錯誤 // // 辨識成功,比對錯誤
json.message1 = data[i]["車牌號碼"]; // json.message1 = data[i]["車牌號碼"];
json.success = true; // json.success = true;
json.failed = true; // json.failed = true;
json.tickoff = false; // json.tickoff = false;
break; // break;
//json.message2 = (json.message2 == null ? "資料異常" : json.message2) + "[" + result + "]"; // //json.message2 = (json.message2 == null ? "資料異常" : json.message2) + "[" + result + "]";
} //}
else else
{ {
json.success = false; json.success = false;
...@@ -197,13 +197,13 @@ namespace ETC_App1 ...@@ -197,13 +197,13 @@ namespace ETC_App1
json.lost1 = false; json.lost1 = false;
json.lost2 = false; json.lost2 = false;
json.message1 = data[i]["車牌號碼"]; json.message1 = data[i]["車牌號碼"];
json.message2 = "車牌定位無結果"; json.message2 = result;
} }
} }
else { json.message2 = "車牌辨識無結果"; } else { json.message2 = "車牌定位無結果"; }
} }
} }
else { json.message2 = "車牌辨識無結果"; } else { json.message2 = "車牌定位無結果"; }
} }
} }
else { else {
......
...@@ -141,7 +141,9 @@ namespace ETC_App1 ...@@ -141,7 +141,9 @@ namespace ETC_App1
listBox1.Items.Add((json.lost2 ? "" : json.index + ". ") + (json.tickoff ? (json.content&&json.failed?json.message2:"資料異常"):json.message1 )); listBox1.Items.Add((json.lost2 ? "" : json.index + ". ") + (json.tickoff ? (json.content&&json.failed?json.message2:"資料異常"):json.message1 ));
listBox2.Items.Add((json.lost2 ? json.filename + "," : json.index + ". ") + (json.tickoff?(json.content?(json.failed?json.message1:json.message2):json.filename):json.message1)); //listBox2.Items.Add((json.lost2 ? json.filename + "," : json.index + ". ") + (json.tickoff?(json.content?(json.failed?json.message1:json.message2):json.filename):json.message1));
listBox2.Items.Add(string.Format("{0},{1}", json.message1, json.message2));
listBox2.SelectedIndex = listBox2.Items.Count - 1; listBox2.SelectedIndex = listBox2.Items.Count - 1;
} }
......
...@@ -244,7 +244,7 @@ namespace ETC_App1 ...@@ -244,7 +244,7 @@ namespace ETC_App1
} }
private void EtcBackgroundWorker31_ProgressChanged(object sender, ProgressChangedEventArgs e) private void EtcBackgroundWorker31_ProgressChanged(object sender, ProgressChangedEventArgs e)
{ {
if (e.UserState is Json && (e.UserState as Json).success) if (e.UserState is Json/* && (e.UserState as Json).success*/)
{ {
etcPictureCheckBox1.Add(e.UserState as Json); etcPictureCheckBox1.Add(e.UserState as Json);
} }
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
<annotation>
<folder>ignore</folder>
<filename>4_0069063759G.jpg</filename>
<path>ignore</path>
<source>
<database>Unknown</database>
</source>
<plate>KLE-7668</plate>
<size>
<width>1392</width>
<height>1040</height>
<depth>1</depth>
</size>
<segmented>0</segmented>
<object>
<name>plate</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>657</xmin>
<ymin>306</ymin>
<xmax>811</xmax>
<ymax>403</ymax>
</bndbox>
</object>
</annotation>
\ No newline at end of file
<annotation>
<folder>ignore</folder>
<filename>4_0069063759G.jpg</filename>
<path>ignore</path>
<source>
<database>Unknown</database>
</source>
<plate>KLE-7668</plate>
<size>
<width>136</width>
<height>73</height>
<depth>1</depth>
</size>
<segmented>0</segmented>
<object>
<name>K</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>14</xmin>
<ymin>23</ymin>
<xmax>31</xmax>
<ymax>51</ymax>
</bndbox>
</object>
<object>
<name>L</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>28</xmin>
<ymin>23</ymin>
<xmax>45</xmax>
<ymax>51</ymax>
</bndbox>
</object>
<object>
<name>E</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>43</xmin>
<ymin>22</ymin>
<xmax>60</xmax>
<ymax>50</ymax>
</bndbox>
</object>
<object>
<name>7</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>60</xmin>
<ymin>22</ymin>
<xmax>77</xmax>
<ymax>50</ymax>
</bndbox>
</object>
<object>
<name>6</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>74</xmin>
<ymin>21</ymin>
<xmax>91</xmax>
<ymax>49</ymax>
</bndbox>
</object>
<object>
<name>6</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>90</xmin>
<ymin>21</ymin>
<xmax>105</xmax>
<ymax>49</ymax>
</bndbox>
</object>
<object>
<name>8</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>103</xmin>
<ymin>21</ymin>
<xmax>119</xmax>
<ymax>49</ymax>
</bndbox>
</object>
</annotation>
\ No newline at end of file
0. KLE-7668 fuzzy KLE7668 = 0.525822829131653 0. KLE-7669GO fuzzy KLE7668 = 0.273989661654135
1. KLB-3873 fuzzy KLB3873 = 0.525822829131653 1. KLB-3879 fuzzy KLB3873 = 0.435749299719888
2. 9238-N8 fuzzy 9238N8 = 0.527380952380952 2. 9238-N9 fuzzy 9238N8 = 0.442857142857143
3. BDL-1637 fuzzy BDL1637 = 0.525822829131653 3. BDL-1639 fuzzy BDL1637 = 0.435749299719888
4. 187-H9 fuzzy 1879 = 0.384469696969697 4. 187-H9 fuzzy 1879 = 0.384469696969697
5. AWU-1392 fuzzy AWU392 = 0.394886363636364 5. AWU-1392 fuzzy AWU392 = 0.394886363636364
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment