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

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

Info

Publication number
WO2014002813A1
WO2014002813A1 PCT/JP2013/066586 JP2013066586W WO2014002813A1 WO 2014002813 A1 WO2014002813 A1 WO 2014002813A1 JP 2013066586 W JP2013066586 W JP 2013066586W WO 2014002813 A1 WO2014002813 A1 WO 2014002813A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
template
resolution
reference image
input
Prior art date
Application number
PCT/JP2013/066586
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 US14/411,295 priority Critical patent/US20150345936A1/en
Priority to EP13810312.2A priority patent/EP2866195A4/en
Priority to JP2013544957A priority patent/JP5477518B1/ja
Publication of WO2014002813A1 publication Critical patent/WO2014002813A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/14Measuring arrangements characterised by the use of optical techniques for measuring distance or clearance between spaced objects or spaced apertures
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/37Determination of transform parameters for the alignment of images, i.e. image registration using transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/74Determining position or orientation of objects or cameras using feature-based methods involving reference images or patches
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/60Noise processing, e.g. detecting, correcting, reducing or removing noise
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform

Definitions

  • the present invention relates to an image processing apparatus, an image processing method, and an image processing program for searching an area corresponding to a reference image from an input image.
  • phase-only correlation (POC) method searches for corresponding points between images using phase difference information of spatial frequencies included in the images.
  • Patent Document 1 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.
  • N-dimensional pattern for example, fingerprint (two-dimensional) or three-dimensional (three-dimensional)
  • Non-Patent Document 1 shows an example of a POC method for size / rotation. More specifically, Non-Patent Document 1 discusses the POC method using Fourier Merin transform.
  • the POC method and the size / rotation-compatible POC method as described above both use the spatial frequency phase difference information included in the image, so that there is an advantage that robust position detection can be performed, but the processing amount is very large. Also, there is a demerit that it takes calculation time. For example, when a matching process for searching for a position where a specific pattern (reference image / template image) included in an input image exists is performed using the size / rotation-compatible POC method, a raster for position search is used. Scanning is required, and the computation time required for the scanning can be enormous.
  • an image processing apparatus that searches an input image for a region corresponding to a reference image.
  • An image processing apparatus includes an input image acquisition unit that acquires first and second input images corresponding to an input image and having at least a first resolution and a second resolution higher than the first resolution, and a reference image Corresponding reference image acquisition unit for acquiring first and second reference images having resolutions respectively corresponding to the first and second resolutions, and a search between the first input image and the first reference image By processing, a relative shift amount of rotation and / or magnification between the first input image and the first reference image is calculated, and the first reference image based on the calculated relative shift amount is calculated.
  • a first corresponding position determination unit that generates a first correction reference image by correction and determines a corresponding position at the first resolution by a search process between the first input image and the first correction reference image; To the first resolution And using the relative shift amount calculated by the first corresponding position determination unit using the position in the second input image corresponding to the corresponding position as a reference, and the second input image and the second reference image, And a second corresponding position determining unit that determines a corresponding position at the second resolution by performing a search process between the first and second resolutions.
  • the second corresponding position determination unit restricts the search range according to the relative shift amount between the first input image and the first reference image, and then determines the second input image and the first input image.
  • a relative shift amount of rotation and / or magnification between the second input image and the second reference image is calculated, and the calculated relative
  • a second correction reference image is generated by correcting the second reference image based on the amount of deviation, and the search processing between the second input image and the second correction reference image is used to cope with the second resolution. Determine the position.
  • the second corresponding position determination unit causes the reference image acquisition unit to generate the second reference image according to the relative shift amount between the first input image and the first reference image.
  • the image processing apparatus calculates the similarity calculated in the search process between the first input image and the first reference image, and between the first input image and the first correction reference image.
  • a control unit is further included that changes the method of determining the corresponding position at the second resolution by the second corresponding position determination unit based on at least one of the similarities calculated in the search process.
  • an image processing method for searching a region corresponding to a reference image from an input image corresponds to an input image, the first and second input images having at least a first resolution and a second resolution higher than the first resolution, respectively, corresponding to the input image; Obtaining first and second reference images having resolutions respectively corresponding to the first and second resolutions; A search process between the first input image and the first reference image calculates a relative shift amount between rotation and / or magnification between the first input image and the first reference image, and A first correction reference image is generated by correcting the first reference image based on the calculated relative shift amount, and the first correction reference image is searched for between the first input image and the first correction reference image.
  • Determining a corresponding position at a resolution of A search process between the second input image and the second reference image is performed using a relative shift amount with reference to the position in the second input image corresponding to the corresponding position in the first resolution.
  • An image processing method comprising: determining a corresponding position at the second resolution.
  • an image processing program for searching an area corresponding to a reference image from an input image.
  • the image processing program obtains first and second input images corresponding to the input image and having at least a first resolution and a second resolution higher than the first resolution, respectively, and the reference image.
  • the relative shift amount of rotation and / or magnification between one input image and the first reference image is calculated, and the first reference image is corrected based on the calculated relative shift amount, thereby correcting the first reference image.
  • FIG. 1 It is a figure which shows an example of the input image used in the template matching process according to Embodiment 1 of this invention, a hierarchy image, and a template image. It is a figure which outlines the content of the template matching process according to Embodiment 1 of this invention. It is a block diagram which shows the function structure of the image processing apparatus according to Embodiment 1 of this invention. It is a figure which outlines the production
  • search processing is efficiently performed by a coarse / fine strategy using multiple resolutions.
  • the relative shift amount of the rotation and / or magnification between the image to be matched and the template image is evaluated, and after this is corrected, the position search is performed. Processing is executed.
  • the relative shift amount refers to the relative shift amount between the image to be processed and the template image (reference image) and the relative magnification (size). This means at least one of the shift amounts due to the difference.
  • information such as a relative shift amount and a matching position is propagated from the low resolution side to the high resolution side, thereby improving the efficiency of the search process.
  • 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 2 as an example.
  • the object 3 (work) is continuously conveyed on the belt conveyor 2, and an image including the appearance of the object 3 is acquired by imaging the object 3 with the camera 4. (Hereinafter, this acquired image is also referred to as “input image”).
  • the objects 3 conveyed on the belt conveyor 2 can be arranged in various directions, and therefore the rotation direction and / or size (enlargement / reduction ratio) of the region representing the object 3 included in the input image is determined. It is not always constant. Therefore, image processing apparatus 100 according to the present embodiment executes matching processing while adjusting the orientation and / or size of the template image. That is, the image processing apparatus 100 searches for a corresponding region in the input image after correcting the template image with some rotation amount and / or magnification.
  • the image processing apparatus 100 may output information (rotation amount and / or magnification) indicating the degree of correction performed in the template matching process in addition to the position information indicating the corresponding region as a search result.
  • 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.
  • the CPU 102 controls the entire image processing apparatus 100 by executing various programs such as an operating system (OS: Operating System) and a template matching processing program 112 stored in the ROM 106, the auxiliary storage device 110, and the like.
  • 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 the like, and includes an image processing program (template matching processing program 112) and a template generation image for realizing various processes according to the present embodiment. 114 and the like are stored. Further, the auxiliary storage device 110 may store a program such as an operating system.
  • the template generation image 114 is used to generate a template image.
  • search processing is efficiently performed by a coarse / fine strategy using multiple resolutions.
  • this coarse / fine strategy requires a template image of each resolution
  • the template generation image 114 is classified by resolution. Preferably stored. Details of the density strategy and the template image will be 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 matching processing program 112, and the like.
  • GUI Graphic User Interface
  • the memory card interface 124 reads and writes data with various memory cards (non-volatile recording media) 126 such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card.
  • non-volatile recording media such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card.
  • the camera interface 128 captures from the camera 4 a template generation image and / or an input image acquired by imaging a subject.
  • 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 a template generation image and / or an input image acquired by some device. That is, the memory card 126 is mounted on the memory card interface 124, and the template generation image and / or the input image read from the memory card 126 are stored (copied) in the auxiliary storage device 110 or the like.
  • the template matching processing program 112 stored in the auxiliary storage device 110 is stored and distributed in a recording medium such as a CD-ROM (Compact Disk-Read Only Memory) or distributed from a server device or the like via a network. .
  • the template matching processing program 112 implements processing by calling necessary modules among program modules provided as part of an operating system executed by the image processing apparatus 100 (personal computer) at a predetermined timing and order. It may be.
  • the template matching processing program 112 itself does not include a module provided by the operating system, and image processing is realized in cooperation with the operating system.
  • the template matching processing program 112 may be provided by being incorporated in a part of some program instead of a single program.
  • the template matching processing program 112 itself does not include a module that is commonly used in the certain program, and image processing is realized in cooperation with the certain program. Even the template matching processing program 112 that does not include some of the modules does not depart from the spirit of the image processing apparatus 100 according to the present embodiment.
  • templates matching processing program 112 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.
  • ⁇ c1 Outline of processing >>
  • a template that combines a search process that takes into account a relative shift between an input image / hierarchical image (partial image included) and a template image and a coarse / fine strategy using multiple resolutions is combined.
  • a method of searching a region corresponding to an image from an input image is adopted.
  • an image group having a plurality of resolutions corresponding to the input image is acquired, and a template matching process is performed in order from the image having the lowest resolution to search for a region corresponding to the template image.
  • the calculation time is short, but the accuracy of the searched position is relatively low (accuracy of the corresponding resolution is limited).
  • template matching processing for an image with higher resolution is executed. At this time, the processing is efficiently performed using the result of the template matching processing executed previously. Therefore, even if the resolution is high, the calculation time can be shortened. Thereafter, by performing the same processing, the position information searched in the image with the highest resolution is output as a result.
  • an image obtained by reducing the first layer image 210 to an image size of 400 ⁇ 300 pixels is generated as an image of the second layer (hereinafter also referred to as “second layer image 220”). Furthermore, an image obtained by reducing the second layer image 220 to an image size of 200 ⁇ 150 pixels is generated as a third layer image (hereinafter also referred to as “third layer image 230”).
  • FIGS. 4 and 5 are diagrams showing an example of input images and hierarchical images used in the template matching process according to the first embodiment of the present invention.
  • hierarchical images with different resolutions are generated from the input image 200.
  • each hierarchical image (first hierarchical image 210, second hierarchical image 220, and third hierarchical image 230) is obtained by reducing the input image 200 by a predetermined magnification.
  • a search range 232 is set for the third hierarchy image 230 and corresponds to a region (hereinafter also referred to as “extraction region”) sequentially extracted from the search range 232.
  • extraction region a region sequentially extracted from the search range 232.
  • Template matching processing is executed with the template image.
  • the extraction area has the same image size as the template image. It is assumed that the position 234 of the extraction region with the highest similarity is specified by this template matching process.
  • a search range 222 is set for the second hierarchical image 220 with reference to the position 234 of the specified extraction region, and a template is extracted between the extraction region sequentially extracted from the search range 222 and the corresponding template image.
  • a matching process is executed. It is assumed that the position 224 of the extraction region with the highest similarity is specified by this template matching process.
  • a search range 212 is set for the first hierarchical image 210 with reference to the position 224 of the extraction region, and template matching is performed between the extraction region sequentially extracted from the search range 212 and the corresponding template image. Processing is executed. It is assumed that the position 214 of the extraction region with the highest similarity is specified by this template matching process.
  • a search range 202 is set for the input image 200 with reference to the position 214 of the extraction region, and template matching between the extraction region sequentially extracted from the search range 202 and the corresponding template image is performed. Processing is executed. It is assumed that the position 204 of the extraction region with the highest similarity is specified by this template matching process. Then, the position 204 of this extraction area is output as a search result.
  • FIG. 6 is a diagram showing an example of input images, hierarchical images, and template images used in the template matching process according to the first embodiment of the present invention.
  • search processing is executed using a template image having a common size (for example, 128 ⁇ 128 pix) for the input image and each hierarchical image. That is, each template image is sequentially compared with an extraction area extracted from the target input image or any one of the hierarchical images.
  • the matching process is executed after the template image is appropriately corrected in accordance with the relative shift between the input image / hierarchical image (partial image included) and the template image.
  • the processing is made efficient by using the search result in the previous hierarchy.
  • FIG. 7 is a diagram schematically showing the contents of the template matching process according to the first embodiment of the present invention.
  • FIG. 7 illustrates the contents of the processing for the third layer image and the second layer image, but the same processing is executed for the first layer image and the input image by the same procedure.
  • a search range is set for the third layer image, and an extraction region to be subjected to a matching process is extracted from the search range.
  • the search process ((1) matching) for the rotation amount is executed between Note that the search range in the third layer image may be the entire third layer image.
  • a relative rotation amount relative shift amount
  • the template image is corrected using the calculated relative rotation amount ((3) rotation amount correction). With this correction, a correction template image is generated.
  • a position search process ((4) matching) is performed between the extraction region and the correction template image.
  • the similarity between the extraction region and the correction template image in the third hierarchy is calculated.
  • the extraction region having the highest similarity with the correction template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating a relative position of the extraction region most matching the correction template image within the search range) is calculated ((5) position calculation). This completes the search process in the third hierarchy.
  • the search process in the second layer is started.
  • a search range is set for the second hierarchy image, and an extraction region to be subjected to matching processing is set from the search range, and between this extraction region and the template image for the second hierarchy is set.
  • Search processing ((6) matching) for the rotation amount is executed.
  • the search range is set based on the position indicating the extraction region with the highest similarity calculated in the third hierarchy.
  • the search process for the rotation amount is only for a predetermined range based on the rotation amount for the extraction region having the highest similarity calculated in the third hierarchy. For example, if the rotation amount calculated in the third layer is ⁇ , in the search process for the rotation amount in the second layer, the search is performed only in the range of ⁇ ⁇ ⁇ ( ⁇ : a predetermined variation angle).
  • the relative rotation amount (relative shift amount) between the extraction region and the template image in the second layer is calculated by the search process for the rotation amount ((7) rotation amount calculation). Then, the template image is corrected using the calculated relative rotation amount ((8) rotation amount correction). With this correction, a correction template image is generated.
  • a position search process ((9) matching) is performed between the extraction region and the correction template image.
  • the similarity between the extraction region and the correction template image in the second hierarchy is calculated.
  • the extraction region having the highest similarity with the correction template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating the relative position of the extraction region that most closely matches the correction template image within the search range) is calculated ((10) position calculation). This completes the search process in the second hierarchy.
  • the image processing apparatus 100 searches for an area corresponding to the template generation image (reference image) from the input image by performing the following functions. That is, the image processing apparatus 100 has a third layer resolution (first resolution) and a second layer resolution (second resolution higher than the first resolution) corresponding to the input image, respectively. It has a function (input image acquisition unit) for acquiring two-layer images (first and second input images). The image processing apparatus 100 further includes, from the template generation image (reference image), template images corresponding to the third and second layers (first and second references having resolutions respectively corresponding to the first and second resolutions). A function (reference image generation unit).
  • the image processing apparatus 100 is extracted from the third hierarchy image by a search process between the third hierarchy image (first input image) and the template image (first reference image) corresponding to the third hierarchy. And calculating the relative shift amount of the rotation and / or magnification between the extracted region and the template image (first input image and first reference image) corresponding to the third hierarchy, and the calculated relative
  • a corrected template image is generated, and the third layer A function (first corresponding position) for determining a corresponding position in the third layer (first resolution) by a search process between an image (first input image) and a correction template image (first correction reference image) Having a tough).
  • the image processing apparatus 100 determines the above function (first corresponding position determination) with reference to the position in the second layer image (second input image) corresponding to the corresponding position in the third layer (first resolution). 2) by performing a search process between the second hierarchical image (second input image) and the template image (second reference image) using the relative shift amount calculated by A function (second corresponding position determining unit) for determining a corresponding position in the hierarchy (second resolution); That is, the second corresponding position determination unit performs a search process between the second input image and the second reference image, thereby rotating between the second input image and the second reference image.
  • the second correction reference image is generated by correcting the second reference image based on the calculated relative displacement amount, and the second input image and the second input image The corresponding position at the second resolution is determined by the search process with the correction reference image.
  • the image processing apparatus 100 sets the relative shift amount between the extraction region extracted from the third layer image and the template image (first input image and first reference image) corresponding to the third layer.
  • the search range is limited accordingly, and a search process between the second hierarchical image (second input image) and the template image (second reference image) is performed, so that the second hierarchical image (second A relative shift amount of rotation and / or magnification between the input image) and the template image (second reference image) is calculated, and a template image (second reference) based on the calculated relative shift amount is calculated.
  • a correction template image (second correction reference image) is generated by correcting the second reference image, and the second layer image (second input image) and the correction template image (second correction reference image) are Through the search process between Ability to determine the corresponding position in the serial second resolution having (second correcting unit).
  • the second corresponding position determination unit causes the reference image acquisition unit to generate the second reference image according to the relative shift amount between the first input image and the first reference image.
  • the image processing apparatus 100 uses the result of the template matching process performed in the previous layer to improve the processing efficiency.
  • FIG. 8 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 according to the present embodiment has an image acquisition unit 150, a multi-resolution image generation unit 152, a template generation unit 154, a search control unit 156, as its main functional configuration.
  • a position detector 158 are realized by the CPU 102 executing the template matching processing program 112 in the image processing apparatus 100 shown in FIG. Details of each functional configuration will be described below.
  • the image acquisition unit 150 acquires an input image to be processed. Typically, an image generated by the connected camera 4 capturing a subject is acquired as an input image. Alternatively, an input image generated by some external device may be acquired via various recording media or communication media.
  • Multi-resolution image generation unit 152 acquires an image (hierarchical image) having a plurality of resolutions corresponding to the input image. Typically, the multi-resolution image generation unit 152 generates a plurality of images (hierarchical images) having different resolutions corresponding to the input image acquired by the image acquisition unit 150. As shown in FIGS. 4 and 5, when the image size of the input image is 1600 ⁇ 1200 pix, the conversion magnification is 1 ⁇ 2, and the number of hierarchies is 4, 800 ⁇ 600 pix and 400 ⁇ corresponding to the input image, respectively. An image group (first hierarchical image, second hierarchical image, and third hierarchical image) having an image size of 300 pix and 200 ⁇ 150 pix is generated.
  • the point (x, y) of the third layer image is the point (2x, 2y), (2x + 1, 2y), (2x, 2) of the second layer image.
  • 2y + 1) and (2x + 1, 2y + 1) is obtained as an average value of 2 ⁇ 2 pixels.
  • the conversion magnification may be determined flexibly as necessary. For example, a smaller value such as 1/3 instead of 1/2 may be adopted as the conversion magnification. In this case, since the number of hierarchies can be reduced, the processing can be further speeded up. Conversely, a larger value such as 1 / 1.5 may be adopted as the conversion magnification. In this case, the number of hierarchies can be increased and the calculation load can be increased. However, since the search can be performed in more detail, the robustness can be improved.
  • Template generation unit 154 sets a template image for each hierarchical image. Typically, the template generation unit 154 generates a template image corresponding to each hierarchical image (resolution) from the input template generation image 114.
  • FIG. 9 is a diagram schematically illustrating a template image generation procedure according to the first embodiment of the present invention. As shown in FIG. 9, template images of the same size corresponding to a plurality of template generation images corresponding to the respective hierarchical images are generated.
  • the user captures a reference subject to set a template image and acquires a template generation image. Then, the user designates a position to be searched for the acquired template generation image.
  • the template generation unit 154 sets each template image so that the position to be searched becomes the barycentric position. In the example illustrated in FIG. 9, the template generation unit 154 sets template images each having an image size of 128 ⁇ 128 pix. Similarly, corresponding template images are set for other hierarchical images. In the example shown in FIG. 9, the template images corresponding to the other hierarchical images are also set to 128 ⁇ 128 pix having the same image size as the template image set first. In addition, the template image corresponding to each hierarchical image is also set so that the searched position becomes the center of gravity position.
  • FIG. 9 shows an example in which template images having the same image size are set between hierarchical images, but at least as the resolution of the hierarchical images becomes lower (rougher), the regions included in the template images are the same or wider. What is necessary is just to set.
  • the template image may be set at a position away from the searched position by a certain amount ( ⁇ x, ⁇ y).
  • the position to be searched can be specified by shifting the result by a certain amount ( ⁇ x, ⁇ y) with respect to the position actually searched using the template image.
  • ⁇ c7 Search Control Unit 156
  • the search control unit 156 efficiently performs a search process using a coarse / fine strategy using multiple resolutions.
  • a procedure for performing a position search on the input image will be described.
  • the procedure of multi-resolution analysis when the image size of the input image is 1600 ⁇ 1200 pix, the conversion magnification is 1/2, and the number of layers is 4 will be described.
  • a position search is executed using a template image corresponding to the third layer image.
  • the corresponding position (x3, y3) is specified.
  • an area having the same image size as the template image corresponding to the third hierarchy image is extracted from the third hierarchy image, and the contents of the extracted area (extraction area) are input to the position detection unit 158.
  • the position is searched.
  • a region to be subjected to template matching processing is extracted from the third layer image (200 ⁇ 150 pix).
  • a region having the same image size as the template image (128 ⁇ 128 pix) corresponding to the third layer image is cut out so that the centroid position of the extraction region matches the centroid position of the third layer image.
  • a template matching process is performed on the extraction region and the template image, and the rotation amount and position are specified.
  • the position (x3, y3) on the third layer image is estimated in the second layer image.
  • the approximate position on the second layer image is next determined using the result obtained by the position search on the third layer image, and then the position is determined. Perform a search.
  • the coordinates obtained by doubling the position specified in the third layer image are set as the initial position in the second layer image.
  • region used as the object of a template matching process between the template images corresponding to a 2nd hierarchy image is extracted from a 2nd hierarchy image.
  • This extraction procedure is the same as the extraction procedure for the third layer image.
  • a template matching process is performed on the extraction region and the template image extracted from the second resolution image, and the rotation amount and position are specified.
  • the approximate position on the image in the first layer image is obtained next using the result of the position search in the second layer image.
  • the result on the low resolution side is gradually brought closer to the correct answer so as to be the initial position on the high resolution side.
  • the final position of the first layer image and the input image is specified by specifying the position in the same manner.
  • the position detection unit 158 searches for the rotation amount and the position using the template image corresponding to the extraction area extracted from the input image and / or the hierarchical image.
  • RIPOC rotation invariant phase only correlation
  • FIG. 10 is a schematic diagram for illustrating processing contents in position detection unit 158 according to the first embodiment of the present invention.
  • FIG. 11 is a schematic diagram for explaining the processing contents executed in the POC shown in FIG.
  • the RIPOC method calculates how much the extraction area is rotated with respect to the template image, corrects the rotation angle of the template image (reference numeral 167), and corrects the rotation angle. And a process (reference numeral 168) for calculating how much similarity and parallel movement amount exist between the correction template image acquired by the above and the extraction region.
  • the position detection unit 158 includes Fourier transform processes 161 and 171, logarithmic processes 162 and 172, polar coordinate transform processes 163 and 173, POC process 164, rotation amount correction process 165, and POC process. 166.
  • Fourier transform processing 161 and 171 calculate frequency components (amplitude component and phase component) included in the template image and the extraction region, respectively.
  • the phase component is not necessarily required, and thus may not be calculated.
  • Logarithmic processing 162 and polar coordinate conversion processing 163 logarithmize the amplitude component of the template image and convert it to polar coordinates.
  • the logarithmic process 172 and the polar coordinate conversion process 173 logarithmize the amplitude component for the extraction region and convert it to polar coordinates.
  • the rotation amount is expressed as a coordinate point on two-dimensional coordinates.
  • the POC process 164 calculates the similarity and the parallel movement amount (corresponding to the rotation amount) for the results of the polar coordinate conversion output from the polar coordinate conversion processes 163 and 173, respectively.
  • FIG. 11 schematically shows a processing result in the POC processing 164.
  • the amount of parallel movement between two images is represented as a peak position.
  • the images are sequentially shifted, and the correlation value is calculated between the components of the spatial frequency included in each image, thereby searching for the one with the highest similarity.
  • the amount of translation between images can be calculated by searching a range of about ⁇ 1/4 of the image size of the template image. That is, in the POC process 164, the position where the similarity is the highest among the results of the polar coordinate conversion is specified, and the corresponding rotation amount is output to the rotation amount correction process 165.
  • the rotation amount correction processing 165 corrects the rotation of the template image according to the rotation amount calculated in the POC processing 164. That is, in the rotation amount correction process 165, the template image is rotationally corrected to generate a corrected template image.
  • a method of rotating the template image itself in real space can be employed.
  • the frequency space is handled in the POC processing 166, it is not necessary to rotate in the real space, and the data (amplitude information and phase information) after Fourier transform, which is an internal representation of the POC processing, is used. You may employ
  • the POC process 166 calculates the similarity and the amount of parallel movement between the corrected template image and the extraction area. The position with the highest similarity indicates a region that matches the corrected template image included in the input image.
  • the efficiency of the rotation amount correction process 165 by the coarse / dense strategy using multi-resolution will be described.
  • the amount of rotation of the object 3 included in the input image is indefinite, so it is necessary to search for the amount of rotation within a maximum range of 360 °.
  • the angle that can be searched by the RIPOC method is ⁇ 90 °
  • the rotation amount ( ⁇ + ⁇ ) is also a calculation candidate. Therefore, the POC process 164 and the rotation amount correction process 165 shown in FIG.
  • the POC process 166 performs two rotations.
  • POC processing position search
  • the height of the peak position by POC process about each template image is compared, and the one where the height of a peak position is higher is output as a translation amount.
  • the rotation correction amount of the template used when calculating the selected peak position is output as the rotation amount in the third layer.
  • FIG. 12 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. 12 is typically realized by the CPU 102 (FIG. 2) executing the template matching processing program 112.
  • the CPU 102 acquires an input image from the camera 4 or the like (step S100). Subsequently, the CPU 102 multi-resolutions the input image to generate a hierarchical image (step S102).
  • the first layer image, the second layer image, and the third layer image corresponding to the input image have been generated. It is assumed that a template image corresponding to the input image and each hierarchical image is prepared in advance.
  • the CPU 102 sets an initial position for performing a position search for the third layer image (step S104).
  • the CPU 102 extracts an area having the same image size as the template image from the third hierarchy image (step S106). This extraction area is set so that the initial position set in step S104 is the center of gravity position.
  • the CPU 102 receives the extraction area and the template image as input and executes a rotation amount search process (step S108), and generates a correction template image based on the rotation amount obtained by the rotation amount search process (step S108).
  • Step S110 Typically, a corrected template image is generated by correcting the template image.
  • the CPU 102 executes position search processing using the correction template image generated in step S110 and the extraction region as inputs (step S112).
  • processing for a higher hierarchy is executed.
  • the CPU 102 sets an initial position for performing a position search on the target hierarchical image or input image based on the position calculated in the lower hierarchy (step S114). Subsequently, the CPU 102 extracts an area having the same image size as the corresponding template image from the target hierarchical image or input image (step S116).
  • the CPU 102 sets a search range for the rotation amount based on the rotation amount for template image correction calculated in the lower hierarchy (step S118), and inputs the extraction area and the template image to input the rotation amount.
  • Search processing is executed (step S120), and a correction template image is generated based on the rotation amount obtained by the rotation amount search processing (step S122).
  • a corrected template image is generated by correcting the template image.
  • the CPU 102 executes position search processing using the correction template image generated in step S122 and the extraction region as inputs (step S124).
  • step S126 determines whether or not the current target image is an input image. If the current target image is not an input image (NO in step S126), the next higher-level image is set as the target (step S128), and the processes in and after step S114 are repeated.
  • step S126 if the current target image is an input image (YES in step S126), the result of the search process of step S124 executed immediately before is output (step S130). Then, the process ends.
  • the search is performed while narrowing down both the relative shift amount and the position from the low resolution side, so that the amount of calculation can be reduced and the accuracy can be reduced. Robustness can also be improved.
  • ⁇ d2 Efficiency of search processing
  • search processing is performed in which a relative shift is corrected between the hierarchical image (partial image included) and the template image on the low resolution side.
  • the rotation amount used when the position with the highest similarity is calculated is used to generate a template image in the next layer.
  • FIG. 13 is a diagram schematically showing the contents of the template matching process according to the second embodiment of the present invention.
  • FIG. 13 illustrates the contents of the processing for the third layer image and the second layer image, but the same processing is executed for the first layer image and the input image by the same procedure.
  • a search range is set for the third hierarchy image, and an extraction region to be subjected to matching processing is extracted from the search range, and this extraction region and the template image for the third hierarchy are extracted.
  • the search process ((1) matching) for the rotation amount is executed between Note that the search range in the third layer image may be the entire third layer image.
  • a relative rotation amount relative shift amount
  • the template image is corrected using the calculated relative rotation amount ((3) rotation amount correction). With this correction, a correction template image is generated.
  • a position search process ((4) matching) is performed between the extraction region and the correction template image.
  • the similarity between the extraction region and the correction template image in the third hierarchy is calculated.
  • the extraction region having the highest similarity with the correction template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating a relative position of the extraction region most matching the correction template image within the search range) is calculated ((5) position calculation). This completes the search process in the third hierarchy.
  • the search process in the second layer is started.
  • the template image is dynamically generated (or recreated) in consideration of the rotation amount when the highest similarity is shown in the third hierarchy ((6) rotation amount correction). Thereby, the degree of matching between the template image and the extraction region can be increased in advance.
  • a template image corresponding to the second layer is generated according to the correction amount (rotation amount) used for generating the correction template image corresponding to the third layer.
  • an initial position is set for the second hierarchy image based on the calculated parallel movement amount, and an extraction area to be subjected to matching processing is set based on the initial position, and the extraction area and the second hierarchy are set.
  • a search process ((7) matching) for the rotation amount is executed with the template image for use.
  • the search range of the search process for the rotation amount is set to ⁇ ⁇ ( ⁇ : a predetermined fluctuation angle), for example. In the present embodiment, since the template image considering the approximate amount of rotation is generated first, the search range can be limited.
  • the relative rotation amount (relative shift amount) between the extraction region and the template image in the second hierarchy is calculated by the search process for the rotation amount ((8) rotation amount calculation). Then, the template image is corrected using the calculated relative rotation amount ((9) rotation amount correction). With this correction, a correction template image is generated.
  • a position search process ((10) matching) is executed between the extraction region and the correction template image.
  • the similarity between the extraction region and the correction template image in the second hierarchy is calculated.
  • the extraction region having the highest similarity with the correction template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating the relative position of the extraction region most matching the correction template image in the search range) is calculated ((11) position calculation). This completes the search process in the second hierarchy.
  • FIG. 14 is a diagram schematically illustrating a template image generation procedure according to the second embodiment of the present invention.
  • a template image corresponding to each layer is generated by cutting out from a template generation image.
  • a template image corresponding to the lowest hierarchy is generated by cutting out from a template generation image ((1) cutting out). This clipping is arbitrarily set by the user. Corresponding positions are searched from matching target images (hierarchical images) using the template image generated in the lowest hierarchy ((2) matching). At this time, a relative shift amount (in this example, a rotation amount) from the template image is calculated.
  • the template image is cut out from the template generation image using the searched matching information (rotation amount) ((3) matching information (rotation amount)) ((4) cut out).
  • a template image corresponding to a state that is substantially close to the amount of rotation of the object shown in the matching target image is generated.
  • a corresponding position is searched from the matching target image (hierarchical image) ((5) matching). Thereafter, the corresponding position is searched similarly.
  • a template image on the high resolution side is generated using the rotation amount on the low resolution side.
  • the image processing apparatus 100 searches the area corresponding to the template generation image (reference image) from the input image by performing the following functions. That is, the image processing apparatus 100 has a third layer resolution (first resolution) and a second layer resolution (second resolution higher than the first resolution) corresponding to the input image, respectively. It has a function (input image acquisition unit) for acquiring two-layer images (first and second input images). The image processing apparatus 100 further includes, from the template generation image (reference image), template images corresponding to the third and second layers (first and second references having resolutions respectively corresponding to the first and second resolutions). A function (reference image generation unit).
  • the image processing apparatus 100 is extracted from the third hierarchy image by a search process between the third hierarchy image (first input image) and the template image (first reference image) corresponding to the third hierarchy. And calculating a relative shift amount between the extracted region and the template image corresponding to the third hierarchy (the first input image and the first reference image), and based on the calculated relative shift amount. It has a function (first correction unit) for generating a correction template image (first correction reference image) by correcting the template image (first reference image). The image processing apparatus 100 further performs corresponding processing in the third hierarchy (first resolution) by a search process between the third hierarchy image (first input image) and the correction template image (first correction reference image). (First corresponding position determining unit).
  • the image processing apparatus 100 uses the position in the second hierarchy (second resolution) corresponding to the corresponding position in the third hierarchy (first resolution) as a reference for the second hierarchy image (second input image).
  • second resolution position in the second hierarchy
  • first resolution position in the third hierarchy
  • second input image second input image
  • the image processing apparatus 100 generates a second template image (second reference image) according to the rotation amount (correction amount) used for generating the first correction template image (first correction reference image). Generate.
  • the image processing apparatus 100 uses the rotation amount (correction amount) used for generating the second layer image (second input image) and the correction template image (first correction reference image) corresponding to the third layer.
  • a correction template image (second correction reference image) is generated by performing a search process with the template image (second reference image) corresponding to the second hierarchy generated accordingly.
  • the image processing apparatus 100 uses the result of the template matching process performed in the previous layer to improve the processing efficiency.
  • FIG. 15 is a flowchart showing an overall procedure of template matching processing according to the second embodiment of the present invention. Each step shown in FIG. 15 is typically realized by the CPU 102 (FIG. 2) executing the template matching processing program 112.
  • step S119 is executed instead of the processing in step S118 as compared with the processing procedure shown in FIG. That is, after setting an initial position for performing a position search for the target hierarchical image or input image based on the position calculated in the lower hierarchy (step S114), the CPU 102 performs the target hierarchical image or input image. A region corresponding to the image and having the same image size as the template image is extracted (step S116).
  • the CPU 102 generates a template image corresponding to the template generation image based on the rotation amount for template image correction calculated in the lower hierarchy. (Step S119). Further, the CPU 102 receives the extracted area and the generated template image as input and executes a rotation amount search process (step S120), and generates a correction template image based on the rotation amount obtained by the rotation amount search process. (Step S122). Typically, a corrected template image is generated by correcting the template image. Further, the CPU 102 executes position search processing using the correction template image generated in step S122 and the extraction region as inputs (step S124).
  • a fine template image such as 1 °
  • a rougher template image such as 10 ° is created, and the closest one is selected. Also good. Even with such processing, a certain accuracy improvement effect can be obtained.
  • a template image having almost no relative shift amount (relative rotation amount and relative magnification) can be used in the high-resolution hierarchical image, so that the search accuracy can be improved.
  • FIG. 16 is a diagram schematically showing the contents of the template matching process according to the third embodiment of the present invention.
  • a search range is set for the third hierarchy image, and an extraction region to be subjected to matching processing is extracted from the search range, and this extraction region and the template image for the third hierarchy are extracted.
  • the search process ((1) matching) for the rotation amount is executed between By the search process for the rotation amount, a relative rotation amount (relative shift amount) between the extraction region and the template image in the third hierarchy is calculated ((2) rotation amount calculation).
  • the template image is corrected using the calculated relative rotation amount ((3) rotation amount correction). With this correction, a correction template image is generated.
  • a position search process ((4) matching) is performed between the extraction region and the correction template image.
  • the similarity between the extraction region and the correction template image in the third hierarchy is calculated.
  • the extraction region having the highest similarity with the correction template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating a relative position of the extraction region most matching the correction template image within the search range) is calculated ((5) position calculation). This completes the search process in the third hierarchy.
  • the search process in the second layer is started.
  • the template image is dynamically generated (or recreated) in consideration of the rotation amount when the highest similarity is shown in the third hierarchy ((6) rotation amount correction). That is, in the template matching process in the second hierarchy, a template image corresponding to the second hierarchy is generated according to the correction amount (rotation amount) used for generating the correction template image corresponding to the third hierarchy.
  • an initial position is set for the second layer image based on the calculated parallel movement amount, and an extraction region to be subjected to matching processing is set based on the initial position.
  • the search process ((7) matching) about a position is performed between an extraction area
  • the search process for this position the similarity between the extraction region and the template image in the second hierarchy is calculated.
  • the extraction region having the highest similarity with the template image is specified.
  • a position indicating the extraction region having the highest similarity (a parallel movement amount indicating a relative position of the extraction region most matching the template image in the search range) is calculated ((8) position calculation). This completes the search process in the second hierarchy.
  • the search process in the first hierarchy is started.
  • the template image is dynamically generated (or recreated) in consideration of the rotation amount when the highest similarity is shown in the third hierarchy ((9) rotation amount correction).
  • an initial position is set for the first layer image based on the parallel movement amount calculated in the second layer, and an extraction region to be subjected to matching processing is set based on the initial position.
  • the search process ((10) matching) about a position is performed between an extraction area
  • the extraction region having the highest similarity with the template image is specified.
  • a position indicating the extraction region having the highest similarity is calculated ((11) position calculation). This completes the search process in the first hierarchy.
  • the same search process is executed for the input image.
  • the image processing apparatus 100 is generated according to the rotation amount (correction amount) used for generating the correction template image (first correction reference image) corresponding to the third hierarchy.
  • the rotation amount corrected amount
  • the image processing apparatus 100 is generated according to the rotation amount (correction amount) used for generating the correction template image (first correction reference image) corresponding to the third hierarchy.
  • ⁇ E3 Functional configuration>
  • the functional configuration of the image processing apparatus and / or image processing program according to the present embodiment is the same as that of the block diagram shown in FIG.
  • the template image generation processing by the template generation unit 154 is different from the processing in the first embodiment as described above.
  • FIG. 17 is a flowchart showing an overall procedure of template matching processing according to the third embodiment of the present invention.
  • the processes in steps S ⁇ b> 120 and S ⁇ b> 122 are omitted as compared with the processing procedure illustrated in FIG. 15.
  • the other processing is as described with reference to FIG. 15, and therefore detailed description will not be repeated.
  • the “matching degree” is an index indicating how similar the input image or the hierarchical image is to the template image, and a correlation value or the like is used. As shown in FIG. 11, in POC, the magnitude (peak value) of a correlation peak obtained after inverse Fourier transform can be used.
  • the degree of parallel movement is performed by searching for the similarity (processing result by the POC process 164 in FIG. 10) and the position acquired when calculating the rotation amount for correcting the rotation of the template image.
  • Similarity processing result by the POC processing 166 in FIG. 10 acquired when calculating.
  • rotational similarity rotational similarity
  • positional deviation similarity positional deviation similarity
  • Pattern example Examples of patterns that optimize the matching method based on the similarity on the low resolution side include the following.
  • ⁇ Pattern 3> Low resolution side: rotation search + rotation amount correction + position search ⁇ positional deviation similarity: high ⁇ high resolution side: template image generation based on rotation amount on low resolution side + rotation search (rotation amount on low resolution side) (2) Low resolution side: rotation search + rotation amount correction + position search ⁇ positional deviation similarity: low ⁇ high resolution side: rotation amount on low resolution side Template image generation based on + rotation search (no search range restriction based on low-resolution rotation amount) + rotation amount correction + position search ⁇ Pattern 4> (1) Low resolution side: rotation search + rotation amount correction + position search ⁇ rotation similarity: high ⁇ high resolution side: template image generation based on the rotation amount on the low resolution side + rotation search (to the rotation amount on the low resolution side) (2) Low resolution side: rotation search + rotation amount correction + position search ⁇ rotation similarity: low ⁇ high resolution side: template based on rotation amount on low resolution side Image generation + rotation search (no limitation of search range based on rotation amount on the
  • image processing apparatus 100 performs a search for the similarity (rotation amount similarity) calculated in the template image rotation amount correction on the low resolution side and the position on the low resolution side. Based on at least one of the calculated similarities (positional deviation similarity), it includes a function (control unit) that varies the procedure for generating a template image or a correction template image used for search processing on the high resolution side. That is, the control unit of the image processing apparatus 100 calculates the similarity calculated in the search process between the first input image and the first reference image, and the first input image and the first correction reference image. Based on at least one of the similarities calculated in the search process between the two, the second corresponding position determining unit changes the method for determining the corresponding position at the second resolution. More specifically, the image processing apparatus 100 changes the generation procedure based on the similarity calculated when determining at least one of the relative shift amount and the positional shift amount.
  • the RIPOC method is used as a method for calculating and correcting a relative shift (geometric shift) between the input image / hierarchical image (partial image included) and the template image.
  • a relative shift geometric shift
  • various algorithm methods for calculating and correcting a geometric shift including a magnification (size) can also be adopted.
  • a matching method using Fourier Merin transform may be adopted.
  • the magnification (size) search process can be performed in the same manner as the rotation amount search process described above.
  • reference 1 Hidet al., "Fusion of image signal processing and image pattern recognition-DCT code limited correlation and its application", Tokyo Metropolitan University, Faculty of System Design The method described in Dynamic Image Processing Actual Utilization Workshop 2007 (2007.3.8)
  • Hishi Hidet al.
  • Embodiments of the present invention include the following aspects.
  • An image processing apparatus is directed to a template matching method that takes into account the relative rotation amount and / or relative magnification between a template image and an acquired image.
  • the image processing apparatus includes: an image acquisition unit that acquires an image; a unit that acquires a template image; a unit that searches for a corresponding position from the acquired image using a correlation between a partial region of the acquired image and the template image; At the time of search, a relative deviation amount calculation unit that calculates a relative rotation amount and / or a magnification with respect to the template image, and a value calculated by the relative deviation amount calculation unit are used to obtain the acquired image and the template image. And a unit for calculating a corresponding position after correcting the relative shift amount.
  • the image processing apparatus 100 further includes a resolution conversion unit that converts the image acquired by the image acquisition unit into a plurality of resolutions, a unit that acquires a template image for each resolution, and a low-resolution image using a template image. Correspondence in the acquired image by specifying the provisional position in the resolution image, the part that sets the provisional position in the high resolution from the provisional position obtained at each resolution, and the provisional position in order from the low resolution to the high resolution A part for determining the position and a part for limiting a search range of the relative shift amount at the high resolution based on the relative shift amount obtained at the low resolution are included.
  • the search is performed by narrowing down both the relative shift amount and the position from the low resolution side by multiplexing the images, the calculation speed can be reduced and the robustness of the accuracy can be improved. .
  • An image processing apparatus is directed to a template matching method that takes into account the relative rotation amount and / or relative magnification between a template image and an acquired image.
  • the image processing apparatus includes: an image acquisition unit that acquires an image; a unit that acquires a template image; a unit that searches for a corresponding position from the acquired image using a correlation between a partial region of the acquired image and the template image; At the time of search, a relative deviation amount calculation unit that calculates a relative rotation amount and / or a magnification with respect to the template image, and a value calculated by the relative deviation amount calculation unit are used to obtain the acquired image and the template image. And a unit for calculating a corresponding position after correcting the relative shift amount.
  • the image processing apparatus 100 further includes a resolution conversion unit that converts the image acquired by the image acquisition unit into a plurality of resolutions, a unit that acquires a template image for each resolution, and a low-resolution image using a template image. Correspondence in the acquired image by specifying the provisional position in the resolution image, the part that sets the provisional position in the high resolution from the provisional position obtained at each resolution, and the provisional position in order from the low resolution to the high resolution A part for determining a position, and a part for using a template image used for template matching at a high resolution as an image area that is shifted so as to be comparable to the relative shift amount obtained at a low resolution. Including.
  • the template with the relative displacement amount of the rotation and the magnification is used in the high-resolution hierarchical image, so that the accuracy can be improved.
  • the image processing apparatus calculates only a positional shift amount after correcting a relative shift amount between an image and a template at a high resolution based on a relative shift amount obtained at a low resolution. calculate.
  • the high-resolution hierarchical image does not perform the calculation for obtaining the relative shift amount of the rotation and the magnification, so that high-speed processing can be realized.
  • the image processing device limits the calculation range when calculating the relative rotation amount and / or the relative magnification at the time of matching at the high resolution based on the similarity calculated in the template matching processing at the low resolution. Control the amount to do.
  • the similarity is a similarity obtained when calculating any one of a relative rotation amount, a relative magnification, and a positional deviation amount.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Signal Processing (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

 画像処理装置は、入力画像に対応する、少なくとも第1の解像度および第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得し、基準画像に対応する、第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得し、第1の入力画像と第1の基準画像との間の探索処理により、第1の入力画像と第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出し、相対的なずれ量に基づく第1の基準画像の補正によって第1の補正基準画像を生成し、第1の入力画像と第1の補正基準画像との間の探索処理により、第1の解像度における対応位置を決定し、第1の解像度における対応位置に相当する第2の入力画像における位置を基準として、相対的なずれ量を利用して第2の入力画像と第2の基準画像との間の探索処理を行なうことによって、第2の解像度における対応位置を決定することを含む。

Description

画像処理装置、画像処理方法および画像処理プログラム
 本発明は、基準画像に対応する領域を入力画像から探索する画像処理装置、画像処理方法および画像処理プログラムに関する。
 従来から、2つの画像間で探索処理(マッチング処理)のための各種の技術が提案されてきた。例えば、ステレオカメラを用いて同一の被写体から一対の画像を取得し、これらの画像間の対応点を探索するような場合には、位相限定相関(POC:Phase-Only Correlation)法がしばしば用いられる。このPOC法は、画像に含まれる空間周波数の位相差情報を用いて、画像間の対応点を探索する。
 一般的なステレオカメラでは、光軸周りの回転および倍率は基本的に同一に設計されるので、このようなステレオ対応点探索では、POC法を利用して基準位置を探索することができる。一方、光軸周りの回転および/または倍率に違いが生じる場合には、POC法を拡張した手法を利用することで、基準位置に加えて、サイズおよび/または回転量を探索できる。このようなPOC法を拡張した手法としては、回転不変位相限定相関(RIPOC:Rotation Invariant Phase Only Correlation)法などのサイズおよび/または回転に対応したPOC法などが挙げられる。
 特開平10-124667号公報(特許文献1)は、RIPOC法を利用したパターン照合装置を開示する。このパターン照合装置は、空間周波数特性に基づいてN次元のパターン(例えば、指紋(2次元)、立体(3次元))の照合を行なうものであり、回転ずれがあっても登録パターンと照合パターンとが同一であるか否かを識別することができるようにすることを目的としている。また、非特許文献1は、サイズ・回転対応POC法の一例を示す。より具体的には、非特許文献1では、フーリエメリン変換を用いたPOC法について論じられている。
 上述のようなPOC法およびサイズ・回転対応POC法は、いずれも画像に含まれる空間周波数の位相差情報を用いるので、ロバストな位置検出を行なえるというメリットがあるが、処理量が非常に大きく、演算時間を要するというデメリットもある。例えば、入力画像に含まれる特定パターン(基準画像/テンプレート画像)が存在する位置を探索するようなマッチング処理をサイズ・回転対応POC法を利用して実行した場合には、位置探索のためにラスタスキャンが必要になり、それに要する演算時間が膨大になり得る。
 また、特開2005-235089号公報(特許文献2)は、多重解像度の画像を用いることにより効率化したマッチング処理を開示する。より具体的には、特許文献2は、粗い解像度レベルでの探索に使うマッチング候補を間引くことにより大幅に効率化を実現するとともに、間引くことによる候補漏れを防ぐために、詳細なベクトルで、新たに探索領域を再構成することで、大幅な探索時間の削減を得ると同時に、正しくマッチングが行なえるようにする画像認識装置を開示する。
特開平10-124667号公報 特開2005-235089号公報
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
 上述したように、マッチング処理を高速化する方法が提案されているが、入力画像と基準画像との間に回転および/または倍率の相対的なずれなどがある場合に、高速にマッチング処理を行なうことは容易ではなかった。
 本発明の目的は、基準画像に対応する領域を入力画像からより高速に探索する新規な画像処理装置、画像処理方法および画像処理プログラムを提供することである。
 本発明のある実施の形態に従えば、基準画像に対応する領域を入力画像から探索する画像処理装置が提供される。画像処理装置は、入力画像に対応する、少なくとも第1の解像度および第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得する入力画像取得部と、基準画像に対応する、第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得する基準画像取得部と、第1の入力画像と第1の基準画像との間の探索処理によって、第1の入力画像と第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第1の基準画像の補正によって第1の補正基準画像を生成し、第1の入力画像と第1の補正基準画像との間の探索処理によって、第1の解像度における対応位置を決定する第1の対応位置決定部と、第1の解像度における対応位置に相当する第2の入力画像における位置を基準として、第1の対応位置決定部によって算出された相対的なずれ量を利用して、第2の入力画像と第2の基準画像との間の探索処理を行なうことによって、第2の解像度における対応位置を決定する第2の対応位置決定部とを含む。
 好ましくは、第2の対応位置決定部は、第1の入力画像と第1の基準画像との間の相対的なずれ量に応じて探索範囲を制限した上で、第2の入力画像と第2の基準画像との間の探索処理を行なうことで、第2の入力画像と第2の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第2の基準画像の補正によって第2の補正基準画像を生成し、第2の入力画像と第2の補正基準画像との間の探索処理によって、第2の解像度における対応位置を決定する。
 さらに好ましくは、第2の対応位置決定部は、基準画像取得部に、第1の入力画像と第1の基準画像との間の相対的なずれ量に応じて第2の基準画像を生成させる。
 さらに好ましくは、第2の対応位置決定部は、第2の入力画像と第2の基準画像との間の探索処理を行なうことで、第2の入力画像と第2の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第2の基準画像の補正によって第2の補正基準画像を生成し、第2の入力画像と第2の補正基準画像との間の探索処理によって、第2の解像度における対応位置を決定する。
 好ましくは、画像処理装置は、第1の入力画像と第1の基準画像との間の探索処理において算出される類似度、および、第1の入力画像と第1の補正基準画像との間の探索処理において算出される類似度の少なくとも一方に基づいて、第2の対応位置決定部による第2の解像度における対応位置の決定方法を変化させる制御部をさらに含む。
 本発明の別の実施の形態に従えば、基準画像に対応する領域を入力画像から探索する画像処理方法が提供される。画像処理方法は、入力画像に対応する、少なくとも第1の解像度および第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得するステップと、基準画像に対応する、第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得するステップと、
 第1の入力画像と第1の基準画像との間の探索処理によって、第1の入力画像と第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第1の基準画像の補正によって第1の補正基準画像を生成し、第1の入力画像と第1の補正基準画像との間の探索処理によって、第1の解像度における対応位置を決定するステップと、
 第1の解像度における対応位置に相当する第2の入力画像における位置を基準として、相対的なずれ量を利用して、第2の入力画像と第2の基準画像との間の探索処理を行なうことで、第2の解像度における対応位置を決定するステップとを備えた画像処理方法。
 本発明のさらに別の実施の形態に従えば、基準画像に対応する領域を入力画像から探索する画像処理プログラムが提供される。画像処理プログラムはコンピューターに、入力画像に対応する、少なくとも第1の解像度および第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得するステップと、基準画像に対応する、第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得するステップと、第1の入力画像と第1の基準画像との間の探索処理によって、第1の入力画像と第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第1の基準画像の補正によって第1の補正基準画像を生成し、第1の入力画像と第1の補正基準画像との間の探索処理によって、第1の解像度における対応位置を決定するステップと、第1の解像度における対応位置に相当する第2の入力画像における位置を基準として、相対的なずれ量を利用して、第2の入力画像と第2の基準画像との間の探索処理を行なうことで、第2の解像度における対応位置を決定するステップとを実行させる。
 本発明によれば、基準画像に対応する領域を入力画像からより高速に探索できる。
本発明の実施の形態に従うテンプレートマッチングの適用例を示す模式図である。 本発明の実施の形態に従うテンプレートマッチングをパーソナルコンピューターにより実現した場合の構成を示すブロック図である。 本発明の実施の形態1に従うテンプレートマッチング処理の概要を説明するための模式図である。 本発明の実施の形態1に従うテンプレートマッチング処理において使用される入力画像および階層画像の一例を示す図である。 本発明の実施の形態1に従うテンプレートマッチング処理において使用される入力画像および階層画像の一例を示す図である。 本発明の実施の形態1に従うテンプレートマッチング処理において使用される入力画像および階層画像とテンプレート画像との一例を示す図である。 本発明の実施の形態1に従うテンプレートマッチング処理の内容を概略する図である。 本発明の実施の形態1に従う画像処理装置の機能構成を示すブロック図である。 本発明の実施の形態1に従うテンプレート画像の生成手順を概略する図である。 本発明の実施の形態1に従う位置検出部における処理内容を説明するための模式図である。 図10に示すPOCにおいて実行される処理内容を説明するための模式図である。 本発明の実施の形態1に従うテンプレートマッチング処理の全体手順を示すフローチャートである。 本発明の実施の形態2に従うテンプレートマッチング処理の内容を概略する図である。 本発明の実施の形態2に従うテンプレート画像の生成手順を概略する図である。 本発明の実施の形態2に従うテンプレートマッチング処理の全体手順を示すフローチャートである。 本発明の実施の形態3に従うテンプレートマッチング処理の内容を概略する図である。 本発明の実施の形態3に従うテンプレートマッチング処理の全体手順を示すフローチャートである。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。
 [A.概要]
 本実施の形態は、基準画像に対応する領域を入力画像から探索する画像処理装置および画像処理方法に向けられている。このような基準画像に対応する領域を入力画像から探索する画像処理方法の典型例として、以下では、テンプレートマッチング処理について説明する。このテンプレートマッチング処理では、マッチング処理における基準画像としてテンプレート画像が用いられる。
 本実施の形態においては、多重解像度を用いた粗密戦略によって効率的に探索処理を行なう。このとき、少なくとも1つの解像度(階層)においては、マッチング対象の画像とテンプレート画像との間の回転および/または倍率の相対的なずれ量が評価され、これが補正された上で、位置についての探索処理が実行される。ここで、本明細書において、相対的なずれ量とは、処理対象の画像とテンプレート画像(基準画像)との間の、相対的な回転方向のずれ量、および、相対的な倍率(サイズ)の違いによるずれ量の少なくとも一方を意味する。そして、相対的なずれ量やマッチング位置などの情報を、低解像度側から高解像度側へ伝搬させることで、探索処理を効率化する。
 [B.システム構成]
 まず、本発明の実施の形態に従うテンプレートマッチング処理を実現する画像処理装置の実装例について説明する。
 《b1:適用例》
 図1は、本発明の実施の形態に従うテンプレートマッチングの適用例を示す模式図である。図1を参照して、本実施の形態に従うシステム1は、一例として、ベルトコンベア2を含む生産ラインに適用される。このシステム1において、ベルトコンベア2上を対象物3(ワーク)が連続的に搬送されるとともに、この対象物3をカメラ4により撮像することで、対象物3の外観を含む画像が取得される(以下、この取得される画像を「入力画像」とも称す。)。
 この入力画像は、画像処理装置100へ伝送される。画像処理装置100は、予め格納しているテンプレート画像5に基づいて、入力画像に対して対応する領域を探索する処理(探索処理)を行なう。そして、この探索処理によって得られた位置情報などを外部出力する。
 システム1において、ベルトコンベア2上を搬送される対象物3は様々な向きに配置され得るので、入力画像に含まれる対象物3を表わす領域の回転方向および/またはサイズ(拡大/縮小率)は、常に一定しているとは限らない。そこで、本実施の形態に従う画像処理装置100は、テンプレート画像の向きおよび/または大きさを調整しつつ、マッチング処理を実行する。すなわち、画像処理装置100は、何らかの回転量および/または倍率でテンプレート画像を補正した上で、入力画像中から対応する領域を探索する。画像処理装置100は、探索結果として、対応する領域を示す位置情報に加えて、当該テンプレートマッチング処理において行なった補正の度合いを示す情報(回転量および/または倍率)を出力してもよい。
 画像処理装置100は、このようなテンプレートマッチング処理に加えて、各種の後処理を行なってもよい。例えば、対象物3とテンプレート画像との類似度(相関値など)が予め定められた値より低い場合などには、当該対象物3を「規格外」として除外してもよい。その他、公知の画像処理および/または生産ラインに対する処理を適宜組み合わせることができる。
 《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などの各種プログラムを実行することで、画像処理装置100の全体を制御する。RAM104は、CPU102でプログラムを実行するためのワーキングメモリとして機能し、プログラムの実行に必要な各種データを一次的に格納する。ROM106は、画像処理装置100において起動時に実行される初期プログラム(ブートプログラム)などを格納する。
 ネットワークインターフェイス108は、各種の通信媒体を介して、他の装置(サーバー装置など)とデータを遣り取りする。より具体的には、ネットワークインターフェイス108は、イーサネット(登録商標)などの有線回線(LAN(Local Area Network)やWAN(Wide Area Network)など)、および/または、無線LANなどの無線回線を介してデータ通信を行なう。
 補助記憶装置110は、典型的には、ハードディスクなどの大容量磁気記録媒体などからなり、本実施の形態に従う各種処理を実現するための画像処理プログラム(テンプレートマッチング処理プログラム112)およびテンプレート生成用画像114などを格納する。さらに、補助記憶装置110には、オペレーティングシステムなどのプログラムが格納されてもよい。
 テンプレート生成用画像114は、テンプレート画像を生成するために用いられる。本実施の形態においては、多重解像度を用いた粗密戦略によって効率的に探索処理を行なうが、この粗密戦略では、各解像度のテンプレート画像が必要となるため、テンプレート生成用画像114としては、解像度別に格納されることが好ましい。この粗密戦略およびテンプレート画像の詳細については後述する。
 表示部120は、オペレーティングシステムが提供するGUI(Graphical User Interface)画面やテンプレートマッチング処理プログラム112の実行によって生成される画像などを表示する。
 入力部122は、典型的には、キーボード、マウス、タッチパネルなどからなり、ユーザーから受付けた指示の内容をCPU102などへ出力する。
 メモリーカードインターフェイス124は、SD(Secure Digital)カードやCF(Compact Flash(登録商標))カードなどの各種メモリーカード(不揮発性記録媒体)126との間で、データの読み書きを行なう。
 カメラインターフェイス128は、被写体を撮像することで取得されるテンプレート生成用画像および/または入力画像をカメラ4から取り込む。但し、画像処理装置100本体が被写体を撮像する機能を有していなくともよい。この場合には、典型的には、何らかの装置で取得したテンプレート生成用画像および/または入力画像を格納したメモリーカード126を介して、必要な画像が取り込まれる。すなわち、メモリーカードインターフェイス124にメモリーカード126が装着され、メモリーカード126から読み出されたテンプレート生成用画像および/または入力画像は、補助記憶装置110などへ格納(コピー)される。
 補助記憶装置110に格納されるテンプレートマッチング処理プログラム112は、CD-ROM(Compact Disk-Read Only Memory)などの記録媒体に格納されて流通し、あるいは、ネットワークを介してサーバー装置などから配信される。テンプレートマッチング処理プログラム112は、画像処理装置100(パーソナルコンピューター)で実行されるオペレーティングシステムの一部として提供されるプログラムモジュールのうち必要なモジュールを、所定のタイミングおよび順序で呼出して処理を実現するようにしてもよい。この場合、テンプレートマッチング処理プログラム112自体には、オペレーティングシステムによって提供されるモジュールは含まれず、オペレーティングシステムと協働して画像処理が実現される。また、テンプレートマッチング処理プログラム112は、単体のプログラムではなく、何らかのプログラムの一部に組込まれて提供されてもよい。このような場合にも、テンプレートマッチング処理プログラム112自体には、当該何らかのプログラムにおいて共通に利用されるようなモジュールは含まれず、当該何らかのプログラムと協働して画像処理が実現される。このような一部のモジュールを含まないテンプレートマッチング処理プログラム112であっても、本実施の形態に従う画像処理装置100の趣旨を逸脱するものではない。
 さらに、テンプレートマッチング処理プログラム112によって提供される機能の一部または全部を専用のハードウェアによって実現してもよい。
 《b3:その他の構成による実現例》
 上述したパーソナルコンピューターにより実現する例に加えて、例えば、デジタルカメラ、携帯電話、あるいはスマートフォン上に実装してもよい。さらに、少なくとも1つのサーバー装置が本実施の形態に従う処理を実現する、いわゆるクラウドサービスのような形態であってもよい。この場合、ユーザーは、自身の端末(パーソナルコンピューターやスマートフォンなど)を用いて、少なくとも2つの処理対象画像をサーバー装置(クラウド側)へ送信し、当該送信された処理対象画像に対して、サーバー装置側が本実施の形態に従う画像処理を行なうような構成が想定される。さらに、サーバー装置側がすべての機能(処理)を行なう必要はなく、ユーザー側の端末とサーバー装置とが協働して、本実施の形態に従う画像処理を実現するようにしてもよい。
 [C.実施の形態1]
 次に、本実施の形態1に従うテンプレートマッチング処理の詳細について説明する。
 《c1:処理概要》
 本実施の形態においては、入力画像/階層画像(に含まれる部分画像)とテンプレート画像との間の相対的なずれを考慮した探索処理と、多重解像度を用いた粗密戦略とを組み合わせて、テンプレート画像に対応する領域を入力画像から探索する方法を採用する。
 より具体的には、入力画像に対応する、複数の解像度を有する画像群を取得し、解像度の低い画像から順に、テンプレートマッチング処理を行なうことで、テンプレート画像に対応する領域を探索する。解像度の低い画像に対するテンプレートマッチング処理では、その演算時間は短くて済むが、探索された位置の精度は相対的に低い(対応する解像度の精度が限界となる)。続いて、より解像度の高い画像に対するテンプレートマッチング処理が実行される。このとき、先に実行されたテンプレートマッチング処理の結果を利用して、効率的に処理が行なわれる。そのため、解像度が高くとも演算時間を短縮できる。以下同様の処理を行なうことで、最も解像度の高い画像において探索された位置情報が結果として出力される。
 図3は、本発明の実施の形態1に従うテンプレートマッチング処理の概要を説明するための模式図である。図3には、入力画像の画像サイズが1600×1200pix(ピクセル/画素)とした場合に、変換倍率を1/2とし、階層数を4としたときの多重解像度解析の例を示す。図3を参照して、入力画像200から解像度が異なる複数の画像が生成される。この例では、入力画像200を800×600pixの画像サイズに縮小した画像が、第1階層の画像(以下、「第1階層画像210」とも称す。)として生成される。さらに、第1階層画像210を400×300pixの画像サイズに縮小した画像が、第2階層の画像(以下、「第2階層画像220」とも称す。)として生成される。さらに、第2階層画像220を200×150pixの画像サイズに縮小した画像が、第3階層の画像(以下、「第3階層画像230」とも称す。)として生成される。
 図4および図5は、本発明の実施の形態1に従うテンプレートマッチング処理において使用される入力画像および階層画像の一例を示す図である。図4に示すように、入力画像200から、解像度が異なる階層画像が生成される。図5に示すように、それぞれの階層画像(第1階層画像210、第2階層画像220、および第3階層画像230)は、入力画像200を所定の倍率ずつ縮小したものである。
 再度図3を参照して、まず、第3階層画像230に対して探索範囲232が設定されるとともに、探索範囲232から順次抽出される領域(以下、「抽出領域」とも称す。)と対応するテンプレート画像との間でテンプレートマッチング処理が実行される。典型的に、抽出領域は、テンプレート画像と同じ画像サイズを有する。このテンプレートマッチング処理によって、最も類似度の高い抽出領域の位置234が特定されたとする。
 この特定された抽出領域の位置234を基準として、第2階層画像220に対して探索範囲222が設定されるとともに、探索範囲222から順次抽出される抽出領域と対応するテンプレート画像との間でテンプレートマッチング処理が実行される。このテンプレートマッチング処理によって、最も類似度の高い抽出領域の位置224が特定されたとする。
 さらに、この抽出領域の位置224を基準として、第1階層画像210に対して探索範囲212が設定されるとともに、探索範囲212から順次抽出される抽出領域と対応するテンプレート画像との間でテンプレートマッチング処理が実行される。このテンプレートマッチング処理によって、最も類似度の高い抽出領域の位置214が特定されたとする。
 最終的に、この抽出領域の位置214を基準として、入力画像200に対して探索範囲202が設定されるとともに、探索範囲202から順次抽出される抽出領域と対応するテンプレート画像との間のテンプレートマッチング処理が実行される。このテンプレートマッチング処理によって、最も類似度の高い抽出領域の位置204が特定されたとする。そして、この抽出領域の位置204が探索結果として出力される。
 図6は、本発明の実施の形態1に従うテンプレートマッチング処理において使用される入力画像および階層画像とテンプレート画像との一例を示す図である。図6を参照して、本実施の形態においては、入力画像およびそれぞれの階層画像に対して、共通のサイズ(例えば、128×128pix)を有するテンプレート画像を用いて探索処理が実行される。すなわち、各テンプレート画像は、対象の入力画像またはいずれかの階層画像から抽出される抽出領域と順次比較される。この際、入力画像/階層画像(に含まれる部分画像)とテンプレート画像との間に相対的なずれに応じて、テンプレート画像が適宜補正された上で、マッチング処理が実行される。このとき、前の階層における探索結果を利用して処理が効率化される。
 《c2:探索処理の効率化》
 次に、本実施の形態に従うテンプレートマッチング処理における処理の効率化手法について説明する。本実施の形態においては、入力画像/階層画像(に含まれる部分画像)とテンプレート画像との間に相対的なずれを補正した探索処理が実行される。この相対的なずれ量は、入力画像/階層画像(に含まれる部分画像)とテンプレート画像の間の、相対的な回転方向のずれ量および/または相対的な倍率(サイズ)の違いによるずれ量である。以下では、相対的なずれ量として回転量を考慮する例について説明するが、これに限られず、相対的な倍率を考慮する構成についても同様の構成が適用可能である。相対的な回転量を考慮した探索処理の一例として、回転不変位相限定相関(RIPOC)法を用いた構成例について説明する。
 図7は、本発明の実施の形態1に従うテンプレートマッチング処理の内容を概略する図である。図7には、第3階層画像および第2階層画像に対する処理の内容を例示するが、同様の手順によって、第1階層画像および入力画像に対しても同様の処理が実行される。
 図7を参照して、まず、第3階層画像に対して探索範囲が設定されるとともに、探索範囲からマッチング処理の対象となる抽出領域が抽出され、この抽出領域と第3階層用のテンプレート画像との間で回転量についての探索処理((1)マッチング)が実行される。なお、第3階層画像における探索範囲は、第3階層画像の全体であってもよい。この回転量についての探索処理によって、第3階層における、抽出領域とテンプレート画像との間の相対的な回転量(相対的なずれ量)が算出される((2)回転量算出)。そして、この算出された相対的な回転量を用いて、テンプレート画像が補正される((3)回転量補正)。この補正によって、補正テンプレート画像が生成される。
 続いて、抽出領域と補正テンプレート画像との間で位置についての探索処理((4)マッチング)が実行される。この位置についての探索処理によって、第3階層における、抽出領域と補正テンプレート画像との間の類似度が算出される。図7に示す(1)~(4)の手順が繰り返されることで、補正テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内における補正テンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((5)位置算出)。これで、第3階層における探索処理は完了する。
 続いて、第2階層における探索処理が開始される。この第2階層における探索処理では、第3階層において算出された、最も類似度が高い抽出領域についての、テンプレート画像との間の相対的な回転量(相対的なずれ量)、および平行移動量が利用される。
 具体的には、第2階層画像に対して探索範囲が設定されるとともに、探索範囲からマッチング処理の対象となる抽出領域が設定され、この抽出領域と第2階層用のテンプレート画像との間で回転量についての探索処理((6)マッチング)が実行される。このとき、探索範囲は、第3階層において算出された最も類似度が高い抽出領域を示す位置を基準として設定される。
 また、回転量についての探索処理は、第3階層において算出された最も類似度が高い抽出領域についての回転量を基準とする所定の範囲のみが対象となる。例えば、第3階層において算出された回転量がθであれば、第2階層における回転量についての探索処理では、θ±α(α:予め定められた変動角度)の範囲だけ探索が行なわれる。
 すなわち、第2階層におけるテンプレートマッチング処理においては、位置についての探索処理の対象となる探索範囲(すなわち、抽出領域)、および回転量についての探索処理の対象となる探索範囲(角度変動範囲)が第3階層におけるテンプレートマッチング処理の結果に基づいて制限される。
 回転量についての探索処理によって、第2階層における、抽出領域とテンプレート画像との間の相対的な回転量(相対的なずれ量)が算出される((7)回転量算出)。そして、この算出された相対的な回転量を用いて、テンプレート画像が補正される((8)回転量補正)。この補正によって、補正テンプレート画像が生成される。
 続いて、抽出領域と補正テンプレート画像との間で位置についての探索処理((9)マッチング)が実行される。この位置についての探索処理によって、第2階層における、抽出領域と補正テンプレート画像との間の類似度が算出される。図7に示す(6)~(9)の手順が繰り返されることで、補正テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内における補正テンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((10)位置算出)。これで、第2階層における探索処理は完了する。
 以下同様にして、第1階層および入力画像についても同様の探索処理が実行される。
 このように、本実施の形態に従う画像処理装置100は、以下のような機能を発揮することで、テンプレート生成用画像(基準画像)に対応する領域を入力画像から探索する。すなわち、画像処理装置100は、入力画像に対応する、第3階層の解像度(第1の解像度)および第2階層の解像度(第1の解像度より高い第2の解像度)をそれぞれ有する第3および第2階層画像(第1および第2の入力画像)を取得する機能(入力画像取得部)を有する。画像処理装置100は、さらにテンプレート生成用画像(基準画像)から、第3および第2階層に対応するテンプレート画像(第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像)を生成する機能(基準画像生成部)を有する。
 さらに、画像処理装置100は、第3階層画像(第1の入力画像)と第3階層に対応するテンプレート画像(第1の基準画像)との間の探索処理によって、第3階層画像から抽出された抽出領域と第3階層に対応するテンプレート画像(第1の入力画像と第1の基準画像)との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づくテンプレート画像(第1の基準画像)の補正によってテンプレート画像(第1の基準画像)を補正することで、補正テンプレート画像(第1の補正基準画像)を生成し、第3階層画像(第1の入力画像)と補正テンプレート画像(第1の補正基準画像)との間の探索処理によって、第3階層(第1の解像度)における対応位置を決定する機能(第1の対応位置決定部)を有する。
 さらに、画像処理装置100は、第3階層(第1の解像度)における対応位置に相当する第2階層画像(第2の入力画像)における位置を基準として、上記の機能(第1の対応位置決定部)によって算出された相対的なずれ量を利用して、第2階層画像(第2の入力画像)とテンプレート画像(第2の基準画像)との間の探索処理を行なうことによって、第2階層(第2の解像度)における対応位置を決定する機能(第2の対応位置決定部)を有する。つまり、第2の対応位置決定部は、第2の入力画像と第2の基準画像との間の探索処理を行なうことで、第2の入力画像と第2の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく第2の基準画像の補正によって第2の補正基準画像を生成し、第2の入力画像と第2の補正基準画像との間の探索処理によって、第2の解像度における対応位置を決定する。
 さらに、画像処理装置100は、第3階層画像から抽出された抽出領域と第3階層に対応するテンプレート画像(第1の入力画像と第1の基準画像)との間の相対的なずれ量に応じて探索範囲を制限した上で、第2階層画像(第2の入力画像)とテンプレート画像(第2の基準画像)との間の探索処理を行なうことで、第2階層画像(第2の入力画像)とテンプレート画像(第2の基準画像)との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づくテンプレート画像(第2の基準画像)第2の基準画像の補正によって補正テンプレート画像(第2の補正基準画像)を生成し、第2階層画像(第2の入力画像)と補正テンプレート画像(第2の補正基準画像)との間の探索処理によって、前記第2の解像度における対応位置を決定する機能(第2の補正部)を有する。
 このとき、第2の対応位置決定部は、基準画像取得部に、第1の入力画像と第1の基準画像との間の相対的なずれ量に応じて第2の基準画像を生成させる。
 このように、本実施の形態に従う画像処理装置100は、前の階層においてなされたテンプレートマッチング処理の結果を利用して、処理を効率化する。
 《c3:機能構成》
 次に、本実施の形態に従う画像処理装置および/または画像処理プログラムの機能構成について説明する。
 図8は、本発明の実施の形態1に従う画像処理装置100の機能構成を示すブロック図である。図8を参照して、本実施の形態に従う画像処理装置100は、その主たる機能構成として、画像取得部150と、多重解像度画像生成部152と、テンプレート生成部154と、探索制御部156と、位置検出部158とを含む。これらの機能構成は、図2に示す画像処理装置100においては、CPU102がテンプレートマッチング処理プログラム112を実行することで実現される。以下、各機能構成の詳細について説明する。
 《c4:画像取得部150》
 画像取得部150は、処理対象となる入力画像を取得する。典型的には、接続されたカメラ4が被写体を撮像することで生成される画像を入力画像として取得する。これに代えて、何らかの外部装置で生成された入力画像を各種の記録媒体または通信媒体を介して取得するようにしてもよい。
 《c5:多重解像度画像生成部152》
 多重解像度画像生成部152は、入力画像に対応する、複数の解像度を有する画像(階層画像)を取得する。典型的には、多重解像度画像生成部152は、画像取得部150によって取得された入力画像に対応する、解像度が異なる複数の画像(階層画像)を生成する。図4および図5に示すように、入力画像の画像サイズを1600×1200pixとし、変換倍率を1/2とし、階層数を4としたときには、入力画像に対応する、それぞれ800×600pix、400×300pix、200×150pixの画像サイズを有する画像群(第1階層画像、第2階層画像、第3階層画像)が生成される。
 この例では、変換倍率が1/2であるので、例えば、第3階層画像の点(x,y)は、第2階層画像の点(2x,2y),(2x+1,2y),(2x,2y+1),(2x+1,2y+1)からなる2×2の画素の平均値として求められる。
 変換倍率については、必要に応じて柔軟に決定すればよい。例えば、変換倍率を1/2ではなく1/3などのようにより小さい値を採用してもよい。この場合には、階層数をより少なくできるので、処理をより高速化できる。逆に、変換倍率を1/1.5などのようにより大きい値を採用してもよい。この場合には、階層数がより多くなり、演算負荷は増加し得るが、より詳細に探索できるので、ロバスト性を高めることができる。
 また、階層間で変換倍率を同一にする必要はない。例えば、入力画像に近いところ(高解像度側)では変換倍率を小さくしておき、低解像度になるにつれて変換倍率を大きくしてもよい。探索対象のオブジェクト以外のものが含まれるような低解像度側では、より詳細に探索できるのでロバスト性を担保することができ、同時に、高解像度側ではロバスト性よりも高速化に重点を置くことで、トータルバランスがとれた探索処理が可能になる。
 《c6:テンプレート生成部154》
 テンプレート生成部154は、階層画像毎にテンプレート画像を設定する。典型的には、テンプレート生成部154は、入力されたテンプレート生成用画像114から、それぞれの階層画像(解像度)に応じたテンプレート画像を生成する。
 図9は、本発明の実施の形態1に従うテンプレート画像の生成手順を概略する図である。図9に示すように、それぞれの階層画像に対応する複数のテンプレート生成用画像に対応する、同一サイズのテンプレート画像が生成される。
 より具体的には、ユーザーは、テンプレート画像を設定するために基準となる被写体を撮像してテンプレート生成用画像を取得する。そして、ユーザーは、その取得したテンプレート生成用画像に対して、探索したい位置を指定する。テンプレート生成部154は、探索したい位置が重心位置になるようにそれぞれのテンプレート画像を設定する。図9に示す例では、テンプレート生成部154は、128×128pixの画像サイズをもつテンプレート画像をそれぞれ設定する。同様に、他の階層画像についても対応するテンプレート画像が設定される。図9に示す例では、他の階層画像に対応するテンプレート画像についても、最初に設定されたテンプレート画像と同じ画像サイズの128×128pixに設定される。また、それぞれの階層画像に対応するテンプレート画像についても、探索した位置が重心位置となるように設定される。
 なお、テンプレート画像の設定については、上述のような方法に代えて、以下のような方針で設定してもよい。
 (1)図9には、階層画像の間で同じ画像サイズを有するテンプレート画像を設定する例を示すが、少なくとも階層画像の解像度が低く(粗く)なるにつれて、テンプレート画像が含む領域が同一または広くなるように設定すればよい。
 (2)探索したい位置がその重心位置となるようにテンプレート画像を設定する例について説明したがそれに限られない。例えば、探索した位置に対して、ある一定量(Δx、Δy)だけ離れた位置にテンプレート画像を設定してもよい。この場合、テンプレート画像を用いて実際に探索した位置に対して、結果を当該一定量(Δx、Δy)だけシフトさせることで、探索したい位置を特定できる。
 《c7:探索制御部156》
 探索制御部156は、図3を参照して説明したように、多重解像度を用いた粗密戦略によって効率的に探索処理を行なう。以下、入力画像に対する位置探索を行なうための手順について説明する。ここでは、上述したように、入力画像の画像サイズを1600×1200pixとし、変換倍率を1/2とし、階層数を4としたときの多重解像度解析の手順について説明する。
 まず、第3階層画像において、第3階層画像に対応するテンプレート画像を用いて位置探索が実行される。これによって、対応する位置(x3、y3)が特定される。より具体的には、第3階層画像に対応するテンプレート画像と同じ画像サイズの領域が第3階層画像から抽出され、この抽出された領域(抽出領域)の内容が位置検出部158へ入力されることで、位置が探索される。
 すなわち、上述の図6に示したように、まず第3階層画像(200×150pix)からテンプレートマッチング処理の対象となる領域が抽出される。この抽出手順としては、抽出領域の重心位置と第3階層画像の重心位置とが一致するように、第3階層画像に対応するテンプレート画像(128×128pix)と同じ画像サイズの領域を切り出す。抽出領域とテンプレート画像とに対して、テンプレートマッチング処理が実行され、回転量および位置が特定される。
 第3階層画像において特定された第3階層画像上の位置(x3、y3)の近傍に正解位置があると推定されるので、第2階層画像においては第3階層画像上の位置(x3、y3)をおよそ2倍(変換倍率の逆数)にした座標の近傍にあると考えられる。そこで、第3階層画像上で位置が特定されると、第3階層画像で位置探索によって得られた結果を利用して、次に第2階層画像上におけるおおよその位置を決定した上で、位置探索を実行する。
 すなわち、上述の図6に示したように、次に第3階層画像で特定された位置を2倍した座標が第2階層画像での初期位置とされる。そして、第2階層画像に対応するテンプレート画像との間でテンプレートマッチング処理の対象となる領域が第2階層画像から抽出される。この抽出手順は、第3階層画像についての抽出手順と同様である。この第2解像画像から抽出された抽出領域とテンプレート画像とに対して、テンプレートマッチング処理が実行され、回転量および位置が特定される。
 同様にして、第2階層画像で位置探索した結果を利用して、次に第1階層画像における画像上のおおよその位置を求める。このように、低解像度側の結果を高解像度側の初期位置になるように徐々に正解に近付けていく。そして、第1階層画像および入力画像についても、同様に位置を特定することで、最終的な位置が特定される。
 《c8:位置検出部158》
 位置検出部158は、入力画像および/または階層画像から抽出された抽出領域と対応するテンプレート画像とを用いて、回転量および位置が探索される。本実施の形態においては、一例として、回転対応の位置検出技術である回転不変位相限定相関(RIPOC:Rotation Invariant Phase Only Correlation)法を用いる方法について説明する。
 図10は、本発明の実施の形態1に従う位置検出部158における処理内容を説明するための模式図である。図11は、図10に示すPOCにおいて実行される処理内容を説明するための模式図である。
 図10を参照して、RIPOC方式は、テンプレート画像に対して抽出領域がどれだけ回転しているかを算出するとともに、テンプレート画像の回転角度を補正する処理(参照符号167)と、回転角度の補正によって取得された補正テンプレート画像と抽出領域との間でどれだけの類似度および平行移動量が存在するのかを算出する処理(参照符号168)とを含む。
 より具体的には、位置検出部158は、フーリエ変換処理161,171と、対数化処理162,172と、極座標変換処理163,173と、POC処理164と、回転量補正処理165と、POC処理166とを含む。
 フーリエ変換処理161および171は、それぞれテンプレート画像および抽出領域に含まれる周波数成分(振幅成分および位相成分)を算出する。本RIPOC処理においては、位相成分は必ずしも必要ではないので、算出しなくともよい。
 対数化処理162および極座標変換処理163は、テンプレート画像についての振幅成分を対数化するとともに、極座標へ変換する。同様に、対数化処理172および極座標変換処理173は、抽出領域についての振幅成分を対数化するとともに、極座標へ変換する。この極座標への変換によって、回転量が2次元座標上の座標点として表現される。
 POC処理164は、極座標変換処理163および173からそれぞれ出力される極座標変換された結果について、類似度および平行移動量(回転量に相当)が算出される。図11には、POC処理164での処理結果を模式的に示す。図11に示すように、2つの画像間の平行移動量がピーク位置として表される。POC処理では、画像同士を順次ずらすとともに、それぞれに含まれる空間周波数の成分の間で相関値を算出することで、最も類似度の高いものを探索する。なお、画像間の平行移動量は、テンプレート画像の画像サイズのおおよそ±1/4程度の範囲をサーチすれば算出できる。すなわち、POC処理164では、極座標変換された結果同士で類似度が最も高くなる位置を特定し、それに対応する回転量が回転量補正処理165へ出力される。
 回転量補正処理165は、テンプレート画像をPOC処理164において算出された回転量に従って回転補正する。すなわち、回転量補正処理165では、テンプレート画像が回転補正されて補正テンプレート画像が生成される。
 回転量補正処理165においてテンプレート画像を回転補正する方法として、テンプレート画像そのものを実空間で回転させる方法を採用することができる。あるいは、後述するように、POC処理166において周波数空間を扱うような場合には、実空間で回転させる必要はなく、POC処理の内部表現であるフーリエ変換後のデータ(振幅情報および位相情報)を回転させる方法を採用してもよい。
 POC処理166は、補正後テンプレート画像と抽出領域との間で、類似度および平行移動量を算出する。類似度が最も高くなる位置が、入力画像に含まれる補正後テンプレート画像と一致する領域を示す。
 ここで、多重解像度を用いた粗密戦略による回転量補正処理165の効率化について説明する。第3階層では入力画像に含まれる対象物3の回転量が不定であるので、最大360°の範囲で回転量を探索する必要がある。但し、RIPOC方式で探索できる角度は±90°であるので、探索された回転量θ(-90°≦θ≦90°)に加えて、回転量(θ+π)も算出候補となる。そのため、図10に示すPOC処理164および回転量補正処理165では、テンプレート画像を回転量θおよび回転量(θ+π)の2種類で回転補正した結果を作成するとともに、POC処理166では、2つの回転量で補正されたそれぞれの補正テンプレート画像についてPOC処理(位置探索)が実行される。そして、それぞれのテンプレート画像についてのPOC処理によるピーク位置の高さを比較して、よりピーク位置の高さが高い方を平行移動量として出力する。回転量については、選択されたピーク位置を算出した際に使われたテンプレートの回転補正量が第3階層での回転量として出力される。
 第2階層以降についても同様に処理されるが、低階層で算出された回転量に基づいて、高階層での回転量の探索範囲を制限することができる。そのため、第3階層では回転量をそれぞれ補正した2つのテンプレート画像を使用したが、第2階層以降では一方の回転量で補正した補正テンプレート画像を用いることができる。このような処理を採用することで、POC処理166において平行移動量を算出する処理において、POC探索を2回行なっていたものを1回にできるので、演算時間を短縮できる。
 さらに、いずれのテンプレート画像を使用するかを制限するだけではなく、図10に示すPOC処理164および回転量補正処理165において回転量を算出するにあたって、POC処理のピーク位置の探索時に、低階層における結果に基づいて、その探索範囲を制限することで演算時間を短縮できるとともに、精度を安定化できる。より具体的には、第3階層で算出された回転量θに対して、第2階層ではθ±αの範囲だけ探索するようにする。
 《c9:処理手順》
 次に、本実施の形態に従うテンプレートマッチング処理の全体手順について説明する。
 図12は、本発明の実施の形態1に従うテンプレートマッチング処理の全体手順を示すフローチャートである。図12に示す各ステップは、典型的には、CPU102(図2)がテンプレートマッチング処理プログラム112を実行するなどして実現される。
 図12を参照して、まず、CPU102は、カメラ4などから入力画像を取得する(ステップS100)。続いて、CPU102は、入力画像を多重解像度化して階層画像を生成する(ステップS102)。ここでは、入力画像に対応する、第1階層画像、第2階層画像、第3階層画像が生成されたものとする。なお、入力画像および各階層画像に対応するテンプレート画像は予め用意されているものとする。
 CPU102は、第3階層画像に対して、位置探索を行なうための初期位置を設定する(ステップS104)。第3階層画像では、低階層側の情報がないので、例えば、画像の重心位置を初期位置として設定すればよい。続いて、CPU102は、第3階層画像からテンプレート画像と同じ画像サイズの領域を抽出する(ステップS106)。この抽出領域は、ステップS104において設定された初期位置が重心位置になるように設定される。そして、CPU102は、抽出領域とテンプレート画像とを入力として、回転量の探索処理を実行し(ステップS108)、その回転量の探索処理によって得られた回転量に基づいて補正テンプレート画像を生成する(ステップS110)。典型的には、テンプレート画像を補正することで補正テンプレート画像が生成される。さらに、CPU102は、ステップS110において生成された補正テンプレート画像と抽出領域とを入力として、位置の探索処理を実行する(ステップS112)。
 続いて、より高階層についての処理が実行される。
 CPU102は、対象の階層画像または入力画像に対して、低階層において算出された位置に基づいて、位置探索を行なうための初期位置を設定する(ステップS114)。続いて、CPU102は、対象の階層画像または入力画像から対応するテンプレート画像と同じ画像サイズの領域を抽出する(ステップS116)。
 そして、CPU102は、低階層において算出されたテンプレート画像補正用の回転量に基づいて、回転量の探索範囲を設定した上で(ステップS118)、抽出領域とテンプレート画像とを入力として、回転量の探索処理を実行し(ステップS120)、その回転量の探索処理によって得られた回転量に基づいて補正テンプレート画像を生成する(ステップS122)。典型的には、テンプレート画像を補正することで補正テンプレート画像が生成される。さらに、CPU102は、ステップS122において生成された補正テンプレート画像と抽出領域とを入力として、位置の探索処理を実行する(ステップS124)。
 そして、CPU102は、現在の対象画像が入力画像であるか否かを判断する(ステップS126)。現在の対象画像が入力画像でない場合(ステップS126においてNOの場合)には、次の高階層の画像を対象に設定し(ステップS128)、ステップS114以下の処理が繰り返される。
 これに対して、現在の対象画像が入力画像である場合(ステップS126においてYESの場合)には、直前に実行されたステップS124の探索処理の結果を出力する(ステップS130)。そして、処理は終了する。
 《c10.利点》
 本実施の形態によれば、入力画像を多重解像度化することで、低解像度側から相対的なずれ量および位置の両方を絞り込みながら探索するので、演算量を低減することがでるとともに、精度のロバスト性も向上できる。
 [D.実施の形態2]
 上述の実施の形態1では、低解像度側から高解像度側へ位置および回転量の情報を伝播させていく際、回転量の探索範囲を制限した上で、予め準備されているテンプレート画像の回転補正を行なう構成について例示した。これに対して、実施の形態2においては、低解像度側で検出された回転量の情報に基づいて、テンプレート画像を動的に生成する構成について例示する。
 《d1:処理概要》
 本実施の形態に従うテンプレートマッチング処理の概要は、上述の図3~図5を参照して説明した内容と実質的に同一である。そのため、詳細な説明は繰り返さない。
 《d2:探索処理の効率化》
 次に、本実施の形態に従うテンプレートマッチング処理における処理の効率化手法について説明する。本実施の形態においては、低解像度側において階層画像(に含まれる部分画像)とテンプレート画像との間に相対的なずれを補正した探索処理が実行される。そして、この探索処理において、最も類似度が高い位置(上述の図11に示すピーク位置)が算出された際に利用された回転量が次の階層におけるテンプレート画像の生成に利用される。
 本実施の形態においても、相対的な回転量を考慮した探索処理の一例として、回転不変位相限定相関(RIPOC)法を用いた構成例について説明するが、これらに限られるものではない。
 図13は、本発明の実施の形態2に従うテンプレートマッチング処理の内容を概略する図である。図13には、第3階層画像および第2階層画像に対する処理の内容を例示するが、同様の手順によって、第1階層画像および入力画像に対しても同様の処理が実行される。
 図13を参照して、まず、第3階層画像に対して探索範囲が設定されるとともに、探索範囲からマッチング処理の対象となる抽出領域が抽出され、この抽出領域と第3階層用のテンプレート画像との間で回転量についての探索処理((1)マッチング)が実行される。なお、第3階層画像における探索範囲は、第3階層画像の全体であってもよい。この回転量についての探索処理によって、第3階層における、抽出領域とテンプレート画像との間の相対的な回転量(相対的なずれ量)が算出される((2)回転量算出)。そして、この算出された相対的な回転量を用いて、テンプレート画像が補正される((3)回転量補正)。この補正によって、補正テンプレート画像が生成される。
 続いて、抽出領域と補正テンプレート画像との間で位置についての探索処理((4)マッチング)が実行される。この位置についての探索処理によって、第3階層における、抽出領域と補正テンプレート画像との間の類似度が算出される。図13に示す(1)~(4)の手順が繰り返されることで、補正テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内における補正テンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((5)位置算出)。これで、第3階層における探索処理は完了する。
 続いて、第2階層における探索処理が開始される。この第2階層における探索処理では、第3階層において算出された、最も類似度が高い抽出領域についての、テンプレート画像との間の相対的な回転量(相対的なずれ量)、および平行移動量が利用される。
 具体的には、第3階層において類似度が最も高い値を示した際の回転量を考慮して、テンプレート画像を動的に生成する(あるいは、作り直す)((6)回転量補正)。これにより、テンプレート画像と抽出領域とのマッチング度合いを予め高めることができる。
 すなわち、第2階層におけるテンプレートマッチング処理においては、第3階層に対応する補正テンプレート画像の生成に用いた補正量(回転量)に応じて、第2階層に対応するテンプレート画像を生成する。
 また、算出された平行移動量に基づいて第2階層画像に対して初期位置が設定されるとともに、初期位置に基づいてマッチング処理の対象となる抽出領域が設定され、この抽出領域と第2階層用のテンプレート画像との間で回転量についての探索処理((7)マッチング)が実行される。この回転量についての探索処理の探索範囲は、例えば、±α(α:予め定められた変動角度)などに設定される。本実施の形態においては、先に、おおよその回転量を考慮したテンプレート画像が生成されているので、探索範囲を限定できる。
 回転量についての探索処理によって、第2階層における、抽出領域とテンプレート画像との間の相対的な回転量(相対的なずれ量)が算出される((8)回転量算出)。そして、この算出された相対的な回転量を用いて、テンプレート画像が補正される((9)回転量補正)。この補正によって、補正テンプレート画像が生成される。
 続いて、抽出領域と補正テンプレート画像との間で位置についての探索処理((10)マッチング)が実行される。この位置についての探索処理によって、第2階層における、抽出領域と補正テンプレート画像との間の類似度が算出される。図13に示す(6)~(10)の手順が繰り返されることで、補正テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内における補正テンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((11)位置算出)。これで、第2階層における探索処理は完了する。
 以下同様にして、第1階層および入力画像についても同様の探索処理が実行される。
 次に、テンプレート画像の生成手順について説明する。
 図14は、本発明の実施の形態2に従うテンプレート画像の生成手順を概略する図である。それぞれの階層に対応するテンプレート画像は、テンプレート生成用画像から切り出すことで生成されるものとする。
 図14を参照して、まず、最も低階層に対応するテンプレート画像がテンプレート生成用画像から切り出すことで生成される((1)切り出し)。この切り出しは、ユーザーが任意に設定する。生成された最も低階層にテンプレート画像を用いて、マッチング対象画像(階層画像)の中から対応位置が探索される((2)マッチング)。このとき、テンプレート画像との間の相対的なずれ量(この例では、回転量)が算出される。
 次の階層での処理においては、探索されたマッチング情報(回転量)を用いて((3)マッチング情報(回転量))、テンプレート生成用画像からテンプレート画像が切り出される((4)切り出し)。これによって、マッチング対象画像に映っている対象物の回転量にほぼ近い状態に対応するテンプレート画像が生成される。そして、この生成されたテンプレート画像を用いて、マッチング対象画像(階層画像)の中から対応位置が探索される((5)マッチング)。以下、同様に対応位置が探索される。
 このように、本実施の形態においては、低解像度側における回転量を用いて、高解像度側におけるテンプレート画像が生成される。
 このように、本実施の形態に従う画像処理装置100は、以下のような機能を発揮することで、テンプレート生成用画像(基準画像)に対応する領域を入力画像から探索する。すなわち、画像処理装置100は、入力画像に対応する、第3階層の解像度(第1の解像度)および第2階層の解像度(第1の解像度より高い第2の解像度)をそれぞれ有する第3および第2階層画像(第1および第2の入力画像)を取得する機能(入力画像取得部)を有する。画像処理装置100は、さらにテンプレート生成用画像(基準画像)から、第3および第2階層に対応するテンプレート画像(第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像)を生成する機能(基準画像生成部)を有する。
 さらに、画像処理装置100は、第3階層画像(第1の入力画像)と第3階層に対応するテンプレート画像(第1の基準画像)との間の探索処理によって、第3階層画像から抽出された抽出領域と第3階層に対応するテンプレート画像(第1の入力画像と第1の基準画像)との間の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づいてテンプレート画像(第1の基準画像)を補正することで、補正テンプレート画像(第1の補正基準画像)を生成する機能(第1の補正部)を有する。画像処理装置100は、さらに第3階層画像(第1の入力画像)と補正テンプレート画像(第1の補正基準画像)との間の探索処理によって、第3階層(第1の解像度)における対応位置を決定する機能(第1の対応位置決定部)を有する。
 さらに、画像処理装置100は、第3階層(第1の解像度)における対応位置に相当する第2階層(第2の解像度)における位置を基準として、第2階層画像(第2の入力画像)に対して、第2階層に対応する補正テンプレート画像(第2の補正基準画像)に基づく探索処理を行なうことで、第2階層(第2の解像度)における対応位置を決定する機能(第2の対応位置決定部)を有する。
 さらに、画像処理装置100は、第1の補正テンプレート画像(第1の補正基準画像)の生成に用いた回転量(補正量)に応じて、第2のテンプレート画像(第2の基準画像)を生成する。
 さらに、画像処理装置100は、第2階層画像(第2の入力画像)と、第3階層に対応する補正テンプレート画像(第1の補正基準画像)の生成に用いた回転量(補正量)に応じて生成された第2階層に対応するテンプレート画像(第2の基準画像)との間の探索処理を行なうことで、補正テンプレート画像(第2の補正基準画像)を生成する。
 このように、本実施の形態に従う画像処理装置100は、前の階層においてなされたテンプレートマッチング処理の結果を利用して、処理を効率化する。
 《d3:機能構成》
 本実施の形態に従う画像処理装置および/または画像処理プログラムの機能構成については、図8に示すブロック図と同様である。但し、テンプレート生成部154によるテンプレート画像の生成処理については、上述したように、実施の形態1における処理とは異なっている。
 《d4:処理手順》
 次に、本実施の形態に従うテンプレートマッチング処理の全体手順について説明する。
 図15は、本発明の実施の形態2に従うテンプレートマッチング処理の全体手順を示すフローチャートである。図15に示す各ステップは、典型的には、CPU102(図2)がテンプレートマッチング処理プログラム112を実行するなどして実現される。
 図15に示す処理手順は、図12に示す処理手順に比較して、ステップS118の処理に代えて、ステップS119の処理が実行される。すなわち、対象の階層画像または入力画像に対して、低階層において算出された位置に基づいて、位置探索を行なうための初期位置を設定(ステップS114)した後、CPU102は、対象の階層画像または入力画像に対応する、テンプレート画像と同じ画像サイズの領域を抽出する(ステップS116)。
 そして、CPU102は、低階層において算出されたテンプレート画像補正用の回転量に基づいて、テンプレート生成用画像に対応するテンプレート画像を生成する。(ステップS119)。さらに、CPU102は、抽出領域と生成したテンプレート画像とを入力として、回転量の探索処理を実行し(ステップS120)、その回転量の探索処理によって得られた回転量に基づいて補正テンプレート画像を生成する(ステップS122)。典型的には、テンプレート画像を補正することで補正テンプレート画像が生成される。さらに、CPU102は、ステップS122において生成された補正テンプレート画像と抽出領域とを入力として、位置の探索処理を実行する(ステップS124)。
 以下、図12と同様の処理が実行される。
 《d5.変形例》
 上述の説明では、予め作成されたテンプレート画像を作り直す処理について説明したが、テンプレート生成用画像から回転量を考慮して複数のテンプレート画像を作成しておき、メモリ上に保持しておいてもよい。このような方法を採用することで、低階層側で取得された回転量に応じて、最適なテンプレート画像を選択するだけでよくなる。その結果、演算時間を短縮化できる。
 なお、メモリの制約が厳しい場合は、例えば1°刻みのような細かいテンプレート画像ではなく、例えば、10°刻みのようなより粗いテンプレート画像を作成しておき、最も近いものを選択するようにしてもよい。このような処理であっても、一定の精度向上効果が得られる。
 《d6.利点》
 本実施の形態によれば、高解像度側の階層画像では相対的なずれ量(相対的な回転量、および、相対的な倍率)がほぼ存在しないテンプレート画像を使用できるので、探索精度を向上できる。
 [E.実施の形態3]
 上述の実施の形態2では、低解像度側で検出された回転量の情報に基づいて、テンプレート画像を動的に生成する構成について例示した。この実施の形態2においては、さらに回転量についての探索処理が実行され、テンプレート画像が補正された上で、位置についての探索処理が実行される。これに対して、実施の形態3においては、生成されたテンプレート画像に対する補正処理を省略する構成について説明する。低解像度側で算出された回転量に基づいて動的に生成されるテンプレート画像は、入力画像に含まれる対象物3の向きに適合していると考えられるので、このようなテンプレート画像の回転補正を省略したとしても、比較的高い精度を保つことができる。
 《e1:処理概要》
 本実施の形態に従うテンプレートマッチング処理の概要は、上述の図3~図5を参照して説明した内容と実質的に同一である。そのため、詳細な説明は繰り返さない。
 《e2:探索処理の効率化》
 次に、本実施の形態に従うテンプレートマッチング処理における処理の効率化手法について説明する。
 図16は、本発明の実施の形態3に従うテンプレートマッチング処理の内容を概略する図である。図16を参照して、まず、第3階層画像に対して探索範囲が設定されるとともに、探索範囲からマッチング処理の対象となる抽出領域が抽出され、この抽出領域と第3階層用のテンプレート画像との間で回転量についての探索処理((1)マッチング)が実行される。この回転量についての探索処理によって、第3階層における、抽出領域とテンプレート画像との間の相対的な回転量(相対的なずれ量)が算出される((2)回転量算出)。そして、この算出された相対的な回転量を用いて、テンプレート画像が補正される((3)回転量補正)。この補正によって、補正テンプレート画像が生成される。
 続いて、抽出領域と補正テンプレート画像との間で位置についての探索処理((4)マッチング)が実行される。この位置についての探索処理によって、第3階層における、抽出領域と補正テンプレート画像との間の類似度が算出される。図16に示す(1)~(4)の手順が繰り返されることで、補正テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内における補正テンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((5)位置算出)。これで、第3階層における探索処理は完了する。
 続いて、第2階層における探索処理が開始される。この第2階層における探索処理では、第3階層において算出された、最も類似度が高い抽出領域についての、テンプレート画像との間の相対的な回転量(相対的なずれ量)、および平行移動量が利用される。
 具体的には、第3階層において類似度が最も高い値を示した際の回転量を考慮して、テンプレート画像を動的に生成する(あるいは、作り直す)((6)回転量補正)。すなわち、第2階層におけるテンプレートマッチング処理においては、第3階層に対応する補正テンプレート画像の生成に用いた補正量(回転量)に応じて、第2階層に対応するテンプレート画像を生成する。
 また、算出された平行移動量に基づいて第2階層画像に対して初期位置が設定されるとともに、初期位置に基づいてマッチング処理の対象となる抽出領域が設定される。そして、抽出領域とテンプレート画像との間で位置についての探索処理((7)マッチング)が実行される。この位置についての探索処理によって、第2階層における、抽出領域とテンプレート画像との間の類似度が算出される。図16に示す(7)の手順が繰り返されることで、テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内におけるテンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((8)位置算出)。これで、第2階層における探索処理は完了する。
 続いて、第1階層における探索処理が開始される。具体的には、第3階層において類似度が最も高い値を示した際の回転量を考慮して、テンプレート画像を動的に生成する(あるいは、作り直す)((9)回転量補正)。
 また、第2階層において算出された平行移動量に基づいて第1階層画像に対して初期位置が設定されるとともに、初期位置に基づいてマッチング処理の対象となる抽出領域が設定される。そして、抽出領域とテンプレート画像との間で位置についての探索処理((10)マッチング)が実行される。図16に示す(10)の手順が繰り返されることで、テンプレート画像との間で最も類似度が高くなる抽出領域が特定される。この最も類似度が高くなった抽出領域を示す位置(探索範囲内におけるテンプレート画像と最も一致する抽出領域の相対位置を示す平行移動量)が算出される((11)位置算出)。これで、第1階層における探索処理は完了する。
 以下同様にして、入力画像についても同様の探索処理が実行される。
 このように、本実施の形態に従う画像処理装置100は、第3階層に対応する補正テンプレート画像(第1の補正基準画像)の生成に用いた回転量(補正量)に応じて生成された第2階層に対応するテンプレート画像(第2の基準画像)に対応する領域を第2階層画像から探索することで、第2の階層画像にける対応位置を決定する。
 《e3:機能構成》
 本実施の形態に従う画像処理装置および/または画像処理プログラムの機能構成については、図8に示すブロック図と同様である。但し、テンプレート生成部154によるテンプレート画像の生成処理については、上述したように、実施の形態1における処理とは異なっている。
 《e4:処理手順》
 次に、本実施の形態に従うテンプレートマッチング処理の全体手順について説明する。
 図17は、本発明の実施の形態3に従うテンプレートマッチング処理の全体手順を示すフローチャートである。図17に示す処理手順は、図15に示す処理手順に比較して、ステップS120およびS122の処理が省略されている。それ以外の処理については、図15を参照して説明したとおりであるので、詳細な説明は繰り返さない。
 《e5.変形例》
 上述の説明では、第1番目の階層(最低解像度)においてのみ回転量についての探索が実行される例を示すが、他の階層においても必要に応じて回転量についての探索を行なってもよい。例えば、最高解像度(すなわち、入力画像)においても、回転量についての探索およびテンプレート画像の回転量補正を行なった上で、位置についての探索処理を行なって平行移動量を算出するようにしてもよい。これにより、よりロバストな回転量算出および平行移動量算出が可能になる。
 また、最低解像度および最高解像度のみに限らず、一部の中間階層においても回転量についての探索およびテンプレート画像の回転量補正を行なってもよい。
 結局のところ精度の安定性と演算速度のトレードオフになるので、これらの事項については、用途やニーズに応じて適宜設計すればよい。
 《e6.利点》
 本実施の形態によれば、高解像度側の階層画像では相対的なずれ量(相対的な回転量、および、相対的な倍率)を算出するための演算を省略できるので、処理を高速化できる。
 [F.実施の形態4]
 上述の実施の形態1~3では、予め定められた手順に従って、テンプレートマッチング処理が実行される例について説明した。これに対して、実施の形態4においては、低解像度側でのテンプレートマッチング処理のマッチング度合いに応じて、高解像度側でのマッチング方法を最適化する方法について説明する。
 《f1.概要》
 「マッチング度合い」は、入力画像または階層画像がテンプレート画像に対してどのくらい類似しているかを示す指標であり、相関値などが用いられる。図11に示すように、POCでは、逆フーリエ変換後に得られる相関ピークの大きさ(ピーク値)を用いることができる。
 本実施の形態においては、テンプレート画像を回転補正するための回転量を算出する際に取得される類似度(図10のPOC処理164による処理結果)と、位置についての探索を行なって平行移動量を算出する際に取得される類似度(図10のPOC処理166による処理結果)の2種類が存在する。説明の便宜上、以下では、前者を「回転類似度」と称し、後者を「位置ずれ類似度」と称す。
 《f2.パターン例》
 このような、低解像度側における類似度に基づいてマッチング方法を最適化するパターン例としては、以下のようなものが挙げられる。
 <パターン1>
 (1)低解像度側:回転探索+回転量補正+位置探索→位置ずれ類似度:高→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+位置探索
 (2)低解像度側:回転探索+回転量補正+位置探索→位置ずれ類似度:低→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索+回転量補正+位置探索
 <パターン2>
 (1)低解像度側:回転探索+回転量補正+位置探索→回転類似度:高→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+位置探索
 (2)低解像度側:回転探索+回転量補正+位置探索→回転類似度:低→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索+回転量補正+位置探索
 すなわち、上述のパターン1および2においては、類似度が高い場合には、高解像度側においては、テンプレート画像に対する回転量についての探索および回転量補正を省略する。
 あるいは、以下のようなパターンを採用してもよい。
 <パターン3>
 (1)低解像度側:回転探索+回転量補正+位置探索→位置ずれ類似度:高→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索(低解像度側の回転量に基づく探索範囲の制限有)+回転量補正+位置探索
 (2)低解像度側:回転探索+回転量補正+位置探索→位置ずれ類似度:低→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索(低解像度側の回転量に基づく探索範囲の制限無)+回転量補正+位置探索
 <パターン4>
 (1)低解像度側:回転探索+回転量補正+位置探索→回転類似度:高→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索(低解像度側の回転量に基づく探索範囲の制限有)+回転量補正+位置探索
 (2)低解像度側:回転探索+回転量補正+位置探索→回転類似度:低→高解像度側:低解像度側の回転量に基づくテンプレート画像の生成+回転探索(低解像度側の回転量に基づく探索範囲の制限無)+回転量補正+位置探索
 すなわち、上述のパターン3および4においては、類似度が高い場合には、高解像度側においては、テンプレート画像に対する回転量についての探索において探索範囲の制限を有効化し、そうでなければ、探索範囲を制限しない。
 上述のように、本実施の形態に従う画像処理装置100は、低解像度側におけるテンプレート画像の回転量補正において算出される類似度(回転量類似度)、および、低解像度側における位置についての探索において算出される類似度(位置ずれ類似度)の少なくとも一方に基づいて、高解像度側における探索処理に用いられるテンプレート画像または補正テンプレート画像の生成手順を異ならせる機能(制御部)を含む。すなわち、画像処理装置100の制御部は、第1の入力画像と第1の基準画像との間の探索処理において算出される類似度、および、第1の入力画像と第1の補正基準画像との間の探索処理において算出される類似度の少なくとも一方に基づいて、第2の対応位置決定部による第2の解像度における対応位置の決定方法を変化させる。より具体的には、画像処理装置100は、相対的なずれ量および位置ずれ量の少なくとも一方を決定する際に算出される類似度に基づいて、生成手順を異ならせる。
 《f3.その他の形態》
 上述の説明においては、回転量類似度および位置ずれ類似度について言及したが、それ以外の類似度、例えば倍率類似度などについても同様に採用することができる。この場合には、例えば、3つの類似度の重み付け平均値などに依存して、高解像度側でのマッチング方法を決定してもよい。
 《f4.利点》
 低解像度側におけるマッチング度合いに応じて高解像度側でのマッチング方法を最適化することで、精度の安定性および演算時間の短縮化を両立できる。例えば、低解像度側で確からしいマッチングができている場合には、高解像度側での回転量についての探索を行なわなくとも、高い精度で平行移動量を算出できると考えられるので、回転量の探索処理を省略できる。これによって、トータルの演算量を低減できる。
 [G.その他の実施の形態]
 上述の実施の形態においては、入力画像/階層画像(に含まれる部分画像)とテンプレート画像との間に相対的なずれ(幾何学的なずれ)を算出および補正する方法として、RIPOC法を用いた例について説明した。これに加えて、あるいは、これに代えて、倍率(サイズ)も含めた幾何学的なずれを算出および補正する各種のアルゴリズム方法を採用することもでき、例えば、上述の非特許文献1に開示されるフーリエメリン変換を用いたマッチング方法を採用してもよい。このフーリエメリン変換を用いたマッチング方法によれば、上述した回転量の探索処理と同様に、倍率(サイズ)の探索処理を行なうことができる。
 さらに、POC以外にも画像内の周波数情報を利用したマッチングアルゴリズムとして、文献1(貴家仁志、「画像信号処理と画像パターン認識の融合-DCT符号限定相関とその応用」、首都大学東京 システムデザイン学部、動的画像処理実利用化ワークショップ2007(2007.3.8))に記載の方法を採用してもよい。
 [H.別形態]
 本発明の実施の形態としては、以下のような態様を含む。
 別の実施の形態に従う画像処理装置は、テンプレート画像と取得画像との相対的な回転量あるいは相対的な倍率、またはその両方を考慮したテンプレートマッチング方法に向けられている。画像処理装置は、画像を取得する画像取得部と、テンプレート画像を取得する部と、取得画像の部分領域とテンプレート画像との相関を利用して、取得画像から対応位置を探索する部と、記探索時において、テンプレート画像との相対的な回転量あるいは倍率、または、その両方を算出する相対ずれ量算出部と、相対ずれ量算出部で算出した値を用いて、取得画像とテンプレート画像との相対的なずれ量を補正後に対応位置を算出する部とを含む。画像処理装置100は、さらに、画像取得部で取得された画像を複数の解像度に変換する解像度変換部と、テンプレート画像を解像度毎に取得する部と、低解像度画像からテンプレート画像を利用して低解像度画像における暫定位置を特定する部と、各解像度で得られた暫定位置から高解像度での仮位置を設定する部と、低解像度から高解像度へ順次暫定位置を特定することで取得画像における対応位置を決定する部と、低解像度で得られた相対的なずれ量に基づいて、高解像度における相対的なずれ量の探索範囲を限定する部とを含む。
 この局面に従う画像処理装置によれば、画像を多重化することで、低解像度側から相対的ずれ量および位置の両方を絞り込みながら探索するので、演算速度を低減でき、精度のロバスト性も向上できる。
 別の実施の形態に従う画像処理装置は、テンプレート画像と取得画像との相対的な回転量あるいは相対的な倍率、またはその両方を考慮したテンプレートマッチング方法に向けられている。画像処理装置は、画像を取得する画像取得部と、テンプレート画像を取得する部と、取得画像の部分領域とテンプレート画像との相関を利用して、取得画像から対応位置を探索する部と、記探索時において、テンプレート画像との相対的な回転量あるいは倍率、または、その両方を算出する相対ずれ量算出部と、相対ずれ量算出部で算出した値を用いて、取得画像とテンプレート画像との相対的なずれ量を補正後に対応位置を算出する部とを含む。画像処理装置100は、さらに、画像取得部で取得された画像を複数の解像度に変換する解像度変換部と、テンプレート画像を解像度毎に取得する部と、低解像度画像からテンプレート画像を利用して低解像度画像における暫定位置を特定する部と、各解像度で得られた暫定位置から高解像度での仮位置を設定する部と、低解像度から高解像度へ順次暫定位置を特定することで取得画像における対応位置を決定する部と、高解像度でのテンプレートマッチングで用いるテンプレート画像を、低解像度で得られた相対的なずれ量と同程度になるようにずれた画像領域をテンプレート画像として使用する部とを含む。
 この局面に従う画像処理装置によれば、高解像度の階層画像では回転や倍率の相対的なずれ量が相対的にずれていないテンプレートを使用するので、精度を向上できる。
 画像処理装置は、高解像度でのテンプレートマッチング処理では、低解像度で得られた相対的なずれ量に基づいて、高解像度における画像とテンプレート間の相対的なずれ量を補正後に位置ずれ量のみを算出する。
 この局面に従う画像処理装置によれば、高解像度の階層画像では回転や倍率の相対的なずれ量を求めるための演算を行なわないので、高速処理を実現できる。
 画像処理装置は、低解像度におけるテンプレートマッチング処理において算出される類似度に基づいて、高解像度でのマッチング時に相対的な回転量もしくは相対的な倍率、またはその両方を算出する際の算出範囲を限定する量を制御する。
 この局面に従う画像処理装置によれば、類似度は、相対的な回転量、相対的な倍率、位置ずれ量のいずれか一方を算出する際に得られる類似度である。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 システム、2 ベルトコンベア、3 対象物、4 カメラ、5 テンプレート画像、100 画像処理装置、102 CPU、104 RAM、106 ROM、108 ネットワークインターフェイス、110 補助記憶装置、112 テンプレートマッチング処理プログラム、114 テンプレート生成用画像、120 表示部、122 入力部、124 メモリーカードインターフェイス、126 メモリーカード、128 カメラインターフェイス、130 バス、150 画像取得部、152 多重解像度画像生成部、154 テンプレート生成部、156 探索制御部、158 位置検出部、161,171 フーリエ変換処理、162,172 対数化処理、163,173 極座標変換処理、164,166 POC処理、165 回転量補正処理。

Claims (7)

  1.  基準画像に対応する領域を入力画像から探索する画像処理装置であって、
     前記入力画像に対応する、少なくとも第1の解像度および前記第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得する入力画像取得部と、
     前記基準画像に対応する、前記第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得する基準画像取得部と、
     前記第1の入力画像と前記第1の基準画像との間の探索処理によって、前記第1の入力画像と前記第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく前記第1の基準画像の補正によって第1の補正基準画像を生成し、前記第1の入力画像と前記第1の補正基準画像との間の探索処理によって、前記第1の解像度における対応位置を決定する第1の対応位置決定部と、
     前記第1の解像度における対応位置に相当する前記第2の入力画像における位置を基準として、前記第1の対応位置決定部によって算出された相対的なずれ量を利用して、前記第2の入力画像と前記第2の基準画像との間の探索処理を行なうことによって、前記第2の解像度における対応位置を決定する第2の対応位置決定部とを備えた画像処理装置。
  2.  前記第2の対応位置決定部は、前記第1の入力画像と前記第1の基準画像との間の相対的なずれ量に応じて探索範囲を制限した上で、前記第2の入力画像と前記第2の基準画像との間の探索処理を行なうことで、前記第2の入力画像と前記第2の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく前記第2の基準画像の補正によって第2の補正基準画像を生成し、前記第2の入力画像と前記第2の補正基準画像との間の探索処理によって、前記第2の解像度における対応位置を決定する、請求項1に記載の画像処理装置。
  3.  前記第2の対応位置決定部は、前記基準画像取得部に、前記第1の入力画像と前記第1の基準画像との間の相対的なずれ量に応じて前記第2の基準画像を生成させる、請求項2に記載の画像処理装置。
  4.  前記第2の対応位置決定部は、前記第2の入力画像と前記第2の基準画像との間の探索処理を行なうことで、前記第2の入力画像と前記第2の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく前記第2の基準画像の補正によって第2の補正基準画像を生成し、前記第2の入力画像と前記第2の補正基準画像との間の探索処理によって、前記第2の解像度における対応位置を決定する、請求項3に記載の画像処理装置。
  5.  前記第1の入力画像と前記第1の基準画像との間の探索処理において算出される類似度、および、前記第1の入力画像と前記第1の補正基準画像との間の探索処理において算出される類似度の少なくとも一方に基づいて、前記第2の対応位置決定部による前記第2の解像度における対応位置の決定方法を変化させる制御部をさらに備える、請求項1~4のいずれか1項に記載の画像処理装置。
  6.  基準画像に対応する領域を入力画像から探索する画像処理方法であって、
     前記入力画像に対応する、少なくとも第1の解像度および前記第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得するステップと、
     前記基準画像に対応する、前記第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得するステップと、
     前記第1の入力画像と前記第1の基準画像との間の探索処理によって、前記第1の入力画像と前記第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく前記第1の基準画像の補正によって第1の補正基準画像を生成し、前記第1の入力画像と前記第1の補正基準画像との間の探索処理によって、前記第1の解像度における対応位置を決定するステップと、
     前記第1の解像度における対応位置に相当する前記第2の入力画像における位置を基準として、前記相対的なずれ量を利用して、前記第2の入力画像と前記第2の基準画像との間の探索処理を行なうことで、前記第2の解像度における対応位置を決定するステップとを備えた画像処理方法。
  7.  基準画像に対応する領域を入力画像から探索する画像処理プログラムであって、前記画像処理プログラムはコンピューターに、
     前記入力画像に対応する、少なくとも第1の解像度および前記第1の解像度より高い第2の解像度をそれぞれ有する第1および第2の入力画像を取得するステップと、
     前記基準画像に対応する、前記第1および第2の解像度にそれぞれ対応する解像度を有する第1および第2の基準画像を取得するステップと、
     前記第1の入力画像と前記第1の基準画像との間の探索処理によって、前記第1の入力画像と前記第1の基準画像との間の回転および/または倍率の相対的なずれ量を算出するとともに、算出された相対的なずれ量に基づく前記第1の基準画像の補正によって第1の補正基準画像を生成し、前記第1の入力画像と前記第1の補正基準画像との間の探索処理によって、前記第1の解像度における対応位置を決定するステップと、
     前記第1の解像度における対応位置に相当する前記第2の入力画像における位置を基準として、前記相対的なずれ量を利用して、前記第2の入力画像と前記第2の基準画像との間の探索処理を行なうことで、前記第2の解像度における対応位置を決定するステップとを実行させる画像処理プログラム。
PCT/JP2013/066586 2012-06-26 2013-06-17 画像処理装置、画像処理方法および画像処理プログラム WO2014002813A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US14/411,295 US20150345936A1 (en) 2012-06-26 2013-06-17 Image Processing Apparatus, Image Processing Method And Image Processing Program
EP13810312.2A EP2866195A4 (en) 2012-06-26 2013-06-17 IMAGE PROCESSING DEVICE, IMAGE PROCESSING METHOD, AND IMAGE PROCESSING PROGRAM
JP2013544957A JP5477518B1 (ja) 2012-06-26 2013-06-17 画像処理装置、画像処理方法および画像処理プログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012142969 2012-06-26
JP2012-142969 2012-06-26

Publications (1)

Publication Number Publication Date
WO2014002813A1 true WO2014002813A1 (ja) 2014-01-03

Family

ID=49782974

Family Applications (1)

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

Country Status (4)

Country Link
US (1) US20150345936A1 (ja)
EP (1) EP2866195A4 (ja)
JP (1) JP5477518B1 (ja)
WO (1) WO2014002813A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018037891A1 (ja) * 2016-08-25 2018-03-01 日本電気株式会社 画像処理装置、画像処理システム、画像処理方法およびプログラム記録媒体
JP2019070974A (ja) * 2017-10-10 2019-05-09 株式会社アクセル 画像処理装置、画像処理方法、および画像処理プログラム
JP2019139640A (ja) * 2018-02-14 2019-08-22 シヤチハタ株式会社 認証システムおよび認証方法
JP7496546B2 (ja) 2020-05-28 2024-06-07 パナソニックIpマネジメント株式会社 画像処理方法、プログラム及び画像処理システム

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6278108B2 (ja) * 2014-03-14 2018-02-14 オムロン株式会社 画像処理装置、画像センサ、画像処理方法
JP6333871B2 (ja) * 2016-02-25 2018-05-30 ファナック株式会社 入力画像から検出した対象物を表示する画像処理装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10124667A (ja) 1996-08-26 1998-05-15 Yamatake Honeywell Co Ltd パターン照合装置
JP2001223874A (ja) * 2000-02-04 2001-08-17 Kiyoharu Aizawa 任意焦点画像合成装置及びこれに用いる複数画像同時撮像型カメラ
JP2005235089A (ja) 2004-02-23 2005-09-02 Japan Science & Technology Agency 画像認識装置、画像認識方法及びプログラム
JP2011198148A (ja) * 2010-03-19 2011-10-06 Fujitsu Ltd 画像処理装置、画像処理方法および画像処理プログラム
JP2012069003A (ja) * 2010-09-24 2012-04-05 Juki Corp 形状ベースマッチングパラメータの調整装置、形状ベースマッチングパラメータの調整方法および部品実装装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6219452B1 (en) * 1999-01-06 2001-04-17 National Instruments Corporation Pattern matching system and method which performs local stability analysis for improved efficiency
US7113652B2 (en) * 2003-01-09 2006-09-26 Banner Engineering Corp. System and method for using normalized gray scale pattern find
US8483489B2 (en) * 2011-09-02 2013-07-09 Sharp Laboratories Of America, Inc. Edge based template matching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10124667A (ja) 1996-08-26 1998-05-15 Yamatake Honeywell Co Ltd パターン照合装置
JP2001223874A (ja) * 2000-02-04 2001-08-17 Kiyoharu Aizawa 任意焦点画像合成装置及びこれに用いる複数画像同時撮像型カメラ
JP2005235089A (ja) 2004-02-23 2005-09-02 Japan Science & Technology Agency 画像認識装置、画像認識方法及びプログラム
JP2011198148A (ja) * 2010-03-19 2011-10-06 Fujitsu Ltd 画像処理装置、画像処理方法および画像処理プログラム
JP2012069003A (ja) * 2010-09-24 2012-04-05 Juki Corp 形状ベースマッチングパラメータの調整装置、形状ベースマッチングパラメータの調整方法および部品実装装置

Non-Patent Citations (3)

* 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", TOKYO METROPOLITAN UNIVERSITY, FACULTY OF SYSTEM DESIGN, JSPE WORKSHOP ON DYNAMIC IMAGE PROCESSING FOR REAL APPLICATION, 2007
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 EP2866195A4

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018037891A1 (ja) * 2016-08-25 2018-03-01 日本電気株式会社 画像処理装置、画像処理システム、画像処理方法およびプログラム記録媒体
JPWO2018037891A1 (ja) * 2016-08-25 2019-06-20 日本電気株式会社 画像処理装置、画像処理システム、画像処理方法およびプログラム記録媒体
US10922823B2 (en) 2016-08-25 2021-02-16 Nec Corporation Motion analyis device, motion analysis method, and program recording medium
JP7063267B2 (ja) 2016-08-25 2022-05-09 日本電気株式会社 画像処理装置、画像処理システム、画像処理方法およびコンピュータプログラム
JP2019070974A (ja) * 2017-10-10 2019-05-09 株式会社アクセル 画像処理装置、画像処理方法、および画像処理プログラム
JP2019139640A (ja) * 2018-02-14 2019-08-22 シヤチハタ株式会社 認証システムおよび認証方法
JP7076772B2 (ja) 2018-02-14 2022-05-30 シヤチハタ株式会社 認証システムおよび認証方法
JP7496546B2 (ja) 2020-05-28 2024-06-07 パナソニックIpマネジメント株式会社 画像処理方法、プログラム及び画像処理システム

Also Published As

Publication number Publication date
JPWO2014002813A1 (ja) 2016-05-30
JP5477518B1 (ja) 2014-04-23
US20150345936A1 (en) 2015-12-03
EP2866195A1 (en) 2015-04-29
EP2866195A4 (en) 2016-06-15

Similar Documents

Publication Publication Date Title
JP5477518B1 (ja) 画像処理装置、画像処理方法および画像処理プログラム
JP4284288B2 (ja) パターン認識装置及びその方法
US20150262346A1 (en) Image processing apparatus, image processing method, and image processing program
CN104751465A (zh) 一种基于lk光流约束的orb图像特征配准方法
US20130051626A1 (en) Method And Apparatus For Object Pose Estimation
US9390330B2 (en) Apparatus and method for extracting correspondences between aerial images
WO2017099251A1 (en) Method and system for registering data
JP6512100B2 (ja) 画像処理を実行する情報処理装置及び画像処理方法
JP2013025799A (ja) 画像検索方法、システム、及びプログラム
JP4521235B2 (ja) 撮影画像の変化抽出装置及び方法
KR20170022736A (ko) 딕셔너리 학습 기반 해상도 향상 장치 및 방법
JP6052186B2 (ja) 画像処理装置
US20200005078A1 (en) Content aware forensic detection of image manipulations
Al-Hammadi et al. Improving SURF based copy-move forgery detection using super resolution
CN114511865A (zh) 一种结构化信息的生成方法、装置和计算机可读存储介质
JP6086491B2 (ja) 画像処理装置およびそのデータベース構築装置
JP6163868B2 (ja) 画像処理方法、画像処理装置および画像処理プログラム
JP5051671B2 (ja) 情報処理装置、情報処理方法およびプログラム
CN106056599B (zh) 一种基于物体深度数据的物体识别算法及装置
US11232323B2 (en) Method of merging images and data processing device
JP6056354B2 (ja) 画像処理装置、画像処理方法および画像処理プログラム
WO2018076137A1 (zh) 一种高光谱图像特征描述子的获取方法及装置
JP2014029677A (ja) 画像処理装置、画像処理方法および画像処理プログラム
JP2005173128A (ja) 輪郭形状抽出装置
JP3706603B2 (ja) データ特徴抽出装置及びデータ照合装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2013544957

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: 13810312

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14411295

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: 2013810312

Country of ref document: EP