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

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

Info

Publication number
WO2014199824A1
WO2014199824A1 PCT/JP2014/064066 JP2014064066W WO2014199824A1 WO 2014199824 A1 WO2014199824 A1 WO 2014199824A1 JP 2014064066 W JP2014064066 W JP 2014064066W WO 2014199824 A1 WO2014199824 A1 WO 2014199824A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
rotation amount
template
matching
rotation
Prior art date
Application number
PCT/JP2014/064066
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 EP14810909.3A priority Critical patent/EP3009985A4/en
Priority to JP2015522705A priority patent/JPWO2014199824A1/ja
Priority to US14/897,570 priority patent/US20160140419A1/en
Publication of WO2014199824A1 publication Critical patent/WO2014199824A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • G06V10/7515Shifting the patterns to accommodate for positional errors
    • 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
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/14Transformations for image registration, e.g. adjusting or mapping for alignment of images
    • G06T3/147Transformations for image registration, e.g. adjusting or mapping for alignment of images using affine transformations
    • 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/32Determination of transform parameters for the alignment of images, i.e. image registration using correlation-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/11Technique with transformation invariance effect

Definitions

  • the present invention relates to an image processing method, an image processing apparatus, and an image processing program related to template matching using a template image.
  • a technique for detecting a position corresponding to a template image from search target images using a template image registered in advance has been put into practical use.
  • a phase-only correlation method Phase-Only Correlation: hereinafter also referred to as “POC method”
  • the POC method is a method of searching for corresponding points between images using phase difference information of spatial frequencies included in the images. By using the phase difference information, it is possible to improve the robustness against illumination fluctuations.
  • the general POC method assumes that there is no change in the rotation direction between the template image and the search target image. Therefore, when an object registered in advance as a template image is rotated in the search target image, the position cannot be accurately detected.
  • a rotation-invariant phase-only correlation method (hereinafter referred to as “RIPOC method”) is an extension of the POC method. It can be dealt with by adopting ".”
  • the amount of rotation (rotational displacement) between images is estimated using the amplitude information included in the template image and the search target image, and either the template image or the search target image is estimated based on the estimated rotation amount. Correct one. Subsequently, using the corrected template image or search target image, a corresponding position is detected. Through such a two-step process, the corresponding position can be accurately detected even when the target object can rotate.
  • Patent Document 1 discloses a pattern matching apparatus using the RIPOC method. This pattern matching device estimates the amount of rotation from an image obtained by converting the amplitude information into polar coordinates, and estimates the position after correcting the template image.
  • Patent Document 2 discloses a position detection method by image processing for obtaining a rotation angle from a reference position set in an image for a target graphic in a given input image.
  • the search target image is matched with a template rotated at a plurality of rotation angles, and the rotation angle and position of the object are determined from the template having the highest similarity and the position found in the template. Is estimated.
  • the RIPOC method disclosed in the above-mentioned Patent Document 1 and the like has high robustness against fluctuations in the rotation direction and the like, but if the estimation of the rotation amount (rotational displacement) between the previous images fails, Since the image cannot be corrected appropriately, position detection at a later stage does not work well. For example, in an image having periodicity in the rotation direction, it is not guaranteed that the estimation of the rotation amount (rotational displacement) can be performed correctly, so that the subsequent position detection may not be performed correctly. Further, in the position detection method disclosed in Patent Document 2 described above, since it is necessary to perform matching for all of a plurality of rotation angles, a lot of calculation time is required.
  • An object of the present invention is to provide an image processing method, an image processing apparatus, and an image processing program capable of speeding up processing while improving robustness in template matching using a template image.
  • an image processing method for performing template matching with a search target image using a template image.
  • a step of acquiring information on periodicity in the rotation direction for at least one of the template image and the search target image, and first matching in the rotation direction between the template image and the search target image are performed.
  • determining a plurality of rotation amount candidates for correcting a relative shift in the rotation direction between the template image and the search target image based on the result of the first matching and the periodicity information Using each of the quantity candidates to generate a plurality of sets of images in which the relative shift in the rotation direction between the template image and the search target image is corrected; and a second position for each of the sets of images. And outputting a result with relatively high accuracy among the results of the second matching.
  • the step of determining a plurality of rotation amount candidates includes a step of limiting a search range of the rotation amount based on periodicity information.
  • the step of limiting the range in which the rotation amount is searched includes the relationship between the rotation amount and the similarity in the range in which the rotation amount is searched, and the rotation amount and similarity outside the range in which the rotation amount is searched.
  • the step of generating information on the similarity of the range to be searched is corrected.
  • the step of determining a plurality of rotation amount candidates includes adding and / or subtracting a rotation amount indicating periodicity information to the rotation amount determined by the first matching. Determining the step.
  • the step of determining a plurality of rotation amount candidates refers to a change characteristic of the similarity between the template image and the search target image with respect to the rotation amount and satisfies the condition of the periodicity information among the rotation amount candidates. Including excluding no candidates.
  • the step of acquiring periodicity information includes a step of receiving periodicity information set by a user when generating a template image.
  • the step of acquiring periodicity information includes a step of performing a third matching with respect to the rotation direction between the template images, and a step of determining the periodicity from the cycle of similarity appearing in the result of the third matching. including.
  • the step of acquiring periodicity information includes a step of receiving arbitrary periodicity information from the user.
  • an image processing apparatus that performs template matching with a search target image using a template image.
  • the image processing apparatus includes a periodic information acquisition unit that acquires information on periodicity in the rotation direction for at least one of the template image and the search target image, and a first rotation direction between the template image and the search target image.
  • Rotation for performing matching and determining a plurality of rotation amount candidates for correcting relative shift in the rotation direction between the template image and the search target image based on the result of the first matching and the periodicity information An image estimator, an image corrector that generates a plurality of image sets in which a relative shift in the rotation direction between the template image and the search target image is corrected using each of the rotation amount candidates, and an image set And a position detection unit that outputs a result with relatively high accuracy among the results of the second matching.
  • an image processing program for performing template matching with a search target image using a template image.
  • the image processing program acquires, in a computer, information on periodicity in the rotation direction for at least one of the template image and the search target image, and a first matching in the rotation direction between the template image and the search target image. And determining a plurality of rotation amount candidates for correcting a relative shift in the rotation direction between the template image and the search target image based on the first matching result and the periodicity information.
  • each of the rotation amount candidates Using each of the rotation amount candidates, generating a plurality of image sets in which the relative displacement in the rotation direction between the template image and the search target image is corrected, and the position of each of the image sets Performing a second matching and outputting a result with a relatively high accuracy among the results of the second matching. That.
  • FIG. 3 is a schematic diagram showing a functional configuration of the image processing apparatus according to the first embodiment.
  • FIG. 6 is a schematic diagram for describing an overview of rotation correction processing in a rotation correction unit of the image processing apparatus according to the first embodiment.
  • FIG. 3 is a more detailed functional block diagram of a rotation amount estimation unit of the image processing device according to the first embodiment.
  • FIG. It is a schematic diagram which shows the algorithm of POC method. It is a figure which shows an example of the POC value calculated according to the general POC method shown in FIG.
  • FIG. 6 is a diagram showing an example of a result of rotation correction processing by a rotation correction unit of the image processing apparatus according to the first embodiment.
  • FIG. 6 is a flowchart showing an overall procedure of position detection processing according to the first embodiment. It is a figure for demonstrating the rotation amount estimation process according to Embodiment 2.
  • FIG. It is a figure which shows an example of the change of POC value with respect to the rotation amount which arises when a noise component is contained in an image. It is a figure for demonstrating the rotation amount estimation process according to Embodiment 3.
  • FIG. FIG. 10 is a schematic diagram showing a functional configuration of an image processing device according to a fifth embodiment.
  • FIG. 20 is a more detailed functional block diagram of a rotation amount estimation unit and a period information calculation unit of an image processing device according to Processing Example 3 of Embodiment 5. It is a figure for demonstrating the rotation amount estimation process according to Embodiment 7.
  • FIG. 20 is a more detailed functional block diagram of a rotation amount estimation unit and
  • an image processing method, an image processing apparatus, and an image processing program for performing template matching with a search target image using a template image are provided.
  • periodicity information in the rotation direction is acquired for at least one of the template image and the search target image.
  • the first matching in the rotation direction is executed between the template image and the search target image. That is, a relative shift (rotation amount) in the rotation direction between images is estimated.
  • a plurality of rotation amount candidates for correcting the relative shift in the rotation direction between the template image and the search target image are determined based on the first matching result and the periodicity information. Then, using each of the rotation amount candidates, a plurality of image sets in which the relative shift in the rotation direction between the template image and the search target image is corrected is generated, and the position of each of the image sets is determined. Match two. That is, a plurality of candidates for rotation amount correction are prepared, and a position search is executed for each candidate. Then, a result with relatively high accuracy is output as a final result among the results of the second matching.
  • FIG. 1 is a schematic diagram showing an application example of template matching according to the present embodiment.
  • system 1 according to the present embodiment is applied to a production line including belt conveyor 3 as an example.
  • the workpiece 2 is continuously conveyed on the belt conveyor 3, and the workpiece 2 is photographed by the camera 10, whereby an image including the appearance of the workpiece 2 (hereinafter also referred to as “object”) (hereinafter “object”). Also referred to as “search target image 16”).
  • the search target image 16 is transmitted to the image processing apparatus 100.
  • the image processing apparatus 100 detects the position of the workpiece 2 included in the search target image 16 using the template image 18 registered in advance.
  • the image processing apparatus 100 outputs position information including information such as a rotation amount and a magnification obtained by the template matching.
  • FIG. 2 is a block diagram showing a configuration when template matching according to the present embodiment is realized by a personal computer.
  • an image processing apparatus 100 realized by a personal computer is mainly mounted on a computer having a general-purpose architecture.
  • the image processing apparatus 100 includes, as main components, a central processing unit (CPU) 102, a random access memory (RAM) 104, a read only memory (ROM) 106, a network interface (I / F) 108, a hard disk 110, and the like.
  • Each component is communicably connected to each other via a bus 130.
  • the CPU 102 controls the entire image processing apparatus 100 by executing various programs such as an operating system (OS) and a template matching execution program 112 stored in the ROM 106, the hard disk 110, and the like.
  • the RAM 104 functions as a working memory for the CPU 102 to execute various programs.
  • 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 hard disk 110 stores an image processing program (mainly the template matching execution program 112) for realizing various processes according to the present embodiment, a template image 18, and the like.
  • the hard disk 110 may further store a program such as an operating system.
  • the display unit 120 displays a GUI (Graphical User Interface) screen provided by the operating system, an image generated by executing the template matching execution program 112, and the like.
  • the input unit 122 typically includes a keyboard, a mouse, a touch panel, and the like, and outputs the content of an instruction received from the user to the CPU 102 or the like.
  • the memory card interface 124 reads / writes data from / to various memory cards (nonvolatile recording media) 126 such as an SD (Secure Digital) card and a CF (Compact Flash (registered trademark)) card.
  • the camera interface 128 captures an image for generating the search target image 16 acquired by photographing the subject from the camera 10.
  • the camera 10 functions as an image acquisition unit for acquiring an image.
  • the main body of the image processing apparatus 100 may not have a function of photographing a subject.
  • a necessary image is captured via a memory card 126 that stores various images acquired by some device. That is, the memory card 126 is attached to the memory card interface 124, and various images read from the memory card 126 are stored (copied) in the hard disk 110 or the like.
  • the template matching execution program 112 stored in the hard disk 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 execution 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 in a necessary order. To do.
  • the template matching execution program 112 itself does not include a module provided by the operating system, but instead implements image processing in cooperation with the operating system.
  • the template matching execution program 112 may be provided by being incorporated in a part of some program instead of a single program.
  • the program itself does not include a module that is used in common with other programs, and instead, image processing is realized in cooperation with the other programs.
  • image processing is realized in cooperation with the other programs.
  • the template matching execution 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 execution 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 apparatus side it is not necessary for the server apparatus side to perform all functions (processing), and the user terminal and the server apparatus may cooperate to realize the image processing according to the present embodiment.
  • FIG. 3 is a schematic diagram showing a functional configuration of image processing apparatus 100 according to the first embodiment.
  • image processing apparatus 100 estimates a change (rotation amount) in the rotation direction between template image 18 and search target image 16, and template image 18 and search target image 16. Correct at least one of the following.
  • the image processing apparatus 100 corrects the change in the rotation direction and then detects a corresponding position between the images by matching processing between the images.
  • processing in the case where rotation correction is performed by rotating the search target image 16 will be exemplified.
  • the template image 18 may be rotationally corrected.
  • the image processing apparatus 100 includes a template holding unit 150, an image acquisition unit 152, a rotation correction unit 154, and a position detection unit 160 as its functional configuration.
  • the template holding unit 150 holds a template image 18 prepared in advance.
  • the template holding unit 150 registers the template image 18 in advance.
  • the template image 18 is arbitrarily created and / or set by a user or the like according to the purpose of template matching.
  • the template image 18 prepared in advance by a user or the like is acquired by the image processing apparatus 100 via an arbitrary recording medium or communication medium, that is, read by file input or the like and held in the template holding unit 150.
  • the template image 18 may be created using all or part of the image taken by the camera 10.
  • the template image 18 held by the template holding unit 150 is used in rotation amount estimation processing and position detection processing described later.
  • the image acquisition unit 152 acquires the search target image 16 that is a target of template matching by an arbitrary method. Typically, the image acquisition unit 152 acquires the search target image 16 generated when the camera 10 captures a subject.
  • the acquisition method of the search target image 16 is not limited to the input method from the camera 10, and the search target image 16 captured in advance is acquired via an arbitrary recording medium or communication medium, that is, input as a file. Also good.
  • the search target image 16 to be acquired may be a single image, or may be a plurality of images captured continuously.
  • the camera 10 acquires images at a predetermined cycle (moving images are captured), and the continuously acquired images are temporarily stored in the frame buffer.
  • a certain trigger release by the user, automatic shooting after a predetermined time elapses, trigger by another recognition process
  • a corresponding image among the images stored in the frame buffer is acquired and processed. There are cases like this.
  • the rotation correction unit 154 estimates a relative rotation amount between the template image 18 and the search target image 16, and uses at least one of the template image 18 and the search target image 16 with the estimated relative rotation amount. Correct the rotation. As described above, image processing apparatus 100 according to the first embodiment performs rotation correction on search target image 16. More specifically, the rotation correction unit 154 includes a rotation amount estimation unit 156 and an image correction unit 158.
  • the rotation amount estimation unit 156 estimates a relative shift in the rotation amount between the template image 18 and the search target image 16 and also estimates a plurality of displacement amount candidates in the rotation direction between the images. That is, the rotation amount estimation unit 156 performs matching (first matching) with respect to the rotation direction between the template image 18 and the search target image 16, and the result of matching with respect to the rotation direction (first matching). Based on the periodicity information, a plurality of rotation amount candidates for correcting the relative shift in the rotation direction between the template image 18 and the search target image 16 are determined.
  • Various methods can be employed as the logic for estimating the relative rotation amount. In this embodiment, the rotation amount is estimated using the POC method.
  • the image correction unit 158 corrects the template image 18 or the search target image 16 based on the plurality of rotation amounts estimated by the rotation amount estimation unit 156, and outputs a plurality of corrected images (in the following description, search target images). 16). That is, the image correction unit 158 generates a plurality of image sets in which the relative shift in the rotation direction between the template image 18 and the search target image 16 is corrected using each of the rotation amount candidates.
  • Rotation correction is realized by relatively rotating one image using affine transformation.
  • the affine transformation includes an interpolation process.
  • a known interpolation method such as a Bi-linear method or a CubicConvolution method can be employed.
  • the position detection unit 160 executes processing for detecting a corresponding position using each corrected image generated by the rotation correction. In other words, the position detection unit 160 performs position detection processing (second matching) on the position of each of the image sets generated by the image correction unit 158, and has relatively high accuracy among the results of the position detection processing. Output high results.
  • position detection logic various methods can be employed, but in the present embodiment, position detection using the POC method is employed.
  • a plurality of rotation amounts are estimated as candidates using period information, and position detection is performed for each rotation amount candidate.
  • the position detection unit 160 outputs the most probable result as final position information. Details of the position detection processing in the position detection unit 160 will be described later.
  • FIG. 4 is a schematic diagram for explaining an outline of the rotation correction process in rotation correction unit 154 of image processing apparatus 100 according to the first embodiment.
  • a plurality of rotation amount candidates used for the rotation correction process are estimated.
  • the position detection robustness is enhanced by performing the subsequent position detection process using each of the estimated plurality of rotation amounts.
  • a relative rotational shift is detected between the template image 18 and the search target image 16.
  • the similarity between the images is calculated while sequentially changing the relative rotation amount between the template image 18 and the search target image 16. That is, matching processing regarding the rotation direction is executed between the template image 18 and the search target image 16.
  • the POC method is adopted.
  • a POC value is calculated as the similarity.
  • a POC value as shown by reference numeral 30 is calculated according to the rotation amount of the search target image 16. That is, the grid-like objects as shown in the template image 18 and the search target image 16 have periodicity, and the peak of the POC value (similarity) appears at a cycle of 90 °.
  • the angle corresponding to the peak position is determined as one of the rotation amount candidates to be corrected, and the determined rotation amount candidate is set as a period.
  • the period information is information on the periodicity in the rotation direction for at least one of the template image 18 and the search target image 16. Details of the method for acquiring the period information will be described later.
  • the cycle information is acquired in advance, and in addition to the rotation amount ⁇ showing the maximum peak, the rotation amount ⁇ ⁇ (the rotation amount according to the cycle information) is determined as a rotation correction candidate.
  • the corrected images 16A and 16B are generated by correcting the search target image 16 according to each estimation result.
  • the post-position detection process is executed using these corrected images 16A and 16B.
  • the process of generating a plurality of sets of images is performed by adding and / or subtracting a rotation amount indicating periodicity information to a rotation amount determined by matching in the rotation direction (first matching). , Including a process of determining rotation amount candidates.
  • FIG. 5 is a more detailed functional block diagram of rotation amount estimation unit 156 of image processing apparatus 100 according to the first embodiment.
  • rotation amount estimation unit 156 has, as its functional configuration, frequency conversion units 1561 and 1562, logarithmization units 1563 and 1564, polar coordinate conversion units 1565 and 1566, POC processing unit 1567, and candidates A generating unit 1568.
  • the frequency conversion units 1561 and 1562 calculate frequency components (amplitude component and phase component) included in the template image 18 and the search target image 16, respectively.
  • an amplitude component is used instead of a phase component.
  • the logarithmization unit 1563 and the polar coordinate conversion unit 1565 logarithmize the amplitude component of the template image 18 and convert it into a polar coordinate image.
  • the logarithmization unit 1564 and the polar coordinate conversion unit 1566 logarithmize the amplitude component of the search target image 16 and convert it into a polar coordinate image.
  • the rotation amount is expressed as a coordinate point on two-dimensional coordinates.
  • the horizontal coordinate of the polar coordinate image corresponds to the rotation amount.
  • the POC processing unit 1567 calculates a similarity and a parallel movement amount (corresponding to a rotation amount) between polar coordinate images output from the polar coordinate conversion units 1565 and 1566, respectively.
  • the similarity calculated by the POC processing unit 1567 is also referred to as a correlation value or a POC value.
  • FIG. 6 is a schematic diagram showing an algorithm of the POC method.
  • POC processing unit 1567 includes reference window setting unit 1571, reference window setting unit 1572, frequency conversion units 1573 and 1574, phase information extraction units 1575 and 1576, and phase difference calculation unit 1577.
  • Frequency inverse transform unit 1578 Frequency inverse transform unit 1578.
  • the standard window setting unit 1571 and the reference window setting unit 1572 set windows for the template image (polar coordinate conversion image) and the search target image (polar coordinate conversion image), respectively.
  • the frequency conversion unit 1573 performs frequency conversion (typically, Fourier transform) on the reference window set on the template image, thereby converting the image information contained therein into information in the frequency space. .
  • the frequency conversion unit 1573 performs frequency conversion (typically, Fourier transform) on the reference window set on the search target image, thereby converting the image information contained therein into the frequency space. Convert to information.
  • the information on the converted frequency space includes amplitude information and phase information for each frequency. That is, frequency conversion units 1573 and 1574 perform frequency decomposition on the partial images included in the respective windows.
  • the calculation result of a general frequency conversion is output in a complex number format including a real part and an imaginary part.
  • frequency conversion is performed according to equation (1).
  • the frequency information is output in a complex number format including a real part Re (u, v) and an imaginary part Im (u, v). Moreover, it can convert into amplitude information A (u, v) and phase information (theta) (u, v) using the value of a real part and an imaginary part.
  • the result of frequency conversion may be stored in a format that combines amplitude and phase, or may be stored in a format that combines a real part and an imaginary part.
  • the phase information extraction units 1575 and 1576 extract the phase information about the reference window and the reference window, respectively, using the frequency conversion results (typically complex numbers) output from the frequency conversion units 1573 and 1574, respectively. .
  • the phase difference calculation unit 1577 calculates the phase information difference for the windows extracted by the phase information extraction units 1575 and 1576, respectively. That is, the phase difference calculation unit 1577 generates phase difference information.
  • the frequency inverse transform unit 1578 performs frequency inverse transform on the phase difference information calculated by the phase difference calculation unit 1577, thereby obtaining a POC value indicating the similarity between partial images included in each set window. calculate.
  • the process of calculating the POC value is repeatedly executed every time the reference window setting unit 1572 updates the position of the reference window set on the template image.
  • FIG. 7 is a diagram showing an example of the POC value calculated according to the general POC method shown in FIG.
  • FIG. 7 shows an example of a POC value calculation result obtained from the template image 18 and the search target image 16 shown in FIG.
  • two peaks appear.
  • the template image 18 and the search target image 16 shown in FIG. 4 are grid-like objects. That is, the amplitude component included in each of the template image 18 and the search target image 16 has a cross shape as shown in FIG. 7, and accordingly, when considered in terms of the phase component, the rotation amounts ⁇ and ⁇ ⁇ 90 °.
  • a plurality of peaks also appear in the POC value (correlation value) calculated by the POC method.
  • the rotation amount corresponding to the maximum peak is estimated as the rotation fluctuation amount. Therefore, when a plurality of peaks occur, it is impossible to accurately determine which peak shows a truly correct rotation amount.
  • the rotation amount is estimated at the stage of rotation amount estimation. Estimate multiple quantity candidates.
  • FIG. 8 is a diagram showing a result example of the rotation correction process by the rotation correction unit 154 of the image processing apparatus 100 according to the first embodiment.
  • the search target image 16 is corrected with a plurality of rotation amount candidates based on the amount of change in the rotation direction between the template image 18 and the search target image 16 and the period information.
  • images 16A and 16B are generated.
  • the position search process is executed using each of the corrected images 16A and 16B.
  • Period information can be acquired using various methods.
  • the frequency component (amplitude component and phase component) included in the template image may be calculated, and the period information may be determined from the periodicity of the frequency component. More specifically, when creating the template image 18, the user can know what periodicity is present from the image characteristics. Specifically, by performing frequency conversion on the template image 18 and extracting amplitude information, an image as in the image after logarithmic processing shown in FIG. 5 can be obtained. By viewing such an image, the user can confirm what periodicity is present in the rotation direction.
  • the processing for acquiring periodicity information includes processing for receiving periodicity information set by the user when the template image 18 is generated.
  • the search target image is corrected with each of a plurality of rotation amount candidates, and position detection is performed using each of the corrected images. From the position detection result, the most probable result is output as final position information.
  • the position detection unit 160 of the image processing apparatus 100 illustrated in FIG. 3 determines whether any position detection result is likely by comparing the magnitudes of the maximum peaks associated with these position detection results.
  • corrected images 16A and 16B are obtained by correcting the search target image 16 at ⁇ 10 ° and 80 °, respectively.
  • the corrected image 16B obtained by correcting the search target image 16 by 80 ° is different in appearance from the template image 18, so that the value of the maximum peak is small, and there is a possibility that the accuracy of the position detection result is not high. Is expensive.
  • the corrected image 16A obtained by correcting the search target image 16 by ⁇ 10 ° looks almost the same as the template image 18, the value of the maximum peak becomes high and the position is accurately detected. It becomes possible.
  • FIG. 9 is a flowchart showing an overall procedure of position detection processing according to the first embodiment. Each step shown in FIG. 9 is typically realized by the CPU 102 executing the template matching execution program 112 (both in FIG. 2).
  • CPU 102 obtains a template image (step S100).
  • the user may cut out an image obtained by photographing the reference workpiece with the camera 10, or may obtain an image generated from the design data of the workpiece 2.
  • the CPU 102 acquires period information (step S102). This period information may be acquired from the outside in association with the template image, or may be set by the user based on the image information included in the template image.
  • steps S100 and S102 information necessary for template matching according to the present embodiment is collected.
  • the CPU 102 acquires a search target image (step S104).
  • the CPU 102 captures the work 2 by the camera 10 and acquires a search target image.
  • an image obtained by photographing a work with another camera or the like may be captured as a search target image.
  • the work 10 may be photographed by the camera 10 on condition that the sensor arranged on the belt conveyor 3 detects the arrival of the work 2.
  • the CPU 102 estimates a change (rotation amount) in the rotation direction between the template image and the search target image (step S106). More specifically, as shown in FIG. 5, the CPU 102 performs frequency conversion, logarithmic processing, and polar coordinate conversion on each image, and then estimates the rotation amount using the POC method. In this rotation amount estimation, the CPU 102 determines a rotation amount showing the highest similarity (correlation value). Then, the CPU 102 estimates a rotation amount candidate using the period information from the rotation amount determined in step S106 (step S108). More specifically, the CPU 102 adds / subtracts the rotation amount indicating the period information to the rotation amount estimated in step S106 to determine a rotation amount candidate.
  • the CPU 102 rotates the search target image 16 using a plurality of candidate rotation amounts to generate a plurality of corrected images (step S110). Then, the CPU 102 performs position detection with each of a plurality of corrected images generated using the template image 18 (step S112). More specifically, the CPU 102 typically searches for a corresponding position between images using the POC method. Finally, the CPU 102 outputs a result indicating the highest similarity (correlation value) among the position detection results executed in step S112 as final position information (step S114). That is, the CPU 102 outputs the most probable result as the final position information among the results of the position search performed using the plurality of candidate rotation amounts. Then, the process ends.
  • ⁇ c6 Advantage >> According to the present embodiment, even when the rotation amount related to the rotation correction cannot be accurately obtained, a plurality of rotation amount candidates are estimated by using the periodicity in the rotation direction of the image, and each candidate is determined. To perform position detection. Then, by determining the optimum rotation amount and the corresponding displacement amount from the position detection result, position detection with higher robustness and accuracy can be realized.
  • the POC value (similarity) is calculated using the amplitude component included in the template image 18 and the search target image 16, and the rotation amount indicating the maximum peak is determined.
  • one or a plurality of rotation amount candidates are estimated from the period information with reference to the rotation amount corresponding to the determined maximum peak.
  • the POC value (similarity) search process in the rotation amount estimation process basically, it is necessary to calculate POC values (similarities) for all rotation amounts.
  • the period information is acquired, the period in which the peak appears can be predicted in advance, so that the search range of the POC value (similarity) can be limited from the period information.
  • FIG. 10 is a diagram for explaining the rotation amount estimation processing according to the second embodiment.
  • FIG. 10 schematically shows one-dimensional changes in the POC value with respect to the rotation amount. In the example shown in FIG. 10, peaks appear at three places in total, that is, rotation amounts of 0 °, ⁇ 90 °, and 90 °.
  • the period information is 90 °
  • only the range of ⁇ 45 ° around 0 ° may be searched. That is, a peak at a position of 0 ° can be specified by searching a range of ⁇ 45 ° centered on 0 °. Then, using the specified 0 ° position as a reference, it can be estimated that there are peaks at the remaining ⁇ 90 ° and 90 ° positions using the period information.
  • search target image 16 when the search target image 16 is rotated by 40 ° with respect to the template image 18, peaks appear at two locations of 40 ° and ⁇ 50 °, and the search target image is 60 °. In the case of rotation, peaks appear at two locations of 60 ° and ⁇ 30 °. In any case, since at least one peak always exists within the range (search range) of ⁇ 45 °, it is possible to search for a peak by limiting the search range.
  • the search range may be limited to ⁇ ( ⁇ / 2).
  • the search range may be set to ⁇ ( ⁇ / 2 + ⁇ ) using the likelihood ⁇ .
  • the POC value is calculated for the amplitude information, the maximum peak position is searched from the POC value, and the rotation amount corresponding to the searched maximum peak position is used as the reference from the period information.
  • a plurality of rotation amount candidates are estimated.
  • the range (search range) for searching for the peak position from the period information is limited. That is, in the second embodiment, the matching (first matching) in the rotation direction between the template image 18 and the search target image 16 is a range in which the rotation amount is searched based on the periodicity information. Includes limited processing. The calculation load can be reduced by adopting such processing that limits the search range from the period information.
  • FIG. 11 is a diagram illustrating an example of a change in the POC value with respect to the rotation amount generated when a noise component is included in the image.
  • FIG. 12 is a diagram for explaining a rotation amount estimation process according to the third embodiment.
  • any noise component (shot noise, shading, etc.) occurs when acquiring the search target image, as shown in FIG. 11, a peak (false peak) is present at a place where it should not be (position b in FIG. 11). May appear.
  • the maximum peak should occur at position a.
  • a rotation amount candidate is determined from the period information with reference to the rotation amount corresponding to the position b. For this reason, in position detection at a later stage, position detection is performed using an image that has been corrected with a rotation amount that is erroneously estimated and a rotation amount that is calculated from the rotation amount using period information. Therefore, position detection cannot be performed accurately.
  • such a false detection can occur even when the search range is limited to ⁇ 45 °. Therefore, in the third embodiment, as shown in FIG. 12, by integrating the limited search range and the POC value information outside the search range, the influence on accuracy due to the occurrence of false peaks is eliminated. To do. More specifically, the amplitude (false waveform) of the false peak appearing at position b in FIG. 11 can be reduced by folding and adding the characteristics (waveforms) of the POC values outside the search range and further averaging. .
  • the search range is limited based on the period information, and the information of the PCO value outside the search range is integrated into the search range, thereby reducing the influence of noise components and the like and improving the robustness. it can. That is, in the third embodiment, in the process of limiting the range in which the search for the rotation amount is performed, the relationship between the rotation amount and the similarity in the range in which the search for the rotation amount is performed, And processing for generating information on the similarity of the range to be searched.
  • a noise component (shot noise, shading, or the like) occurs when acquiring the search target image, a peak appears at a place (position b in FIG. 11) that should not exist as shown in FIG. (False peaks) may appear.
  • the presence or absence of periodicity may be determined for each peak.
  • the period (90 in this example) obtained from the period information based on the rotation amount corresponding to the position b.
  • the POC value at the position where the angle is added / subtracted (the rotation amount of the peak position ⁇ 90 °) is evaluated. If the POC value at this (peak position rotation amount ⁇ 90 °) is smaller than a predetermined threshold value, periodicity is not seen, so the peak appearing at position b is a false peak. This can be judged and excluded.
  • a peak having the next largest amplitude at a position other than the position b is searched.
  • the presence or absence of periodicity is also determined for the newly searched peak. If it is determined by this determination that there is periodicity, the position of the peak and the position corresponding to the period information are extracted as rotation amount candidates.
  • position detection processing is executed for each extracted rotation amount candidate, and the most probable result (rotation amount and corresponding position) is output as final position information.
  • whether or not the extracted peak is a false peak is determined by determining whether or not there is a periodic peak on the basis of the rotation amount indicating the extracted maximum peak. Can be judged. That is, in the fourth embodiment, with reference to the change characteristic of the similarity between the template image 18 and the search target image 16 with respect to the rotation amount, a candidate that does not satisfy the condition of periodicity information among rotation amount candidates is selected. Execute the process to be excluded. Thus, by determining the presence or absence of periodicity with respect to the extracted peak, it is possible to eliminate false peaks, thereby improving robustness.
  • FIG. 13 is a schematic diagram showing a functional configuration of the image processing apparatus 100A according to the fifth embodiment.
  • image processing apparatus 100 ⁇ / b> A according to the fifth embodiment is further added with period information calculation unit 162 compared to image processing apparatus 100 shown in FIG. 3. Since the other components have been described with reference to FIG. 3, detailed description will not be repeated.
  • the period information calculation unit 162 shown in FIG. 13 calculates the period information included in the template image using any one of the methods 1 to 3 described later.
  • Treatment example 1 As Processing Example 1, the period information calculation unit 162 performs rotation estimation between template images set by the user. The rotation estimation between the template images is performed offline, that is, before the position search process for the search target image is performed.
  • a plurality of peaks appear in accordance with the periodicity, and the periodicity included in the template image can be extracted from these peaks. More specifically, out of a plurality of appearing peaks, those whose peak value (amplitude) exceeds a predetermined threshold are extracted, and how many pixel intervals the extracted peaks occur.
  • the period information can be calculated by determining.
  • the rotation amount can be estimated in consideration of the cycle information as described in the above embodiment.
  • a sharp peak is output only at the center of the image as the POC value, making it difficult to calculate period information. For this reason, it is preferable to cause some error between the template images to be subjected to rotation estimation.
  • a method for generating such an error for example, a method of adding some noise such as random noise to any one of the template images may be employed, or one of the template images may be subjected to a smoothing filter or the like. A method of degrading an image may be adopted.
  • processing example 2 calculates a correlation value between the template image and an image generated by rotating the template image, and thereby calculates the periodicity of the template image. .
  • the period information calculation unit 162 generates a plurality of images obtained by rotating a template image set by the user by a predetermined angle (for example, by 1 °). This image generation process is executed off-line. Then, the period information calculation unit 162 uses the template image set by the user to perform position detection matching with a plurality of images generated by rotating the image by a predetermined angle, thereby obtaining a correlation value for each image. calculate.
  • the correlation value calculated for each image varies according to the periodicity. That is, a higher matching degree is shown according to the periodicity. Therefore, the period information is calculated by calculating how many rotation amounts of the peak occur from the correlation value data exceeding a predetermined threshold value among the calculated correlation values. Can be determined.
  • FIG. 14 is a more detailed functional block diagram of rotation amount estimation unit 156 and period information calculation unit 162 of the image processing apparatus according to processing example 3 of the fifth embodiment.
  • period information calculation section 162 has an axis representing the rotation amount with respect to an image (polar coordinate conversion image) obtained by polar coordinate conversion of the amplitude information of the template image (horizontal axis in the polar coordinate conversion image shown in FIG. 14).
  • frequency transformation typically, Fourier transformation
  • the process of acquiring periodicity information includes a process of performing matching (third matching) in the rotation direction between the template images 18, and a period from the period of similarity appearing in the result of the matching. Processing to determine gender.
  • the process of acquiring periodicity information includes a process of performing matching (third matching) in the rotation direction between the template images 18, and a period from the period of similarity appearing in the result of the matching. Processing to determine gender.
  • the user may arbitrarily set in addition to or instead of the automatically determined periodicity information. That is, the process of acquiring periodic information may include a process of receiving arbitrary periodic information from the user.
  • a peak position having an amplitude equal to or greater than a predetermined threshold value may be calculated, and a periodic position with respect to each peak position may be calculated.
  • Rotation amount estimation uses unstable amplitude information such as illumination fluctuations, which may increase the probability of error in rotation amount estimation.
  • robust detection is possible by performing the subsequent position detection for a plurality of rotation amount candidates.
  • a plurality of peak positions having amplitudes equal to or greater than a predetermined threshold value are calculated, and it is determined whether a periodic relationship exists for the calculated plurality of peak positions. .
  • a candidate for the amount of rotation is determined after excluding the peak position, and position detection is performed in the subsequent stage. This process means that the maximum peak position that matches the period information is calculated.
  • FIG. 15 is a diagram for explaining a rotation amount estimation process according to the seventh embodiment.
  • the peak (1) shown in FIG. 15 shows the maximum peak value, and the peaks (2) to (4) show peak values exceeding a predetermined threshold value (horizontal broken line). .
  • the peaks (1) to (4) shown in FIG. 15 are extracted as candidates for rotation amount estimation.
  • the probability of the peak is determined using the period information in order from the maximum peak.
  • the determination of the probability does not necessarily need to be performed in order from the maximum peak, and the order is arbitrary. For example, it may be performed in order from the peak located on the left side shown in FIG. 15, or may be performed in order from the peak located on the right side.
  • period information A here, 90 ° as an example.
  • the length corresponding to 90 ° is indicated by an arrow
  • the peak of (1) is excluded from the candidates.
  • the peak of (2) using the period information B (here, also 90 °), it is determined whether or not there is a peak exceeding the threshold at the corresponding position. to decide.
  • the peak (3) exists at a position that is exactly 90 ° away from the peak (2), the peak (2) is left as a candidate because it is likely.
  • the probability of each peak is determined for all peaks exceeding a predetermined threshold (except for a peak paired with another peak such as the peak in (3)).
  • the probabilities may be judged in order from the highest peak value, and the remaining peaks may be excluded when at least one peak matching the period information is found. .
  • the processing example using the POC method as the position detection method has been described.
  • any method capable of performing position detection between images may be employed.
  • a technique capable of detecting a position such as a SAD (Sum of Absolute Difference) method can be employed.
  • the SAD method is a method of evaluating the similarity by calculating the sum of absolute values of differences for each pixel between the template image and the search target image.
  • the rotation amount of the template image is optimized in the rotation amount correction process, it is possible to use a technique that is somewhat inferior if only final candidates are narrowed down.
  • the SAD method has a smaller calculation load than the POC method, the processing speed can be increased.
  • the present embodiment includes the following aspects.
  • the image processing apparatus uses means for acquiring a template image and a search target image, means for acquiring periodicity regarding the rotation direction of amplitude information of the acquired image, and amplitude information and periodicity of the template image and search target image.
  • the image processing apparatus is configured to limit a search range for estimating the relative rotation amount based on the periodicity information, and to estimate a relative rotation amount from the limited search range; Means for estimating a plurality of relative rotation amounts based on the estimated relative rotation amount and periodicity information.
  • the image processing apparatus includes means for integrating the correlation value in the limited search range and the correlation value outside the search range.
  • the image processing apparatus includes means for excluding, from the estimation result, a rotation amount that does not match the periodicity information with respect to the estimated plurality of relative rotation amounts.
  • the means for acquiring periodicity is set by the user when creating the template.
  • the means for acquiring the periodicity performs a process for estimating the rotation amount between the templates set by the user, and calculates the periodicity from the obtained correlation value.
  • the RIPOC method in an algorithm that first estimates the amount of deviation in the rotational direction and then executes a position search, it is important to estimate the amount of deviation in the first rotational direction.
  • the amplitude information of the image has periodicity in the rotation direction, it is impossible to accurately determine which rotation amount is the correct shift amount, and there is a possibility of estimating an incorrect rotation amount.
  • the amount of rotation unrelated to the periodicity is estimated due to the influence of noise on the image. Therefore, in the position detection method considering the rotation direction of the image, it is possible to improve the robustness and accuracy in the initially calculated rotation amount estimation using the periodicity of the rotation direction of the image.

