24.6 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

24.1  Introduction 
24.2  Class Name 
24.3 Class Overview 
24.4 Link to Class 
24.5 Counting Parameters 
24.6 Implementation 
24.7 Tracking 
24.8 Testing 
[Home][24 Counting ][24.6 Implementation]

 

24.6   Implementing Counting

In this section, we will use the training image as an input and obtain the attributes from the Counting object. We will add a button to the last chapter project. Double click the “Counting\Count Left” and enter:

        private void menuItem165_Click(object sender, System.EventArgs e)

                {

                this.mainMenuToAPI.count ( textBox1.Text );

                }

         

        public bool count( string sInput)

                {

                if ( ! System.IO .File .Exists (sInput) )

                {

                    appendText ( "Please enter a valid image!\n");

                    return false;

                }

                    

                bool b  = script.counting.setInput  (sInput  );

                if (!b )

                    return false;

                

                setText (  countingResults( ) + "\n" );

         

                return true;

                

            }

The first section makes sure a training image has been selected:

        System.IO .File .Exists (sInput).

The second section uses the Counting object in the script object, “script.counting”. The object uses the training image as the input:

        bool b  = script.counting.setInput  (sInput );

 The last section calls the following function to print the attributes calculated by the Counting:

         setText (  countingResults( ) + "\n" );

 

[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