Exemplo n.º 1
0
        public OpenODForm(Form caller)
        {
            InitializeComponent();
            List <string> recentProjectList = LocalConfig.getRecentProjects();

            comboBox1.Items.AddRange(recentProjectList.ToArray());
            comboBox1.SelectedIndex = 0;
            this.caller             = caller;
        }
        private void GenerateODImagePrepareForm_Load(object sender, EventArgs e)
        {
            String[] settings = LocalConfig.getGenerateSettings();

            textBox1.Text = settings[0];
            textBox2.Text = settings[1];
            textBox3.Text = settings[2];
            textBox4.Text = settings[3];
            textBox5.Text = settings[4];
            textBox6.Text = settings[5];
        }
        private void button3_Click(object sender, EventArgs e)
        {
            caller.resetData();

            String sourceImageDirectory = textBox1.Text;
            String sourceXmlDirectory   = textBox2.Text;

            double maxRotation = textBox3.Text.Equals("") ? 360 : Double.Parse(textBox3.Text);
            int    maxShift_x  = textBox4.Text.Equals("") ? -1 : Int32.Parse(textBox4.Text);
            int    maxShift_y  = textBox5.Text.Equals("") ? -1 : Int32.Parse(textBox5.Text);
            int    sampleCount = textBox6.Text.Equals("") ? 30 : Int32.Parse(textBox6.Text);

            ImageCreator.createBoxesFromJson(sourceImageDirectory, sourceXmlDirectory, caller.getImageDirectory(), caller.getAnnotationDirectory(), maxRotation, maxShift_x, maxShift_y, sampleCount);
            //ODImageCreator ic = new ODImageCreator(sourceImageDirectory, sourceXmlDirectory, caller.getImageDirectory(), caller.getAnnotationDirectory(), maxRotation, maxShift_x, maxShift_y, sampleCount);
            LocalConfig.setGenerateSettings(new String[] { textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text });
            caller.reloadImageList();
            caller.reloadXmlList();
            this.Close();
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            String projectPath = comboBox1.Text;

            if (projectPath.Equals(""))
            {
                System.Windows.Forms.MessageBox.Show("Please select a directory");
            }
            else
            {
                if (Path.GetFileName(Directory.GetDirectories(projectPath)[1]).Equals("research"))
                {
                    LocalConfig.addRecentProject(projectPath);
                    ObjectDetectionMenuForm odmf1 = new ObjectDetectionMenuForm(projectPath);
                    odmf1.Show();
                    caller.Hide();
                    this.Close();
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("Invalid Project Directory!");
                }
            }
        }
Exemplo n.º 5
0
 public Form1()
 {
     InitializeComponent();
     LocalConfig.init();
 }