Landscapes

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

Abstract

 画像処理方法は、テンプレート画像および探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得するステップと、テンプレート画像と探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、第1のマッチングの結果と周期性の情報とに基づいて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定するステップと、回転量の候補の各々を用いて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成するステップと、画像の組の各々で位置についての第2のマッチングを行なうとともに、第2のマッチングの結果のうち相対的に確度の高い結果を出力するステップとを含む。

Description

画像処理方法、画像処理装置および画像処理プログラム
 本発明は、テンプレート画像を用いたテンプレートマッチングに係る画像処理方法、画像処理装置および画像処理プログラムに関する。
 予め登録されたテンプレート画像を用いて、探索対象画像の中から当該テンプレート画像に対応する位置を検出する手法(テンプレートマッチング)が実用化されている。テンプレートマッチングの一手法として、位相限定相関法(Phase-Only Correlation:以下「POC法」とも」とも称す。)がしばしば用いられる。POC法は、画像に含まれる空間周波数の位相差情報を用いて画像間の対応点を探索する手法である。位相差情報を用いることで、照明変動などに対するロバスト性を高めることができる。
 一般的なPOC法では、テンプレート画像と探索対象画像との間には、回転方向の変化がないことを前提にしている。そのため、予めテンプレート画像として登録されたオブジェクトが、探索対象画像内で回転している場合には、位置を正確に検出することができない。このような光軸周りの回転変位(回転方向の変化)が生じ得る場合には、POC法を拡張した手法として、回転不変位相限定相関法(Rotation Invariant Phase Only Correlation:以下「RIPOC法」とも」とも称す。)を採用することで対処可能である。
 RIPOC法では、先に、テンプレート画像および探索対象画像に含まれる振幅情報を利用して画像間の回転量(回転変位)を推定し、その推定した回転量でテンプレート画像または探索対象画像のいずれか一方を補正する。続いて、その補正されたテンプレート画像または探索対象画像を利用して、対応する位置を検出する。このような二段階の処理を経ることで、対象のオブジェクトが回転し得るような場合であっても、対応する位置を正確に検出できる。
 例えば、特開平10-124667号公報(特許文献1)は、RIPOC法を利用したパターン照合装置を開示する。このパターン照合装置は、振幅情報を極座標変換した画像から回転量を推定し、テンプレート画像を補正した後に位置の推定を行なう。
 また、特開平10-206134号公報(特許文献2)は、与えられた入力画像内の対象図形について画像内に設定した基準位置からの回転角度を求める画像処理による位置検出方法を開示する。この位置検出方法では、探索対象画像に対して、複数の回転角度で回転させたテンプレートとのマッチングをとって、最も類似度が高いテンプレートとそのテンプレートで見つけた位置から対象物の回転角度と位置を推定する。
