26.8 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

26.1  Why DOS? 
26.2  The Idea 
26.3 Batch Design 
26.4 Class Name 
26.5 Class Overview 
26.6 Console Project 
26.7 Link to Class 
26.8 Implementation 
26.9 Example 
26.10 How to Use 
[Home][26 ImageFinder for DOS][26.8 Implementation]

 

26.8   Implementation the Project

The implementation is fairly straightforward. The first thing to do is to read the argument, which determines which batch file is to be used. This argument can be 1, 2, 3, 4, or 5. Then it will call the run function in the Dos object.

The algorithm is:

Step 1. Object d70

      The project first creates an object, d70. If this object cannot be created, the program terminates.

Step 2. Argument

      The project will then find the argument, which determines the batch file to be used. If there is any error, it will use the default 1.

Step 3. Data Files.

      If you use the command:

        C:\>…\chap26  1

      You will need the following files:

        Abm70.txt

        Bf70.txt

        Bf270.txt

        Nf70.txt

        Nf270.txt

        Tp70.txt

      These text files are used by the ImageFinder for Dos and are stored in the “.\data\” folder. If you did not change the installation folder, it is:

        “c:\transapplet70\ transapplet70.chap26\bin\Debug\data”.

      Before you can run the Dos version, you must prepare these files using the Windows version for your application.

       

Step 4. Code

        class Class1

            {

                static string sCode = "0";

                static void Main(string[] args)

                {

                    Attrasoft.TransApplet70.Dos70.Dos70 d70;

                    try

                    {

                        d70 = new Attrasoft.TransApplet70.Dos70.Dos70 ();

                    }

                    catch (Exception ee)

                    {

                        Console.Write (ee.ToString () );

                        return;

                    }

         

                    int theCode = 0;

                    if (args.Length == 0 )

                        theCode = 0;

                    else

                    {

                        sCode = args[0];

                        theCode = getCode ();

                    }

                    Console.WriteLine ("Batch Option " + theCode );

                    

                    try

                    {

                        bool b = d70.ImageFinderForDos (theCode ) ;

                        Console.Write ( d70.toString () );

                        if ( !b )

                            Console.Write ( "ImageFinder for Dos fails!" );

                    }

                    catch (Exception ee)

                    {

                        Console.Write (ee.ToString () );

                    }

        }

         

            static int getCode (  )

                {

                    int i = 0;

                    try

                    {

                        i = int.Parse (sCode);

                    }

                    catch

                    {

                        Console.WriteLine ("Invalid args!");

                        return 0;

                    }

                    if ( (i>=0 ) && (i <= 5 ) )

                        return i;

                    return 0;

                }

            }

The first section,

        d70 = new Attrasoft.TransApplet70.Dos70.Dos70 ();

creates a Dos object.

The second section,

        sCode = args[0];

        theCode = getCode (); (which calls int.Parse (sCode) )

gets the “Command Line Arguments”.

The last section,

            bool b = d70.ImageFinderForDos (theCode ) ;

calls the dos command.

 

[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