20.5 Input Implementation
About1 Introduction2 Image Recognition3 TransApplet4 API5 Interface6 Input7 Image Display8 Preprocessing9 Processing10 Normalization11 Parameter Class12 Image Signatures13 Unsupervised Filters14 BioFilters15 NeuralFilters16 Dynamic Library17 NeuralNet Filter18 Parameters19 Input Options20 Database Input21 Video Input22  Live Video Input23  Counting & Tracking24  Counting 25  Batch Job26 ImageFinder for DOS27 ImageHunt 28 Support Packages

20.1  Access Class 
20.2  Input Class 
20.3 Input Selection 
20.4 Parameter Input 
20.5 Input Implementation 
20.6 Testing 
[Home][20 Database Input][20.5 Input Implementation]

 

20.5   Database Input Implementation

The database input is implemented by the following codes:

        internal string dbmsSQL ="NA";

            internal void setSQL (string s)

                {

                dbmsSQL = s;

                }

            internal string getSQL ()

                {

                return dbmsSQL ;

                }

                

            private bool searachSource4 ()

                {

                try{

         

        //Step 1. Database file

                if ( f.openFileDialog1.ShowDialog () != DialogResult.OK )

                    return false;

                string sDBMS =  f.openFileDialog1.FileName  ;

                f.textBox2.Text = sDBMS ;

         

                // Step 2. SQL Statement

                string sQuery ="";

                Parameter_DbmsInput pd = new Parameter_DbmsInput (this, 0);

                pd.ShowDialog ();

                sQuery = getSQL ();

                f.richTextBox1.AppendText ( "Database: " +sDBMS +"\n" );

                f.richTextBox1.AppendText ( "Query: " + sQuery +"\n" );

                

        //Step 3. Database Input

                this.imageAbsoultePath = script.input.getAccessList  (sDBMS, sQuery);

                if ( imageAbsoultePath  == null )

                {

         

                    f.richTextBox1.AppendText ( "Data Source fails!\n");

                    return false;

                }

                }

                catch (Exception e )

                {

                    f.richTextBox1.AppendText ( e.ToString () +"\n" );

                    return false;

         

                }

                return true;

                }

         

            private bool searachSource5 ()

                {

                …

                }

Now we briefly explain the code:

  •    The code in section “Step 1. Database file” will get a Microsoft Access file.
  •    The code in section “Step 2. SQL Statement” will get the SQL statement. Here class, “Parameter_DbmsInput”, will produce Figure 20.1, which will call function, “setSQL (string s)”, to set the SQL statement.
  •    The code in section “Step 3. Database Input” will enter the two parameters (Access file and SQL statement) into the Input class; and retrieve the image list from the database. This is similar to other input options. The result is a string list and each string is a path of an image.  

The implementation, searchSource5 (), for the Access Segment is similar.

 

[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.

gina@attrasoft.com