特開平10-124667号公報 特開平10-206134号公報
 上述の特許文献1などに開示されるRIPOC法は、回転方向の変動などに対しても高いロバスト性を有しているが、前段の画像間の回転量(回転変位)の推定に失敗すると、画像を適切に補正することができないため、後段での位置検出がうまく機能しない。例えば、回転方向に周期性を有する画像では、回転量(回転変位)の推定を正しく実行できることが保障されないため、後段の位置検出が正しく実行されない可能性がある。また、上述の特許文献2に開示される位置検出方法では、複数の回転角度のすべてについてマッチングを行なう必要があるので、多くの演算時間を要する。
 本発明の目的は、テンプレート画像を用いたテンプレートマッチングにおいて、よりロバスト性を高めつつ、処理をより高速化できる画像処理方法、画像処理装置および画像処理プログラムを提供することである。
 本発明のある局面に従えば、テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理方法が提供される。画像処理方法は、テンプレート画像および探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得するステップと、テンプレート画像と探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、第1のマッチングの結果と周期性の情報とに基づいて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定するステップと、回転量の候補の各々を用いて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成するステップと、画像の組の各々で位置についての第2のマッチングを行なうとともに、第2のマッチングの結果のうち相対的に確度の高い結果を出力するステップとを含む。
 好ましくは、回転量の候補を複数決定するステップは、周期性の情報に基づいて、回転量の探索を行なう範囲を限定するステップを含む。
 さらに好ましくは、回転量の探索を行なう範囲を限定するステップは、回転量の探索を行なう範囲における回転量と類似度との関係を、回転量の探索を行なう範囲外における回転量と類似度との関係で補正することで、探索を行なう範囲の類似度の情報を生成するステップを含む。
 好ましくは、回転量の候補を複数決定するステップは、第1のマッチングにより決定された回転量に対して、周期性の情報を示す回転量を加算および/または減算することで、回転量の候補を決定するステップを含む。
 好ましくは、回転量の候補を複数決定するステップは、テンプレート画像と探索対象画像との類似度の回転量に対する変化特性を参照して、回転量の候補のうち、周期性の情報の条件を満たさない候補を除外するステップを含む。
 好ましくは、周期性の情報を取得するステップは、テンプレート画像の生成時に、ユーザーが設定した周期性の情報を受け付けるステップを含む。
 好ましくは、周期性の情報を取得するステップは、テンプレート画像同士で回転方向についての第3のマッチングを行なうステップと、第3のマッチングの結果に現われる類似度の周期から周期性を決定するステップとを含む。
 好ましくは、周期性の情報を取得するステップは、ユーザーから任意の周期性の情報を受け付けるステップを含む。
 本発明の別の局面に従えば、テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理装置が提供される。画像処理装置は、テンプレート画像および探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得する周期情報取得部と、テンプレート画像と探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、第1のマッチングの結果と周期性の情報とに基づいて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定する回転量推定部と、回転量の候補の各々を用いて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成する画像補正部と、画像の組の各々で位置についての第2のマッチングを行なうとともに、第2のマッチングの結果のうち相対的に確度の高い結果を出力する位置検出部とを含む。
 本発明のさらに別の局面に従えば、テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理プログラムが提供される。画像処理プログラムはコンピューターに、テンプレート画像および探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得するステップと、テンプレート画像と探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、第1のマッチングの結果と周期性の情報とに基づいて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定するステップと、回転量の候補の各々を用いて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成するステップと、画像の組の各々で位置についての第2のマッチングを行なうとともに、第2のマッチングの結果のうち相対的に確度の高い結果を出力するステップとを実行させる。
 本発明によれば、テンプレート画像を用いたテンプレートマッチングにおいて、よりロバスト性を高めつつ、処理をより高速化できる。
