11. Batch Job11.1 Creating Batch Code
11.2 Sample Batch
11.3 Overview
11.4 Batch Execution Code
11.5 BioFilter Examples
11.6 NeuralFilter Examples
11.7 NeuralNet Filter Examples
When matching images, you will need to select many filters. For each selected filter, you will need to select many parameters.
![]()
Figure 11.1 Batch Menu.
One simple approach is:
Edge Filters: Sobel 1 (or Sobel 2)If this is your first matching and you do not like the default values, you will have go through a trial and error process. However, if this is your second matching, you can save everything in the first matching and then use a batch command. Click the "Batch/Save" menu command; you will get the batch file in the text area.
Threshold Filters: Dark Background 128
Clean Up Filter: None.
NeuralNet Filter:Segment: AutoSeg 10
Segment Cut: Trial and Error
Symmetry: Default
Blurring: Start with 5, Trial and Error
Sensitivity: Start with 50, Trial and Error.Throughout this chapter, we will use the two examples in the three previous chapters:
- Label Recognition Problem
- Logo Recognition Problem
The Filter selection and Parameter setting can be saved in one of 5 files by the following commands:
Batch/Save
Batch/Save 2
Batch/Save 3
Batch/Save 4
Batch/Save 5
These 5 commands create the batch codes and save them to 5 different files. The batch codes can also be recalled later by clicking the following commands:Batch/Open
Batch/Open 2
Batch/Open 3
Batch/Open 4
Batch/Open 5
These 5 commands open existing batch codes.A matching requires you specify the following Filters and their Parameters:
Image Preprocessing
Edge Filters;Normalization
Threshold Filters; and
Clean Up Filter.Reduction Filter.Feature RecognitionBioFilter;Pixel Level Recognition
Neural Filter.NeuralNet Filter or ABM Filter.Multi-Layered Pixel RecognitionBioFilter 2;A typical batch code looks like this:
NeuralFilter 2;
ABM Filter 2.[ImageFinder 6.0]
executionCode=1001[Input]trainFileName=None[Image Processing Filters]
searchDirName=None
fileInputName=NoneedgeFilter=1[Reduction Filter]
thresholdFilter=1
cleanUpFilter=1reductionType=0[BioFilter]
segmentCut=0
sizeCut=0
borderCut=0
lookAtX=0
lookAtY=0
lookAtXLength=0
lookAtYLength=0bioFilter=10[NeuralFilter]
bioFilterPercent=50
bioFilterMode=2
bioFilterFinal=0
bioFilterCutOff=0neuralFilter=0[Neural Net]
neuralFilterPercent=20
neuralFilterMode=0
neuralFilterSize=2
neuralFilterFinal=0
neuralFilterCutOff=0neuralNetFilter=0[BioFilter 2]
segmentX=0
segmentY=0
segmentXlength=0
segmentYLength=0
symmetry=3
rotationType=0
translationType=0
scalingType=0
sensitivity=50
blurring=5
internalWeightCut=100
externalWeightCut=100
segmentSize=0
imageType=1
fileDisplayType=0
autoSegment=0
neuralNetMode=0bioFilter=0[NeuralFilter 2]
bioFilterPercent=20
bioFilterMode=2
bioFilterFinal=0
bioFilterCutOff=0neuralFilter=0[Neural Net 2]
neuralFilterPercent=20
neuralFilterMode=0
neuralFilterSize=2
neuralFilterFinal=0
neuralFilterCutOff=0neuralNetFilter=0
segmentX=40
segmentY=40
segmentXlength=220
segmentYLength=220
symmetry=3
rotationType=0
translationType=0
scalingType=0
sensitivity=70
blurring=20
internalWeightCut=90
externalWeightCut=10000
segmentSize=0
imageType=1
fileDisplayType=0
autoSegment=0
neuralNetMode=0
This batch code has the following sections:Batch Execution Code
Input
Image Processing Filters
Reduction Filter
BioFilter
Neural Filter
NeuralNet Filter or ABM Filter
BioFilter 2
NeuralFilter 2
ABM Filter 2
When you create the batch code by command Batch/Save, you will see the above code in the text area. When you open a batch file by command Batch/Open, you will see the above code in the text area.This section will explain how batch code is used.
(1) Create an application using the ImageFinder;
(2) Save the setting to batch code with the following commands:Batch/SaveYou might find the following online note useful in helping you remember what you saved into these 5 batch files:
Batch/Save 2
Batch/Save 3
Batch/Save 4
Batch/Save 5Batch/Notes(3) Later you can open the batch file with the following commands:Batch/Open
Batch/Open 2
Batch/Open 3
Batch/Open 4
Batch/Open 5
(4) To load the parameter without running, click:Batch/Load.(5) To load the parameter and run, click:Batch/Run.The Batch/Save command saves the following information:
- Filter selection and their Parameter settings;
- The template file, which contains the records from images.
![]()
Figure 11.2 Excecution Code Window.
There are many commands in the ImageFinder. Each command has an integer for identification. This integer is called Batch Execution Code. The �Batch/Run� command uses this code to run the command specified by the batch file. To find the batch code for each command, click:
Batch/Set Execution CodeYou will see a textbox and the following codes:Template File Input:
BioFilter/N:N Match (Untrained) 1001
BioFilter/N:N Match (Trained) 1002
BioFilter/1:N Match (Untrained) 1003
BioFilter/1:N Match (Trained) 1004Directory Input:
BioFilter/N:N Match (Untrained) 1005
BioFilter/N:N Match (Trained) 1006
BioFilter/1:N Match (Untrained) 1007
BioFilter/1:N Match (Trained) 1008File Input:
BioFilter/N:N Match (Untrained) 1009
BioFilter/N:N Match (Trained) 1010
BioFilter/1:N Match (Untrained) 1011
BioFilter/1:N Match (Trained) 1012Template File Input:
NeuralFilter/N:N Match 1013
NeuralFilter/N:(N-1) Match 1014
NeuralFilter/1:N Match 1015Directory Input:
NeuralFilter/N:N Match 1016
NeuralFilter/N:(N-1) Match 1017
NeuralFilter/1:N Match 1018File Input:
NeuralFilter/N:N Match 1019
NeuralFilter/N:(N-1) Match 1020
NeuralFilter/1:N Match 1021Template File Input:
NeuralFilter/a1 + a2 ==> b2 1022
NeuralFilter/a1 + a3 ==> b3 1023
NeuralFilter/a1 + a4 ==> b4 1024
NeuralFilter/a1 + a5 ==> b5 1026Neural Net:
NeuralNet/1:N Search 1027
NeuralNet/1:N Search+Sort 1028
NeuralNet/N:N Match 1029
NeuralNet/1:N Long Search 1030
NeuralNet/1:N Long Search+Sort 1031
NeuralNet/1:N File Search 1032
NeuralNet/1:N File Search+Sort 1033
NeuralNet/N:N File Match 1034BioFilter 2:
BioFilter 2/1:N Match 1035
BioFilter 2/N:N Match 1036Neural Filter 2:
NeuralFilter 2/1:N Match 1037
NeuralFilter 2/N:N Match 1038Neural Net 2:
NeuralNet 2/1:N Match 1039The default batch code is 1001. You must specify the Batch Execution Code for your batch files. The easiest way is:
You can also make changes directly in the batch files. The batch files are abm60.txt, abm60_2.txt, abm60_3.txt, abm60_4.txt, abm60_5.txt.
- Click Batch/Set Execution Code;
- Enter the Batch Execution Code to the text box and click OK button.
In this chapter, we will reproduce the examples in the earlier chapters.
The Batch Execution can take three types of input:
For the Template Input, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly. For the File Input and Directory Input, the template file is not loaded, so the ImageFinder will first convert images to records. The ImageFinder will scan through all images in the input file or the input directory.
- Template Input
- File Input
- Directory Input
![]()
Figure 11.3 Example Menu.
![]()
Figure 11.4 Example/BioFilter Menu.
There are 8 examples in this section:
N:N Match, Untrained, Label Template
N:N Match, Trained, Label Template
1:N Match, Untrained, Label Template
1:N Match, Trained, Label Template
1:N Match, Trained, Label File
N:N Match, Trained, Label File
1:N Match, Trained, Label Directory
N:N Match, Trained, Label DirectoryThe first 4 examples use Template Input, which is fast because the conversion from Input Space to Feature Space is already done. This will be followed by 2 examples for File Input and 2 examples for Directory Input.
Example 1. Untrained N:N Matching, Template Input.
This is the Label Recognition example. This example uses Untrained N:N Matching.
The result is the same as BioFilter Untrained N:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly.
- Click �Example\BioFilter\N:N Match, Untrained, Label Template�;
- Click: Batch\Run.
Example 2. Trained N:N Matching, Template Input.
This is the Label Recognition example. This example uses Trained N:N Matching.
The result is the same as BioFilter Trained N:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly.
- Click �Example\BioFilter\N:N Match, Trained, Label Template�;
- Click: Batch\Run.
Example 3. Untrained 1:N Matching, Template Input.
This is the Label Recognition example. This example uses untrained 1:N Matching.
The result is the same as BioFilter Untrained 1:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly. However, the sample image is not converted into records in advance, so the ImageFinder will first convert the sample image into a record and then, make a 1:N matching.
- Click �Example\BioFilter\1:N Match, Untrained, Label Template�;
- Click: Batch\Run.
Example 4. Trained 1:N Matching, Template Input.
This is the Label Recognition example. This example uses Trained 1:N matching.
The result is the same as BioFilter Trained 1:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly. However, the sample image is not converted into a record in advance; so the ImageFinder will first convert the sample image into a record and then, make a 1:N Matching.
- Click �Example\BioFilter\1:N Match, Trained, Label Template�;
- Click: Batch\Run.
Example 5. Trained 1:N Matching, File Input.
This is the Label Recognition example. This example uses Trained 1:N Matching and uses the input file.
This example uses an input file, biofilterex1_input1.txt. This input file lists the first 4 pairs of images in the Label Recognition problem.
- Click �Example\BioFilter\1:N Match, Trained, Label File�;
- Click: Batch\Run.
The result is the same as BioFilter Trained 1:N matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images. After that, the ImageFinder will match the sample image with the 8 images.
Example 6. Trained N:N Matching, File Input.
This is the Label Recognition example. This example uses Trained N:N matching and uses the input file.
This example uses an input file, biofilterex1_input1.txt. This input file lists the first 4 pairs of images in the Label Recognition problem.
- Click �Example\BioFilter\N:N Match, Trained, Label File�;
- Click: Batch\Run.
The result is the same as BioFilter Trained N:N matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images. After that, the ImageFinder will match each image with the 8 images.
Example 7. Trained 1:N Matching, Directory Input.
This is the Label Recognition example. This example uses Trained 1:N matching and uses the directory file.
This example uses an input directory, �.\biofilterex2\�, where �.\� is the ImageFinder directory. This input directory lists the first 4 pairs of images in the Label Recognition problem.
- Click �Example\BioFilter\1:N Match, Trained, Label Directory�;
- Click: Batch\Run.
The result is the same as BioFilter Trained 1:N matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images. After that, the ImageFinder will match the sample image with the 8 images.
Example 8. Trained N:N Matching, Directory Input.
This is the Label Recognition example. This example uses Trained N:N matching and uses the directory file.
This example uses an input directory, �.\biofilterex2\�, where �.\� is the ImageFinder directory. This input directory lists the first 4 pairs of images in the Label Recognition problem.
- Click �Example\BioFilter\N:N Match, Trained, Label Directory�;
- Click: Batch\Run.
The result is the same as BioFilter Trained N:N matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images. After that, the ImageFinder will match each image with the 8 images.
The Batch Execution can take three types of input:
For the Template Input, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the records directly. For the File Input and Directory Input, the template file is not loaded, so the ImageFinder will first convert images to records. The ImageFinder will scan through all images in the input file or the input directory.
- Template Input
- File Input
- Directory Input
There are 10 examples in this section:
N:N Match, Label Template
N:N-1 Match, Label Template
1:N Match, Label Template
N:N Match, Label File
N:N-1 Match, Label File
1:N Match, Label File
N:N Match, Label Directory
N:N-1 Match, Label Directory
1:N Match, Label Directory
N:N Match, Logo TemplateThe first 9 examples are for the Label Identification problem and the last one is for Logo Identification. The results will match the Neural-Filter chapter and the NeuralNet Filter chapter.
The first 3 examples use Template Input, which is fast because the conversion from Input Space to Feature Space is already done. This will be followed by 3 examples for File Input and 3 examples for Directory Input.
Example 1. N:N Matching, Template Input.
This is the Label Recognition example. This example uses N:N Matching.
The result is the same as NeuralFilter N:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly.
- Click �Example\NeuralFilter\N:N Match, Label Template�;
- Click: Batch\Run.
Example 2. N:N-1 Matching, Template Input.
This is the Label Recognition example. This example uses N:N-1 Matching.
The result is the same as NeuralFilter N:N-1 Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the saved records directly.
- Click �Example\NeuralFilter\N:N-1 Match, Label Template�;
- Click: Batch\Run.
Example 3. 1:N Matching, Template Input.
This is the Label Recognition example. This example uses 1:N Matching.
The result is the same as NeuralFilter 1:N Matching. In this example, the template file is loaded, so the ImageFinder does not convert images to records, but rather works on the records directly.
- Click �Example\NeuralFilter\1:N Match, Label Template�;
- Click: Batch\Run.
Example 4. N:N Matching, File Input.
This is the Label Recognition example. This example uses N:N Matching.
This example uses an Input File, biofilterex1_input1.txt. This input file lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter N:N Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\N:N Match, Label File�;
- Click: Batch\Run.
Example 5. N:N-1 Matching, File Input.
This is the Label Recognition example. This example uses N:N-1 Matching.
This example uses an input file, biofilterex1_input1.txt. This input file lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter N:N-1 Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\N:N-1 Match, Label File�;
- Click: Batch\Run.
Example 6. 1:N Matching, File Input.
This is the Label Recognition example. This example uses 1:N Matching.
This example uses an input file, biofilterex1_input1.txt. This input file lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter 1:N Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\1:N Match, Label File�;
- Click: Batch\Run.
Example 7. N:N Matching, Directory Input.
This is the Label Recognition example. This example uses N:N Matching.
This example uses an input directory, �.\biofilterex2\�, where �.\� is the ImageFinder directory. This input directory lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter N:N Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\N:N Match, Label Directory�;
- Click: Batch\Run.
Example 8. N:N-1 Matching, Directory Input.
This is the Label Recognition example. This example uses N:N-1 Matching.
This example uses an input directory, �.\biofilterex2\�, where �.\� is the ImageFinder directory. This input directory lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter N:N-1 Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\N:N-1 Match, Label Directory�;
- Click: Batch\Run.
Example 9. 1:N Matching, Directory Input.
This is the Label Recognition example. This example uses 1:N Matching.
This example uses an input directory, �.\biofilterex2\�, where �.\� is the ImageFinder directory. This input directory lists the first 4 pairs of images in the Label Recognition problem. The result is the same as NeuralFilter N:N Matching. In this example, the template file is not loaded, so the ImageFinder will first convert images to records. There are 8 images in this example; you will see the ImageFinder scan through these 8 images.
- Click �Example\NeuralFilter\1:N Match, Label Directory�;
- Click: Batch\Run.
Example 10. N:N Matching, Logo Identification, Template Input.
This is the Logo Recognition example. This example uses N:N Matching.
11.7 NeuralNet Filter Examples
- Click �Example\NeuralFilter\N:N Match, Logo Template�;
- Click: Batch\Run.
This section has 2 Logo Recognition examples, 1:N Matching via file input and N:N Matching via file input. The Logo Recognition example in the last chapter is 1:N Match. We will also use the same example for N:N Matching.
Example 1. 1:N Matching, File Input.
This is the Logo Recognition example. This example uses 1:N Matching.
The result is the same as NeuralNet Filter 1:N Matching.
- Click �Example\Neural Net\1:N Match, Logo, File�;
- Click: Batch\Run.
In this example, the input file is the output file of the Neural Filter, so the results cover both Feature Space recognition (Neural Filter) and Input Space recognition (NeuralNet Filter).
Example 2. N:N Matching, File Input.
This is the Logo Recognition example. This example uses N:N Matching.
In this example, the input file is the output file of the Neural Filter, so the results cover both Feature Space recognition (Neural Filter) and Input Space recognition (NeuralNet Filter). The input file has many blocks of data; in each block, the first line is the Neural Filter input, and the rest of the lines are Neural-Filter output. The N:N Matching will only process the first block and ignore the rest of the data. The ImageFinder will match each image in the first block against all other images in the first block.
- Click �Example\Neural Net\N:N Match, Logo, File�;
- Click: Batch\Run.
Return