WO2014024854A1 - 画像処理装置、画像処理方法および画像処理プログラム - Google Patents

画像処理装置、画像処理方法および画像処理プログラム Download PDF

Info

Publication number
WO2014024854A1
WO2014024854A1 PCT/JP2013/071196 JP2013071196W WO2014024854A1 WO 2014024854 A1 WO2014024854 A1 WO 2014024854A1 JP 2013071196 W JP2013071196 W JP 2013071196W WO 2014024854 A1 WO2014024854 A1 WO 2014024854A1
Authority
WO
WIPO (PCT)
Prior art keywords
template
image
candidate
search
input image
Prior art date
Application number
PCT/JP2013/071196
Other languages
English (en)
French (fr)
Inventor
墨友 博則
Original Assignee
コニカミノルタ株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by コニカミノルタ株式会社 filed Critical コニカミノルタ株式会社
Priority to EP13827663.9A priority Critical patent/EP2884459A4/en
Priority to US14/420,602 priority patent/US20150186422A1/en
Priority to JP2013555701A priority patent/JP5541426B1/ja
Publication of WO2014024854A1 publication Critical patent/WO2014024854A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5854Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using shape and object relationship
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/28Determining representative reference patterns, e.g. by averaging or distorting; Generating dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/772Determining representative reference patterns, e.g. averaging or distorting patterns; Generating dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/776Validation; Performance evaluation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/06Recognition of objects for industrial automation