本実施の形態に従うテンプレートマッチングの適用例を示す模式図である。 本実施の形態に従うテンプレートマッチングをパーソナルコンピューターにより実現した場合の構成を示すブロック図である。 実施の形態1に従う画像処理装置の機能構成を示す模式図である。 実施の形態1に従う画像処理装置の回転補正部における回転補正処理の概要を説明するための模式図である。 実施の形態1に従う画像処理装置の回転量推定部のより詳細な機能ブロック図である。 POC法のアルゴリズムを示す模式図である。 図6に示す一般的なPOC法に従って算出されたPOC値の一例を示す図である。 実施の形態1に従う画像処理装置の回転補正部による回転補正処理の結果例を示す図である。 実施の形態1に従う位置検出処理の全体手順を示すフローチャートである。 実施の形態2に従う回転量推定の処理を説明するための図である。 画像にノイズ成分が含まれている場合に生じる回転量に対するPOC値の変化の一例を示す図である。 実施の形態3に従う回転量推定の処理を説明するための図である。 実施の形態5に従う画像処理装置の機能構成を示す模式図である。 実施の形態5の処理例3に従う画像処理装置の回転量推定部および周期情報算出部のより詳細な機能ブロック図である。 実施の形態7に従う回転量推定の処理を説明するための図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰り返さない。
 [A.概要]
 本実施の形態によれば、テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理方法、画像処理装置、および画像処理プログラムが提供される。この処理では、テンプレート画像および探索対象画像の少なくとも一方についての、回転方向の周期性の情報が取得される。また、テンプレート画像と探索対象画像との間で回転方向についての第1のマッチングが実行される。すなわち、画像間の回転方向の相対的なずれ(回転量)が推定される。
 その上で、第1のマッチングの結果と周期性の情報とに基づいて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補が複数決定される。そして、回転量の候補の各々を用いて、テンプレート画像と探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成し、画像の組の各々で位置についての第2のマッチングを行なう。つまり、回転量補正についての複数の候補を用意しておき、各候補について、位置探索が実行される。そして、第2のマッチングの結果のうち相対的に確度の高い結果が最終結果として出力される。
 [B.システム構成]
 まず、本実施の形態に従うテンプレート画像を用いたテンプレートマッチングの機能を有する画像処理装置の実装例について説明する。
 《b1:適用例》
 図1は、本実施の形態に従うテンプレートマッチングの適用例を示す模式図である。図1を参照して、本実施の形態に従うシステム1は、一例として、ベルトコンベア3を含む生産ラインに適用される。システム1において、ワーク2はベルトコンベア3上を連続的に搬送されるとともに、ワーク2をカメラ10により撮影することで、ワーク2の外観(以下「オブジェクト」とも称す。)を含む画像(以下「探索対象画像16」とも称す。)が取得される。
 探索対象画像16は、画像処理装置100へ伝送される。画像処理装置100は、予め登録されたテンプレート画像18を用いて探索対象画像16に含まれるワーク2の位置検出を実行する。画像処理装置100は、このテンプレートマッチングによって得られた、回転量および倍率などの情報を含む位置情報を出力する。
 《b2:パーソナルコンピューターによる実現例》
 図2は、本実施の形態に従うテンプレートマッチングをパーソナルコンピューターにより実現した場合の構成を示すブロック図である。図2を参照して、パーソナルコンピューターにより実現される画像処理装置100は、主として、汎用的なアーキテクチャーを有するコンピューター上に実装される。画像処理装置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)、および、テンプレート画像18などを格納する。ハードディスク110には、オペレーティングシステムなどのプログラムがさらに格納されてもよい。
 表示部120は、オペレーティングシステムが提供するGUI(Graphical User Interface)画面やテンプレートマッチング実行プログラム112の実行によって生成される画像などを表示する。入力部122は、典型的には、キーボード、マウス、タッチパネルなどからなり、ユーザーから受け付けた指示の内容をCPU102などへ出力する。
 メモリーカードインターフェイス124は、SD(Secure Digital)カードやCF(Compact Flash(登録商標))カードなどの各種メモリーカード(不揮発性記録媒体)126との間で、データの読み書きを行なう。カメラインターフェイス128は、被写体を撮影することで取得される、探索対象画像16を生成するための画像をカメラ10から取り込む。カメラ10は、画像を取得するための画像取得手段として機能する。但し、画像処理装置100本体が被写体を撮影する機能を有していなくともよい。この場合には、典型的には、何らかの装置で取得した各種画像を格納したメモリーカード126を介して、必要な画像が取り込まれる。すなわち、メモリーカードインターフェイス124にメモリーカード126が装着され、メモリーカード126から読み出された各種画像は、ハードディスク110などへ格納(コピー)される。
 ハードディスク110に格納される、テンプレートマッチング実行プログラム112は、CD-ROM(Compact Disk-Read Only Memory)などの記録媒体に格納されて流通し、あるいは、ネットワークを介してサーバー装置などから配信される。テンプレートマッチング実行プログラム112は、画像処理装置100(パーソナルコンピューター)で実行されるオペレーティングシステムの一部として提供されるプログラムモジュールのうち必要なモジュールを、所定のタイミングおよび必要な順序で呼出して処理を実現する。この場合、テンプレートマッチング実行プログラム112自体は、オペレーティングシステムによって提供されるモジュールは含まず、それに代えて、オペレーティングシステムと協働して画像処理を実現する。テンプレートマッチング実行プログラム112は、単体のプログラムではなく、何らかのプログラムの一部に組み込まれて提供されてもよい。このような場合にも、プログラム自体には、他のプログラムと共通に利用されるようなモジュールは含まれず、それに代えて、当該他のプログラムと協働して画像処理が実現される。このような一部のモジュールを含まないテンプレートマッチング実行プログラム112であっても、本実施の形態に従う画像処理装置100の趣旨を逸脱するものではない。
 さらに、テンプレートマッチング実行プログラム112によって提供される機能の一部または全部を専用のハードウェアによって実現してもよい。
 《b3:その他の構成による実現例》
 上述したパーソナルコンピューターにより実現する例に加えて、例えば、デジタルカメラ、携帯電話、あるいはスマートフォン上に実装してもよい。さらに、少なくとも1つのサーバー装置が本実施の形態に従う処理を実現する、いわゆるクラウドサービスのような形態であってもよい。この場合、ユーザーは、自身の端末(パーソナルコンピューターやスマートフォンなど)を用いて、少なくとも2つの処理対象画像をサーバー装置(クラウド側)へ送信し、当該送信された処理対象画像に対して、サーバー装置側が本実施の形態に従う画像処理を行なうような構成が想定される。但し、サーバー装置側がすべての機能(処理)を行なう必要はなく、ユーザー側の端末とサーバー装置とが協働して、本実施の形態に従う画像処理を実現するようにしてもよい。
 [C.実施の形態1]
 《c1:全体構成》
 図3は、実施の形態1に従う画像処理装置100の機能構成を示す模式図である。図3を参照して、実施の形態1に従う画像処理装置100は、テンプレート画像18と探索対象画像16との間で回転方向の変化(回転量)を推定し、テンプレート画像18および探索対象画像16の少なくとも一方を補正する。画像処理装置100は、この回転方向の変化の補正を行なった上で、画像間のマッチング処理によって画像間の対応する位置を検出する。説明の便宜上、以下の説明においては、探索対象画像16を回転させることで回転補正を行なう場合の処理を例示する。もちろん、テンプレート画像18に対して回転補正するようにしてもよい。
 より具体的には、画像処理装置100は、その機能構成として、テンプレート保持部150と、画像取得部152と、回転補正部154と、位置検出部160とを含む。
 テンプレート保持部150は、予め用意されたテンプレート画像18を保持する。テンプレート保持部150は、テンプレート画像18を予め登録する。テンプレート画像18は、テンプレートマッチングの目的などに応じて、ユーザーなどが任意に作成および/または設定する。ユーザーなどによって予め用意されたテンプレート画像18は、任意の記録媒体または通信媒体を介して画像処理装置100へ取得され、つまりファイル入力などによって読み込まれ、テンプレート保持部150で保持される。もちろん、カメラ10により撮影された画像の全部または一部を用いて、テンプレート画像18を作成してもよい。テンプレート保持部150が保持するテンプレート画像18は、後述する回転量推定処理および位置検出処理において用いられる。
 画像取得部152は、任意の方法で、テンプレートマッチングの対象になる探索対象画像16を取得する。典型的には、画像取得部152は、カメラ10が被写体を撮影することで生成される探索対象画像16を取得する。もちろん、探索対象画像16の取得方法としては、カメラ10からの入力方法に限られず、予め撮影された探索対象画像16を、任意の記録媒体または通信媒体を介して取得する、つまりファイル入力してもよい。
 取得される探索対象画像16は、1枚であることもあるし、連続的に撮影された複数枚であってもよい。カメラ10との連係方法として、カメラ10が所定周期で画像取得しており(動画像の取り込みをしており)、その連続的に取得される画像がフレームバッファに一次的に保存される。そして、何らかのトリガー(ユーザーによるレリーズ、所定時間経過後に自動撮影、別の認識処理によるトリガー)が発生することによって、フレームバッファに保存されている画像のうち対応する画像が取得されて、処理されるような場合もある。
 回転補正部154は、テンプレート画像18と探索対象画像16との間の相対的な回転量を推定するとともに、その推定された相対的な回転量でテンプレート画像18および探索対象画像16の少なくとも一方を回転補正する。上述したように、実施の形態1に従う画像処理装置100は、探索対象画像16に対して回転補正を行なう。より具体的には、回転補正部154は、回転量推定部156と、画像補正部158とを含む。
 回転量推定部156は、テンプレート画像18と探索対象画像16との間の相対的な回転量のずれを推定するとともに、画像間にある回転方向の変位量の候補を複数推定する。すなわち、回転量推定部156は、テンプレート画像18と探索対象画像16との間で回転方向についてのマッチング(第1のマッチング)を行なうとともに、回転方向についてのマッチング(第1のマッチング)の結果と周期性の情報とに基づいて、テンプレート画像18と探索対象画像16との間の回転方向の相対的なずれを補正する回転量の候補を複数決定する。この相対的な回転量の推定のロジックとしては、各種の方法を採用することができるが、本実施の形態においては、POC法を用いて回転量を推定する。
 画像補正部158は、回転量推定部156によって推定された複数の回転量に基づいて、テンプレート画像18または探索対象画像16を補正して、複数の補正後画像(以下の説明では、探索対象画像16に対して回転補正する)を生成する。すなわち、画像補正部158は、回転量の候補の各々を用いて、テンプレート画像18と探索対象画像16との間の回転方向の相対的なずれを補正した画像の組を複数生成する。
 回転補正は、アフィン変換を用いて一方の画像を相対的に回転させることで実現する。アフィン変換は、補間処理を含むが、この補間処理は、Bi-linear法やCubicConvolution法といった公知の補間方法を採用することができる。
 回転補正部154における回転補正処理の詳細については、後述する。
 位置検出部160は、回転補正によって生成されるそれぞれの補正後画像を用いて、対応する位置を検出するための処理を実行する。すなわち、位置検出部160は、画像補正部158によって生成された画像の組の各々で位置についての位置検出処理(第2のマッチング)を行なうとともに、位置検出処理の結果のうち相対的に確度の高い結果を出力する。
 位置検出のロジックとしては、各種の方法を採用することができるが、本実施の形態においては、POC法を用いた位置検出を採用する。本実施の形態においては、周期情報を利用して複数の回転量が候補として推定され、回転量の各候補について位置検出が実行される。位置検出部160は、最も確からしい結果を最終的な位置情報として出力する。この位置検出部160での位置検出処理の詳細については、後述する。
 《c2:回転補正処理》
 次に、上述した回転補正処理の詳細について説明する。図4は、実施の形態1に従う画像処理装置100の回転補正部154における回転補正処理の概要を説明するための模式図である。
 本実施の形態においては、テンプレート画像18の回転方向の周期性に着目して、回転補正処理に用いる回転量の候補を複数推定する。これらの推定された複数の回転量の各々を用いて、後段の位置検出処理を行なうことで、位置検出のロバスト性を高める。
 図4を参照して、まず、テンプレート画像18と探索対象画像16との間で、相対的な回転量のずれが検出される。具体的には、テンプレート画像18と探索対象画像16との間の相対的な回転量を順次変更しつつ、画像間の類似度を算出する。すなわち、テンプレート画像18と探索対象画像16との間で、回転方向に関するマッチング処理が実行される。このマッチング処理としては、任意の手法を採用できるが、本実施の形態においては、POC法を採用する。POC法を採用した場合には、類似度としてPOC値が算出される。
 例えば、図4に示すようなテンプレート画像18と探索対象画像16との間では、探索対象画像16の回転量に応じて、参照符号30に示すようなPOC値が算出される。すなわち、テンプレート画像18および探索対象画像16に示すような格子状のオブジェクトは、周期性を有しており、POC値(類似度)も90°の周期でピークが現われる。
 そこで、参照符号30に示すようなPOC値の特性にピークが現われると、そのピーク位置に対応する角度を補正すべき回転量の候補の一つとして決定するとともに、決定した回転量の候補を周期情報に基づいて補正することで、他の一つ以上の回転量の候補を決定する。ここで、周期情報は、テンプレート画像18および探索対象画像16の少なくとも一方についての、回転方向の周期性の情報である。周期情報の取得方法の詳細については、後述する。
 より具体的には、周期情報を予め取得しておき、最大ピークを示す回転量θに加えて、回転量θ±(周期情報に応じた回転量)を回転補正の候補として決定する。例えば、周期情報が90°であり、最大ピークを示す回転量θ=-10°である場合、回転量θ=-10°に加えて、回転量θ=80°(-10°+90°=80°)の合計2つを推定結果として出力する。そして、それぞれの推定結果に応じて探索対象画像16を補正することで、補正後画像16Aおよび16Bが生成される。これらの補正後画像16Aおよび16Bを用いて、後段の位置検出処理が実行される。すなわち、画像の組を複数生成する処理は、回転方向についてのマッチング(第1のマッチング)により決定された回転量に対して、周期性の情報を示す回転量を加算および/または減算することで、回転量の候補を決定する処理を含む。
 なお、回転量の推定結果としては、回転量θ=-100°(-10°-90°=-100°)も候補になり得るが、POC法を用いた場合は、-90°から90°の範囲までしか検出できないので、回転量θ=-100°は仕様範囲外として除外される。
 図5は、実施の形態1に従う画像処理装置100の回転量推定部156のより詳細な機能ブロック図である。図5を参照して、回転量推定部156は、その機能構成として、周波数変換部1561,1562と、対数化部1563,1564と、極座標変換部1565,1566と、POC処理部1567と、候補生成部1568とを含む。
 周波数変換部1561および1562は、それぞれテンプレート画像18および探索対象画像16に含まれる周波数成分(振幅成分および位相成分)を算出する。回転量推定の処理においては、位相成分ではなく振幅成分を用いる。ここで、テンプレート画像18および探索対象画像16は、互いに同じサイズであるとする。
 対数化部1563および極座標変換部1565は、テンプレート画像18についての振幅成分を対数化するとともに、極座標画像へ変換する。同様に、対数化部1564および極座標変換部1566は、探索対象画像16についての振幅成分を対数化するとともに、極座標画像へ変換する。このような極座標画像への変換によって、回転量が2次元座標上の座標点として表現される。ここで、極座標画像の横方向の座標が回転量に相当する。
 POC処理部1567は、極座標変換部1565および1566からそれぞれ出力される極座標画像間について、類似度および平行移動量(回転量に相当)を算出する。POC処理部1567で算出される類似度は、相関値またはPOC値とも称される。
 図6は、POC法のアルゴリズムを示す模式図である。図6を参照して、POC処理部1567は、基準ウィンドウ設定部1571と、参照ウィンドウ設定部1572と、周波数変換部1573,1574と、位相情報取出部1575,1576と、位相差算出部1577と、周波数逆変換部1578とを含む。
 基準ウィンドウ設定部1571および参照ウィンドウ設定部1572は、テンプレート画像(極座標変換画像)および探索対象画像(極座標変換画像)に対して、それぞれウィンドウを設定する。
 周波数変換部1573は、テンプレート画像上に設定された基準ウィンドウに対して、周波数変換(典型的には、フーリエ変換)を行なうことで、その中に含まれる画像情報を周波数空間の情報へ変換する。同様に、周波数変換部1573は、探索対象画像上に設定された参照ウィンドウに対して、周波数変換(典型的には、フーリエ変換)を行なうことで、その中に含まれる画像情報を周波数空間の情報へ変換する。これらの変換された周波数空間の情報は、周波数毎の振幅情報および位相情報を含む。すなわち、周波数変換部1573および1574は、それぞれのウィンドウに含まれる部分画像に対して周波数分解を行なう。
 例えば、ウィンドウサイズがN×Mの場合、横方向の周波数の全域は、直流成分と周波数F1~Fx_max=(N-1)/2(但し、Nは奇数サイズとする)の交流成分で表され、縦方向の周波数の全域は、直流成分と周波数F1~Fy_max=(M-1)/2(但し、Mは奇数サイズとする)で表される。なお、実際には、交流成分は、N個またはM個存在するが、直流成分を中心とした対称的な情報を有するので、有意な情報としては、Fx_max×Fy_max個しか存在しない。
 一般的な周波数変換の計算結果は、実部および虚部を含む複素数形式で出力される。典型的には、(1)式に従って、周波数変換が実行される。
