|
|
|
|
[Home][16 Dynamic Library][16.7 1:N Matching]
|
|
16.7 Library 1:N MatchingTo make 1:N Matching via the library,
Double click menu item �Library/Matching/1:N (Key vs. lib1.txt)� and enter: private void menuItem98_Click(object sender, System.EventArgs e) { bool b = this.mainMenuToAPI.library_Matching_1_N (textBox1.Text , dataDir + "b1.txt" ); } 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_Matching_1_N( string key, string b1File) { if ( script.imageLibrary == null ) { appendText ("Dynamic Library not available!\n"); return false; } bool b = script.neuralFilter .setLibrary ( script.imageLibrary ); if (!b) { appendText ("Dynamic Library Assignment Fails!\n"); return false; } b = false;
if ( ! System.IO .File .Exists (key) ) { appendText ( "Please enter a valid Key!\n"); return false; }
b = this.signature_Key_Signature (key); if ( ! b ) { appendText ( "Key Signature computation fails!\n"); return false; }
try { script.results_1N = script.neuralFilter.findMatch1N ( script.imageSignature); } catch (Exception e) { appendText ( "NeuralFilter 1:N Matching fails:\n" + e.ToString () + "\n"); return false; } if ( script.results_1N == null ) { appendText ( "NeuralFilter 1:N Matching fails!\n" ); return false; }
if ( script.results_1N.getStatus () ) { setText ( script.results_1N.toString () + "\n"); appendText ("" + script.results_1N.getNumberOfMatches () +" matches!\n"); } else { appendText ( "No Match!\n"); return false; } } The only difference between this 1:N Matching and the NeuralFilter 1:N Matching introduced earlier is the following statement: bool b = script.neuralFilter .setLibrary ( script.imageLibrary ); In a normal 1:N Matching, the neural filter gets the library from a1.txt. This statement assigns the dynamic library, �script.imageLibrary�, to the NeuralFilter object, �script.NeuralFilter�.
[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. |