Definitions

  • the present invention relates to an image processing apparatus, an image processing method, and an image processing program for generating a template used for searching for an object included in an input image.
  • Patent Document 1 discloses an article position detection apparatus.
  • the position detection device detects the position of the detected part by scanning a template having a pattern corresponding to the shape of the detected part on the screen where the detected part is imaged and matching them.
  • a plurality of templates each having a pattern corresponding to the shape of each part when the shape of the detected part is divided into a plurality of parts are set as templates. Are matched with the corresponding part image, and the position of the entire detected part is obtained from the result.
  • Patent Document 2 discloses a dead zone region setting method for template matching.
  • the template image and the detected object image are stored, the stored template image and the detected object image are divided into partial images, the partial images are subjected to template matching processing, and correlation is performed.
  • the partial image area of the template image is set as a dead zone area.
  • a phase-only correlation (hereinafter also referred to as “POC method”) is known.
  • This POC method searches for corresponding points between images using phase difference information of spatial frequencies included in the images, and is excellent in robustness.
  • Rotation Invariant Phase Only Correlation (hereinafter referred to as “RIPOC method”) is an extended method of the POC method when there is a magnification difference and / or rotation difference between two images to be searched. .)) And / or a POC method corresponding to rotation.
  • Patent Document 3 discloses a pattern matching apparatus using the RIPOC method. This pattern collation apparatus collates an N-dimensional pattern (for example, fingerprint (two-dimensional) or three-dimensional (three-dimensional)) based on the spatial frequency characteristics. It is intended to be able to identify whether or not are the same.
  • the template used for the matching process as described above is an image corresponding to a part or all of the target object included in the input image.
  • the matching process is successful when the movable part of the object in the input image is not at the same position as the template. It may not be possible.
  • the above-mentioned Japanese Patent Application Laid-Open No. 06-317406 (Patent Document 1) and Japanese Patent Application Laid-Open No. 06-089343 (Patent Document 2) divide a template into a plurality of partial areas.
  • An object of the present invention is to provide an image processing apparatus, an image processing method, and an image processing program that can generate a template suitable for search processing (matching processing) using frequency information of an image.
  • an image processing apparatus having a function of generating a template used for searching for an object in an input image.
  • the image processing apparatus includes a first image acquisition unit that acquires a first input image including the target object, and a second input that includes the target object and position information in the image of the target object is known.
  • a second image acquisition unit that acquires an image and a candidate area set in the first input image so as to include the target object are divided into a plurality of small areas, and a single small area or adjacent to each other
  • a template candidate setting unit that sets a plurality of rectangular template candidates composed of a plurality of small regions, and a search process for the target object using each template candidate in the second input image, and execution of the search process Based on the result, a calculation unit that calculates the search accuracy of each template candidate, and a plurality of portions from the plurality of template candidates based on the search accuracy and the size of each template candidate Plates select, and a generator for generating a set of selected portions template as the template.
  • the calculation unit is configured to calculate frequency information from each template candidate and a region corresponding to the template candidate set in the second input image, and based on the frequency information And an object search unit for executing the object search process.
  • the generation unit includes a selection index calculation unit that calculates a selection index based on the similarity calculated by the search process and a weighting factor that depends on the size of the template candidate, and the selection index calculation unit.
  • a selection unit that selects a template candidate having a larger calculated selection index as the partial template.
  • the image processing device includes a third image acquisition unit that acquires a third input image to be searched for the target, and each of the plurality of partial templates with respect to the third input image. And a search unit that outputs position information of the target object in the third input image based on the result of each search process.
  • the image processing apparatus stores a similarity for each of the plurality of partial templates calculated as a result of the search processing by the search unit over the plurality of third input images, And a weight changing unit that changes weights in the search unit for the plurality of partial templates based on temporal changes in the similarity stored in the storage unit.
  • the template candidate setting unit expands the candidate area and sets the template candidate again when the calculation unit cannot calculate effective search accuracy for any template candidate.
  • the template candidate setting unit sets the template candidate again after changing the position of the candidate region when the calculation unit cannot calculate effective search accuracy for any template candidate.
  • an image processing method for generating a template used for searching for an object in an input image includes a step of acquiring a first input image including the object, and a step of acquiring a second input image including the object and having known position information in the image of the object.
  • the candidate area set in the first input image so as to include the object is divided into a plurality of small areas, and a rectangular template comprising a single small area or a plurality of adjacent small areas
  • a step of setting a plurality of candidates, a search process for the target object using each template candidate in the second input image, and a search accuracy of each template candidate are calculated based on the execution result of the search process
  • an image processing program for generating a template used for searching for an object in an input image.
  • the image processing program acquires, in a computer, a first input image that includes the target object, and a second input image that includes the target object and whose position information in the target object image is known. And acquiring the candidate area set in the first input image so as to include the object, and dividing the candidate area into a plurality of small areas and including a single small area or a plurality of small areas adjacent to each other.
  • a step of setting a plurality of rectangular template candidates, a search process for the target object using each template candidate in the second input image, and a search for each template candidate based on the execution result of the search process Based on the step of calculating accuracy and the search accuracy and the size of each template candidate, a plurality of partial texts are extracted from the plurality of template candidates. Plates select, to the set of selected portions templates and a step of generating as the template.
  • a template suitable for search processing (matching processing) using frequency information of an image can be generated.
  • FIG. 1 It is a figure which shows an example of the production
  • the present embodiment is directed to an image processing apparatus and an image processing method for generating a template used for searching for an object in an input image.
  • a template matching process using a template registered in advance is used for searching for an object in the input image.
  • the matching process is executed using a plurality of partial templates (hereinafter, the combination is also referred to as “integrated template”) generated by the process described later.
  • This integrated template is composed of a plurality of partial templates selected from a plurality of template candidates.
  • FIG. 1 is a schematic diagram showing an application example of template matching according to the embodiment of the present invention.
  • system 1 according to the present embodiment is applied to a production line including belt conveyor 3 as an example.
  • the object 2 (work) is continuously conveyed by the belt conveyor 3 and is imaged by the camera 10 to capture an image including the appearance of the object 2 (hereinafter also referred to as “input image”). Is acquired.
  • the input image is transmitted to the image processing apparatus 100.
  • the image processing apparatus 100 searches for the target object 2 in the input image based on the integrated template 18 stored in advance.
  • the image processing apparatus 100 outputs information (hereinafter also referred to as “position information”) such as the position and rotation amount of the object 2 obtained by the template matching process.
  • This position information indicates at least the position of the object 2 in the input image, and includes information such as the rotation amount and magnification (corresponding to the position of the camera in the optical axis direction) of the object 2 in addition to this position. It doesn't matter.
  • frequency information of the image is used.
  • the present embodiment provides a function for efficiently and easily generating a template that does not include such an ineligible region.
  • FIG. 2 is a block diagram showing a configuration when template matching according to the embodiment of the present invention is realized by a personal computer.
  • an image processing apparatus 100 realized by a personal computer is mainly mounted on a computer having a general-purpose architecture.
  • an image processing apparatus 100 includes, as main components, a CPU (Central Processing Unit) 102, a RAM (Random Access Memory) 104, a ROM (Read Only Memory) 106, and a network interface (I / F). ) 108, auxiliary storage device 110, display unit 120, input unit 122, memory card interface (I / F) 124, and camera interface (I / F) 128.
  • Each component is communicably connected to each other via a bus 130.
  • the CPU 102 executes various programs, such as an operating system (OS), a template generation processing program 112, and a template matching processing program 114, which are stored in the ROM 106, the auxiliary storage device 110, and the like. To control the whole.
  • the RAM 104 functions as a working memory for executing a program by the CPU 102, and temporarily stores various data necessary for executing the program.
  • the ROM 106 stores an initial program (boot program) that is executed when the image processing apparatus 100 is started.
  • the network interface 108 exchanges data with other devices (such as server devices) via various communication media. More specifically, the network interface 108 is connected via a wired line such as Ethernet (registered trademark) (LAN (Local Area Network), WAN (Wide Area Network), etc.) and / or a wireless line such as a wireless LAN. Perform data communication.
  • a wired line such as Ethernet (registered trademark) (LAN (Local Area Network), WAN (Wide Area Network), etc.) and / or a wireless line such as a wireless LAN. Perform data communication.
  • the auxiliary storage device 110 typically includes a large-capacity magnetic recording medium such as a hard disk, and is an image processing program (a template generation processing program 112 and a template matching processing program 114) for realizing various processes according to the present embodiment. ), A template generation image 12, a test image 14, an integrated template 18, and the like. Further, the auxiliary storage device 110 may store a program such as an operating system.
  • the template generation image 12 is used to generate the integrated template 18.
  • an integrated template 18 suitable for matching processing is generated by processing as described later.
  • the display unit 120 displays a GUI (Graphical User Interface) screen provided by the operating system, an image generated by executing the template generation processing program 112 and the template matching processing program 114, and the like.
  • GUI Graphic User Interface
  • the input unit 122 typically includes a keyboard, a mouse, a touch panel, and the like, and outputs the content of the instruction received from the user to the CPU 102 or the like.
  • the memory card interface 124 reads / writes data from / to various memory cards (nonvolatile recording media) 126 such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card.
  • nonvolatile recording media such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card.
  • the camera interface 128 takes in the template generation image 12, the test image 14, the integrated template 18, and / or the input image acquired from imaging the subject such as the object 2 from the camera 10.
  • the camera 10 functions as an image acquisition unit that acquires images.
  • the main body of the image processing apparatus 100 may not have a function of capturing an image of a subject.
  • a necessary image is captured via a memory card 126 that stores various images acquired by some device. That is, the memory card 126 is attached to the memory card interface 124, and various images read from the memory card 126 are stored (copied) in the auxiliary storage device 110 or the like.
  • the template generation processing program 112 and / or the template matching processing program 114 stored in the auxiliary storage device 110 is stored and distributed on a recording medium such as a CD-ROM (Compact Disk-Read Only Memory) or the network. Via the server device.
  • the template generation processing program 112 and / or the template matching processing program 114 is a predetermined timing and order of necessary modules among program modules provided as part of an operating system executed by the image processing apparatus 100 (personal computer). May be called to implement the processing.
  • the template generation processing program 112 and / or the template matching processing program 114 itself does not include a module provided by the operating system, and image processing is realized in cooperation with the operating system.
  • the template generation processing program 112 and / or the template matching processing program 114 may be provided by being incorporated in a part of some program instead of a single program. Even in such a case, the program itself does not include modules that are used in common with other programs, and image processing is realized in cooperation with the other programs. Even such a template generation processing program 112 that does not include some modules does not depart from the spirit of the image processing apparatus 100 according to the present embodiment.
  • part or all of the functions provided by the template generation processing program 112 and / or the template matching processing program 114 may be realized by dedicated hardware.
  • ⁇ b3: Realization Example with Other Configuration
  • the personal computer described above may be mounted on a digital camera, a mobile phone, or a smartphone. Further, it may be in the form of a so-called cloud service in which at least one server device realizes processing according to the present embodiment.
  • the user transmits at least two processing target images to the server device (cloud side) using his / her terminal (such as a personal computer or a smartphone), and the server device is transmitted to the transmitted processing target image.
  • the server device side is assumed.
  • FIG. 3 is a schematic diagram for describing an overview of template generation processing according to the first embodiment of the present invention.
  • the template generation process is basically executed off-line from the production line, not on-line like the production line shown in FIG. However, it may be executed online as long as it is in an environment where an image described below can be acquired.
  • the image processing apparatus 100 acquires a template generation image 12 (first input image) including the object 2 by the camera 10. An integrated template 18 described later is generated from the template generation image 12. At least one template generation image 12 is sufficient, but a plurality of images may be acquired.
  • the image processing apparatus 100 acquires the test image 14 (second input image) that includes the target object 2 and whose position information in the image of the target object 2 is known. That is, it is assumed that the position information of the object 2 in the test image 14 is known.
  • the position information of the object 2 may be specified by performing a matching process in advance, or may be specified visually by the user.
  • one of the input images generated by imaging the object 2 using the camera 10 a plurality of times is selected as the test image 14, and the remaining one or a plurality of images are for template generation. Selected as image 12.
  • the image processing apparatus 100 divides the candidate area 13 set in the template generation image 12 so as to include the target object 2 into a plurality of rectangular small areas, and is adjacent to a single small area or to each other. A plurality of rectangular template candidates 16 composed of a plurality of small areas are set. Then, the image processing apparatus 100 executes a matching process using each template candidate 16 on the test image 14 and calculates the search accuracy of each template candidate 16 based on the execution result of the matching process. More specifically, since the position information of the target object 2 in the test image 14 is known, the image processing apparatus 100 increases the search accuracy based on the difference between the execution result of the matching process and the known position information. evaluate.
  • the image processing apparatus 100 selects a plurality of partial templates from the plurality of template candidates 16 based on the search accuracy, and generates a combination of the selected partial templates as the integrated template 18. Therefore, the integrated template 18 includes a plurality of selected template candidates 16 (partial templates). Details of the matching process using the integrated template 18 will be described later.
  • FIG. 4 is a block diagram showing a functional configuration of image processing apparatus 100 according to the first embodiment of the present invention.
  • image processing apparatus 100 has, as its main functional configuration, template generation image acquisition unit 150, test image acquisition unit 152, candidate region setting unit 154, and candidate region division.
  • the template generation image acquisition unit 150 acquires an input image for generating the integrated template 18. Typically, an image generated when the connected camera 10 images a subject is acquired as the template generation image 12. More specifically, the template generation image acquisition unit 150 uses one input image as the template generation image 12 from input images obtained by photographing the object 2 in advance using the camera 10. To do.
  • the template generation image 12 includes an object 2 that is a subject.
  • the template generation image 12 may be a plurality of images instead of one.
  • an integrated template 18 may be generated for each of the plurality of template generation images 12, and one optimal integrated template 18 may be selected from these integrated templates 18.
  • the template generation image acquisition unit 150 receives a plurality of template generation images 12 and performs statistical processing (for example, an average process) on the template generation images 12 to obtain a single sheet.
  • the template generation image 12 may be created.
  • Test Image Acquisition Unit 152 acquires the test image 14 used for processing in the calculation unit 160 described later.
  • the test image acquisition unit 152 acquires the test image 14 including the object 2 separately from the template generation image 12.
  • one image generated by the connected camera 10 capturing an image of the subject is acquired as the test image 14.
  • the test image acquisition unit 152 selects one input that was not used as the template generation image 12 from the input images obtained by photographing the object 2 in advance using the camera 10.
  • the image is used as the test image 14.
  • the test image 14 includes the object 2 that is a subject.
  • the test image acquisition unit 152 acquires position information (correct information) of the object 2 in the test image 14 using a known method.
  • Candidate area setting unit 154 sets a candidate area (template area) for the template generation image 12 acquired by the template generation image acquisition unit 150. That is, the candidate area setting unit 154 sets a candidate area (template area) in the image obtained from the template generation image acquisition unit 150.
  • This candidate area may be explicitly designated by the user, or may be automatically set using a known method. As a general method, the candidate area is set so that the position of the center of gravity of the candidate area coincides with the place where position detection is desired (for example, the center position of the object 2).
  • the candidate area may be set at a position separated by a certain amount ( ⁇ x, ⁇ y) from the position to be searched.
  • the position to be searched can be specified by shifting the result by a certain amount ( ⁇ x, ⁇ y) with respect to the position to be searched using the integrated template 18. At this time, the position to be searched does not need to be included in the template.
  • the candidate area may be a rectangular area having an arbitrary size.
  • the size (number of pixels) of the candidate area (template area) is preferably a power of 2 so that the fast Fourier transform can be adopted as the Fourier transform.
  • the candidate area dividing unit 156 divides the candidate area (template area) set for the template generation image 12 into a plurality of rectangular small areas. That is, the candidate area dividing unit 156 divides the candidate area set in the template generation image 12 so as to include the target object 2 into a plurality of small areas.
  • FIG. 5 is a diagram showing an example of candidate area division processing in image processing apparatus 100 according to Embodiment 1 of the present invention. Referring to FIG. 5, for example, when a candidate area having a size of 128 ⁇ 128 is set, the candidate area is divided into 4 ⁇ 4 so that the size of each small area becomes 32 ⁇ 32.
  • Each small region that divides the candidate region may be a rectangular region having an arbitrary size.
  • the size of each small region obtained by dividing the candidate region is preferably a power of 2 so that the fast Fourier transform can be adopted as the Fourier transform.
  • Template candidate generation unit 158 sets a plurality of rectangular template candidates composed of a plurality of small regions that are single or adjacent to each other for the small regions divided by the candidate region dividing unit 156. That is, the template candidate generation unit 158 combines the small areas divided by the candidate area dividing unit 156 so as to become rectangular areas. In other words, the template candidate generation unit 158 generates a plurality of template candidates by combining the divided areas with adjacent areas.
  • each small area divided by the candidate area dividing unit 156 is expressed as “block”, the candidate area is configured by 4 ⁇ 4 blocks in the example shown in FIG.
  • This candidate area is defined as 1 ⁇ 1, 1 ⁇ 2, 1 ⁇ 3, 1 ⁇ 4, 2 ⁇ 1, 2 ⁇ 2, 2 ⁇ 3, 2 ⁇ 4, 3 ⁇ 1, 3 ⁇ 2, 3 ⁇ 3, 3
  • a rectangular area (template candidate 16) is generated by combining 16 patterns of x4, 4x1, 4x2, 4x3, and 4x4.
  • FIG. 6 shows an example of template candidate (2 ⁇ 1 block) generation processing in image processing apparatus 100 according to the first embodiment of the present invention.
  • FIG. 7 is a diagram showing an example of template candidate (3 ⁇ 2 block) generation processing in image processing apparatus 100 according to Embodiment 1 of the present invention.
  • the number of template candidates set for each pattern described above is as follows. (1) 1 ⁇ 1 pattern: 16 (2) 1 ⁇ 2 pattern: 12 (3) 1 ⁇ 3 pattern: 8 (4) 1 ⁇ 4 pattern: 4 (5) 2 ⁇ 1 Pattern: 12 (6) 2 ⁇ 2 pattern: 9 (7) 2 ⁇ 3 pattern: 6 (8) 2 ⁇ 4 pattern: 3 (9) 3 ⁇ 1 pattern: 8 ( 10) 3 ⁇ 2 pattern: 6 (11) 3 ⁇ 3 pattern: 4 (12) 3 ⁇ 4 pattern: 2 (13) 4 ⁇ 1 pattern: 4 (14) 4 ⁇ 2 Pattern: 3 (15) 4 ⁇ 3 pattern: 2 (16) 4 ⁇ 4 pattern: 1 As described above, basically, by combining all the combinations of adjacent blocks, the template Candidates are set.
  • Calculation unit 160 executes matching processing using each template candidate 16 in the test image 14 and calculates search accuracy of each template candidate 16 based on the execution result of the matching processing. That is, the calculation unit 160 searches for the target object 2 in the test image 14 using each of the plurality of template candidates 16. In the present embodiment, the RIPOC method is used as the search method, and the correlation value between the test image 14 and each template candidate is calculated.
  • the matching process executed by the calculation unit 160 is the same method as the matching process executed for searching the object 2 by the image processing apparatus 100 of FIG. 1, and uses the frequency information of the image. It is.
  • FIG. 8 is a schematic diagram for illustrating matching processing (RIPOC method) in calculation unit 160 according to the first embodiment of the present invention.
  • FIG. 9 is a schematic diagram for explaining in detail the processing content of the matching processing (RIPOC method) shown in FIG.
  • the RIPOC method calculates how much the extraction region is rotated with respect to the template, and obtains the processing by correcting the rotation angle of the template (reference numeral 160A) and correcting the rotation angle. Processing (reference numeral 160B) for calculating how much similarity and parallel movement amount exist between the corrected template and the extraction region.
  • each template candidate 16 is used as a “template”, an area having the same size as this template is sequentially set in the test image 14, and these are used as “extraction area images”.
  • the calculation unit 160 includes Fourier transform units 161 and 164, logarithmic processing units 162 and 165, polar coordinate conversion units 163 and 166, a first POC processing unit 167, a rotation amount correction unit 168, A second POC processing unit 169.
  • Fourier transform units 161 and 164 calculate frequency information (amplitude component and phase component) included in the template and the extracted region image, respectively.
  • the phase component is not necessarily required, and thus may not be calculated.
  • the logarithmic processing unit 162 and the polar coordinate conversion unit 163 logarithmize the amplitude component of the template and convert it to polar coordinates.
  • the logarithmic processing unit 162 and the polar coordinate conversion unit 166 logarithmize the amplitude component of the extracted region image and convert it to polar coordinates.
  • the rotation amount is expressed as a coordinate point on two-dimensional coordinates.
  • the first POC processing unit 167 performs a correlation operation on the results of the polar coordinate conversion output from the polar coordinate conversion units 163 and 166, respectively, and calculates the rotation amount.
  • the rotation amount correction unit 168 corrects the rotation of the template according to the rotation amount calculated by the first POC processing unit 167. That is, the rotation amount correction unit 168 generates a correction template by correcting the rotation of the template.
  • a method of rotating and correcting the template in the rotation amount correcting unit 168 a method of rotating the template itself in real space can be employed.
  • the second POC processing unit 169 handles the frequency space, it is not necessary to rotate in the real space, and the data (amplitude information and phase information) after the Fourier transform, which is an internal representation of the POC processing, is not necessary. ) May be adopted.
  • the second POC processing unit 169 performs POC processing (phase-only correlation processing) between the correction template and the extraction region image, and calculates a similarity and a position (a parallel movement amount between images).
  • the peak value of the POC process indicates the similarity between the images, and the peak position indicates the amount of parallel movement (position shift amount) between the images. Therefore, the positional relationship between the correction template and the extraction area image can be understood.
  • the second POC processing unit 169 outputs position information including the rotation amount.
  • FIG. 9 schematically shows a processing result in the second POC processing unit 169.
  • a peak appears at a certain position as shown in the correlation image of FIG. 9 by calculating a correlation value between components of spatial frequencies included in each of the images.
  • This peak position is the amount of parallel movement between images, and the size of the peak is the similarity between images. Note that the amount of parallel movement between images can be generally calculated by searching a range of about ⁇ 1/4 of the template image size.
  • the calculation unit 160 performs a search process of the target object 2 in the test image 14 using each template candidate 16. As a result of this search processing, position information and similarity obtained by each template candidate 16 are output.
  • Integrated template generation unit 170 outputs a combination of a plurality of partial templates (template candidates 16) selected based on the search accuracy and size obtained by the calculation unit 160 from among the plurality of template candidates 16 as the integrated template 18. .
  • the integrated template generation unit 170 generates a combination of a plurality of template candidates as the integrated template 18 based on the position information, the similarity, and the size of the template candidate 16.
  • the integrated template generation unit 170 generates the integrated template 18 composed of a plurality of partial templates in which the relative positional relationship is maintained. A method for combining the template candidates 16 will be described below.
  • the best template is one that has a high degree of similarity (correlation value: POC peak value) and a large size.
  • the template candidate 16 is selected as the first partial template. If there is a template candidate 16 having the maximum similarity and the maximum size from the remaining template candidates 16, the template candidate 16 is selected as the second partial template.
  • the similarity is a very effective index for the test image 14 prepared in advance, but it is preferable to place importance on the template size from the viewpoint of robustness.
  • the template candidate 16 having a larger template size can stabilize the search accuracy and can expand the search area. Therefore, if the similarity is the same, the template candidate 16 having a larger template size is selected. Further, even if the degree of similarity is slightly inferior, if the template size is sufficiently large, it is desirable to select a larger template candidate 16 with emphasis on the template size.
  • the template candidate 16 used for the integrated template 18 for example, for each template candidate 16, an index is obtained by multiplying the weight coefficient set depending on the template size by the calculated similarity. While calculating R, the template candidate 16 may be selected based on the magnitude relationship of the index R. That is, the index R is calculated according to the following equation (1).
  • the index R is calculated for each template candidate 16, and a predetermined number (for example, three) of template candidates 16 are selected in descending order of the value of the index R.
  • the selected template candidate 16 is used as the integrated template 18.
  • the integrated template generation unit 170 configures the integrated template 18 as a final template by the predetermined number of selected template candidates 16.
  • the corresponding positions are obtained using the respective template candidates (partial templates) 16, and the corresponding positions are averaged. It is output as a search result by the integrated template 18.
  • the integrated template generation unit 170 has a weighting factor that depends on the similarity calculated by the calculation unit 160 and the size (template size) of the template candidate 16 for the template candidate 16 from which accurate position information is obtained. Based on the above, the index R is calculated. Then, the integrated template generation unit 170 determines the template candidate 16 having a larger calculated index R as a partial template to be used as the integrated template 18.
  • the weight coefficient between the template candidates 16 may be determined based on the size of the positional deviation amount of the template candidates 16, the size of the similarity, and the size of the template candidates 16.
  • the following method may be used instead of or in addition to the above.
  • a combination of template candidates 16 that minimizes the cost function is determined as the integrated template 18.
  • each test image 14 is subjected to a matching process to calculate each position information and similarity. Then, with respect to the same template candidate 16, the degree of variation in position information and similarity due to the difference in the test image 14 is calculated. Whether or not it is suitable for use as the integrated template 18 may be determined based on the positional information and the degree of variation in similarity. By adopting such a method, the template candidate 16 that can perform the matching process more stably can be selected.
  • the template candidates 16 may be selected in descending order of the index R value until the similarity as the integrated template 18 exceeds a predetermined threshold value. According to this method, the number of template candidates 16 to be selected is not limited to a predetermined value, and a necessary number of template candidates 16 are dynamically selected.
  • the number of template candidates 16 to be selected may be set as appropriate.
  • the template candidates 16 are selected in descending order of similarity, and the integrated template 18 is evaluated. More specifically, the position information and the similarity based on the integrated template 18 at the time when two template candidates 16 are selected are calculated for a plurality of test images 14, and variations in the calculated plurality of position information are predetermined. Evaluate whether it is within the range.
  • the test image 14 it is preferable to prepare a test image different from the test image 14 used when the template candidate 16 is selected.
  • Template candidates 16 constituting the integrated template 18 may overlap each other.
  • the input image acquisition unit 172 acquires the input image 20 to be searched. Typically, the input images 20 generated by the camera 10 capturing images of workpieces that sequentially flow through the production line as shown in FIG. 1 are sequentially acquired. The input image acquisition unit 172 outputs the acquired input image 20 to the position detection unit 176.
  • Integrated Template Holding Unit 174 holds the integrated template 18 generated by the integrated template generating unit 170. Then, in response to the request from the position detection unit 176, the held integrated template 18 is output.
  • the position detection unit 176 performs a search process using each of the plurality of partial templates (template candidates 16) determined as the integrated template 18 in the input image 20 from the input image acquisition unit 172, and each search process Are integrated and output as the final search result. More specifically, the position detection unit 176 performs matching processing with the input image 20 using each partial template included in the integrated template 18. That is, the position detection unit 176 outputs the position information of the target object 2 based on the relative shift amount in the frequency space after decomposing the partial area and each partial template of the input image 20 into frequency information.
  • the RIPOC method shown in FIG. 4 is used. However, other matching processing using frequency information can be employed.
  • the position detection unit 176 performs statistical processing (for example, averaging processing) on the position information obtained by each partial template, and outputs the result as a matching processing result by the integrated template 18. More specifically, a position obtained by averaging the corresponding positions obtained by each partial template is output as a final search result.
  • the final search result is output as position information including position and rotation amount information.
  • search result by the integrated template 18 is not limited to the position obtained by averaging the corresponding positions obtained by the respective partial templates, and the following calculation method may be employed.
  • the position information acquired by the partial template with the highest similarity may be output as the final search result.
  • the final position information may be calculated by weighting the selected template candidate 16 according to the degree of similarity.
  • FIG. 10 is a flowchart showing an overall procedure of template generation processing according to the first embodiment of the present invention.
  • FIG. 11 is a flowchart showing an overall procedure of template matching processing according to the first embodiment of the present invention.
  • Each step shown in FIG. 10 and FIG. 11 is typically realized by the CPU 102 (FIG. 2) executing the template generation processing program 112 and the template matching processing program 114, respectively.
  • the template matching process shown in FIG. 10 is an offline process
  • the template matching process shown in FIG. 11 is an online process.
  • CPU 102 obtains template generation image 12 and test image 14 (step S100). More specifically, the CPU 102 acquires a plurality of input images by capturing the object 2 with the camera 10, and sets a part of these input images as the test image 14 and the rest as the template generation image 12. To do.
  • the CPU 102 sets a candidate area (template area) for the template generation image 12 (step S102). As described above, this candidate area may be set manually by the user, or may be automatically set by a known method. Then, the CPU 102 divides the candidate area set for the template generation image 12 into a plurality of small areas (blocks) (step S104), and a template composed of a single small area or a plurality of small areas adjacent to each other. A plurality of candidates 16 are generated (step S106).
  • the CPU 102 selects one of the plurality of template candidates 16 (step S108), executes a matching process using the selected template candidate 16 in the test image 14, and obtains position information and similarity of the target object 2. Calculate (step S110).
  • the CPU 102 determines whether or not all of the plurality of template candidates 16 have been selected, that is, whether or not matching processing has been executed with all the template candidates 16 (step S112). If there is an unselected template candidate among the plurality of template candidates 16 (NO in step S112), CPU 102 selects one of unselected template candidates 16 (step S114), and steps S110 and thereafter. Execute the process.
  • the CPU 102 searches for the correct position of the target object 2 in the test image 14 and each template candidate 16.
  • the search accuracy of each template candidate 16 is calculated based on the amount of deviation from the determined position and the similarity calculated in the matching for each template candidate 16 (step S116).
  • the CPU 102 selects a plurality of partial templates from the plurality of template candidates 16 based on the search accuracy calculated in step S116 and the size of the template candidate 16, and selects the integrated template 18 based on the combination of the selected partial templates. Generate. (Step S118).
  • the integrated template 18 is produced
  • the integrated template 18 is stored in a predetermined area of the storage unit.
  • the template matching process shown in FIG. 11 is executed using this integrated template 18.
  • the CPU 102 acquires the input image 20 that is a target of the matching process (step S ⁇ b> 200).
  • the CPU 102 executes a matching process using the partial template (template candidate 16) included in the integrated template 18 on the input image 20 (step S202).
  • the CPU 102 integrates the respective search results (position, similarity, rotation amount) based on the partial templates, and calculates a final search result (step S204).
  • CPU102 calculates the positional information on the target object 2 by averaging these.
  • the calculated position information is output as a search result by the integrated template 18. This completes the template matching process.
  • the template matching process shown in FIG. 11 may be executed every time the object 2 (workpiece) is conveyed on the belt conveyor 3.
  • ⁇ c14 Advantage >>
  • a partial template used for an actual matching process is determined, and an integrated template is used as a collection of these finally used template candidates.
  • an integrated template is used as a collection of these finally used template candidates.
  • template candidate 16 obtained by combining small regions obtained by dividing candidate regions
  • low-frequency information included in an image can be used, thereby improving the accuracy and robustness of matching processing.
  • the candidate area (template area) set in the template generation image acquisition unit 150 is divided into a plurality of small areas, and an integrated template is generated based on these small areas.
  • an example was described.
  • the candidate area set in the template generation image acquisition unit 150 is set by a user or the like, but an appropriate integrated template may not be generated in the candidate area set by the user. For example, since the candidate area set by the user is too small, sufficient position detection accuracy may not be obtained in the matching process.
  • Embodiment 2 exemplifies a configuration in which a candidate area (template area) set in the template generation image acquisition unit 150 can be automatically reset in such a situation. That is, if the candidate area initially set by the user is inappropriate, the candidate area is expanded and recalculated.
  • the image processing apparatus according to the second embodiment is mainly different from the image processing apparatus 100 according to the first embodiment only in the functional configuration of the candidate area setting unit 154 (FIG. 4). Detailed description of the processing contents will not be repeated.
  • FIG. 12 is a diagram for explaining an automatic resetting function for candidate areas according to the second embodiment of the present invention.
  • FIG. 12 shows an example in which candidate areas (template areas) are set for an object having a hole.
  • FIG. 12A shows an example in which a candidate area 13 composed of 2 ⁇ 2 blocks is set.
  • the image processing apparatus executes the process again after expanding the candidate area when the effective search accuracy cannot be calculated for any of the template candidates.
  • the image processing apparatus according to the second embodiment expands the candidate area 13 and recalculates the optimal area.
  • An integrated template 18 is created.
  • a candidate area (template area) is expanded has been described. However, if the candidate area is too large, it may be reduced.
  • the candidate area (template area) set in the template generation image acquisition unit 150 is divided into a plurality of small areas, and an integrated template is generated based on these small areas.
  • an example was described.
  • the candidate area set in the template generation image acquisition unit 150 is set by a user or the like, but an appropriate integrated template may not be generated in the candidate area set by the user. For example, this is a case where the candidate area set by the user largely includes the movable part of the object (work) 2 and the appearance changes for each work 2.
  • Embodiment 3 exemplifies a configuration in which a candidate area (template area) set in the template generation image acquisition unit 150 can be automatically reset in such a situation. That is, if the candidate area initially set by the user is inappropriate, the candidate area is moved to the periphery and recalculated.
  • the image processing device according to the third embodiment is mainly different from the image processing device 100 according to the first embodiment only in the functional configuration of the candidate area setting unit 154 (FIG. 4). Detailed description of the processing contents will not be repeated.
  • FIG. 13 is a diagram for explaining an automatic resetting function for candidate areas according to the third embodiment of the present invention.
  • FIG. 13A shows a case where the set candidate area 13 includes a thing with a very large individual difference. In such a case, no matter how the blocks obtained by dividing the candidate region 13 are combined, a partial template (template candidate 16) with high search accuracy cannot be obtained. However, the search accuracy is low.
  • the candidate area 13 is moved to another location, and the candidate area is set again (candidate area 13 #). Then, the selection of the partial template (template candidate 16) is executed again.
  • the candidate region 13 # is moved to a position where the appearance of the workpiece 2 is unlikely to change, so that the integrated template 18 with high search accuracy can be created.
  • the image processing apparatus executes the process again after changing the position of the candidate area when the effective search accuracy cannot be calculated for any of the template candidates.
  • the image processing apparatus selects a partial template again by moving candidate area 13 to another location.
  • the image processing apparatus executes the process again after moving the candidate area to another place when the effective search accuracy cannot be calculated for any of the template candidates. .
  • an optimal integrated template 18 can be created.
  • template candidates 16 are set using the template generation image 12 acquired in advance, and evaluated using the test image 14 acquired in advance.
  • An example of processing for generating the optimum integrated template 18 has been described. Assuming a case where it is actually used in a production line or the like, there is a possibility that the search accuracy of the integrated template 18 may be reduced due to a change with time (for example, when the lot of the work 2 is changed).
  • FIG. 14 is a diagram for describing an input image 20 acquired by the image processing apparatus according to the fourth embodiment of the present invention.
  • FIG. 15 is a diagram for describing search accuracy evaluation processing by the image processing apparatus according to the fourth embodiment of the present invention.
  • the image processing apparatus acquires input images 20 every predetermined time, and sequentially performs matching using the integrated template 18 for each input image 20.
  • the image processing apparatus holds the degree of similarity calculated by matching with each input image 20 for a predetermined number of times for each partial template. For example, as shown in FIG. 15, the temporal change in the similarity can be evaluated by holding the similarity for each partial template. That is, the image processing apparatus stores the similarity calculated as a result of the search process by template matching over the plurality of input images 20.
  • the overall evaluation of the integrated template 18 and the individual evaluation of the partial templates constituting the integrated template 18 are performed. Only one of these may be performed.
  • the image processing apparatus interrupts the matching process (position detection process) and re-creates the integrated template 18 (offline) as fail-safe. More specifically, the position detection process is interrupted when the similarity calculated using each partial template constituting the integrated template 18 is below the threshold Th.
  • the image processing apparatus reduces the weight for the partial template. That is, when the image processing apparatus calculates the final detection position from the corresponding position detected using each partial template, the information on the corresponding position detected using the partial template whose similarity is decreased. The weight for is relatively low.
  • the image processing apparatus calculates a slope indicating a temporal change using linear approximation from the latest similarity (for example, 20 times) for the input images 20 arranged in time series. To do. Then, when the calculated inclination becomes smaller than a predetermined value (negative value), the image processing apparatus relatively reduces the weight for the corresponding partial template.
  • a predetermined value negative value
  • the image processing apparatus changes the weight in the position search for a plurality of partial templates constituting the integrated template 18 based on the temporal change of the stored similarity.
  • the image processing apparatus acquires the input images in time series, stores the similarity when the corresponding position is specified in each input image for each partial template, and determines the similarity for each partial template.
  • the weight map is updated based on the change over time.
  • the search accuracy of the integrated template generated in advance decreases due to environmental fluctuations with time, etc., it can be detected and the search accuracy can be improved.
  • template candidates 16 are set using the template generation image 12 acquired in advance, and evaluated using the test image 14 acquired in advance. An example of processing for generating the optimum integrated template 18 has been described.
  • a partial template used as the integrated template 18 may be dynamically determined. That is, rather than selecting a template to be used as the integrated template 18 from a plurality of template candidates 16 in advance, each time an input image is acquired, the plurality of template candidates 16 are evaluated, and integration is performed based on the evaluation result. What is used as a partial template of the template 18 may be determined each time.
  • the input image 20 is matched using each of the template candidates 16 and the similarity included in the matching result is evaluated. To do. Then, based on the similarity for each template candidate 16, a template that can be used as the integrated template 18 is selected. Then, the corresponding position is calculated from the search result of the selected template candidate 16 (partial template).
  • the search accuracy can be maintained even when the environment fluctuates.
  • information on the magnification (size) between images can be obtained in the same manner as the amount of rotation between images obtained by the RIPOC method. Accordingly, information on the magnification (size) can be handled as position information instead of or in addition to the rotation amount between images in the above-described embodiment.
  • a partial template used for an actual matching process is determined, and an integrated template is used as a collection of these finally used template candidates. Constitute.
  • a template that does not include an ineligible region can be generated. Accordingly, it is possible to improve the robustness of template matching (for example, phase only correlation method (POC method)) using frequency information. That is, according to this embodiment, a template that does not include an ineligible region can be easily generated.
  • POC method phase only correlation method
  • a template including an ineligible region if a template including an ineligible region is used, search accuracy is greatly reduced due to changes in frequency information. Further, when the template size is reduced, low frequency information is lost, so that the search accuracy is likely to deteriorate, and the searchable area is also narrowed.
  • a partial template template candidate 16 obtained by combining small areas obtained by dividing candidate areas is used, an area as wide as possible can be obtained while eliminating unqualified areas. It is possible to set a template to include, and to improve the search accuracy and robustness of the matching process. Further, low frequency information included in the image can be used, and this can further improve the search accuracy and robustness of the matching process.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Library & Information Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

 入力画像における対象物の探索に用いられるテンプレートを生成する機能を有する画像処理装置が提供される。画像処理装置は、当該対象物を含む第1の入力画像を取得する第1の画像取得部と、当該対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得する第2の画像取得部と、当該対象物を含むように当該第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するテンプレート候補設定部と、当該第2の入力画像において各テンプレート候補を用いた当該対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出する算出部と、当該探索精度および各テンプレート候補のサイズに基づいて、当該複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を当該テンプレートとして生成する生成部とを含む。

Description

画像処理装置、画像処理方法および画像処理プログラム
 本発明は、入力画像に含まれる対象物の探索に用いられるテンプレートを生成する画像処理装置、画像処理方法および画像処理プログラムに関する。
 従来から、画像における対象物探索処理(マッチング処理)のための技術が各種提案されてきた。
 例えば、特開平06-317406号公報(特許文献1)は、物品の位置検出装置を開示する。この位置検出装置は、被検出部位の形状に対応したパターンを有するテンプレートを、該被検出部位を撮像した画面上で走査させて、これらをマッチングさせることにより、該被検出部位の位置を検出する。特に、この位置検出装置では、テンプレートとして、被検出部位の形状を複数個に分割したときの各部分の形状にそれぞれ対応したパターンを有する複数個のテンプレートを設定し、これらのテンプレートと被検出部位の対応する部分の画像とをマッチングさせ、その結果から被検出部位の全体としての位置を求める。
 また、特開平06-089343号公報(特許文献2)は、テンプレートマッチングの不感帯領域設定方法を開示する。この不感帯領域設定方法では、テンプレート画像と、検出物の画像とを記憶し、記憶したテンプレート画像と、検出物の画像とをそれぞれ部分画像に分割し、その部分画像同士をテンプレートマッチング処理し、相関値が所定の値より低い場合は、そのテンプレート画像の部分画像領域を不感帯領域とする。
 一方、マッチング処理としては、画像の周波数情報を用いるものがあり、例えば、位相限定相関法(Phase-Only Correlation:以下「POC法」とも記す。)が知られている。このPOC法は、画像に含まれる空間周波数の位相差情報を用いて、画像間の対応点を探索するものであり、ロバスト性に優れている。探索対象の2つの画像間に倍率差および/または回転差などがある場合には、POC法を拡張した手法として、回転不変位相限定相関法(Rotation Invariant Phase Only Correlation:以下「RIPOC法」とも記す。)などのサイズおよび/または回転に対応したPOC法などが用いられる。特開平10-124667号公報(特許文献3)は、RIPOC法を利用したパターン照合装置を開示する。このパターン照合装置は、空間周波数特性に基づいてN次元のパターン(例えば、指紋(2次元)、立体(3次元))の照合を行なうものであり、回転ずれがあっても登録パターンと照合パターンとが同一であるか否かを識別することができるようにすることを目的としている。
特開平06-317406号公報 特開平06-089343号公報 特開平10-124667号公報
 上述のようなマッチング処理に用いられるテンプレートは、入力画像に含まれる対象物の一部または全部と対応する画像である。しかしながら、例えば、対象物に可動部があり、テンプレートがその可動部を含む画像である場合には、入力画像における対象物の可動部がテンプレートと同様の位置にないときに、マッチング処理が上手に行なえない可能性がある。このような状況に対応するために、上述した特開平06-317406号公報(特許文献1)や特開平06-089343号公報(特許文献2)は、テンプレートを複数の部分領域に分割することや不感帯領域を設定することを開示するが、これらの技術をそのまま画像の周波数情報を用いるマッチング処理に適用しても、十分な探索精度を得ることはできない。すなわち、画像の周波数情報を用いるマッチング処理においては、テンプレートのサイズや形状が探索精度に影響を与えるが、上述した文献ではこの点が全く考慮されていない。
 本発明の目的は、画像の周波数情報を用いる探索処理(マッチング処理)により適したテンプレートを生成できる画像処理装置、画像処理方法および画像処理プログラムを提供することである。
 本発明のある局面に従えば、入力画像における対象物の探索に用いられるテンプレートを生成する機能を有する画像処理装置が提供される。画像処理装置は、当該対象物を含む第1の入力画像を取得する第1の画像取得部と、当該対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得する第2の画像取得部と、当該対象物を含むように当該第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するテンプレート候補設定部と、当該第2の入力画像において各テンプレート候補を用いた当該対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出する算出部と、当該探索精度および各テンプレート候補のサイズに基づいて、当該複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を当該テンプレートとして生成する生成部とを含む。
 好ましくは、当該算出部は、各テンプレート候補と当該第2の入力画像に設定される当該テンプレート候補に対応する領域とのそれぞれから周波数情報を算出する周波数情報算出部と、当該周波数情報に基づいて、当該対象物の探索処理を実行する対象物探索部とを含む。
 好ましくは、当該生成部は、当該探索処理により算出された類似度と、テンプレート候補の大きさに依存する重み係数とに基づいて選択指標を算出する選択指標算出部と、当該選択指標算出部によって算出された選択指標がより大きなテンプレート候補を、当該部分テンプレートとして選択する選択部とを含む。
 好ましくは、画像処理装置は、当該対象物の探索が行われるべき第3の入力画像を取得する第3の画像取得部と、当該第3の入力画像に対して、当該複数の部分テンプレートのそれぞれを用いて探索処理を実行するとともに、それぞれの探索処理の結果に基づいて、当該第3の入力画像における当該対象物の位置情報を出力する探索部とをさらに含む。
 さらに好ましくは、画像処理装置は、複数の当該第3の入力画像にわたって、当該探索部による探索処理の結果として算出される当該複数の部分テンプレートのそれぞれについての類似度を記憶する記憶部と、当該記憶部に記憶された類似度の時間的変化に基づいて、当該複数の部分テンプレートに対する当該探索部における重みを変更する重み変更部とをさらに含む。
 好ましくは、当該テンプレート候補設定部は、当該算出部によっていずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、当該候補領域を拡張した上で、再度テンプレート候補を設定する。
 好ましくは、当該テンプレート候補設定部は、当該算出部によっていずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、当該候補領域の位置を変更した上で、再度テンプレート候補を設定する。
 本発明の別の局面に従えば、入力画像における対象物の探索に用いられるテンプレートを生成する画像処理方法が提供される。画像処理方法は、当該対象物を含む第1の入力画像を取得するステップと、当該対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得するステップと、当該対象物を含むように当該第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するステップと、当該第2の入力画像において各テンプレート候補を用いた当該対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出するステップと、当該探索精度および各テンプレート候補のサイズに基づいて、当該複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を当該テンプレートとして生成するステップとを含む。
 本発明のさらに別の局面に従えば、入力画像における対象物の探索に用いられるテンプレートを生成するための画像処理プログラムが提供される。当該画像処理プログラムはコンピューターに、当該対象物を含む第1の入力画像を取得するステップと、当該対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得するステップと、当該対象物を含むように当該第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するステップと、当該第2の入力画像において各テンプレート候補を用いた当該対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出するステップと、当該探索精度および各テンプレート候補のサイズに基づいて、当該複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を当該テンプレートとして生成するステップとを実行させる。
 本発明によれば、画像の周波数情報を用いる探索処理(マッチング処理)により適したテンプレートを生成できる。
本発明の実施の形態に従うテンプレートマッチングの適用例を示す模式図である。 本発明の実施の形態に従うテンプレートマッチングをパーソナルコンピューターにより実現した場合の構成を示すブロック図である。 本発明の実施の形態1に従うテンプレートの生成処理の概要を説明するための模式図である。 本発明の実施の形態1に従う画像処理装置の機能構成を示すブロック図である。 本発明の実施の形態1に従う画像処理装置における候補領域の分割処理の一例を示す図である。 本発明の実施の形態1に従う画像処理装置におけるテンプレート候補(2×1のブロック)の生成処理の一例を示す図である。 本発明の実施の形態1に従う画像処理装置におけるテンプレート候補(3×2のブロック)の生成処理の一例を示す図である。 本発明の実施の形態1に従う算出部におけるマッチング処理を説明するための模式図である。 図8に示すマッチング処理(RIPOC法)の処理内容をより詳細に説明するための模式図である。 本発明の実施の形態1に従うテンプレート生成処理の全体手順を示すフローチャートである。 本発明の実施の形態1に従うテンプレートマッチング処理の全体手順を示すフローチャートである。 本発明の実施の形態2に従う候補領域の自動再設定機能を説明するための図である。 本発明の実施の形態3に従う候補領域の自動再設定機能を説明するための図である。 本発明の実施の形態4に従う画像処理装置が取得する入力画像を説明するための図である。 本発明の実施の形態4に従う画像処理装置による探索精度の評価処理を説明するための図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。
 [A.概要]
 本実施の形態は、入力画像における対象物の探索に用いられるテンプレートを生成する画像処理装置および画像処理方法に向けられている。入力画像における対象物の探索には、予め登録されたテンプレートを用いたテンプレートマッチング処理が用いられる。
 本実施の形態においては、後述する処理によって生成される複数の部分テンプレート(以下、その組み合わせを「統合テンプレート」とも記す。)を用いて、マッチング処理が実行される。この統合テンプレートは、複数のテンプレート候補から選択された複数の部分テンプレートから構成される。
 [B.システム構成]
 まず、本発明の実施の形態に従うテンプレートを生成する機能を有する画像処理装置の実装例について説明する。
 《b1:適用例》
 図1は、本発明の実施の形態に従うテンプレートマッチングの適用例を示す模式図である。図1を参照して、本実施の形態に従うシステム1は、一例として、ベルトコンベア3を含む生産ラインに適用される。このシステム1において、対象物2(ワーク)はベルトコンベア3によって連続的に搬送されるとともに、カメラ10により撮像することで、対象物2の外観を含む画像(以下「入力画像」とも記す。)が取得される。
 入力画像は、画像処理装置100へ伝送される。画像処理装置100は、予め格納している統合テンプレート18に基づいて、入力画像における対象物2の探索を実行する。画像処理装置100は、このテンプレートマッチング処理によって得られた、対象物2の位置、回転量などの情報(以下「位置情報」とも記す。)を出力する。この位置情報は、少なくとも入力画像における対象物2の位置を示すものであり、この位置に加えて対象物2の回転量や倍率(カメラの光軸方向の位置に対応する)などの情報を含んでも構わない。また、テンプレートマッチング処理においては、画像の周波数情報が用いられる。
 システム1において、カメラ10の撮像範囲には、対象物2以外にどのような被写体が存在しているのかは不定である。対象物2以外の領域に含まれる情報は、各撮像タイミングや撮像条件などに応じて変動し得る。また、対象物2自体に可動部が含まれている場合には、その可動部の状態が変動し得る。このような変動し得る領域(以下「不適格領域」とも記す。)がテンプレートに含まれていると、マッチング処理を必ずしも適切に行なうことができない。そこで、本実施の形態は、このような不適格領域を含まないテンプレートを効率的かつ容易に生成する機能を提供する。
 《b2:パーソナルコンピューターによる実現例》
 図2は、本発明の実施の形態に従うテンプレートマッチングをパーソナルコンピューターにより実現した場合の構成を示すブロック図である。
 図2を参照して、パーソナルコンピューターにより実現される画像処理装置100は、主として、汎用的なアーキテクチャーを有するコンピューター上に実装される。図2を参照して、画像処理装置100は、主たるコンポーネントとして、CPU(Central Processing Unit)102と、RAM(Random Access Memory)104と、ROM(Read Only Memory)106と、ネットワークインターフェイス(I/F)108と、補助記憶装置110と、表示部120と、入力部122と、メモリーカードインターフェイス(I/F)124と、カメラインターフェイス(I/F)128とを含む。各コンポーネントは、バス130を介して、互いに通信可能に接続されている。
 CPU102は、ROM106や補助記憶装置110などに格納された、オペレーティングシステム(OS:Operating System)、テンプレート生成処理プログラム112、およびテンプレートマッチング処理プログラム114などの各種プログラムを実行することで、画像処理装置100の全体を制御する。RAM104は、CPU102でプログラムを実行するためのワーキングメモリとして機能し、プログラムの実行に必要な各種データを一次的に格納する。ROM106は、画像処理装置100において起動時に実行される初期プログラム(ブートプログラム)などを格納する。
 ネットワークインターフェイス108は、各種の通信媒体を介して、他の装置(サーバー装置など)とデータを遣り取りする。より具体的には、ネットワークインターフェイス108は、イーサネット(登録商標)などの有線回線(LAN(Local Area Network)やWAN(Wide Area Network)など)、および/または、無線LANなどの無線回線を介してデータ通信を行なう。
 補助記憶装置110は、典型的には、ハードディスクなどの大容量磁気記録媒体などからなり、本実施の形態に従う各種処理を実現するための画像処理プログラム(テンプレート生成処理プログラム112およびテンプレートマッチング処理プログラム114)、ならびに、テンプレート生成用画像12、テスト画像14、統合テンプレート18などを格納する。さらに、補助記憶装置110には、オペレーティングシステムなどのプログラムが格納されてもよい。
 テンプレート生成用画像12は、統合テンプレート18を生成するために用いられる。本実施の形態においては、後述するような処理によって、マッチング処理に適した統合テンプレート18が生成される。
 表示部120は、オペレーティングシステムが提供するGUI(Graphical User Interface)画面やテンプレート生成処理プログラム112およびテンプレートマッチング処理プログラム114の実行によって生成される画像などを表示する。
 入力部122は、典型的には、キーボード、マウス、タッチパネルなどからなり、ユーザーから受付けた指示の内容をCPU102などへ出力する。
 メモリーカードインターフェイス124は、SD(Secure Digital)カードやCF(Compact Flash(登録商標))カードなどの各種メモリーカード(不揮発性記録媒体)126との間で、データの読み書きを行なう。
 カメラインターフェイス128は、対象物2などの被写体を撮像することで取得される、テンプレート生成用画像12、テスト画像14、統合テンプレート18、および/または入力画像をカメラ10から取り込む。カメラ10は、画像を取得する画像取得部として機能する。但し、画像処理装置100本体が被写体を撮像する機能を有していなくともよい。この場合には、典型的には、何らかの装置で取得した各種画像を格納したメモリーカード126を介して、必要な画像が取り込まれる。すなわち、メモリーカードインターフェイス124にメモリーカード126が装着され、メモリーカード126から読み出された各種画像は、補助記憶装置110などへ格納(コピー)される。
 補助記憶装置110に格納される、テンプレート生成処理プログラム112および/またはテンプレートマッチング処理プログラム114は、CD-ROM(Compact Disk-Read Only Memory)などの記録媒体に格納されて流通し、あるいは、ネットワークを介してサーバー装置などから配信される。テンプレート生成処理プログラム112および/またはテンプレートマッチング処理プログラム114は、画像処理装置100(パーソナルコンピューター)で実行されるオペレーティングシステムの一部として提供されるプログラムモジュールのうち必要なモジュールを、所定のタイミングおよび順序で呼出して処理を実現するようにしてもよい。この場合、テンプレート生成処理プログラム112および/またはテンプレートマッチング処理プログラム114自体には、オペレーティングシステムによって提供されるモジュールは含まれず、オペレーティングシステムと協働して画像処理が実現される。また、テンプレート生成処理プログラム112および/またはテンプレートマッチング処理プログラム114は、単体のプログラムではなく、何らかのプログラムの一部に組込まれて提供されてもよい。このような場合にも、プログラム自体には、他のプログラムと共通に利用されるようなモジュールは含まれず、当該他のプログラムと協働して画像処理が実現される。このような一部のモジュールを含まないテンプレート生成処理プログラム112であっても、本実施の形態に従う画像処理装置100の趣旨を逸脱するものではない。
 さらに、テンプレート生成処理プログラム112および/またはテンプレートマッチング処理プログラム114によって提供される機能の一部または全部を専用のハードウェアによって実現してもよい。
 《b3:その他の構成による実現例》
 上述したパーソナルコンピューターにより実現する例に加えて、例えば、デジタルカメラ、携帯電話、あるいはスマートフォン上に実装してもよい。さらに、少なくとも1つのサーバー装置が本実施の形態に従う処理を実現する、いわゆるクラウドサービスのような形態であってもよい。この場合、ユーザーは、自身の端末(パーソナルコンピューターやスマートフォンなど)を用いて、少なくとも2つの処理対象画像をサーバー装置(クラウド側)へ送信し、当該送信された処理対象画像に対して、サーバー装置側が本実施の形態に従う画像処理を行なうような構成が想定される。さらに、サーバー装置側がすべての機能(処理)を行なう必要はなく、ユーザー側の端末とサーバー装置とが協働して、本実施の形態に従う画像処理を実現するようにしてもよい。
 [C.実施の形態1]
 次に、本実施の形態1に従うテンプレートの生成処理の詳細について説明する。
 《c1:処理概要》
 図3は、本発明の実施の形態1に従うテンプレートの生成処理の概要を説明するための模式図である。テンプレートの生成処理は、基本的には、図1に示すような生産ラインのようなオンラインで実行されるのではなく、生産ラインから外れたオフラインで実行される。但し、以下に説明するような画像が取得できる環境下であれば、オンラインで実行されてもよい。
 図3を参照して、まず、画像処理装置100は、カメラ10により対象物2を含むテンプレート生成用画像12(第1の入力画像)を取得する。このテンプレート生成用画像12から後述する統合テンプレート18が生成される。テンプレート生成用画像12としては、少なくとも1枚あれば十分であるが、複数枚を取得してもよい。また、画像処理装置100は、対象物2を含むとともに、対象物2の画像内の位置情報が既知であるテスト画像14(第2の入力画像)を取得する。すなわち、テスト画像14における対象物2の位置情報は既知であるとする。この対象物2の位置情報は、事前にマッチング処理を行なうことで特定してもよいし、ユーザーが目視で特定してもよい。
 一般的な手順としては、カメラ10を用いて対象物2を複数回撮像することで生成される入力画像のうち1枚がテスト画像14として選択され、残りの1枚または複数枚がテンプレート生成用画像12として選択される。
 続いて、画像処理装置100は、対象物2を含むようにテンプレート生成用画像12に設定された候補領域13を、複数の矩形の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補16を複数設定する。そして、画像処理装置100は、テスト画像14に対して各テンプレート候補16を用いたマッチング処理を実行するとともに、マッチング処理の実行結果に基づいて、各テンプレート候補16の探索精度を算出する。より具体的には、対象物2のテスト画像14内の位置情報は既知であるので、画像処理装置100は、マッチング処理の実行結果と既知の位置情報との差分などに基づいて、探索精度を評価する。
 最終的に、画像処理装置100は、探索精度に基づいて、複数のテンプレート候補16から複数の部分テンプレートを選択するとともに、選択された部分テンプレートの組み合わせを統合テンプレート18として生成する。したがって、統合テンプレート18は、複数の選択されたテンプレート候補16(部分テンプレート)を含む。このような統合テンプレート18を用いたマッチング処理の詳細については、後述する。
 《c2:機能構成》
 次に、本実施の形態に従う画像処理装置および/または画像処理プログラムの機能構成について説明する。
 図4は、本発明の実施の形態1に従う画像処理装置100の機能構成を示すブロック図である。図4を参照して、本実施の形態に従う画像処理装置100は、その主たる機能構成として、テンプレート生成用画像取得部150と、テスト画像取得部152と、候補領域設定部154と、候補領域分割部156と、テンプレート候補生成部158と、算出部160と、統合テンプレート生成部170と、入力画像取得部172と、統合テンプレート保持部174と、位置検出部176とを含む。
 これらの機能構成は、図2に示す画像処理装置100においては、CPU102がテンプレート生成処理プログラム112およびテンプレートマッチング処理プログラム114を実行することで実現される。以下、各機能構成の詳細について説明する。
 《c3:テンプレート生成用画像取得部150》
 テンプレート生成用画像取得部150は、統合テンプレート18を生成するための入力画像を取得する。典型的には、接続されたカメラ10が被写体を撮像することで生成される画像をテンプレート生成用画像12として取得する。より具体的には、テンプレート生成用画像取得部150は、カメラ10を用いて対象物2を事前に撮影して得られた入力画像の中から1枚の入力画像をテンプレート生成用画像12として使用する。テンプレート生成用画像12は、被写体である対象物2を含む。
 なお、何らかの外部装置で生成された画像を各種の記録媒体または通信媒体を介して取得するようにしてもよい。
 また、テンプレート生成用画像12は、1枚ではなく複数枚としてもよい。この場合には、複数枚のテンプレート生成用画像12の各々について、統合テンプレート18をそれぞれ生成し、これらの統合テンプレート18の中から最適な1つの統合テンプレート18を選択するようにしてもよい。
 あるいは、テンプレート生成用画像取得部150は、複数枚のテンプレート生成用画像12を受付けるとともに、これらのテンプレート生成用画像12に対して統計処理(例えば、平均処理など)を行なうことで、1枚のテンプレート生成用画像12を作成するようにしてもよい。
 《c4:テスト画像取得部152》
 テスト画像取得部152は、後述の算出部160における処理に用いられるテスト画像14を取得する。テスト画像取得部152は、テンプレート生成用画像12とは別に、対象物2が含まれるテスト画像14を取得する。典型的には、接続されたカメラ10が被写体を撮像することで生成される1つの画像をテスト画像14として取得する。より具体的には、テスト画像取得部152は、カメラ10を用いて対象物2を事前に撮影して得られた入力画像の中から、テンプレート生成用画像12として用いられなかった1枚の入力画像をテスト画像14として使用する。テスト画像14は、被写体である対象物2を含む。この際、テスト画像取得部152は、公知の方法を用いて、テスト画像14内の対象物2の位置情報(正解情報)を取得する。
 《c5:候補領域設定部154》
 候補領域設定部154は、テンプレート生成用画像取得部150によって取得されたテンプレート生成用画像12に対して、候補領域(テンプレート領域)を設定する。すなわち、候補領域設定部154は、テンプレート生成用画像取得部150から得られた画像中に候補領域(テンプレート領域)を設定する。この候補領域は、ユーザーが明示的に指定してもよいし、公知の方法を用いて自動的に設定してもよい。一般的な方法としては、候補領域の重心位置が位置検出したい場所(例えば、対象物2の中心位置)と一致するように、候補領域を設定する。
 但し、探索したい位置が候補領域の概重心位置になるように設定しなくともよい。例えば、探索したい位置に対して、ある一定量(Δx、Δy)だけ離れた位置に候補領域を設定してもよい。この場合、統合テンプレート18を用いた探索したい位置に対して、当該一定量(Δx、Δy)だけ結果をシフトさせることで、探索したい位置を特定できる。このとき、探索したい位置がテンプレートに含まれている必要もない。
 候補領域(テンプレート領域)は、任意の大きさの矩形領域とすればよいが、後述するように、回転不変位相限定相関法(RIPOC法)を用いる場合には、内部処理としてフーリエ変換を実行するので、このフーリエ変換として、高速フーリエ変換を採用できるように、候補領域(テンプレート領域)のサイズ(画素数)は、2のべき乗とすることが好ましい。
 《c6:候補領域分割部156》
 候補領域分割部156は、テンプレート生成用画像12に対して設定された候補領域(テンプレート領域)を複数の矩形の小領域に分割する。すなわち、候補領域分割部156は、対象物2を含むようにテンプレート生成用画像12に設定された候補領域を、複数の小領域に分割する。
 図5は、本発明の実施の形態1に従う画像処理装置100における候補領域の分割処理の一例を示す図である。図5を参照して、例えば、128×128のサイズの候補領域が設定された場合、各小領域のサイズが32×32になるように、候補領域を4×4に分割する。
 候補領域を分割する各小領域は、任意の大きさの矩形領域とすればよいが、後述するように、回転不変位相限定相関法(RIPOC法)を用いる場合には、内部処理としてフーリエ変換を実行するので、このフーリエ変換として、高速フーリエ変換を採用できるように、候補領域を分割して得られる各小領域のサイズは、2のべき乗とすることが好ましい。
 《c7:テンプレート候補生成部158》
 テンプレート候補生成部158は、候補領域分割部156によって分割された小領域について、単一または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定する。すなわち、テンプレート候補生成部158は、候補領域分割部156によって分割された小領域を矩形領域になるように結合する。言い換えれば、テンプレート候補生成部158は、分割された領域を隣接する領域同士で結合して複数のテンプレート候補を生成する。
 例えば、候補領域分割部156によって分割された各小領域を「ブロック」と表現すると、図5に示す例においては、4×4のブロックで候補領域が構成される。この候補領域を、1×1,1×2,1×3,1×4,2×1,2×2,2×3,2×4,3×1,3×2,3×3,3×4,4×1,4×2,4×3,4×4の16種類のパターン毎に結合して、矩形領域(テンプレート候補16)を生成する。
 図6は、本発明の実施の形態1に従う画像処理装置100におけるテンプレート候補(2×1のブロック)の生成処理の一例を示す図である。図7は、本発明の実施の形態1に従う画像処理装置100におけるテンプレート候補(3×2のブロック)の生成処理の一例を示す図である。
 例えば、2×1のパターンでは、図6に示すように12通りのテンプレート候補が設定される。また、3×2のパターンでは、図7に示すように6通りのテンプレート候補が設定される。
 上述の各パターンについて、設定されるテンプレート候補の数は、以下の通りである。
  (1)1×1のパターン:16個
  (2)1×2のパターン:12個
  (3)1×3のパターン:8個
  (4)1×4のパターン:4個
  (5)2×1のパターン:12個
  (6)2×2のパターン:9個
  (7)2×3のパターン:6個
  (8)2×4のパターン:3個
  (9)3×1のパターン:8個
 (10)3×2のパターン:6個
 (11)3×3のパターン:4個
 (12)3×4のパターン:2個
 (13)4×1のパターン:4個
 (14)4×2のパターン:3個
 (15)4×3のパターン:2個
 (16)4×4のパターン:1個
 以上のように、基本的には、隣接するブロックのすべての組み合わせについて結合することで、テンプレート候補が設定される。
 《c8:算出部160》
 算出部160は、テスト画像14において各テンプレート候補16を用いたマッチング処理を実行するとともに、マッチング処理の実行結果に基づいて、各テンプレート候補16の探索精度を算出する。すなわち、算出部160は、複数のテンプレート候補16のそれぞれを使って、テスト画像14内の対象物2の探索を行なう。本実施の形態においては、この探索方法としてRIPOC法を用い、テスト画像14と各テンプレート候補との間の相関値を算出する。なお、この算出部160で実行されるマッチング処理は、図1の画像処理装置100で対象物2の探索を行なうために実行されるマッチング処理と同一の方法であり、画像の周波数情報を用いるものである。
 図8は、本発明の実施の形態1に従う算出部160におけるマッチング処理(RIPOC法)を説明するための模式図である。図9は、図8に示すマッチング処理(RIPOC法)の処理内容をより詳細に説明するための模式図である。
 図8を参照して、RIPOC法は、テンプレートに対して抽出領域がどれだけ回転しているかを算出するとともに、テンプレートの回転角度を補正する処理(参照符号160A)と、回転角度の補正によって取得された補正テンプレートと抽出領域との間でどれだけの類似度および平行移動量が存在するのかを算出する処理(参照符号160B)とを含む。
 図8においては、各テンプレート候補16が「テンプレート」として用いられ、このテンプレートと同じ大きさの領域がテスト画像14に逐次設定され、これらが「抽出領域画像」として用いられる。
 より具体的には、算出部160は、フーリエ変換部161,164と、対数化処理部162,165と、極座標変換部163,166と、第1POC処理部167と、回転量補正部168と、第2POC処理部169とを含む。
 フーリエ変換部161および164は、それぞれテンプレートおよび抽出領域画像に含まれる周波数情報(振幅成分および位相成分)を算出する。本RIPOC処理においては、位相成分は必ずしも必要ではないので、算出しなくともよい。
 対数化処理部162および極座標変換部163は、テンプレートについての振幅成分を対数化するとともに、極座標へ変換する。同様に、対数化処理部162および極座標変換部166は、抽出領域画像についての振幅成分を対数化するとともに、極座標へ変換する。この極座標への変換によって、回転量が2次元座標上の座標点として表現される。
 第1POC処理部167は、極座標変換部163および166からそれぞれ出力される極座標変換された結果について、相関演算を行い、回転量を算出する。
 回転量補正部168は、テンプレートを第1POC処理部167において算出された回転量に従って回転補正する。すなわち、回転量補正部168は、テンプレートを回転補正して補正テンプレートを生成する。
 回転量補正部168におけるテンプレートを回転補正する方法としては、テンプレートそのものを実空間で回転させる方法を採用することができる。あるいは、後述するように、第2POC処理部169において周波数空間を扱うような場合には、実空間で回転させる必要はなく、POC処理の内部表現であるフーリエ変換後のデータ(振幅情報および位相情報)を回転させる方法を採用してもよい。
 第2POC処理部169は、補正テンプレートと抽出領域画像との間で、POC処理(位相限定相関処理)を行い、類似度および位置(画像間の平行移動量)を算出する。POC処理のピーク値が画像間の類似度を示し、ピークの位置が画像間の平行移動量(位置ずれ量)を示す。したがって、補正テンプレートと抽出領域画像との位置関係がわかることになる。この位置関係に基づいて、第2POC処理部169は、回転量を含む位置情報を出力する。図9には、第2POC処理部169での処理結果を模式的に示す。POC処理では、画像のそれぞれに含まれる空間周波数の成分の間で相関値を算出することで、図9の相関画像に示すようにある位置にピークが現れる。このピーク位置が画像間の平行移動量であり、ピークの大きさが画像間の類似度となる。なお、画像間の平行移動量は、一般に、テンプレートの画像サイズのおおよそ±1/4程度の範囲をサーチすれば算出できる。
 このように、算出部160は、各テンプレート候補16を用いてテスト画像14における対象物2の探索処理を行なう。この探索処理の結果として、各テンプレート候補16によって得られた位置情報および類似度を出力する。
 《c9:統合テンプレート生成部170》
 統合テンプレート生成部170は、複数のテンプレート候補16の中から、算出部160によって得られた探索精度およびサイズに基づいて選択した複数の部分テンプレート(テンプレート候補16)の組み合わせを統合テンプレート18として出力する。すなわち、統合テンプレート生成部170は、位置情報、類似度、テンプレート候補16のサイズに基づいて、複数のテンプレート候補の組み合わせを統合テンプレート18として生成する。言い換えれば、統合テンプレート生成部170は、互いの相対的な位置関係が保持された複数の部分テンプレートから構成される統合テンプレート18を生成する。このテンプレート候補16の組み合わせ方法について、以下説明する。
 基本的には、算出部160におけるマッチング処理によって得られた結果(対象物2の位置)が対象物2の正解位置と一致しているテンプレート候補16から、類似度および/またはテンプレートサイズに基づいて有効な部分テンプレートが選択される。
 テンプレートとして最適なものは、類似度(相関値:POCのピーク値)が高い上に、そのサイズが大きいものである。
 そのため、最大の類似度かつ最大のサイズを有するテンプレート候補16が存在する場合には、そのテンプレート候補16が第1部分テンプレートとして選択される。そして、残っているテンプレート候補16の中から、同様に最大の類似度かつ最大のサイズを有するテンプレート候補16が存在すれば、そのテンプレート候補16が第2部分テンプレートとして選択される。
 一方、最大の類似度かつ最大のサイズを有するテンプレート候補16が1つに決まらない場合について、以下説明する。類似度は、予め用意されたテスト画像14に対しては非常に有効な指標であるが、ロバスト性の観点からは、テンプレートサイズを重視する方が好ましい。テンプレートサイズが大きいテンプレート候補16の方が探索精度を安定化でき、かつ探索エリアを拡大することもできる。そのため、類似度が同じであれば、よりテンプレートサイズの大きなテンプレート候補16を選択する。さらに、類似度が少し劣っているとしても、テンプレートサイズが十分大きい場合には、そのテンプレートサイズを重視して、より大きなテンプレート候補16を選択する方が望ましい。
 そこで、統合テンプレート18に用いるテンプレート候補16を選択する際には、例えば、各テンプレート候補16について、そのテンプレートサイズに依存して設定される重み係数と、算出された類似度とを乗算して指標Rを算出するとともに、指標Rの大小関係に基づいて、テンプレート候補16を選択してもよい。すなわち、指標Rは、以下に示す(1)式に従って算出される。
  指標R=重み係数f(テンプレートサイズ)×類似度 …(1)
 ここで、重み係数fは、テンプレートサイズ(あるいは、テンプレート面積)に依存する値であり、テンプレート面積が大きいほど、重み係数は大きくなる。類似度は、上述した通り相関値の大きさである。
 以上のように、各テンプレート候補16について指標Rを算出し、この指標Rの値が大きいものから順に所定数(例えば、3個)のテンプレート候補16を選択する。この選択されたテンプレート候補16が統合テンプレート18として用いられる。すなわち、統合テンプレート生成部170は、選択された所定数のテンプレート候補16によって、最終的なテンプレートとなる統合テンプレート18を構成する。複数のテンプレート候補16からなる統合テンプレート18を用いてマッチング処理を行なう場合には、それぞれのテンプレート候補(部分テンプレート)16を用いて対応位置を取得し、これらの対応位置を平均化することで、統合テンプレート18による探索結果として出力される。
 このように、統合テンプレート生成部170は、正確な位置情報が得られるテンプレート候補16について、算出部160により算出された類似度と、テンプレート候補16の大きさ(テンプレートサイズ)とに依存する重み係数とに基づいて指標Rを算出する。そして、統合テンプレート生成部170は、算出された指標Rがより大きなテンプレート候補16を、統合テンプレート18として用いる部分テンプレートとして決定する。
 また、テンプレート候補16の位置ずれ量の大きさ、類似度の大きさ、テンプレート候補16の大きさに基づいて、テンプレート候補16間の重み係数を決定してもよい。
 一般的に、部分テンプレートのうちテスト画像14(抽出領域画像)との位置ずれ量が小さいほど、有効な部分テンプレートである。また、テスト画像14(抽出領域画像)との類似度が高いものほど、有効な部分テンプレートである。さらに、テンプレートサイズが大きいものほど有効なテンプレートである。そこで、本実施の形態においては、これらの値に基づいて、部分テンプレート間の重みを決定することで、ロバスト性を向上させる。
 統合テンプレート18として用いるテンプレート候補16の選択(評価)手法としては、上述したものに代えて、あるいは、加えて、以下のような手法を用いてもよい。
 (1) 上述のような指標Rを用いる方法に代えて、動的計画法(Dynamic Programming)によるマッチング(DPマッチング)手法などを用いて、類似度+テンプレートサイズを最大化するようなコスト関数を定義してもよい。このコスト関数が最小となるテンプレート候補16の組み合わせが、統合テンプレート18として決定される。
 (2) テスト画像14が複数枚用意できる場合には、各テスト画像14についてマッチング処理を行なうことで、それぞれの位置情報および類似度を算出する。そして、同一のテンプレート候補16について、テスト画像14の相違による位置情報や類似度のばらつきの度合いを算出する。この位置情報や類似度のばらつきの度合いに基づいて、統合テンプレート18として用いることに適しているか否かを判断してもよい。このような手法を採用することで、マッチング処理をより安定的に行なうことができる、テンプレート候補16を選択できる。
 (3) 統合テンプレート18としての類似度が予め定められたしきい値を超えるまで、テンプレート候補16を指標Rの値が大きいものから順に選択してもよい。この手法によれば、選択されるテンプレート候補16の数は、予め定められた値には制限されず、必要な数のテンプレート候補16が動的に選択される。
 (4) 選択するテンプレート候補16の数を適宜設定してもよい。例えば、テンプレート候補16を類似度の高いものから順に選択していき、統合テンプレート18としての評価を行なう。より具体的には、テンプレート候補16が2つ選ばれた時点での統合テンプレート18による位置情報および類似度を、複数のテスト画像14について算出し、その算出された複数の位置情報のばらつきが所定値以内に収まっているか否かを評価する。ここで、テスト画像14については、テンプレート候補16を選択する際に使用したテスト画像14とは別のテスト画像を用意することが好ましい。
 ここで、複数の位置情報のばらつきが所定値以内に収まっていないときには、別のテンプレート候補16が追加される。これに対して、複数の位置情報のばらつきが所定値以内に収まっているときには、新たなテンプレート候補16の選択を終了し、それまでに選択されたテンプレート候補16が統合テンプレート18として出力される。
 (5) 統合テンプレート18を構成するテンプレート候補16同士が重なり合っていてもよい。
 《c10:入力画像取得部172》
 入力画像取得部172は、探索処理の対象となる入力画像20を取得する。典型的には、図1に示すような生産ラインを順次流れるワークをカメラ10が撮像することで生成される入力画像20を順次取得する。入力画像取得部172は、取得した入力画像20を位置検出部176へ出力する。
 《c11:統合テンプレート保持部174》
 統合テンプレート保持部174は、統合テンプレート生成部170によって生成された統合テンプレート18を保持する。そして、位置検出部176からの要求に応答として、保持している統合テンプレート18を出力する。
 《c12:位置検出部176》
 位置検出部176は、入力画像取得部172からの入力画像20において、統合テンプレート18として決定された複数の部分テンプレート(テンプレート候補16)のそれぞれを用いて探索処理を実行するとともに、それぞれの探索処理の結果を統合して、最終的な探索結果として出力する。より具体的には、位置検出部176は、統合テンプレート18に含まれる各部分テンプレートを用いて、入力画像20との間でマッチング処理を行なう。すなわち、位置検出部176は、入力画像20の部分領域と各部分テンプレートを周波数情報に分解した後、周波数空間における相対的なずれ量に基づいて、対象物2の位置情報を出力する。
 位置検出部176によって実行されるマッチング処理としては、上述の図4に示すRIPOC法が用いられる。但し、周波数情報を用いた他のマッチング処理を採用することも可能である。
 さらに、位置検出部176は、各部分テンプレートによって得られた位置情報を統計処理(例えば、平均処理など)して、その結果を統合テンプレート18によるマッチング処理の結果として出力する。より具体的には、各部分テンプレートによって得た対応位置を平均化した位置を最終的な探索結果として出力する。この最終的な探索結果は、位置および回転量の情報を含む位置情報として出力される。
 なお、統合テンプレート18による探索結果は、それぞれの部分テンプレートによって得られた対応位置を平均化することで得られる位置に限られず、以下のような算出方法を採用してもよい。
 (1) 統合テンプレート18に含まれる部分テンプレートのうち、最も高い類似度が得られた部分テンプレートによって取得された位置情報を最終的な探索結果として出力してもよい。
 (2) 各部分テンプレートについて算出されたPOC値を、各部分テンプレートの重心位置に対応させて3次元空間上で加算する。そして、加算されたPOC値からピーク位置を求めることで最終的な位置情報を決定してもよい。
 (3) 統合テンプレート18として使用するテンプレート候補16と、そうでないテンプレート候補16とを選別したが、統合テンプレート18として使用するテンプレート候補16の中でも、ロバスト性が高いものもあれば、そうでないものもある。そこで、選択されたテンプレート候補16に対して、類似度に応じた重み付けを行ない、最終的な位置情報を算出するようにしてもよい。このような方法を採用することで、ロバスト性の向上に寄与するテンプレート候補16の情報をより重視することになるので、探索精度をより安定化できる。
 《c13:処理手順》
 次に、本実施の形態に従うテンプレート生成処理およびテンプレートマッチング処理の全体手順について説明する。
 図10は、本発明の実施の形態1に従うテンプレート生成処理の全体手順を示すフローチャートである。図11は、本発明の実施の形態1に従うテンプレートマッチング処理の全体手順を示すフローチャートである。図10および図11に示す各ステップは、典型的には、CPU102(図2)がテンプレート生成処理プログラム112およびテンプレートマッチング処理プログラム114をそれぞれ実行するなどして実現される。また、典型的には、図10に示すテンプレートマッチング処理はオフライン処理であり、図11に示すテンプレートマッチング処理はオンライン処理である。
 図10を参照して、CPU102は、テンプレート生成用画像12およびテスト画像14を取得する(ステップS100)。より具体的には、CPU102は、対象物2をカメラ10により撮像することで複数の入力画像を取得するとともに、これらの入力画像の一部をテスト画像14とし、残りをテンプレート生成用画像12とする。
 CPU102は、テンプレート生成用画像12に対して候補領域(テンプレート領域)を設定する(ステップS102)。上述したように、この候補領域は、ユーザーにより手動で設定されてもよいし、あるいは公知の方法によって自動で設定されてもよい。そして、CPU102は、テンプレート生成用画像12に対して設定した候補領域を複数の小領域(ブロック)に分割する(ステップS104)とともに、単一の小領域または互いに隣接する複数の小領域からなるテンプレート候補16を複数生成する(ステップS106)。
 CPU102は、複数のテンプレート候補16のうち1つを選択し(ステップS108)、テスト画像14において、選択したテンプレート候補16を用いたマッチング処理を実行して、対象物2の位置情報および類似度を算出する(ステップS110)。
 CPU102は、複数のテンプレート候補16のすべてが選択済であるか否か、すなわちすべてのテンプレート候補16によってマッチング処理を実行したかどうかを判断する(ステップS112)。複数のテンプレート候補16のうち、未選択のものがある場合(ステップS112においてNOの場合)には、CPU102は、未選択のテンプレート候補16のうち1つを選択し(ステップS114)、ステップS110以下の処理を実行する。
 これに対して、複数のテンプレート候補16のすべてによってマッチング処理を実行した場合(ステップS112においてYESの場合)には、CPU102は、テスト画像14における対象物2の正解位置と各テンプレート候補16について探索された位置とのずれ量、ならびに、各テンプレート候補16についてのマッチングにおいて算出された類似度に基づいて、各テンプレート候補16の探索精度を算出する(ステップS116)。最終的に、CPU102は、ステップS116において算出した探索精度およびテンプレート候補16のサイズに基づいて、複数のテンプレート候補16から複数の部分テンプレートを選択し、選択された部分テンプレートの組み合わせによる統合テンプレート18を生成する。(ステップS118)。以上の処理によって、統合テンプレート18が生成される。この統合テンプレート18は、記憶部の所定領域に格納される。この統合テンプレート18を用いて、図11に示すテンプレートマッチング処理が実行される。
 図11を参照して、CPU102は、マッチング処理の対象となる入力画像20を取得する(ステップS200)。CPU102は、入力画像20に対して、統合テンプレート18に含まれる部分テンプレート(テンプレート候補16)を用いたマッチング処理をそれぞれ実行する(ステップS202)。そして、CPU102は、部分テンプレートによるそれぞれの探索結果(位置、類似度、回転量)を統合して、最終的な探索結果を算出する(ステップS204)。典型的には、CPU102は、これらを平均化することで、対象物2の位置情報を算出する。この算出された位置情報は、統合テンプレート18による探索結果として出力される。以上で、テンプレートマッチング処理は終了する。なお、図11に示すテンプレートマッチング処理は、ベルトコンベア3上を対象物2(ワーク)が搬送される毎に実行されてもよい。
 《c14:利点》
 本実施の形態においては、複数のテンプレート候補の各々を評価した上で、実際のマッチング処理に使用される部分テンプレートを決定し、これらの最終的に使用されるテンプレート候補の集合体として統合テンプレートを構成する。このような部分テンプレートの集合体として統合テンプレートを生成することで、不適格領域を含まないようなテンプレートを生成することができる。これによって、マッチング処理の精度やロバスト性を向上できる。
 また、候補領域を分割して得られる小領域を結合した部分テンプレート(テンプレート候補16)を用いるので、画像に含まれる低周波情報を利用でき、これによって、マッチング処理の精度やロバスト性を向上できる。
 [D.実施の形態2]
 上述の実施の形態1においては、テンプレート生成用画像取得部150に設定された候補領域(テンプレート領域)が複数の小領域に分割され、これらの小領域に基づいて、統合テンプレートが生成される処理例について説明した。上述したように、テンプレート生成用画像取得部150に設定される候補領域は、ユーザーなどにより設定されるが、ユーザー設定された候補領域では、適正な統合テンプレートを生成できない場合がある。例えば、ユーザーが設定した候補領域が小さ過ぎるため、マッチング処理において十分な位置検出精度を得ることができない場合がある。
 実施の形態2においては、このような状況において、テンプレート生成用画像取得部150に設定される候補領域(テンプレート領域)を自動的に再設定可能な構成について例示する。すなわち、ユーザーが最初に設定した候補領域が不適切な場合は、その候補領域を拡張して、再度計算し直す。
 実施の形態2に従う画像処理装置は、実施の形態1に従う画像処理装置100に比較して、主として、候補領域設定部154(図4)の機能構成が異なるに過ぎないので、それ以外の機能構成や処理内容の詳細な説明は繰り返さない。
 図12は、本発明の実施の形態2に従う候補領域の自動再設定機能を説明するための図である。図12には、穴があいた対象物に候補領域(テンプレート領域)を設定した例を示す。図12(a)には、2×2のブロックからなる候補領域13が設定されている例を示す。対象物の位置や傾きによって、この穴の中の見え方が変化する場合には、4つに分割されたブロックをどのように組み合わせても、探索精度の高い部分テンプレート(テンプレート候補16)を得ることはできないので、生成される統合テンプレート18についても、探索精度が低いものになってしまう。
 このような場合には、例えば、図12(b)に示すように、大きさを変化させた候補領域13#を設定した上で、再度、部分テンプレート(テンプレート候補16)の選択が実行される。図12(b)に示す例では、環境変動によって、見え方が変化する穴の中以外にもブロックを設定できるので、探索精度の高い統合テンプレート18を作成することができる。
 このように、実施の形態2に従う画像処理装置は、いずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、候補領域を拡張した上で、再度処理を実行する。言い換えれば、実施の形態2に従う画像処理装置は、ユーザーが設定した候補領域13から適切な統合テンプレート18が得られない場合は、候補領域13を拡張して、再度計算し直すことで、最適な統合テンプレート18を作成する。
 上述の説明では、候補領域(テンプレート領域)を拡張する場合の例について説明したが、候補領域が大きすぎる場合には逆に縮小してもよい。
 [E.実施の形態3]
 上述の実施の形態1においては、テンプレート生成用画像取得部150に設定された候補領域(テンプレート領域)が複数の小領域に分割され、これらの小領域に基づいて、統合テンプレートが生成される処理例について説明した。上述したように、テンプレート生成用画像取得部150に設定される候補領域は、ユーザーなどにより設定されるが、ユーザー設定された候補領域では、適正な統合テンプレートを生成できない場合がある。例えば、ユーザーが設定した候補領域が対象物(ワーク)2の可動部を大きく含んでおり、ワーク2毎に見え方が変動するような場合である。
 実施の形態3においては、このような状況において、テンプレート生成用画像取得部150に設定される候補領域(テンプレート領域)を自動的に再設定可能な構成について例示する。すなわち、ユーザーが最初に設定した候補領域が不適切な場合は、その候補領域を周辺に移動させて、再度計算し直す。
 実施の形態3に従う画像処理装置は、実施の形態1に従う画像処理装置100に比較して、主として、候補領域設定部154(図4)の機能構成が異なるに過ぎないので、それ以外の機能構成や処理内容の詳細な説明は繰り返さない。
 図13は、本発明の実施の形態3に従う候補領域の自動再設定機能を説明するための図である。図13(a)には、設定されている候補領域13に、非常に個体差の大きいモノが含まれている場合を示す。このような場合には、候補領域13を分割して得られるブロックをどのように組み合わせても、探索精度の高い部分テンプレート(テンプレート候補16)を得ることはできないので、生成される統合テンプレート18についても、探索精度が低いものになってしまう。
 このような場合には、例えば、図13(b)に示すように、候補領域13を別の場所へ移動させて、再度候補領域を設定する(候補領域13#)。その上で、再度、部分テンプレート(テンプレート候補16)の選択が実行される。図13(b)に示す例では、ワーク2によって見え方が変化しにくい位置に候補領域13#を移動させるので、探索精度の高い統合テンプレート18を作成することができる。
 このように、実施の形態3に従う画像処理装置は、いずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、候補領域の位置を変更した上で、再度処理を実行する。言い換えれば、実施の形態3に従う画像処理装置は、候補領域13を別の場所に移動させることで、再度部分テンプレートの選択を行なう。
 このように、実施の形態3に従う画像処理装置は、いずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、候補領域を別の場所に移動させた上で、再度処理を実行する。このような候補領域の自動更新の機能を採用することで、最適な統合テンプレート18を作成できる。
 さらに、実施の形態2の処理と実施の形態3の処理とを並列的に実行してもよい。
 [F.実施の形態4]
 上述の実施の形態1においては、事前に取得したテンプレート生成用画像12を用いてテンプレート候補16を設定し、これを事前に取得したテスト画像14を用いて評価することで、複数の部分テンプレートからなる、最適な統合テンプレート18を生成する処理例について説明した。実際に生産ラインなどで使用される場合を想定すると、運用に伴う経時変化(例えば、ワーク2のロットが変化した場合)によって、統合テンプレート18の探索精度が低下する可能性がある。
 実施の形態4においては、このような統合テンプレート18の探索精度の時間的な経過を観測するとともに、探索精度が低下した場合に必要な対処を行なう構成について例示する。以下の説明では、上述の実施の形態1に従う画像処理装置100とは異なる点について主として説明し、それ以外の機能構成や処理内容の詳細な説明は繰り返さない。
 図14は、本発明の実施の形態4に従う画像処理装置が取得する入力画像20を説明するための図である。図15は、本発明の実施の形態4に従う画像処理装置による探索精度の評価処理を説明するための図である。
 図14に示すように、画像処理装置は、所定時間毎に入力画像20を取得し、各入力画像20に対して統合テンプレート18を用いたマッチングを逐次行なう。画像処理装置は、各入力画像20に対するマッチングによって算出された類似度を、部分テンプレート毎に所定回数分を保持する。例えば、図15に示すように、部分テンプレート毎に類似度を保持することで、類似度の時間的な変化を評価することができる。すなわち、画像処理装置は、複数の入力画像20にわたって、テンプレートマッチングによる探索処理の結果として算出される類似度を記憶する。
 本実施の形態においては、以下に説明するように、統合テンプレート18の全体評価、および、統合テンプレート18を構成する部分テンプレートの個別評価を行なう。これらのいずれか一方のみを行なうようにしてもよい。
 統合テンプレート18の全体評価としては、統合テンプレート18を構成する部分テンプレートの大多数において、マッチングによる類似度が低下した場合には、統合テンプレート18として使用し続けることは困難である。そのため、このような場合には、画像処理装置は、フェールセーフとして、マッチング処理(位置検出処理)を中断し、(オフラインで)統合テンプレート18を再度作り直す。より具体的には、統合テンプレート18を構成するそれぞれの部分テンプレートを用いて算出された類似度がいずれもしきい値Thを下回った場合などには、位置検出処理を中断する。
 次に、部分テンプレートの個別評価としては、部分テンプレート毎に類似度の時間的変化を評価する。例えば、統合テンプレート18を構成する大多数の部分テンプレートでは、安定した類似度が得られているが、一部の部分テンプレートの類似度は、時間とともに低下している兆候がみられる場合には、画像処理装置は、その部分テンプレートについての重みを低下させる。すなわち、画像処理装置は、それぞれの部分テンプレートを用いて検出された対応位置から最終的な検出位置を算出する際に、類似度が低下している部分テンプレートを用いて検出された対応位置の情報に対する重みを相対的に低くする。
 具体的な処理例としては、画像処理装置は、時系列に並べられた入力画像20についての直近の類似度(例えば、20回分)から、直線近似を用いて時間的な変化を示す傾きを算出する。そして、画像処理装置は、その算出された傾きが所定値(負値)よりも小さくなった場合に、対応する部分テンプレートに対する重みを相対的に低くする。
 以上のように、本実施の形態に従う画像処理装置は、記憶した類似度の時間的変化に基づいて、統合テンプレート18を構成する複数の部分テンプレートに対する、位置探索における重みを変更する。言い換えれば、本実施の形態に従う画像処理装置は、入力画像を時系列に取得し、各入力画像において対応位置を特定した際の類似度を部分テンプレート毎に記憶し、部分テンプレート毎の類似度の時間的な変化に基づいて、重みマップを更新する。
 本実施の形態によれば、時間的経過に伴う環境変動などにより、予め生成した統合テンプレートの探索精度が低下した場合に、それを検出し、探索精度を向上するように対応することができる。
 [G.実施の形態5]
 上述の実施の形態1においては、事前に取得したテンプレート生成用画像12を用いてテンプレート候補16を設定し、これを事前に取得したテスト画像14を用いて評価することで、複数の部分テンプレートからなる、最適な統合テンプレート18を生成する処理例について説明した。
 これに対して、統合テンプレート18として用いる部分テンプレートを動的に決定してもよい。すなわち、複数のテンプレート候補16から予め統合テンプレート18として使用するものを選択しておくのではなく、入力画像を取得するたびに、複数のテンプレート候補16を評価し、その評価結果に基づいて、統合テンプレート18の部分テンプレートとして使用するものをその都度決定してもよい。
 より具体的には、図4に示す算出部160での処理と同様に、入力画像20に対して、テンプレート候補16の各々を用いたマッチングを行ない、そのマッチングの結果に含まれる類似度を評価する。そして、各テンプレート候補16についての類似度に基づいて、統合テンプレート18として使用可能なものを選択する。そして、選択されたテンプレート候補16(部分テンプレート)の探索結果から対応位置を算出する。
 実施の形態5によれば、他の実施の形態に比較してより長い演算時間を要するが、各マッチングにおいて、統合テンプレート18として使用する部分テンプレートを動的に変更しながら最適なものを選択できるので、環境変動が生じた場合であっても、探索精度を維持できる。
 [H.その他の実施の形態]
 上述の実施の形態においては、テンプレートマッチングの一例として、RIPOC法を採用する例について説明した。これに加えて、あるいは、これに代えて、サイズも含めた幾何学的なずれがあっても対応可能なアルゴリズム方法を採用できる。例えば、文献1(Qin-Sheng Chen, "Symmetric Phase-Only Matched Filtering of Fourier-Mellin Transforms for Image Registration and Recognition",IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. I6, NO. 12, DECEMBER 1994)に開示されるフーリエメリン変換を用いたマッチング方法を採用してもよい。このマッチング方法によれば、RIPOC法によって得られた画像間の回転量と同様に、画像間の倍率(サイズ)の情報を得ることができる。したがって、上述した実施形態における画像間の回転量に代えて、または回転量に加えて、倍率(サイズ)の情報を位置情報として取り扱うことができる。
 また、POC以外にも画像内の周波数情報を利用したマッチングアルゴリズムとして、文献2(貴家仁志、「画像信号処理と画像パターン認識の融合-DCT符号限定相関とその応用」、首都大学東京 システムデザイン学部、動的画像処理実利用化ワークショップ2007(2007.3.8))に開示されるマッチング方法を採用してもよい。
 [I.利点]
 本実施の形態においては、複数のテンプレート候補の各々を評価した上で、実際のマッチング処理に使用される部分テンプレートを決定し、これらの最終的に使用されるテンプレート候補の集合体として統合テンプレートを構成する。このような部分テンプレートの集合体として統合テンプレートを生成することで、不適格領域を含まないようなテンプレートを生成することができる。これによって、周波数情報を利用したテンプレートマッチング(例えば、位相限定相関法(POC法))のロバスト性を向上できる。すなわち、本実施の形態によれば、不適格領域を含まないテンプレートを容易に生成できる。
 また、周波数情報を利用したテンプレートマッチング(例えば、位相限定相関法(POC法))を利用する位置検出において、不適格領域を含むテンプレートを用いると周波数情報の変化によって探索精度が大きく低下する。また、テンプレートのサイズが小さくなると低周波情報が失われるので探索精度の劣化が生じやすく、また、探索できるエリアも狭くなってしまう。これに対して、本実施の形態によれば、候補領域を分割して得られる小領域を結合した部分テンプレート(テンプレート候補16)を用いるので、不適格領域を排除しつつ、できるだけ広範囲なエリアを含むテンプレートを設定することができ、マッチング処理の探索精度やロバスト性を向上できる。また、画像に含まれる低周波情報を利用でき、これによっても、マッチング処理の探索精度やロバスト性をさらに向上できる。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 システム、2 対象物、3 ベルトコンベア、10 カメラ、12 テンプレート生成用画像、13 候補領域、14 テスト画像、16 テンプレート候補、18 統合テンプレート、20 入力画像、100 画像処理装置、102 CPU、104 RAM、106 ROM、108 ネットワークインターフェイス、110 補助記憶装置、112 テンプレート生成処理プログラム、114 テンプレートマッチング処理プログラム、120 表示部、122 入力部、124 メモリーカードインターフェイス、126 メモリーカード、128 カメラインターフェイス、130 バス、150 テンプレート生成用画像取得部、152 テスト画像取得部、154 候補領域設定部、156 候補領域分割部、158 テンプレート候補生成部、160 算出部、161,164 フーリエ変換部、162,165 対数化処理部、163,166,166 極座標変換部、167 第1POC処理部、168 回転量補正部、169 第2POC処理部、170 統合テンプレート生成部、172 入力画像取得部、174 統合テンプレート保持部、176 位置検出部。

Claims (9)

  1.  入力画像における対象物の探索に用いられるテンプレートを生成する機能を有する画像処理装置であって、
     前記対象物を含む第1の入力画像を取得する第1の画像取得部と、
     前記対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得する第2の画像取得部と、
     前記対象物を含むように前記第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するテンプレート候補設定部と、
     前記第2の入力画像において各テンプレート候補を用いた前記対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出する算出部と、
     前記探索精度および各テンプレート候補のサイズに基づいて、前記複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を前記テンプレートとして生成する生成部とを備える、画像処理装置。
  2.  前記算出部は、
      各テンプレート候補と前記第2の入力画像に設定される当該テンプレート候補に対応する領域とのそれぞれから周波数情報を算出する周波数情報算出部と、
      前記周波数情報に基づいて、前記対象物の探索処理を実行する探索部とを含む、請求項1に記載の画像処理装置。
  3.  前記生成部は、
      前記探索処理により算出された類似度と、テンプレート候補の大きさに依存する重み係数とに基づいて選択指標を算出する選択指標算出部と、
      前記選択指標算出部によって算出された選択指標がより大きなテンプレート候補を、前記部分テンプレートとして選択する選択部とを含む、請求項1または2に記載の画像処理装置。
  4.  前記対象物の探索が行われるべき第3の入力画像を取得する第3の画像取得部と、
     前記第3の入力画像に対して、前記複数の部分テンプレートのそれぞれを用いて探索処理を実行するとともに、それぞれの探索処理の結果に基づいて、前記第3の入力画像における前記対象物の位置情報を出力する対象物探索部とをさらに備える、請求項1~3のいずれか1項に記載の画像処理装置。
  5.  複数の前記第3の入力画像にわたって、前記探索部による探索処理の結果として算出される前記複数の部分テンプレートのそれぞれについての類似度を記憶する記憶部と、
     前記記憶部に記憶された類似度の時間的変化に基づいて、前記複数の部分テンプレートに対する前記探索部における重みを変更する重み変更部とをさらに備える、請求項4に記載の画像処理装置。
  6.  前記テンプレート候補設定部は、前記算出部によっていずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、前記候補領域を拡張した上で、再度テンプレート候補を設定する、請求項1~5のいずれか1項に記載の画像処理装置。
  7.  前記テンプレート候補設定部は、前記算出部によっていずれのテンプレート候補についても有効な探索精度を算出できなかった場合に、前記候補領域の位置を変更した上で、再度テンプレート候補を設定する、請求項1~6のいずれか1項に記載の画像処理装置。
  8.  入力画像における対象物の探索に用いられるテンプレートを生成する画像処理方法であって、
     前記対象物を含む第1の入力画像を取得するステップと、
     前記対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得するステップと、
     前記対象物を含むように前記第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するステップと、
     前記第2の入力画像において各テンプレート候補を用いた前記対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出するステップと、
     前記探索精度および各テンプレート候補のサイズに基づいて、前記複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を前記テンプレートとして生成するステップとを備える、画像処理方法。
  9.  入力画像における対象物の探索に用いられるテンプレートを生成するための画像処理プログラムであって、前記画像処理プログラムはコンピューターに、
     前記対象物を含む第1の入力画像を取得するステップと、
     前記対象物を含むとともに、当該対象物の画像内の位置情報が既知である第2の入力画像を取得するステップと、
     前記対象物を含むように前記第1の入力画像に設定された候補領域を、複数の小領域に分割するとともに、単一の小領域または互いに隣接する複数の小領域からなる矩形のテンプレート候補を複数設定するステップと、
     前記第2の入力画像において各テンプレート候補を用いた前記対象物の探索処理を実行するとともに、当該探索処理の実行結果に基づいて、各テンプレート候補の探索精度を算出するステップと、
     前記探索精度および各テンプレート候補のサイズに基づいて、前記複数のテンプレート候補から複数の部分テンプレートを選択し、選択された部分テンプレートの組を前記テンプレートとして生成するステップとを実行させる、画像処理プログラム。
PCT/JP2013/071196 2012-08-10 2013-08-06 画像処理装置、画像処理方法および画像処理プログラム WO2014024854A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP13827663.9A EP2884459A4 (en) 2012-08-10 2013-08-06 PICTURE PROCESSING DEVICE, PICTURE PROCESSING METHOD AND PICTURE PROCESSING PROGRAM
US14/420,602 US20150186422A1 (en) 2012-08-10 2013-08-06 Image processing apparatus, image processing method, and image processing program
JP2013555701A JP5541426B1 (ja) 2012-08-10 2013-08-06 画像処理装置、画像処理方法および画像処理プログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012178619 2012-08-10
JP2012-178619 2012-08-10

Publications (1)

Publication Number Publication Date
WO2014024854A1 true WO2014024854A1 (ja) 2014-02-13

Family

ID=50068078

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/071196 WO2014024854A1 (ja) 2012-08-10 2013-08-06 画像処理装置、画像処理方法および画像処理プログラム

Country Status (4)

Country Link
US (1) US20150186422A1 (ja)
EP (1) EP2884459A4 (ja)
JP (1) JP5541426B1 (ja)
WO (1) WO2014024854A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017045166A (ja) * 2015-08-25 2017-03-02 キヤノン株式会社 ワークの処理方法、基準画像の作成方法、基準画像の作成装置、ワークの処理装置、プログラム、及び記録媒体
JP2022540072A (ja) * 2019-07-31 2022-09-14 深▲セン▼市商▲湯▼科技有限公司 位置姿勢決定方法及び装置、電子機器並びに記憶媒体

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160125266A1 (en) * 2013-06-17 2016-05-05 Konica Minolta, Inc. Image Processing Method, Image Processing Device, And Image Processing Program
CN108475425B (zh) * 2016-01-20 2022-03-08 富士通株式会社 图像处理装置、图像处理方法及计算机可读取的记录介质
JP6333871B2 (ja) * 2016-02-25 2018-05-30 ファナック株式会社 入力画像から検出した対象物を表示する画像処理装置
CN112465050B (zh) * 2020-12-04 2024-02-09 广东拓斯达科技股份有限公司 一种图像模板选择方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0689343A (ja) 1992-09-08 1994-03-29 Yaskawa Electric Corp テンプレートマッチングの不感帯領域設定方法
JPH06317406A (ja) 1993-05-07 1994-11-15 Mazda Motor Corp 物品の位置検出装置
JPH10124667A (ja) 1996-08-26 1998-05-15 Yamatake Honeywell Co Ltd パターン照合装置
JP2006005242A (ja) * 2004-06-18 2006-01-05 Canon Inc 画像処理装置、画像処理方法、露光装置、およびデバイス製造方法
JP2011155492A (ja) * 2010-01-27 2011-08-11 Nikon Corp 画像処理装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006065764A (ja) * 2004-08-30 2006-03-09 Sharp Corp 画像照合装置、画像照合方法、画像照合プログラムおよび画像照合プログラムを記録したコンピュータ読取り可能な記録媒体
US7817826B2 (en) * 2005-08-12 2010-10-19 Intelitrac Inc. Apparatus and method for partial component facial recognition
WO2009113598A1 (en) * 2008-03-13 2009-09-17 Kabushiki Kaisha Toshiba Template matching apparatus and method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0689343A (ja) 1992-09-08 1994-03-29 Yaskawa Electric Corp テンプレートマッチングの不感帯領域設定方法
JPH06317406A (ja) 1993-05-07 1994-11-15 Mazda Motor Corp 物品の位置検出装置
JPH10124667A (ja) 1996-08-26 1998-05-15 Yamatake Honeywell Co Ltd パターン照合装置
JP2006005242A (ja) * 2004-06-18 2006-01-05 Canon Inc 画像処理装置、画像処理方法、露光装置、およびデバイス製造方法
JP2011155492A (ja) * 2010-01-27 2011-08-11 Nikon Corp 画像処理装置

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
HITOSHI KIYA: "Integration of Image Signal Processing and Image Pattern Recognition -- DCT Sign Only Correlation and Its Application", WORKSHOP ON DYNAMIC IMAGE PROCESSING FOR REAL APPLICATION, 8 March 2007 (2007-03-08)
QIN-SHENG CHEN: "Symmetric Phase-Only Matched Filtering of Fourier-Mellin Transforms for Image Registration and Recognition", IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, vol. 16, no. 12, December 1994 (1994-12-01), XP000486818, DOI: doi:10.1109/34.387491
See also references of EP2884459A4
YUKI HISHINUMA ET AL.: "Phase Correlation For High Resolution Motion Video With Low Operation Cost", THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS 2009 NAN SOGO TAIKAI KOEN RONBUNSHU, JOHO SYSTEM 2, 4 March 2009 (2009-03-04), pages 3, XP008176397 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017045166A (ja) * 2015-08-25 2017-03-02 キヤノン株式会社 ワークの処理方法、基準画像の作成方法、基準画像の作成装置、ワークの処理装置、プログラム、及び記録媒体
JP2022540072A (ja) * 2019-07-31 2022-09-14 深▲セン▼市商▲湯▼科技有限公司 位置姿勢決定方法及び装置、電子機器並びに記憶媒体

Also Published As

Publication number Publication date
JP5541426B1 (ja) 2014-07-09
EP2884459A4 (en) 2016-03-30
EP2884459A1 (en) 2015-06-17
JPWO2014024854A1 (ja) 2016-07-25
US20150186422A1 (en) 2015-07-02

Similar Documents

Publication Publication Date Title
JP5541426B1 (ja) 画像処理装置、画像処理方法および画像処理プログラム
US8693785B2 (en) Image matching devices and image matching methods thereof
CN108875523B (zh) 人体关节点检测方法、装置、系统和存储介质
US10740589B2 (en) Skin information processing method, skin information processing device, and non-transitory computer-readable medium
WO2014203687A1 (ja) 画像処理方法、画像処理装置、および画像処理プログラム
JP2008257469A (ja) 画像処理装置及び画像検索方法
US10657672B2 (en) Image processing device, image processing method and storage medium
JP6338274B2 (ja) 情報処理装置ならびにその特徴点選択方法、装置およびプログラム
JP5477518B1 (ja) 画像処理装置、画像処理方法および画像処理プログラム
US10740590B2 (en) Skin information processing method, skin information processing device, and non-transitory computer-readable medium
JP6403201B2 (ja) 画像特徴量登録装置、方法及びプログラム
JP5931646B2 (ja) 画像処理装置
JP5310402B2 (ja) 画像変換パラメータ算出装置、画像変換パラメータ算出方法およびプログラム
JP6393495B2 (ja) 画像処理装置および物体認識方法
CN108876853B (zh) 图像定位方法、装置、系统和存储介质
JP2013101592A (ja) 3次元座標算出装置、3次元座標算出方法、及びプログラム
US9189693B2 (en) Information processing apparatus and information processing method
JP2016206909A (ja) 情報処理装置、情報処理方法
JP6056354B2 (ja) 画像処理装置、画像処理方法および画像処理プログラム
WO2014178241A1 (ja) 画像処理装置、画像処理方法および画像処理プログラム
JP2015187770A (ja) 画像認識装置、画像認識方法及びプログラム
JP2007148820A (ja) 画像処理方法、その装置およびプログラム
JP6399651B2 (ja) 登録装置及び検索装置並びに方法及びプログラム
JP6460520B2 (ja) 特徴記述装置、方法及びプログラム
Matsui et al. Automatic feature point selection through hybrid metaheauristics based on Tabu search and memetic algorithm for augmented reality

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2013555701

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13827663

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14420602

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2013827663

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013827663

Country of ref document: EP