Figure JPOXMLDOC01-appb-M000001
 すなわち、周波数情報は、実部Re(u,v)および虚部Im(u,v)を含む複素数形式で出力される。また、実部および虚部の値を用いて、振幅情報A(u,v)および位相情報θ(u,v)に変換できる。
 振幅情報および位相情報と、実部および虚部を含む複素数表現との関係式は、(2)式のようになる。
Figure JPOXMLDOC01-appb-M000002
 なお、周波数変換の結果は、振幅と位相とを組み合わせた形式で保存してもよいし、実部と虚部とを組み合わせた形式で保存してもよい。
 位相情報取出部1575および1576は、それぞれ周波数変換部1573および1574から出力される周波数変換の結果(典型的には、複素数形式)を用いて、基準ウィンドウおよび参照ウィンドウについての位相情報をそれぞれ抽出する。
 位相差算出部1577は、位相情報取出部1575,1576によりそれぞれ抽出されたウィンドウについての位相情報の差を算出する。つまり、位相差算出部1577は、位相差情報を生成する。
 周波数逆変換部1578は、位相差算出部1577によって算出された位相差情報に対して周波数逆変換を行なうことで、それぞれ設定されているウィンドウに含まれる部分画像間の類似度を示すPOC値を算出する。このPOC値を算出する処理は、参照ウィンドウ設定部1572がテンプレート画像上に設定する参照ウィンドウの位置を更新する毎に繰り返し実行される。
 図7は、図6に示す一般的なPOC法に従って算出されたPOC値の一例を示す図である。図7には、図4に示すテンプレート画像18および探索対象画像16から得られたPOC値の算出結果の一例を示す。図7に示す算出結果においては、2つのピークが現われている。これは、図4に示すテンプレート画像18および探索対象画像16が格子状のオブジェクトであることに起因している。すなわち、テンプレート画像18および探索対象画像16のそれぞれに含まれる振幅成分は、図7に示すように十字状になり、これによって、位相成分で考えた場合には、回転量θとθ±90°との間で区別ができず、その結果、POC法によって算出されるPOC値(相関値)についても、複数のピークが現われることになる。
 なお、POC法では、回転量θとθ±180°との間についても区別ができないが、公知のRIPOC法の仕様としては、テンプレート画像を基準として±90°の範囲でのみ探索するので、180°回転については考慮する必要はない。但し、通常の仕様と異なり、90°を超えて回転させる場合には、参考文献(Gerhard X. Ritter, Joseph N. Wilson, "Handbook of Computer Vision Algorithms in Image Algebra", 1996.5.1)などを参照されたい。
 このように、テンプレート画像18および探索対象画像16の内容によっては、複数のピークが現われる。公知のRIPOC法では、最大ピークに対応する回転量を回転変動量として推定する。そのため、複数のピークが生じた場合には、いずれのピークが真に正しい回転量を示しているのかを正確に判断することはできない。
 上述したように、本実施の形態においては、このようなロバスト性を低下させる要因を排除するために、画像に含まれる回転方向の周期性に着目して、回転量推定の段階においては、回転量の候補を複数推定する。
 そこで、図5に示す回転量推定部156の候補生成部1568は、POC法に従って算出された最大ピークを示す回転量θと併せて、回転量θ±(周期情報に基づく回転量)を回転量の候補として推定する。上述したように、例えば、周期情報が90°であり、最大ピークを示す回転量θ=-10°である場合、回転量θ=-10°に加えて、回転量θ=80°(-10°+90°=80°)の合計2つを推定結果として出力する。そして、それぞれの推定結果に応じて探索対象画像がそれぞれ補正される。
 図8は、実施の形態1に従う画像処理装置100の回転補正部154による回転補正処理の結果例を示す図である。図8に示すように、テンプレート画像18と探索対象画像16との間にある回転方向の変動量、および周期情報に基づいて、探索対象画像16が複数の回転量の候補で補正されて、補正後画像16Aおよび16Bが生成される。補正後画像16Aおよび16Bのそれぞれを用いて、位置探索処理が実行される。
 《c3:周期情報》
 周期情報は、各種の方法を用いて取得することができる。典型的には、テンプレート画像に含まれる周波数成分(振幅成分および位相成分)を算出し、この周波数成分の周期性から周期情報を決定してもよい。より具体的には、ユーザーは、テンプレート画像18を作成する際、その画像特徴からどのような周期性があるかを知ることができる。具体的には、テンプレート画像18に対して周波数変換を行なって振幅情報を抽出することで、図5に示す対数化処理後の画像にあるような画像を得ることができる。このような画像を見ることで、ユーザーは、回転方向にどのような周期性があるかを確認することができる。
 このように周期性を確認した上で、ユーザーは、その周期性を周期情報として画像処理装置100へ与えることができる。すなわち、周期性の情報を取得する処理としては、テンプレート画像18の生成時に、ユーザーが設定した周期性の情報を受け付ける処理を含む。
 《c4:位置検出処理》
 次に、上述した位置検出処理の詳細について説明する。
 上述したように、本実施の形態においては、複数の回転量の候補のそれぞれで探索対象画像を補正し、補正後のそれぞれの画像を用いて、位置検出を行なう。そして、位置検出の結果から、最も確からしい結果を最終的な位置情報として出力する。
 上述の図8に示す例(周期情報が90°であり、最大ピークを示す回転量θ=-10°である場合、回転量θ=-10°,80°の2つを回転量推定の結果が出力される)、回転量θ=-10°の補正を行なった場合の位置検出結果と、回転量θ=80°の補正を行なった場合の位置検出結果とが得られる。
 図3に示す画像処理装置100の位置検出部160は、これらの位置検出結果に付随する最大ピークの大きさを比較することで、いずれかの位置検出結果が確からしいかを判断する。
 図8に示すように、探索対象画像16を-10°および80°でそれぞれ補正することで、補正後画像16Aおよび16Bが得られる。探索対象画像16を80°補正して得られる補正後画像16Bは、テンプレート画像18と見え方が異なるため、最大ピークの値が小さくなり、位置検出結果の精度が高くないと判断される可能性が高い。これに対して、探索対象画像16を-10°補正して得られる補正後画像16Aは、テンプレート画像18とほぼ同じ見え方であるので、最大ピークの値が高くなり、正確に位置を検出することが可能になる。
 《c5:処理手順》
 次に、本実施の形態に従う位置検出処理の全体手順について説明する。図9は、実施の形態1に従う位置検出処理の全体手順を示すフローチャートである。図9に示す各ステップは、典型的には、CPU102がテンプレートマッチング実行プログラム112(いずれも図2)を実行するなどして実現される。
 図9を参照して、まず、CPU102は、テンプレート画像を取得する(ステップS100)。このテンプレート画像の取得は、基準となるワークをカメラ10により撮影して得られる画像からユーザーが切り出してもよいし、ワーク2の設計データなどから生成された画像を取得するようにしてもよい。続いて、CPU102は、周期情報を取得する(ステップS102)。この周期情報は、テンプレート画像に関連付けて外部から取得してもよいし、テンプレート画像に含まれる画像情報に基づいて、ユーザーが設定してもよい。ステップS100およびS102において、本実施の形態に従うテンプレートマッチングに必要な情報が収集される。
 続いて、CPU102は、探索対象画像を取得する(ステップS104)。典型的には、CPU102は、カメラ10によりワーク2をカメラにより撮影して、探索対象画像を取得する。あるいは、別のカメラなどでワークを撮影して得られた画像を探索対象画像として取り込むようにしてもよい。ステップS104の処理を何らかのトリガーの発生を条件にして実行するようにしてもよい。例えば、ベルトコンベア3上に配置されたセンサーがワーク2の到着を検知したことを条件にして、カメラ10により当該ワーク2を撮影するようにしてもよい。
 続いて、CPU102は、テンプレート画像と探索対象画像との間で回転方向の変化(回転量)を推定する(ステップS106)。より具体的には、図5に示すように、CPU102は、それぞれの画像に対して、周波数変換、対数化処理、極座標変換を行なった上で、POC法を用いて回転量を推定する。この回転量推定において、CPU102は、最も高い類似度(相関値)を示す回転量を決定する。そして、CPU102は、ステップS106において決定した回転量から、周期情報を利用して回転量の候補を推定する(ステップS108)。より具体的には、CPU102は、ステップS106において推定した回転量に周期情報を示す回転量を加算/減算して、回転量の候補を決定する。
 続いて、CPU102は、複数の候補の回転量を用いて、探索対象画像16をそれぞれ回転させて複数の補正後画像を生成する(ステップS110)。そして、CPU102は、テンプレート画像18を用いて生成された複数の補正後画像の各々との間で位置検出を実行する(ステップS112)。より具体的には、CPU102は、典型的には、POC法を用いて画像間の対応する位置を探索する。最終的に、CPU102は、ステップS112において実行された位置検出の結果のうち、最も高い類似度(相関値)を示す結果を最終的な位置情報として出力する(ステップS114)。すなわち、CPU102は、複数の候補の回転量を用いて実行した位置探索の結果のうち、最も確からしい結果を最終的な位置情報として出力する。そして、処理は終了する。
 《c6:利点》
 本実施の形態によれば、回転補正に係る回転量を正確に求めることができない場合でも、画像の回転方向の周期性を利用することで、複数の回転量の候補を推定し、各候補を用いて位置検出を実行する。そして、位置検出結果から最適な回転量および対応する位置ずれ量を決定することで、よりロバスト性および正確性の高い位置検出を実現できる。
 [D.実施の形態2]
 上述の実施の形態1においては、回転量推定の処理において、テンプレート画像18および探索対象画像16に含まれる振幅成分を用いてPOC値(類似度)を算出し、最大ピークを示す回転量を決定するとともに、当該決定した最大ピークに対応する回転量を基準として、周期情報から1または複数の回転量の候補を推定する。この回転量推定の処理におけるPOC値(類似度)の探索処理では、基本的には、すべての回転量についてPOC値(類似度)を算出する必要がある。一方で、周期情報が取得されている場合には、ピークが現われる周期が予め予測できるので、周期情報からPOC値(類似度)の探索範囲を限定できる。
 実施の形態2においては、このような周期情報を用いて、回転量推定の処理をより効率的に実行する処理について説明する。この回転量推定の処理以外の部分については、上述の実施の形態1と同様であるので、詳細な説明は繰り返さない。
 図10は、実施の形態2に従う回転量推定の処理を説明するための図である。図10には、回転量に対するPOC値の変化を模式的に一次元で表したものである。図10に示す例では、回転量が0°,-90°,90°の合計3ヶ所にそれぞれピークが現われている。
 ここで、周期情報が90°であると予めわかっている場合には、0°を中心として±45°の範囲だけを探索すればよい。すなわち、0°を中心として±45°の範囲を探索することで、0°の位置にあるピークを特定できる。そして、特定された0°の位置を基準として、周期情報を用いて、残りの-90°および90°の位置にピークがあることを推定できる。
 別の例として、テンプレート画像18に対して探索対象画像16が40°回転している場合には、40°および-50°の2ヶ所にそれぞれピークが現われることになり、探索対象画像が60°回転している場合には、60°および-30°の2ヶ所にそれぞれピークが現われることになる。いずれの場合についても、必ず±45°の範囲(探索範囲)内に、少なくとも1つのピークが存在することになるので、探索範囲を限定してピークを探索することができる。
 原理的には、周期情報αが得られている場合には、探索範囲を±(α/2)に限定すればよい。もちろん、ロバスト性を高めるために、尤度βを用いて、探索範囲を±(α/2+β)としてもよい。
 上述の実施の形態1では、振幅情報に対してPOC値を算出し、POC値の中から最大のピーク位置を探索し、この探索された最大ピーク位置に対応する回転量を基準に周期情報から複数の回転量の候補が推定される。これに対して、実施の形態2においては、周期情報からピーク位置を探索する範囲(探索範囲)を限定する。すなわち、実施の形態2においては、テンプレート画像18と探索対象画像16との間で回転方向についてのマッチング(第1のマッチング)は、周期性の情報に基づいて、回転量の探索を行なう範囲を限定する処理を含む。このような周期情報から探索範囲を限定する処理を採用することで、演算負荷を低減できる。
 [E.実施の形態3]
 上述の実施の形態2では探索範囲を限定することで、演算負荷が低減する構成について説明した。但し、探索範囲を限定することでロバスト性が低下する場合もある。そのため、実施の形態3では、回転量推定の処理において探索範囲を限定するとともに、探索範囲外の情報を利用することでロバスト性を向上させる処理について説明する。この回転量推定の処理以外の部分については、上述の実施の形態1と同様であるので、詳細な説明は繰り返さない。
 図11は、画像にノイズ成分が含まれている場合に生じる回転量に対するPOC値の変化の一例を示す図である。図12は、実施の形態3に従う回転量推定の処理を説明するための図である。
 探索対象画像を取得する際に何らかのノイズ成分(ショットノイズやシェーディングなど)が生じると、図11に示すように、本来あるべきではない場所(図11中の位置b)にピーク(偽のピーク)が現われる場合がある。図11に示す例では、位置aに最大のピークが生じるべきである。このような場合において、位置bに現われるピークが最大ピークを示すときには、位置bに対応する回転量を基準として、周期情報から回転量の候補が決定される。そのため、後段での位置検出においては、誤推定された回転量および当該回転量から周期情報を用いて算出された回転量でそれぞれ補正された画像を用いて、位置検出が実行される。そのため、位置検出を正確に実行することができない。
 図11に示す例では、探索範囲を±45°に限定した場合でもこのような誤検出は生じ得る。そこで、実施の形態3においては、図12に示すように、限定した探索範囲と探索範囲外のPOC値の情報とを統合することで、偽のピークが生じたことによる精度への影響を排除する。より具体的には、探索範囲外のPOC値の特性(波形)を折り返して加算し、さらに平均化することで、図11の位置bに現われていた偽のピークの振幅を低減させることができる。
 図12に示す例では、正しいピーク位置(0°)では、探索範囲および探索範囲外の情報を統合した結果においてもピークが存在するが、偽のピーク位置では、探索範囲外の情報にはピークが存在しない。このように、POC値を統合処理(加算または平均)することで、偽のピークの振幅を小さくできる。すなわち、偽のピークに対応する回転量が推定結果として出力されることを防止できる。
 実施の形態3においては、周期情報から探索範囲を限定するとともに、探索範囲外のPCO値の情報を探索範囲に統合することで、ノイズ成分などの影響を低減して、ロバスト性が高めることができる。すなわち、実施の形態3では、回転量の探索を行なう範囲を限定する処理では、回転量の探索を行なう範囲における回転量と類似度との関係を、回転量の探索を行なう範囲外における回転量と類似度との関係で補正することで、探索を行なう範囲の類似度の情報を生成する処理を含む。
 [F.実施の形態4]
 上述の実施の形態3では、探索範囲と探索範囲外とのPOC値の情報を統合することで、ロバスト性を向上する処理について説明した。これに対して、実施の形態4においては、統合処理ではなく、別の処理で、偽のピークを除外する処理について説明する。この回転量推定の処理以外の部分については、上述の実施の形態1と同様であるので、詳細な説明は繰り返さない。
 上述したように、探索対象画像を取得する際に何らかのノイズ成分(ショットノイズやシェーディングなど)が生じると、図11に示すような、本来あるべきではない場所(図11中の位置b)にピーク(偽のピーク)が現われる場合がある。
 POC値の特性に現われたピークが本来のピークであるか、偽のピークであるかを判断する方法として、各ピークについて周期性の有無を判断するようにしてもよい。図11に示す例においては、図11中の位置bのピークが最大ピークを示す場合には、この位置bに対応する回転量を基準として、周期情報から得られた周期(この例では、90°)を加算/減算した位置(ピーク位置の回転量±90°)のPOC値を評価する。この(ピーク位置の回転量±90°)でのPOC値が予め定められたしきい値よりも小さい場合は、周期性が見られないので、位置bに現われているピークが偽のピークであると判断でき、これを除外する。
 このように位置bに現われている偽のピークを除外した後、位置b以外の位置にある次に大きな振幅を有するピークを探索する。新たに探索されたピークについても、周期性の有無を判断する。この判断によって、周期性があると判断された場合には、当該ピークの位置および周期情報に対応する位置を回転量の候補として抽出する。後段においては、抽出された回転量の候補のそれぞれについて位置検出の処理を実行し、最も確からしい結果(回転量および対応する位置)を最終的な位置情報として出力する。
 実施の形態4においては、抽出された最大ピークを示す回転量を基準として、周期的なピークが存在するか否かを判断することで、その抽出されたピークが偽のピークであるか否かを判断することができる。すなわち、実施の形態4においては、テンプレート画像18と探索対象画像16との類似度の回転量に対する変化特性を参照して、回転量の候補のうち、周期性の情報の条件を満たさない候補を除外する処理を実行する。このように、抽出されたピークについての周期性の有無を判断することで、偽のピークを排除することができ、これによってロバスト性を向上できる。
 [G.実施の形態5]
 上述の実施の形態1においては、ユーザーが周期情報を取得して設定するような例について説明した。図4に示すような格子状の単純なテンプレート画像のパターンであれば、ユーザーが知り得ることができる。しかしながら、少し複雑なパターンになると、どのような周期性を有しているか否かを知ることが困難になる。そこで、実施の形態5においては、ユーザーがテンプレート画像を設定すれば、そのテンプレート画像がどのような周期性を有しているか否かを自動的に判断する構成について例示する。
 図13は、実施の形態5に従う画像処理装置100Aの機能構成を示す模式図である。図13を参照して、実施の形態5に従う画像処理装置100Aは、図3に示す画像処理装置100に比較して、周期情報算出部162がさらに付加されている。その他のコンポーネントについては、図3を参照して説明したので、詳細な説明は繰り返さない。
 図13に示す周期情報算出部162は、後述するような処理例1~3のいずれかの方法を用いて、テンプレート画像が有している周期情報を算出する。
 《g1:処理例1》
 処理例1として、周期情報算出部162は、ユーザーが設定したテンプレート画像同士の間で回転推定を行なう。このテンプレート画像同士の回転推定は、オフライン、すなわち探索対象画像に対する位置探索処理が実行される前に実行される。
 何らかの周期性を有するテンプレート画像では、その周期性に合わせてピークが複数出現するので、これらのピークからテンプレート画像に含まれる周期性を抽出できる。より具体的には、複数出現したピークのうち、そのピーク値(振幅)が予め定められたしきい値を越えているものを抽出し、その抽出したピークがどのくらいの画素間隔で発生しているかを判断することで、周期情報を算出できる。
 例えば、テンプレートサイズが128画素×128画素である場合、1画素が1.4°に相当する(テンプレートサイズの全体で180°になるとした場合)ので、一例として、ピークの出現する画素間隔が32画素であるときには、周期情報としては、32画素×1.4°≒45°となる。このような処理によって、テンプレート画像が有する周期情報が45°であるということがわかるので、上述の実施の形態において説明したように、この周期情報を考慮して、回転量を推定できる。
 なお、完全に同一のテンプレート画像同士で回転推定を行なうと、POC値としては、画像中央にのみ鋭いピークが出力されて、周期情報を算出することが難しくなる。そのため、回転推定の対象となるテンプレート画像間に何らかの誤差を生じさせることが好ましい。このような誤差を生じさせる方法としては、例えば、いずれか一方のテンプレート画像に対して、ランダムノイズなどの何らかのノイズを付与する方法を採用してもよいし、一方のテンプレート画像を平滑化フィルタなどで画像劣化させる方法を採用してもよい。
 《g2:処理例2》
 処理例2として、周期情報算出部162は、テンプレート画像とテンプレート画像を回転させて生成される画像との間で相関値を算出し、これによって、テンプレート画像が有している周期性を算出する。
 より具体的には、周期情報算出部162は、ユーザーが設定したテンプレート画像を所定角度ずつ(例えば、1°ずつ)回転させた画像を複数生成する。この画像生成処理は、オフラインで実行される。そして、周期情報算出部162は、ユーザーが設定したテンプレート画像を用いて、所定角度ずつ回転させて生成された複数の画像との間で位置検出のマッチングをそれぞれ行なうことで、画像別に相関値を算出する。画像別に算出される相関値は、その周期性に合わせて変動する。つまり、周期性に合わせて、より高いマッチング度を示すようになる。そこで、算出された相関値のうち、予め定められたしきい値を越えている相関値のデータから、ピークがどの程度の回転量の間隔で発生しているかを算出することで、周期情報を決定できる。
 《g3:処理例3》
 図14は、実施の形態5の処理例3に従う画像処理装置の回転量推定部156および周期情報算出部162のより詳細な機能ブロック図である。図14を参照して、周期情報算出部162は、テンプレート画像の振幅情報を極座標変換した画像(極座標変換画像)に対して、回転量を表す軸(図14に示す極座標変換画像では横軸)方向に周波数変換(典型的には、フーリエ変換)を行なうことで、周期性に相当する周波数のピークが高くなる。この性質を利用して周期情報を取得する。
 《g4:利点》
 実施の形態5においては、周期性の情報を取得する処理は、テンプレート画像18同士で回転方向についてのマッチング(第3のマッチング)を行なう処理と、当該マッチングの結果に現われる類似度の周期から周期性を決定する処理とを含む。このような実施の形態5によれば、ユーザーはテンプレート画像を設定すれば、その設定したテンプレート画像についての周期性の情報を自身で設定する必要がない。つまり、設定したテンプレート画像の有している周期性が自動的に解析されるので、ユーザビリティを高めたシステムを実現できる。
 《g5:その他》
 上述したように、自動的に決定された周期性の情報に加えて、あるいは、それに代えて、ユーザーが任意に設定するようにしてもよい。つまり、周期性の情報を取得する処理としては、ユーザーから任意の周期性の情報を受け付ける処理を含んでいてもよい。
 [H.実施の形態6]
 上述の実施の形態1では、回転量推定時に最大ピークの回転量のみを求め、周期情報に基づいて複数の回転量を推定していたが、別の処理方法を採用してもよい。実施の形態6では、回転量推定の処理のバリエーションについて説明する。この回転量推定の処理以外の部分については、上述の実施の形態1と同様であるので、詳細な説明は繰り返さない。
 例えば、回転量推定時において、予め定められたしきい値以上の振幅を有するピーク位置を算出するとともに、各ピーク位置に対する周期的な位置も算出するようにしてもよい。この場合、回転量の候補が多数存在することになり演算負荷が高くなり得る。回転量推定では、照明変動などの不安定な振幅情報を使うため、回転量推定での誤りの確率が増加する可能性があるが、後段の位置検出では、照明変動などの誤差要因に対してロバストなPOC法を利用することで、正しく回転量が補正された画像についてのみ高い相関値を有する位置検出結果を得ることができる。
 実施の形態6によれば、複数の回転量候補に対して後段の位置検出を行なうことで、ロバストな検出が可能になる。
 [I.実施の形態7]
 上述の実施の形態1では、回転量推定時に最大ピークの回転量のみを求め、周期情報に基づいて複数の回転量を推定していたが、別の処理方法を採用してもよい。実施の形態7では、回転量推定の処理のさらなるバリエーションについて説明する。この回転量推定の処理以外の部分については、上述の実施の形態1と同様であるので、詳細な説明は繰り返さない。
 例えば、回転量推定時において、予め定められたしきい値以上の振幅を有する複数のピーク位置を算出するとともに、算出した複数のピーク位置について、周期的な関係が存在するか否かを判断する。
 周期的な関係が存在しない場合には、そのピーク位置を除外した上で回転量の候補を決定し、後段での位置検出を実行する。この処理は、周期情報に合致する最大ピーク位置を算出することを意味する。
 図15は、実施の形態7に従う回転量推定の処理を説明するための図である。図15に示すピーク(1)では、最大のピーク値を示しており、ピーク(2)~(4)では、予め定められたしきい値(横方向の破線)を超えるピーク値を示している。
 実施の形態7においては、図15に示す(1)~(4)のピークが回転量推定の候補として抽出される。次に、最大ピークから順に周期情報を利用して、そのピークの確からしさが判断される。なお、確からしさの判断は、必ずしも最大ピークから順に実施される必要はなく、その順番は任意である。例えば、図15に示す左側に位置するピークから順に行なってもよいし、右側に位置するピークから順に行なってもよい。
 (1)のピークに対して、周期情報A(ここでは一例として、90°とする。図15においては、90°に相当する長さを矢印で示している。)を利用して、その対応する位置にしきい値を超えるようなピークが存在するか否かを判断する。図15に示す例では、(1)のピークからちょうど90°離れた位置にピークは存在しないので、(1)のピークは候補から除外される。
 次に、(2)のピークに対して、周期情報B(ここでは、同じく90°とする。)を利用して、その対応する位置にしきい値を超えるようなピークが存在するか否かを判断する。図15に示す例では、(2)のピークからちょうど90°離れた位置に(3)のピークが存在するので、(2)のピークは確からしいとして候補として残される。
 次に、(3)のピークについては、先に(2)のピークと対になっていることが判明しているので、改めて周期情報を利用して判断する必要はなく、候補として残しつつ、(3)のピークについての判断処理はスキップされる。
 最後に、(4)のピークに対して、同様に判断が実行される。この例では、(4)のピークからちょうど90°離れた位置にピークは存在しないので、(4)のピークは候補から除外される。
 上述したような実施の形態7に示すような手法を採用することで、本来誤りである回転量において最大ピーク位置が現われるような場合であっても、周期情報を利用することで、それらの誤りである回転量を排除することができる。そのため、回転量候補の推定をよりロバスト性を高めた状態で実現できる。その上で、後段での位置検出結果に基づいて、周期的な関係を持つ回転量の候補の中で最も確からしい回転量および位置を算出することができるので、さらにロバスト性が高めることができる。
 上述の例においては、予め定められたしきい値を超えるピーク(但し、(3)のピークのように別のピークと対になったピークは除く)のすべてについて、それぞれの確からしさを判断するようにしてもよいし、ピーク値の高いものから順に確からしさを判断していき、1つでも周期情報に合致するピークが発見された時点で、残っているピークを除外するようにしてもよい。このような処理を採用することで、周期情報を有する最も確からしい回転量の推定候補を決定できるとともに、演算時間を短縮することも可能になる。
 [J.その他の実施の形態]
 上述の実施の形態1~7においては、位置検出の手法としてPOC法を利用する処理例について説明したが、画像間で位置検出を行なうことができる任意の手法を採用してもよい。例えば、SAD(Sum of Absolute Difference)法のような位置検出できる手法を採用できる。SAD法は、テンプレート画像と探索対象画像との間で画素毎に差の絶対値和を算出して、類似度を評価する方法である。
 本実施の形態においては、回転量補正処理において、テンプレート画像の回転量が最適化されているので、最終的な候補を絞り込むだけであれば、多少ロバスト性が劣る手法でも利用可能である。一方、SAD法は、POC法に比較して演算負荷が小さいので、処理を高速化できる。
 なお、SAD法に限られる、SSD(Sum of Squared Difference)やNCC(Normalize Cross Correlation)といった他の手法を用いても同様の効果は得ることができる。
 [K.付記]
 本実施の形態は、以下のような局面を含む。
 画像処理装置は、テンプレート画像と探索対象画像を取得する手段と、取得した画像の振幅情報の回転方向に関する周期性を取得する手段と、テンプレート画像と探索対象画像の振幅情報と周期性を利用して、相対的な回転量を複数推定する手段と、推定した複数の回転量に基づいて、それぞれテンプレート画像と探索対象画像間の相対的な回転量を補正する手段と、補正後のそれぞれの画像から、テンプレートマッチングの相関値が最も高い位置を、探索対象画像内のオブジェクトの位置としてそれぞれ検出する手段と、検出した各位置の中で、最も高い相関値を有する位置を選択する手段とを含む。
 好ましくは、画像処理装置は、周期性の情報に基づいて、相対的な回転量を推定するための探索範囲を限定する手段と、限定した探索範囲から相対的な回転量を推定する手段と、推定された相対的な回転量と周期性の情報に基づいて、相対的な回転量を複数推定する手段とを含む。
 さらに好ましくは、画像処理装置は、限定した探索範囲における相関値と探索範囲以外の相関値を統合する手段を含む。
 好ましくは、画像処理装置は、推定された複数個の相対的な回転量に対して、周期性の情報に合致しない回転量を推定結果から除外する手段を含む。
 好ましくは、周期性を取得する手段は、テンプレート作成時にユーザーが設定する。
 好ましくは、周期性を取得する手段は、ユーザーが設定したテンプレート同士で回転量推定のための処理を行ない、得られた相関値から周期性を算出する。
 [L.利点]
 本実施の形態によれば、画像の回転を考慮した位置検出手法において、最初に算出される回転量推定時に、画像の回転方向の周期性を利用することで、周期性に合致しないピークの影響を低減したり、探索範囲を限定することで、ロバスト性を向上したり、演算負荷を低減したりすることができる。
 すなわち、RIPOC法のように、回転方向のずれ量を最初に推定し、その後、位置探索を実行するようなアルゴリズムでは、最初の回転方向のずれ量の推定が重要である。特に、画像の振幅情報が回転方向に周期性を有するような場合では、いずれの回転量が正しいずれ量であるかを正確に判断できないため、誤った回転量を推定する可能性がある。また、画像上のノイズなどの影響で、周期性とは無関係な回転量を推定する可能性もある。そのため、画像の回転方向を考慮した位置検出手法において、画像の回転方向の周期性を利用して、最初に算出される回転量推定におけるロバスト性および正確性を高めることができる。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 システム、2 ワーク、3 ベルトコンベア、10 カメラ、16 探索対象画像、16A,16B 補正後画像、18 テンプレート画像、100,100A 画像処理装置、102 CPU、104 RAM、106 ROM、108 ネットワークインターフェイス、110 ハードディスク、112 テンプレートマッチング実行プログラム、120 表示部、122 入力部、124 メモリーカードインターフェイス、126 メモリーカード、128 カメラインターフェイス、130 バス、150 テンプレート保持部、152 画像取得部、154 回転補正部、156 回転量推定部、158 画像補正部、160 位置検出部、162 周期情報算出部、1561,1562,1573,1574 周波数変換部、1563,1563,1564,1564 対数化部、1565,1565,1566,1566 極座標変換部、1567 POC処理部、1568 候補生成部、1571 基準ウィンドウ設定部、1572 参照ウィンドウ設定部、1575,1576 位相情報取出部、1577 位相差算出部、1578 周波数逆変換部。

