Commit 5fb261df authored by Bruce's avatar Bruce

first -v 0.1

parent 4558df7b
......@@ -54,16 +54,16 @@ namespace ETC_App1
DirectoryInfo dir = new DirectoryInfo(@Imgs_path);
foreach (FileInfo dChild in dir.GetFiles("*.jgp"))
{
this.listBox1.Items.Add(Path.Combine(Imgs_path,dChild.Name));
this.listBox1.Items.Add("=> "+Path.Combine(Imgs_path,dChild.Name));
}
foreach (FileInfo dChild in dir.GetFiles("*.png"))
{
this.listBox1.Items.Add(Path.Combine(Imgs_path,dChild.Name));
this.listBox1.Items.Add("=> " + Path.Combine(Imgs_path,dChild.Name));
}
if (listBox1.Items.Count > 0)
{
listBox1.SetSelected(0, true);
string img = listBox1.SelectedItem.ToString();
string img = listBox1.SelectedItem.ToString().Remove(0,3);
Bitmap bitmap = new Bitmap(img);
pictureBox1.Image = bitmap;
}
......@@ -75,17 +75,18 @@ namespace ETC_App1
path.ShowDialog();
Xmls_path = path.SelectedPath;
XmlLableObject lableObject = new XmlLableObject();
lableObject.Name = "g";
lableObject.X1 = "10";
lableObject.Y1 = "20";
lableObject.X2 = "30";
lableObject.Y2 = "40";
xmlLable.Object.Add(lableObject);
xmlLable.Object.Add(lableObject);
xmlLable.Object.Add(lableObject);
CreateXmlTree(@"C:\Users\Bruce\source\repos\e-eye\ETC_App1\bin\Debug\form2_config\Eample.xml", @"C:\Users\Bruce\source\repos\e-eye\ETC_App1\bin\Debug\form2_config\Eample2.xml");
XmlLableObject obj1 = new XmlLableObject("A", "11", "12", "13", "14");
XmlLableObject obj2 = new XmlLableObject("B", "15", "16", "17", "18");
XmlLableObject obj3 = new XmlLableObject("C", "19", "20", "21", "22");
xmlLable.Object.Add(obj1);
xmlLable.Object.Add(obj2);
xmlLable.Object.Add(obj3);
ProcessCombobox();
CreateXmlTree(@"C:\Users\Bruce\source\repos\e-eye\ETC_App1\bin\Debug\form2_config\Eample.xml", Xmls_path+@"\Eample2.xml");
}
private void Form2_KeyPress(object sender, KeyPressEventArgs e)
......@@ -101,10 +102,19 @@ namespace ETC_App1
{
if (listBox1.Items.Count > listBox1.SelectedIndex + 1)
{
listBox1.SetSelected(listBox1.SelectedIndex + 1, true);
string img = listBox1.SelectedItem.ToString();
listBox1.SetSelected(listBox1.SelectedIndex+1 , true);
string img = listBox1.SelectedItem.ToString().Remove(0, 3);
Bitmap bitmap = new Bitmap(img);
pictureBox1.Image = bitmap;
this.xmlLable = new XmlLable();
checkedListBox1.Items.Clear();
string xml = img.Replace(".jpg", ".xml").Replace(".png",".xml");
if (File.Exists(xml))
{
Console.WriteLine(xml);
}
}
}
}
......@@ -115,9 +125,11 @@ namespace ETC_App1
if (0 <= listBox1.SelectedIndex -1)
{
listBox1.SetSelected(listBox1.SelectedIndex - 1, true);
string img = listBox1.SelectedItem.ToString();
string img = listBox1.SelectedItem.ToString().Remove(0, 3);
Bitmap bitmap = new Bitmap(img);
pictureBox1.Image = bitmap;
this.xmlLable = new XmlLable();
checkedListBox1.Items.Clear();
}
}
}
......@@ -185,5 +197,21 @@ namespace ETC_App1
}
doc.Save(save_path);
}
public void ProcessCombobox()
{
List<XmlLableObject> objs = xmlLable.Object;
foreach (XmlLableObject obj in objs)
{
string temp = String.Format("{0}: {1},{2},{3},{4}", obj.Name, obj.X1, obj.Y1, obj.X2, obj.Y2);
if (checkedListBox1.Items.IndexOf(temp) < 0 || true)
{
checkedListBox1.Items.Add(temp);
checkedListBox1.SetItemChecked(checkedListBox1.Items.IndexOf(temp), true);
}
}
}
}
}
......@@ -8,11 +8,21 @@ namespace ETC_App1
{
class XmlLableObject
{
public string Name { get; set; }
public string X1 { get; set; }
public string Y1 { get; set; }
public string X2 { get; set; }
public string Y2 { get; set; }
public XmlLableObject(string name, string x1, string y1, string x2,string y2)
{
this.Name = name;
this.X1 = x1;
this.X2 = x2;
this.Y1 = y1;
this.Y2 = y2;
}
}
}
<annotation>
<folder>
</folder>
<folder>ignore</folder>
<filename>
</filename>
<path>
</path>
<path>ignore</path>
<source>
<database>Unknown</database>
</source>
......@@ -18,39 +16,75 @@
</size>
<segmented>0</segmented>
<object>
<name>g</name>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>10</xmin>
<ymin>20</ymin>
<xmax>30</xmax>
<ymax>40</ymax>
<xmin>11</xmin>
<ymin>12</ymin>
<xmax>13</xmax>
<ymax>14</ymax>
</bndbox>
</object>
<object>
<name>g</name>
<name>B</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>10</xmin>
<xmin>15</xmin>
<ymin>16</ymin>
<xmax>17</xmax>
<ymax>18</ymax>
</bndbox>
</object>
<object>
<name>C</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>19</xmin>
<ymin>20</ymin>
<xmax>30</xmax>
<ymax>40</ymax>
<xmax>21</xmax>
<ymax>22</ymax>
</bndbox>
</object>
<object>
<name>A</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>11</xmin>
<ymin>12</ymin>
<xmax>13</xmax>
<ymax>14</ymax>
</bndbox>
</object>
<object>
<name>B</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>15</xmin>
<ymin>16</ymin>
<xmax>17</xmax>
<ymax>18</ymax>
</bndbox>
</object>
<object>
<name>g</name>
<name>C</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>10</xmin>
<xmin>19</xmin>
<ymin>20</ymin>
<xmax>30</xmax>
<ymax>40</ymax>
<xmax>21</xmax>
<ymax>22</ymax>
</bndbox>
</object>
</annotation>
\ No newline at end of file
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