|
|
|
|
[Home][16 Dynamic Library][16.9 Updating Implementation]
|
|
16.9 Update ImplementationDouble click menu item �Library/Maintenance/Add (Key)� and enter: private void menuItem95_Click (object sender, System.EventArgs e) { if ( ! System.IO .File .Exists (textBox1.Text ) ) { this.mainMenuToAPI.appendText ("File does not exist: \n" + textBox1.Text + "\n"); return; } this.mainMenuToAPI.library_add (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 library_add ( string sImage) { script.imageSignature = script.signatureFilter.getSignature (sImage);
if (script.imageSignature == null ) { this.setLine ("Image Signature computation fails!"); return false; }
if (script.imageSignature.getStatus () <= 0 ) { this.setLine ("Image Signature computation fails!"); return false; } bool b = script.imageLibrary.addSignature (script.imageSignature); return b; } The script object contains all of the objects required for the ImageFinder project. In particular, �script.imageLibrary� is the dynamic library object. The first section of the code computes the image signature. The next section of code checks the validity of the signature. The following statement inserts the signature to the dynamic library: bool b = script.imageLibrary.addSignature (script.imageSignature); The menu item Delete and the menu item Replace can be implemented in a similar fashion and the codes are provided in the project.
[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. |