Claims (10)

  1.  テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理方法であって、
     前記テンプレート画像および前記探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得するステップと、
     前記テンプレート画像と前記探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、前記第1のマッチングの結果と前記周期性の情報とに基づいて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定するステップと、
     前記回転量の候補の各々を用いて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成するステップと、
     前記画像の組の各々で位置についての第2のマッチングを行なうとともに、前記第2のマッチングの結果のうち相対的に確度の高い結果を出力するステップとを含む、画像処理方法。
  2.  前記回転量の候補を複数決定するステップは、前記周期性の情報に基づいて、回転量の探索を行なう範囲を限定するステップを含む、請求項1に記載の画像処理方法。
  3.  前記回転量の探索を行なう範囲を限定するステップは、前記回転量の探索を行なう範囲における回転量と類似度との関係を、前記回転量の探索を行なう範囲外における回転量と類似度との関係で補正することで、探索を行なう範囲の類似度の情報を生成するステップを含む、請求項2に記載の画像処理方法。
  4.  前記回転量の候補を複数決定するステップは、前記第1のマッチングにより決定された回転量に対して、前記周期性の情報を示す回転量を加算および/または減算することで、前記回転量の候補を決定するステップを含む、請求項1~3のいずれか1項に記載の画像処理方法。
  5.  前記回転量の候補を複数決定するステップは、前記テンプレート画像と前記探索対象画像との類似度の回転量に対する変化特性を参照して、前記回転量の候補のうち、前記周期性の情報の条件を満たさない候補を除外するステップを含む、請求項1~4のいずれか1項に記載の画像処理方法。
  6.  前記周期性の情報を取得するステップは、前記テンプレート画像の生成時に、ユーザーが設定した前記周期性の情報を受け付けるステップを含む、請求項1~5のいずれか1項に記載の画像処理方法。
  7.  前記周期性の情報を取得するステップは、
      前記テンプレート画像同士で回転方向についての第3のマッチングを行なうステップと、
      前記第3のマッチングの結果に現われる類似度の周期から周期性を決定するステップとを含む、請求項1~5のいずれか1項に記載の画像処理方法。
  8.  前記周期性の情報を取得するステップは、ユーザーから任意の周期性の情報を受け付けるステップを含む、請求項1~5のいずれか1項に記載の画像処理方法。
  9.  テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理装置であって、
     前記テンプレート画像および前記探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得する周期情報取得部と、
     前記テンプレート画像と前記探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、前記第1のマッチングの結果と前記周期性の情報とに基づいて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定する回転量推定部と、
     前記回転量の候補の各々を用いて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成する画像補正部と、
     前記画像の組の各々で位置についての第2のマッチングを行なうとともに、前記第2のマッチングの結果のうち相対的に確度の高い結果を出力する位置検出部とを含む、画像処理装置。
  10.  テンプレート画像を用いて探索対象画像との間でテンプレートマッチングを行なう画像処理プログラムであって、前記画像処理プログラムはコンピューターに
     前記テンプレート画像および前記探索対象画像の少なくとも一方についての、回転方向の周期性の情報を取得するステップと、
     前記テンプレート画像と前記探索対象画像との間で回転方向についての第1のマッチングを行なうとともに、前記第1のマッチングの結果と前記周期性の情報とに基づいて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正する回転量の候補を複数決定するステップと、
     前記回転量の候補の各々を用いて、前記テンプレート画像と前記探索対象画像との間の回転方向の相対的なずれを補正した画像の組を複数生成するステップと、
     前記画像の組の各々で位置についての第2のマッチングを行なうとともに、前記第2のマッチングの結果のうち相対的に確度の高い結果を出力するステップとを実行させる、画像処理プログラム。
