12.4 Key Signature
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

12.1 Signature Menu 
12.2 API 
12.3 Objects 
12.4 Key Signature 
12.5 Signature File 
12.6 Implementation 
12.7 Examples 
[Home][12 Image Signatures][12.4 Key Signature]

 

12.4   Key Signature

You can collect the signature(s) of the left image, the right image, and all of the images in a folder. To compute the signature of an image:

  •    Click the “Key” button to select a key image or sample image;
  •    Click the “Signature/Left Signature (Key)” to compute the signature.

Example. Left Signature.

To continue from Figure 3.4, click the “Clear” button to clear the text box. Click “Signature/Left Signature (Key)” and you will see Figure 12.2.

Figure 12.2  Click “Signature/Left Signature (Key)”.

The Signature looks like:

      1591    26  23  26  23  …

Similarly, click “Signature/Right Signature” and you will get an image signature for the right image.

In 1:1 Matching or 1:N Matching, the signatures are computed behind the screen; you do not need to use the signature directly. The menu item “Signature/Left Signature (Key)” shows you the mechanism behind the screen so you can see what a signature looks like.

Now we implement these two menu items. Double click these menu items and enter:

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

          {

          this.mainMenuToAPI.signature_Key_Signature ( textBox1.Text );

          }

Here, mainMenuToAPI is an object, which will implement all functions. As we discussed in the last chapter, the main form simply links menu items to functions in the mainMenuToAPI object. The implementation is:

 

      public bool signature_Key_Signature ( string key)

          {

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

              {

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

                  return false;

              }

       

              int x =0, y = 0, w =0, h = 0;

              try

              {

                  x = int.Parse (f.textBox3.Text );

                  y = int.Parse (f.textBox4.Text );

                  w = int.Parse (f.textBox5.Text );

                  h = int.Parse (f.textBox6.Text );

              }

              catch

              {

                  setText ("Invalid integers!\n");

                  x= 0;

                  y = 0;

                  w = 0;

                  h = 0;

                  return false;

              }

       

              script.ImageSignature

                  = script.signatureFilter.getSignature (key, "1 of 1:N", x, y, w, h );

       

              if ( script.imageSignature != null )

                  {

                      setLine ("The Signature for the left picture box:");

                      appendLine (script.imageSignature.toString () );

                      return true;

                  }

              else

                  return false;

              }

The following section of code simply makes sure the key image exists:

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

              {

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

                  return false;

              }

The following section of code computes (x, y, w, h) of the key segment:

      int x =0, y = 0, w =0, h = 0;

              try

              {

                  x = int.Parse (f.textBox3.Text );

                  y = int.Parse (f.textBox4.Text );

                  w = int.Parse (f.textBox5.Text );

                  h = int.Parse (f.textBox6.Text );

              }

              catch

              {

                  setText ("Invalid integers!\n");

                  x= 0;

                  y = 0;

                  w = 0;

                  h = 0;

      return false;

              }

The following section of code computes the signature of the key segment:

      script.ImageSignature

              = script.signatureFilter.getSignature (key, "1 of 1:N", x, y, w, h );       

In this statement, the script object contains all of the objects required for the ImageFinder project. In particular, “script.ImageSignature” is the image signature object; and script.signatureFilter is the signature filter object. The parameter, "1 of 1:N", is the ID, which we arbitrarily assigned to the key image. The following section of code prints the signature of the key segment in the text window:

      if ( script.imageSignature != null )

              {

                  setLine ("The Signature for the left picture box:");

                  appendLine (script.imageSignature.toString () );

                  return true;

              }

The menu item, “Signature/Right Signature”, is implemented in a similar fashion.

 

[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