|
|
|
|
[Home][17 NeuralNet Filter][17.4 Training ]
|
|
17.4 TrainingTraining here means setting up the NeuralNet Filter. After specifying a key segment, click “NeuralNet/Training” in Figure 17.3 to complete the training. You should see this message: Training ... Training End! Double click menu item “NeuralNet/Training” and enter: private void menuItem109_Click(object sender, System.EventArgs e) { this.mainMenuToAPI.neuralNet_Training ( textBox1.Text ); } Here, mainMenuToAPI is an object, which will implement all functions. As we discussed earlier, the main form simply links menu items to functions in the mainMenuToAPI object. The implementation is: public bool neuralNet_Training ( string b) { if ( ! System.IO .File .Exists (b) ) { appendText ( "Please enter a valid Key!\n"); return false; }
int x =0, y = 0, w =0, h = 0; try { x = int.Parse (f.textBox3.Text ); y = int.Parse (f.textBox4.Text ); w = int.Parse (f.textBox5.Text ); h = int.Parse (f.textBox6.Text ); } catch { setText ("Invalid Training Segment!\n"); x = 0; y = 0; w = 0; h = 0; return false; }
script.neuralNetFilter.train ( b, x, y, w, h) ; return true; } The following code simply makes sure the key image exists: if ( ! System.IO .File .Exists (b) ) { appendText ( "Please enter a valid Key!\n"); return false; } The next section of code computes (x, y, w, h): int x =0, y = 0, w =0, h = 0; try { x = int.Parse (f.textBox3.Text ); y = int.Parse (f.textBox4.Text ); w = int.Parse (f.textBox5.Text ); h = int.Parse (f.textBox6.Text ); } catch { setText ("Invalid Training Segment!\n"); x = 0; y = 0; w = 0; h = 0; return false; } The last section of code trains the neural net: script.neuralNetFilter.train ( b, x, y, w, h) ;
[Home][About][1 Introduction][2 Image Recognition][3 TransApplet][4 API][5 Interface][6 Input][7 Image Display][8 Preprocessing][9 Processing][10 Normalization][11 Parameter Class][12 Image Signatures][13 Unsupervised Filters][14 BioFilters][15 NeuralFilters][16 Dynamic Library][17 NeuralNet Filter][18 Parameters][19 Input Options][20 Database Input][21 Video Input][22 Live Video Input][23 Counting & Tracking][24 Counting ][25 Batch Job][26 ImageFinder for DOS][27 ImageHunt ][28 Support Packages]
Copyright (c) 2006 - 2007 Attrasoft. All rights reserved. |