PCT/JP2014/064066 2013-06-13 2014-05-28 画像処理方法、画像処理装置および画像処理プログラム WO2014199824A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP14810909.3A EP3009985A4 (en) 2013-06-13 2014-05-28 Image processing method, image processing device, and image processing program
JP2015522705A JPWO2014199824A1 (ja) 2013-06-13 2014-05-28 画像処理方法、画像処理装置および画像処理プログラム
US14/897,570 US20160140419A1 (en) 2013-06-13 2014-05-28 Image Processing Method, Image Processing Apparatus, And Image Processing Program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2013-124439 2013-06-13
JP2013124439 2013-06-13

Publications (1)

Publication Number Publication Date
WO2014199824A1 true WO2014199824A1 (ja) 2014-12-18

Family

ID=52022123

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/064066 WO2014199824A1 (ja) 2013-06-13 2014-05-28 画像処理方法、画像処理装置および画像処理プログラム

Country Status (4)

Country Link
US (1) US20160140419A1 (ja)
EP (1) EP3009985A4 (ja)
JP (1) JPWO2014199824A1 (ja)
WO (1) WO2014199824A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321810A1 (en) * 2015-04-28 2016-11-03 Pixart Imaging (Penang) Sdn. Bhd. Optical navigation sensor, electronic device with optical navigation function and operation method thereof
JP6713185B2 (ja) * 2015-10-15 2020-06-24 株式会社日立ハイテク テンプレートマッチングを用いた検査装置および検査方法
CN106355607B (zh) * 2016-08-12 2019-01-22 辽宁工程技术大学 一种宽基线彩色图像模板匹配方法

