Apparatus, method and program product for matching with a template
First Claim
1. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
- template area selecting means for selecting a template area from an image for a template as a template original image;
similar image detecting means for detecting a similar image having a high correlation to the template original image selected by said template area selecting means, from said image for a template;
difference image forming means for forming a difference image between said template original image and said similar image;
modified template forming means for modifying said template original image so as to incur a penalty to said similar image during evaluation and forming a modified template, in accordance with said difference image; and
similarity degree evaluating means for calculating said modified template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
2 Assignments
0 Petitions
Accused Products
Abstract
A similar image having a high correlation is selected through autocorrelation performs a template original image selected from an image photographed for a template, and a difference image between the similar image and template original image is formed. An image extracting a real difference is formed by removing noises and edges in unstable areas from the difference image. This image is added to the template original image to form a modified template. Template matching is performed by using the modified template as a template. The image extracting the real reference and added to the modified template functions to add an evaluation penalty to the similar image during matching evaluation to lower an evaluation value of the similar image so that a probability of erroneously recognizing the similar image as the image to be detected.
-
Citations
26 Claims
-
1. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
template area selecting means for selecting a template area from an image for a template as a template original image; similar image detecting means for detecting a similar image having a high correlation to the template original image selected by said template area selecting means, from said image for a template; difference image forming means for forming a difference image between said template original image and said similar image; modified template forming means for modifying said template original image so as to incur a penalty to said similar image during evaluation and forming a modified template, in accordance with said difference image; and similarity degree evaluating means for calculating said modified template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
2. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
area extracting means for separating and extracting a background portion and a structural portion of an image for a template, and using the background portion and structural portion as area extraction data of a template area; template area selecting means for selecting a template area from the area extraction data of the template area extracted by said area extracting means; similar area extraction data detecting means for detecting similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting means; difference area extraction data forming means for forming difference area extraction data between said area extraction data of said template area and said similar area extraction data; modified area extraction template forming means for modifying said area extraction data of said template area so as to incur a penalty to said similar area extraction data during evaluation and forming a modified area extraction template, in accordance with said area extraction difference data; and similarity degree evaluating means for calculating said modified area extraction template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
3. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
area extracting means for separating and extracting a background portion and a structural portion of an image for a template, and using the background portion and structural portion as area extraction data of a template area; template area selecting means for selecting a template area from the area extraction data of the template area extracted by said area extracting means; similar area extraction data detecting means for detecting similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting means; difference area extraction data forming means for forming difference area extraction data between said area extraction data of said template area and said similar area extraction data; border-added structure recognition data forming means for forming border-added structure recognition data having a border with a predetermined width formed between the background portion and the structural portion of said area extraction data of the template area selected by said template area selecting means; modified structure recognition template forming means for modifying said border-added structure recognition data of said template area so as to incur a penalty to said border-added structure recognition data during evaluation and forming a modified structure recognition template, in accordance with said difference area extraction data; and similarity degree evaluating means for calculating said modified structure recognition template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula. - View Dependent Claims (4)
-
-
5. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided template area selecting means, similar image detecting means, difference image forming means, modified template forming means and similarity degree evaluating means; said template area selecting means selects a template area from an image for a template as a template original image; said similar image detecting means detects a similar image having a high correlation to the template original image selected by said template area selecting means, from said image for a template; said difference image forming means forms a difference image between said template original image and said similar image; said modified template forming means modifies said template original image so as to incur a penalty to said similar image during evaluation and forms a modified template, in accordance with said difference image; and said similarity degree evaluating means calculates said modified template and a partial image in each area of said input image and evaluates a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
6. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided area extracting means, template area selecting means, similar area extraction data detecting means, difference area extraction data forming means, modified area extraction template forming means, and similarity degree evaluating means; said area extracting means separates and extracts a background portion and a structural portion of an image for a template, and uses the background portion and structural portion as area extraction data of a template area; said template area selecting means selects a template area from the area extraction data of the template area extracted by said area extracting means; said similar area extraction data detecting means detects similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting means; said difference area extraction data forming means forms difference area extraction data between said area extraction data of said template area and said similar area extraction data; said modified area extraction template forming means modifies said area extraction data of said template area so as to incur a penalty to said similar area extraction data during evaluation and forms a modified area extraction template, in accordance with said area extraction difference data; and said similarity degree evaluating means calculates said modified area extraction template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
7. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided area extracting means, template area selecting means, similar area extraction data detecting means, difference area extraction data forming means, border-added structure recognition data forming means, modified structure recognition template forming means and similarity degree evaluating means; said area extracting means separates and extracts a background portion and a structural portion of an image for a template, and uses the background portion and structural portion as area extraction data of a template area; said template area selecting means selects a template area from the area extraction data of the template area extracted by said area extracting means; said similar area extraction data detecting means detects similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting means; said difference area extraction data forming means forms difference area extraction data between said area extraction data of said template area and said similar area extraction data; said border-added structure recognition data forming means forms border-added structure recognition data having a border with a predetermined width formed between the background portion and the structural portion of said area extraction data of the template area selected by said template area selecting means; said modified structure recognition template forming means modifies said border-added structure recognition data of said template area so as to incur a penalty to said border-added structure recognition data during evaluation and forms a modified structure recognition template, in accordance with said difference area extraction data; and said similarity degree evaluating means calculates said modified structure recognition template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula. - View Dependent Claims (8)
-
-
9. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
a template area selecting step of selecting a template area from an image for a template as a template original image; a similar image detecting step of detecting a similar image having a high correlation to the template original image selected by said template area selecting step, from said image for a template; a difference image forming step of forming a difference image between said template original image and said similar image; a modified template forming step of modifying said template original image so as to incur a penalty to said similar image during evaluation and forming a modified template, in accordance with said difference image; and a similarity degree evaluating step of calculating said modified template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
10. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
an area extracting step of separating and extracting a background portion and a structural portion of an image for a template, and using the background portion and structural portion as area extraction data of a template area; a template area selecting step of selecting a template area from the area extraction data of the template area extracted by said area extracting step; a similar area extraction data detecting step of detecting similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting step; a difference area extraction data forming step of forming difference area extraction data between said area extraction data of said template area and said similar area extraction data; a modified area extraction template forming step of modifying said area extraction data of said template area so as to incur a penalty to said similar area extraction data during evaluation and forming a modified area extraction template, in accordance with said area extraction difference data; and a similarity degree evaluating step of calculating said modified area extraction template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
11. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
an area extracting step of separating and extracting a background portion and a structural portion of an image for a template, and using the background portion and structural portion as area extraction data of a template area; a template area selecting step of selecting a template area from the area extraction data of the template area extracted by said area extracting step; a similar area extraction data detecting step of detecting similar area extraction data from the image for a template, said similar area extraction data having a high correlation to said area extraction data of the template area selected by said template area selecting step; a difference area extraction data forming step of forming difference area extraction data between said area extraction data of said template area and said similar area extraction data; a border-added structure recognition data forming step of forming border-added structure recognition data having a border with a predetermined width formed between the background portion and the structural portion of said area extraction data of the template area selected by said template area selecting step; a modified structure recognition template forming step of modifying said border-added structure recognition data of said template area so as to incur a penalty to said border-added structure recognition data during evaluation and forming a modified structure recognition template, in accordance with said difference area extraction data; and a similarity degree evaluating step of calculating said modified structure recognition template and a partial image in each area of said input image and evaluating a similarity degree of each area, in accordance with a predetermined evaluation formula.
-
-
12. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
template area selecting means for selecting a template area from an image for a template as a template original image; detecting means for detecting a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears; difference image forming means for forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; modified template forming means for forming a plurality of difference images by changing a reference method to said direction and said movement amount, and using a synthesized image of said plurality of difference images as a new modified template; threshold value similarity degree evaluating means for performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said modified template, to thereby evaluate of a similarity degree of each area; threshold value setting means for setting a threshold value by referring to a highest similarity degree and a second highest similarity degree among similarity degrees of areas obtained by said threshold value similarity degree evaluating means; comparison similarity degree evaluating means for performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and judging means for judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating means and said set threshold value. - View Dependent Claims (13, 14, 15)
-
-
16. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
template area selecting means for selecting a template area from an image for a template as a template original image; detecting means for detecting two directions and two movement amounts of areas near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears; difference image forming means for forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said two directions and said two movement amounts detected by said detecting means; first tentative template forming means for forming a plurality of difference images by changing a reference method to the movement amount in a first direction of said two directions and using a synthesized image of said plurality of difference images as a first tentative template; second tentative template forming means for forming a plurality of difference images by changing a reference method to the movement amount in a second direction of said two directions and using a synthesized image of said plurality of difference images and said first tentative template as a second tentative template; first similarity degree evaluating means for performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first tentative template, to thereby evaluate of a similarity degree of each area; second similarity degree evaluating means for performing template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image, and as a template said second tentative template, to thereby evaluate of a similarity degree of each area; first rate calculating means for calculating a first rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said first similarity degree evaluating means; second rate calculating means for calculating a second rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said second similarity degree evaluating means; modified template forming means for comparing said first and second ratios, and using a tentative template having a lower ratio as a modified template; comparison similarity degree evaluating means for performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and judging means for judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating means and said set threshold value.
-
-
17. A template matching apparatus, containing at least a processor, for matching an input image obtained by photographing an inspection object with a template image, comprising:
-
template area selecting means for selecting a template area from an image for a template as a template original image; detecting means for detecting a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears; difference image forming means for forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; first modified template forming means for forming a plurality of difference images by changing a reference method to said direction and said movement amount, and using a synthesized image of said plurality of difference images as a new first modified template; second modified template forming means for forming a second modified template by referring to said template original image and said first modified template; first threshold value similarity degree evaluating means for performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first modified template, to thereby evaluate of a similarity degree of each area; second threshold value similarity degree evaluating means for performing template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said second modified template, to thereby evaluate of a similarity degree of each area; threshold value setting means for forming synthesized similarity degrees of similarity degrees of areas obtained by said first and second threshold value similarity degree evaluating means and setting a threshold value by referring to a synthesized highest similarity degree and a synthesized second highest similarity degree among said synthesized similarity degrees; first comparison similarity degree evaluating means for performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said first modified template; second comparison similarity degree evaluating means for performing template matching to thereby evaluate the similarity degree of each area by using as an input image said comparison image obtained by photographing said inspection object, and as a template said second modified template; and judging means for calculating a synthesized similarity degree of similarity degrees of areas obtained by both said first and second comparison similarity degree evaluating means, and judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the synthesized similarity degree and said threshold value.
-
-
18. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided template area selecting means, detecting means for detecting a direction and a movement amount of an area where a similar morphology appears, difference image forming means, modified template forming means, threshold value similarity degree evaluating means, threshold value setting means, comparison similarity degree evaluating means, and judging means; said template area selecting means selects a template area from an image for a template as a template original image; said detecting means for detecting a direction and a movement amount of an area where a similar morphology appears detects a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears; said difference image forming means forms a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; said modified template forming means forms a plurality of difference images by changing a reference method to said direction and said movement amount, and uses a synthesized image of said plurality of difference images as a new modified template; said threshold value similarity degree evaluating means performs template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said modified template, to thereby evaluate of a similarity degree of each area; said threshold value setting means sets a threshold value by referring to a highest similarity degree and a second highest similarity degree among similarity degrees of areas obtained by said threshold value similarity degree evaluating means; said comparison similarity degree evaluating means performs template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and said judging means judges whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating means and said set threshold value.
-
-
19. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided template area selecting means, detecting means for detecting two directions and two movement amounts of areas where a similar morphology appears, difference image forming means, first tentative template forming means, second tentative template forming means, first similarity degree evaluating means, second similarity degree evaluating means, first rate calculating means, second rate calculating means, modified template forming means, comparison similarity degree evaluating means, and judging means; said template area selecting means selects a template area from an image for a template as a template original image; said detecting means for detecting two directions and two movement amounts of areas where a similar morphology appears detects two directions and two movement amounts of areas near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears; said difference image forming means forms a difference image between an image obtained by moving said image for a template and said template original image, by referring to said two directions and said two movement amounts detected by said detecting means; said first tentative template forming means forms a plurality of difference images by changing a reference method to the movement amount in a first direction of said two directions and using a synthesized image of said plurality of difference images as a first tentative template; said second tentative template forming means forms a plurality of difference images by changing a reference method to the movement amount in a second direction of said two directions and using a synthesized image of said plurality of difference images and said first tentative template as a second tentative template; said first similarity degree evaluating means performs template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first tentative template, to thereby evaluate of a similarity degree of each area; said second similarity degree evaluating means performs template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image, and as a template said second tentative template, to thereby evaluate of a similarity degree of each area; said first rate calculating means calculates a first rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said first similarity degree evaluating means; said second rate calculating means calculates a second rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said second similarity degree evaluating means; said modified template forming means compares said first and second ratios, and uses a tentative template having a lower ratio as a modified template; said comparison similarity degree evaluating means performs template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and said judging means judges whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating means and said set threshold value.
-
-
20. A template matching method for matching an input image obtained by photographing an inspection object with a template image, wherein:
-
there are provided template area selecting means, detecting means for detecting a direction and a movement amount of an area where a similar morphology appears, difference image forming means, first modified template forming means, second modified template forming means, first threshold value similarity degree evaluating means, second threshold value similarity degree evaluating means, threshold value setting means, first comparison similarity degree evaluating means, second comparison similarity degree evaluating means, and judging means; said template area selecting means selects a template area from an image for a template as a template original image;
said detecting means for detecting a direction and a movement amount of an area where a similar morphology appears detects a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting means where a similar morphology appears;said difference image forming means forms a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; said first modified template forming means forms a plurality of difference images by changing a reference method to said direction and said movement amount, and uses a synthesized image of said plurality of difference images as a new first modified template; said second modified template forming means forms a second modified template by referring to said template original image and said first modified template; said first threshold value similarity degree evaluating means performs template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first modified template, to thereby evaluate of a similarity degree of each area; said second threshold value similarity degree evaluating means performs template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said second modified template, to thereby evaluate of a similarity degree of each area; said threshold value setting means forms synthesized similarity degrees of similarity degrees of areas obtained by said first and second threshold value similarity degree evaluating means and sets a threshold value by referring to a synthesized highest similarity degree and a synthesized second highest similarity degree among said synthesized similarity degrees; said first comparison similarity degree evaluating means performs template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said first modified template; said second comparison similarity degree evaluating means performs template matching to thereby evaluate the similarity degree of each area by using as an input image said comparison image obtained by photographing said inspection object, and as a template said second modified template; and said judging means calculates a synthesized similarity degree of similarity degrees of areas obtained by both said first and second comparison similarity degree evaluating means, and judges whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the synthesized similarity degree and said threshold value.
-
-
21. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
a template area selecting step of selecting a template area from an image for a template as a template original image; a detecting step of detecting a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting step where a similar morphology appears; a difference image forming step of forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; a modified template forming step of forming a plurality of difference images by changing a reference method to said direction and said movement amount, and using a synthesized image of said plurality of difference images as a new modified template; a threshold value similarity degree evaluating step of performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said modified template, to thereby evaluate of a similarity degree of each area; a threshold value setting step of setting a threshold value by referring to a highest similarity degree and a second highest similarity degree among similarity degrees of areas obtained by said threshold value similarity degree evaluating step; a comparison similarity degree evaluating step of performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and a judging step of judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating step and said set threshold value. - View Dependent Claims (22, 23, 24)
-
-
25. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
a template area selecting step of selecting a template area from an image for a template as a template original image; a detecting step of detecting two directions and two movement amounts of areas near a predetermined area of said template original image selected by said template area selecting step where a similar morphology appears; a difference image forming step of forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said two directions and said two movement amounts detected by said detecting step; a first tentative template forming step of forming a plurality of difference images by changing a reference method to the movement amount in a first direction of said two directions and using a synthesized image of said plurality of difference images as a first tentative template; a second tentative template forming step of forming a plurality of difference images by changing a reference method to the movement amount in a second direction of said two directions and using a synthesized image of said plurality of difference images and said first tentative template as a second tentative template; a first similarity degree evaluating step of performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first tentative template, to thereby evaluate of a similarity degree of each area; a second similarity degree evaluating step of performing template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image, and as a template said second tentative template, to thereby evaluate of a similarity degree of each area; a first rate calculating step of calculating a first rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said first similarity degree evaluating step; a second rate calculating step of calculating a second rate having as a denominator a highest similarity degree value and as a numerator a second highest similarity degree value among similarity degree values of areas obtained by said second similarity degree evaluating step; a modified template forming step of comparing said first and second ratios, and using a tentative template having a lower ratio as a modified template; a comparison similarity degree evaluating step of performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said modified template; and a judging step of judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the similarity degree of each area obtained by said comparison similarity degree evaluating step and said set threshold value.
-
-
26. A template matching program for matching an input image obtained by photographing an inspection object with a template image, wherein the program is embodied in a non-transitory computer readable medium and is for implementing a sequence of operations comprising:
-
a template area selecting step of selecting a template area from an image for a template as a template original image; a detecting step of detecting a direction and a movement amount of an area near a predetermined area of said template original image selected by said template area selecting step where a similar morphology appears; a difference image forming step of forming a difference image between an image obtained by moving said image for a template and said template original image, by referring to said direction and said movement amount; a first modified template forming step of forming a plurality of difference images by changing a reference method to said direction and said movement amount, and using a synthesized image of said plurality of difference images as a new first modified template; a second modified template forming step of forming a second modified template by referring to said template original image and said first modified template; a first threshold value similarity degree evaluating step of performing template matching in accordance with a predetermined evaluation formula, by using as an input image a threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said first modified template, to thereby evaluate of a similarity degree of each area; a second threshold value similarity degree evaluating step of performing template matching in accordance with a predetermined evaluation formula, by using as an input image said threshold value detection image obtained by photographing a same area and a same object as said image for a template, and as a template said second modified template, to thereby evaluate of a similarity degree of each area; a threshold value setting step of forming synthesized similarity degrees of similarity degrees of areas obtained by said first and second threshold value similarity degree evaluating means and setting a threshold value by referring to a synthesized highest similarity degree and a synthesized second highest similarity degree among said synthesized similarity degrees; a first comparison similarity degree evaluating step of performing template matching to thereby evaluate the similarity degree of each area by using as an input image a comparison image obtained by photographing said inspection object, and as a template said first modified template; a second comparison similarity degree evaluating step of performing template matching to thereby evaluate the similarity degree of each area by using as an input image said comparison image obtained by photographing said inspection object, and as a template said second modified template; and a judging step of calculating a synthesized similarity degree of similarity degrees of areas obtained by both said first and second comparison similarity degree evaluating means, and judging whether said comparison image contains an area having a same morphology as said selected template area, in accordance with the synthesized similarity degree and said threshold value.
-
Specification