Citations (3)

* 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 パターン照合装置
JPH10206134A (ja) 1997-01-17 1998-08-07 Matsushita Electric Works Ltd 画像処理による位置検出方法
JP2012069084A (ja) * 2010-08-27 2012-04-05 Hitachi High-Technologies Corp 重み付きテンプレートマッチング実行装置およびプログラム

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100308456B1 (ko) * 1999-07-09 2001-11-02 오길록 주파수 공간상에서의 질감표현방법 및 질감기반 검색방법
JP2004240931A (ja) * 2003-02-05 2004-08-26 Sony Corp 画像照合装置、画像照合方法、およびプログラム
US7212673B2 (en) * 2003-06-05 2007-05-01 National Instruments Corporation Rotational symmetry detection for configurations of discrete curves
WO2005096218A1 (en) * 2004-03-31 2005-10-13 Canon Kabushiki Kaisha Imaging system performance measurement
US7340089B2 (en) * 2004-08-17 2008-03-04 National Instruments Corporation Geometric pattern matching using dynamic feature combinations
JP4909859B2 (ja) * 2007-09-28 2012-04-04 株式会社日立ハイテクノロジーズ 検査装置及び検査方法
JP5409237B2 (ja) * 2009-09-28 2014-02-05 キヤノン株式会社 パターン検出装置、その処理方法及びプログラム
US9613285B2 (en) * 2012-03-22 2017-04-04 The Charles Stark Draper Laboratory, Inc. Compressive sensing with local geometric features

Patent Citations (3)

* 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 パターン照合装置
JPH10206134A (ja) 1997-01-17 1998-08-07 Matsushita Electric Works Ltd 画像処理による位置検出方法
JP2012069084A (ja) * 2010-08-27 2012-04-05 Hitachi High-Technologies Corp 重み付きテンプレートマッチング実行装置およびプログラム

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GERHARD X. RITTER; JOSEPH N. WILSON: "Handbook of Computer Vision Algorithms in Image Algebra", 1 May 1996
KOJI KOBAYASHI ET AL.: "Filtering on Phase Only Correlation Domain and its Applications", ITE TECHNICAL REPORT, vol. 21, no. 42, 22 July 1997 (1997-07-22), pages 31 - 36, XP008181648 *
See also references of EP3009985A4

Also Published As

Publication number Publication date
US20160140419A1 (en) 2016-05-19
EP3009985A1 (en) 2016-04-20
JPWO2014199824A1 (ja) 2017-02-23
EP3009985A4 (en) 2017-02-15

Similar Documents

Publication Publication Date Title
JP7297018B2 (ja) ビジョンシステムでラインを検出するためのシステム及び方法
KR101283262B1 (ko) 영상 처리 방법 및 장치
EP2911116A1 (en) Image-processing device, image-processing method, and image-processing program
US10664946B2 (en) Signal processors and methods for estimating transformations between signals with phase deviation
US8582810B2 (en) Detecting potential changed objects in images
JP2006350434A (ja) 手形状認識装置及びその方法
US10249058B2 (en) Three-dimensional information restoration device, three-dimensional information restoration system, and three-dimensional information restoration method
US9971954B2 (en) Apparatus and method for producing image processing filter
JP2023120281A (ja) ビジョンシステムでラインを検出するためのシステム及び方法
EP3336588A2 (en) Method and apparatus for matching images
WO2014199824A1 (ja) 画像処理方法、画像処理装置および画像処理プログラム
TW201719572A (zh) 三維模型分析及搜尋方法
EP2994884A2 (en) Method and apparatus for image matching
JP6163868B2 (ja) 画像処理方法、画像処理装置および画像処理プログラム
US20170140549A1 (en) Method of perceiving 3d structure from a pair of images
US20180082434A1 (en) Method, apparatus for shape estimation, and non-transitory computer-readable storage medium
JP5643147B2 (ja) 動きベクトル検出装置、動きベクトル検出方法及び動きベクトル検出プログラム
WO2016142965A1 (ja) 映像処理装置、映像処理方法及び映像処理プログラムを記憶する記録媒体
JP2014029677A (ja) 画像処理装置、画像処理方法および画像処理プログラム
JP3811474B2 (ja) 顔部品位置検出方法及び顔部品位置検出装置
WO2015005425A1 (ja) 顔照合装置、顔照合方法及び顔照合プログラム
Amankwah Image registration by automatic subimage selection and maximization of combined mutual information and spatial information
EP2214138A1 (en) Detecting potential changed objects in images
WO2017061148A1 (ja) 線分検出方法
Arnal et al. Parallel Fuzzy Filter for Impulse Noise Removal

Legal Events

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

Ref document number: 14810909

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2015522705

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 14897570

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

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014810909

Country of ref document: EP