WO2017206099A1 - Method and device for image pattern matching - Google Patents

Method and device for image pattern matching Download PDF

Info

Publication number
WO2017206099A1
WO2017206099A1 PCT/CN2016/084277 CN2016084277W WO2017206099A1 WO 2017206099 A1 WO2017206099 A1 WO 2017206099A1 CN 2016084277 W CN2016084277 W CN 2016084277W WO 2017206099 A1 WO2017206099 A1 WO 2017206099A1
Authority
WO
WIPO (PCT)
Prior art keywords
layer
angle
target image
image
normalized cross
Prior art date
Application number
PCT/CN2016/084277
Other languages
French (fr)
Chinese (zh)
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 PCT/CN2016/084277 priority Critical patent/WO2017206099A1/en
Priority to CN201680039123.3A priority patent/CN107851196B/en
Publication of WO2017206099A1 publication Critical patent/WO2017206099A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the invention belongs to the technical field of image processing and the field of computer technology, and in particular relates to a method and device for image pattern matching.
  • Image matching technology is an important research in the field of digital image processing and has been widely used in computer vision, virtual reality scene generation, aerospace remote sensing measurement, medical image analysis, optical and radar tracking, and landscape guidance.
  • Image matching is to find the same point through these differences.
  • Image matching algorithms are mainly divided into two categories: one is based on grayscale matching; the other is based on feature matching.
  • Pattern matching is an important algorithm in machine vision; gray value pattern matching is one of the earliest and most widely used algorithms. Gray value pattern matching generally uses Normalized Cross Correlation (NCC) between the template image and the target image area as a measure similarity criterion. Pattern matching in a more generalized manner includes searching for a template image in which a rotation transform and a scale transform are performed in the target image.
  • NCC Normalized Cross Correlation
  • Embodiments of the present invention provide a method and apparatus for image pattern matching, which are used to improve pattern matching.
  • the rate at which images are matched in the algorithm is used to improve pattern matching.
  • the first aspect of the present invention provides a method for image pattern matching, which may include:
  • the template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer, and the bottom layer area of the template image pyramid is the area of the original template image
  • the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer.
  • the bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
  • the pattern matching with the topmost target image is a full-angle pattern matching, and the pattern images of the other layer's template image and the corresponding layer's target image are matched to the interval angle pattern matching; the topmost target image is reduced by the original target image.
  • the target images of the other layers are all sampled from the normalized cross-correlation map acquired by the pattern matching to the next layer.
  • the first layer 1, to obtain a normalized cross-correlation is normalized cross-correlation value is greater than the predetermined threshold value is a C 1 and an angle corresponding to FIG. A 1, the C 1 corresponding to an area represented by the original template image in the original A position appearing in the target image, the angle corresponding to the corresponding angle map A 1 indicating the rotation angle of the original template image at the position where the original target image appears.
  • the matching of the top-most template image with the top-level target image may include: Performing a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtaining a normalized cross-correlation graph Ck+1 with a normalized cross-correlation value greater than the preset threshold and corresponding FIG angle a k + 1, and the normalized cross-correlation C k + 1 and FIG angle corresponding to FIG sample a k + 1 through k-th layer is a layer the target image C k 'k and the corresponding angle a in FIG. ' k .
  • the full angle is [- ⁇ , ⁇ ],
  • the matching of the template image of the k+1th layer with the target image of the k+1th layer may include: using the k+ in the full angle [- ⁇ , ⁇ ] according to the step size x k+1
  • the template image of the first layer performs pattern matching on the target image of the k+1th layer, and the k k+1 is a positive integer.
  • the interval angle pattern matching between the template image of each layer and the target image of the corresponding layer may include : matching the template image of the layer a and the target image C′ a of the layer a to the interval angle pattern of the layer a, and obtaining a normalized cross-correlation graph Ca and a normalized cross-correlation value greater than the preset threshold.
  • Corresponding angle map A a and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the target image C' a-1 of the a-1 layer and the corresponding angle Figure A' a-1 , 1 ⁇ a ⁇ k, and a is a positive integer.
  • the method may further include: determining the target of the other each layer In each connected subset of the image C' a , the position of the normalized cross-correlation value corresponding to the angle on A' a is The According to the Determine the interval angle of the a layer (n a is a positive integer).
  • the matching the template image of the layer a and the target image C′ a of the layer a to the interval angle pattern of the layer a may include: According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, the x a positive integer.
  • Performing pattern matching on the target image of the k+1th layer using the template image of the k+1th layer according to the step size x k+1 in the full angle [- ⁇ , ⁇ ] may include: at the full angle [- ⁇ , ⁇ ] of the target image k + 1 th layer using a template image for pattern matching the first k + 1 2 k layer according to the step.
  • a second aspect of the embodiments of the present invention provides an apparatus for image pattern matching, including:
  • a first acquiring module configured to acquire an original template image and an original target image
  • a module is created for establishing a template image pyramid and a target image pyramid of the k+1 layer.
  • the original template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer.
  • the bottom layer area of the template image pyramid is the original The area of the template image, the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer.
  • the bottom layer area of the target image pyramid is the area of the original target image, and the k is an integer greater than or equal to 1;
  • the pattern matching module is configured to pattern match the template image of each layer with the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle map with the normalized cross-correlation value greater than a preset threshold.
  • A wherein the pattern of the topmost template image matches the pattern of the topmost target image is a full angle pattern matching, and the pattern image of the other layer template image matches the target image of the corresponding layer is an interval angle pattern matching;
  • the topmost target image For the original target image to be reduced to the topmost level, the target images of the other layers are all sampled by the previous layer for pattern matching, and the normalized cross-correlation map is sampled to the next layer;
  • a second obtaining module when used in the first layer, obtains a normalized cross-correlation graph C 1 and a corresponding angle graph A 1 whose normalized cross-correlation value is greater than the preset threshold, and the region corresponding to the C 1 represents the original the template appears in the position of the original image in the target image, a 1 corresponding to an angle corresponding to the angle of the rotation angle view showing the position of the original template image appearing in the original target image.
  • the pattern matching module is configured to perform a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtain a normalized cross-correlation whose normalized cross-correlation value is greater than the preset threshold.
  • Figure C k+1 and the corresponding angle map A k+1 and upsample the normalized cross-correlation map C k+1 and the corresponding angle map A k+1 to the target image C of the kth layer ' k and the corresponding angle map A' k .
  • the full angle is [- ⁇ , ⁇ ],
  • the pattern matching module is further configured to perform pattern matching on the target image of the k+1th layer by using the template image of the k+1th layer according to the step size xk+1 in the full angle [- ⁇ , ⁇ ], x k+1 is a positive integer.
  • the pattern matching module is further configured to use the template image of the layer a and the layer a
  • the target image C' a performs interval angle pattern matching of the a layer, obtains a normalized cross-correlation map Ca and a corresponding angle map A a whose normalized cross-correlation value is greater than the preset threshold, and normalizes the image
  • the cross-correlation map C a and the corresponding angle map A a are upsampled to the target image C' a-1 of the a-1 layer and the corresponding angle map A' a-1 , 1 ⁇ a ⁇ k, And a is a positive integer.
  • the device further includes:
  • a first determination means for determining 'of each of a subset of the communication, the maximum normalized cross-correlation values corresponding to the position A' of the target image on each other on the angle of a C, to The
  • a second determining module for Determine the interval angle of the a layer (n a is a positive integer).
  • the fourth possible implementation manner of the second aspect of the present invention the fifth possible implementation manner of the second aspect of the embodiment of the present disclosure
  • the mode matching module specifically used in the interval angle
  • the x a positive integer
  • the pattern matching module is further configured to the full angle [- ⁇ , ⁇ ] of the target image k + 1 th layer is a template image for pattern matching according to step 2 k k + 1 using the first layer.
  • a third aspect of the embodiments of the present invention provides an apparatus for image pattern matching, including:
  • processors a processor, a memory, and a bus, the processor and the memory being connected by a bus;
  • the memory is used to store a program
  • the processor is operative to execute a program in the memory such that the image pattern matching device performs the method of image pattern matching in the first aspect of the invention.
  • a fourth aspect of the embodiments of the present invention further provides a storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software production port.
  • the computer software product is stored in a storage medium for storing computer software instructions for use in the electronic device, including programs for performing the first, second, and third aspects described above.
  • the computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
  • the original template image and the original target image are first acquired; then the template image pyramid and the target image pyramid of the k+1 layer are established, and the full angle is used at the top layer of the image pyramid.
  • the computational complexity of angle pattern matching improves operational efficiency.
  • FIG. 1 is a schematic diagram of an embodiment of a method for image pattern matching according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of establishing an image pyramid in an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of another embodiment of a method for image pattern matching according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an embodiment of an image pattern matching apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of another embodiment of an image pattern matching apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another embodiment of an image pattern matching apparatus according to an embodiment of the present invention.
  • Embodiments of the present invention provide a method for image pattern matching, which is used to reduce the duration of image matching in a pattern matching algorithm.
  • an embodiment of a method for image pattern matching according to the present invention includes:
  • the original template image and the original target image can be obtained by the sensor.
  • the original template image and the original target image have various shapes, which are not limited. Generally, the size of the original template image is smaller than the original.
  • the size of the target image, the original template image and the original target image are usually rectangular, for ease of expression, assuming that both the original template image and the original target image are square images.
  • a k+1 layer template image pyramid and a target image pyramid Create a k+1 layer template image pyramid and a target image pyramid.
  • the template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer.
  • the bottom layer area of the template image pyramid is the area of the template image
  • the target image pyramid is from The bottom layer to the top layer, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the target image, and k is an integer greater than or equal to 1;
  • the original template image and the original target image are subjected to pattern matching of normalized cross-correlation.
  • the template image pyramid and the target image pyramid of the k+1 layer are established.
  • the template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer.
  • the bottom layer area of the template image pyramid is the area of the template image
  • the target image pyramid is the most From the bottom layer to the top layer, the area is scaled down by layer.
  • the bottom layer area of the target image pyramid is the area of the target image
  • k is an integer greater than or equal to 1.
  • the pattern matching algorithm can calculate a normalized cross-correlation between a template image of size N ⁇ N and a target image of size M ⁇ M in O(M 2 log 2 M) time.
  • M the number of bits
  • M ⁇ 1000 the normalized cross-correlation value
  • the size of the original template image is smaller than the size of the original target image, so the height of the image pyramid is determined by the size of the original template image, which is a series of down sampling of a pair of images.
  • the image pyramid please refer to the schematic diagram of the image pyramid of Figure 2, which is straightforward to say the size of the original image and the collection of images reduced to 1/2, 1/4, 1/8 of the original image size, assuming K+1 layer pyramid, then the image pyramid from the lowest to the top, each layer of image area is about a quarter of the previous layer, M ⁇ M, Hence
  • Gaussian sampling and Laplacian sampling which correspond to Gaussian pyramid and Laplacian pyramid respectively.
  • the first layer area of the template image pyramid is the area of the template image
  • the target image pyramid is from the first layer to the fifth layer
  • each layer is one quarter of the area of the upper layer
  • the first layer area of the target image pyramid Is the area of the target image.
  • the template image of each layer is pattern-matched with the target image of each layer, wherein the template image of each layer and the corresponding layer are Performing pattern matching on the target image, obtaining a normalized cross-correlation map C and a corresponding angle map A whose normalized cross-correlation values are greater than a preset threshold; wherein the pattern of the topmost template image and the topmost target image is matched as Full-angle mode matching, the pattern matching of the template image of the other layer and the target image of the corresponding layer is matched by the interval angle pattern; the top-level target image is obtained when the original target image is reduced to the top layer, and the target image of the other layer is obtained.
  • the normalized cross-correlation map obtained by the pattern matching of the previous layer is sampled to the next layer.
  • pattern matching may include: matching the template image of the k+1th layer with the target image of the k+1th layer to obtain a normalized mutual
  • the normalized cross-correlation graph C k+1 whose correlation value is greater than the preset threshold and the corresponding angle graph A k+1
  • the normalized cross-correlation graph C k+1 and the corresponding angle graph A k+1 are upsampled k to k-th layer is a layer of target image C 'k and a corresponding angle of FIG. a' k.
  • the full angle may be [- ⁇ , ⁇ ] or [0, 2 ⁇ ], and is not limited.
  • performing the full-angle mode matching on the template image of the k+1th layer and the target image of the k+1th layer may include: using the k+1 in the step size x k+1 in the full angle [- ⁇ , ⁇ ]
  • the template image of the layer performs pattern matching on the target image of the k+1th layer, and x k+1 is a positive integer.
  • Performing pattern matching on each of the other layers may include: matching the template image of the layer a and the target image C' a of the layer a to the interval angle pattern of the layer a, and obtaining the normalized cross-correlation value greater than the preset threshold.
  • the normalized cross-correlation map Ca and the corresponding angle map A a , and the normalized cross-correlation map Ca and the corresponding angle map A a are upsampled to the target image of the a-1 layer of the a-1 layer C' a-1 and the corresponding angle diagram A' a-1 , 1 ⁇ a ⁇ k, and a is a positive integer.
  • the template image of the layer a and the target image C' a of the layer a are matched to the interval angle pattern of the layer a, which may include: According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, x a is a positive integer.
  • the top level At the fifth level, the top level:
  • the size of the step size x k+1 is not limited, and the larger the step size is, the smaller the workload is for the machine vision application, and the obtained value is relatively small. Accurate, the smaller the step size, the greater the workload for machine vision applications and the more accurate the values obtained.
  • each rotation angle of the template image and the target image will obtain a normalized cross-correlation map, where the normalized cross-correlation
  • the value of the pixel on the graph is [-1,1], and the pixel on the normalized cross-correlation graph takes the normalized cross-correlation value, then 44 normalized cross-correlations of the same size are obtained.
  • the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a combined normalized cross-correlation map and corresponding angles are obtained.
  • Figure; threshold processing of the integrated normalized cross-correlation map and angle map Assume that if the preset threshold is set to 0.9, the region larger than 0.9 in the normalized cross-correlation graph is retained while retaining the same region in the angle map.
  • the areas reserved in the two figures constitute a series of connected areas, denoted as C 5 and A 5 respectively .
  • the upsampling mapping is performed on C 5 and A 5 to obtain the target image C' 4 and the corresponding angle map A' 4 .
  • the acquired target image is C' 4 and the corresponding angle map A' 4 , assuming that the maximum position of the cross-correlation value in the first connected subset in the target image C' 4 corresponds to the template on A' 4
  • the angle of rotation of the image is 28 degrees, then degree. It should be noted that only a connected subset is used for description, and multiple connected subsets are also applicable. The same method is used, and the details of the connected subset are not limited herein.
  • the interval angle of the first connected subset of the fourth layer is [20, 36], and the step size x 4 is assumed to be four.
  • Angle in the interval [20, 36] according to the steps of the template image using the fourth layer 4 of the fourth layer image of the target region corresponding C '4 communicates a first subset pattern matching; if another communication sub Set, perform similar calculations on other connected subsets, and finally obtain a normalized cross-correlation graph C 4 with a normalized cross-correlation value greater than a preset threshold and a corresponding angle in combination with the normalized cross-correlation calculation results of all connected subsets.
  • Figure A 4 normalized cross-correlation graph C 4 and angle graph A 4 upsampled to the third layer of the 3-layer target image C' 3 and the corresponding angle map A' 3 .
  • Re-determination target image C 3 each connected subset 'in the position of maximum normalized cross-correlation value corresponding to the angle according to Determine the angle of the third layer
  • the angle search based on the rotated template image uses the angle search based on the rotated template image to rotate the template image of the fourth layer That is, there are 5 possible angles of 20 degrees, 24 degrees, 28 degrees, 32 degrees, and 36 degrees, respectively, and the target image of the 4th layer corresponds to the area of the C' 4 first connected subset for pattern matching, and each rotation angle
  • Both the template image and the target image C' 4 will obtain a normalized cross-correlation map, where the normalized cross-correlation map has a value range of [-1, 1], then 5 normalized sizes of the same size will be obtained.
  • the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a comprehensive normalized cross-correlation map is obtained.
  • Corresponding angle map similar calculations are performed for each connected subset, and all the results are combined to obtain a normalized cross-correlation map and a corresponding angle map.
  • the preset threshold value is 0.9
  • the normalized cross-correlation graph C 4 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 4 are determined , wherein the normalized cross-correlation graph C 4 And a series of connected regions of the angle map A 4 , the upsampling mapping of C 4 and A 4 is performed to obtain the target image C' 3 and the corresponding angle map A' 3 .
  • a target image C '3 in the position of maximum normalized cross-correlation value of the angle corresponding to a first subset of communication 32 degrees, the first connected subset interval angle of the third layer is
  • n 3 is 4, then
  • the interval angle of the first connected subset of the third layer is [28, 36], and the step size x 3 is assumed to be 2.
  • 2 is used in [28, 36] in steps of a template image within the layer 3 of the object image corresponding to the third layer region C '3 is a first subset of communication pattern matching; if another subset of communication, Perform similar calculations on other connected subsets, and finally obtain a normalized cross-correlation graph C 3 with a normalized cross-correlation value greater than a preset threshold and a corresponding angle graph A in combination with the normalized cross-correlation calculation results of all connected subsets.
  • normalized cross-correlation C 3 and FIG angle a 3-sampled FIG mapped to the second layer as a target image C '2 and FIG angle corresponding a' 2 2 layers.
  • Re-determination target image C 2 each connected subset 'in normalized angular position of the maximum cross-correlation value corresponding to according to Determine the interval angle of the second layer
  • each rotation angle Both the template image and the target image will obtain a normalized cross-correlation graph, where the normalized cross-correlation graph has a value range of [-1, 1], then 5 normalized cross-correlations of the same size will be obtained.
  • the preset threshold value is 0.9
  • the normalized cross-correlation graph C 3 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 3 are determined , wherein the normalized cross-correlation graph C 3 And A 3 is a series of connected regions, and C 3 and A 3 are upsampled to obtain a target image C' 2 and a corresponding angle map A' 2 .
  • the interval angle of the first connected subset of the second layer is [28, 32], and the step size x 2 is assumed to be 1.
  • the normalized cross-correlation graph C 2 and the angle map A 2 are upsampled to the target image C' 1 of the first layer and the corresponding angle map A' 1 .
  • Re-determination target image C 1 of each connected subset 'in normalized cross-correlation value is the largest angle corresponding to the position according to Determine the angle of the first layer
  • the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a comprehensive normalized cross-correlation map and corresponding angles are obtained.
  • a similar calculation is performed for each connected subset, and all the results are combined to obtain a normalized cross-correlation map and a corresponding angle map.
  • the preset threshold value is 0.9
  • the normalized cross-correlation graph C 2 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 2 are determined , wherein the normalized cross-correlation graph C 2 And A 2 is a series of connected regions, and C 2 and A 2 are upsampled to obtain a target image C' 1 and a corresponding angle map A' 1 .
  • FIG C 1 represents the original target image of the original template image and, C corresponding to the area A 1 1 corresponding to the angle of FIG.
  • the position appearing in the corresponding angle angle corresponding to the angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the corresponding angle map A 1 , the area corresponding to C 1 represents the original template image.
  • the position appearing in the original target image, the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • the interval angle of the first connected subset of the second layer is [28, 30], and the step size x 1 is assumed to be 1.
  • [28, 30] according to the steps of a template image used for the first layer of the object image of the first layer corresponding to the region C '1 of the first subset of communication pattern matching; for the remaining subset of communication Similar to the calculation, the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold and the corresponding angle graph A 1 are finally obtained by combining the normalized cross-correlation calculation results of all connected subsets.
  • the preset threshold value is 0.9
  • the normalized cross-correlation graph C 1 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 1 are determined , wherein the normalized cross-correlation graph C 1 And A 1 is a series of connected areas.
  • the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the normalized cross-correlation value of each connected subset in the corresponding angle graph A 1 , C 1 is obtained.
  • the largest position represents the most likely position of the original template image in the original target image, and the corresponding angle of the corresponding angle map A 1 represents the most likely rotation angle of the original template image when the original target image appears. .
  • the normalized cross-correlation graphs C' 1 , C' 2 , C' 3 , C' 4 which are larger than the preset threshold in each layer may actually include a plurality of connected components. Set, the above is only used to illustrate one of them, that is, the first connected subset. Similarly, if there are multiple connected subsets, the same calculation method is used to determine the interval angle.
  • the full-angle pattern matching is used at the top of the image pyramid, and the interval angle pattern matching is performed on the non-topmost image pyramid.
  • the calculation amount of the pattern matching is ensured by the present invention under the premise of ensuring the pattern matching precision. Focusing on low-resolution pyramid images reduces the computational complexity of full-angle pattern matching and improves operational efficiency. Because of the actual application, pattern matching usually requires full-angle search because the invention is real-time and efficient for development. The machine vision application will be of great help.
  • another embodiment of a method for image pattern matching according to the present invention includes:
  • step 301 is the same as step 101 shown in FIG. 1, and details are not described herein again.
  • the template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer.
  • the bottom layer area of the template image pyramid is original.
  • the area of the template image, the target image pyramid from the lowest to the top, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
  • a 3-layer template image pyramid and a target image pyramid are established, indicating that the original template image has a relatively small area.
  • the template image pyramid is from the bottom to the top, and the area is scaled down by layer.
  • the bottom layer area of the template image pyramid is the area of the original template image; the target image pyramid is from the bottom to the top, and the area is scaled down by layer.
  • the bottom layer area of the image pyramid is the area of the original target image, and k is an integer greater than or equal to 1.
  • the template image of the third layer is matched with the target image of the third layer by full-angle mode, and the normalized cross-correlation whose normalized cross-correlation value is greater than the preset threshold is obtained.
  • C 3 and FIG angles corresponding to FIG. a 3 and normalized cross-correlation C 3 and FIG angle corresponding to FIG sample layer 2 second layer is a target image C '2 and FIG angle corresponding a' on the a 3 2 .
  • the full angle is [- ⁇ , ⁇ ], which may include: using the template image of the k+1th layer to the target of the k+1th layer according to the step size x k+1 in the full angle [- ⁇ , ⁇ ]
  • the 2-layer target image C' 2 and the corresponding angle map A' 2 .
  • the template image of the second layer and the target image C' 2 of the second layer are matched by the interval angle pattern of the two layers, and the normalized cross-correlation value is greater than the preset threshold.
  • the normalized cross-correlation value is greater than the preset threshold.
  • the template image of the second layer and the target image C' 2 of the second layer are matched by the two-layer interval angle pattern, and the normalized cross-correlation value is greater than the preset threshold. Normalized cross-correlation graph C 2 and corresponding angle graph A 2 , and upsampled normalized cross-correlation graph C 2 and corresponding angle graph A 2 to target image C' 1 of layer 1 of layer 1 and Corresponding angle diagram A' 1 .
  • the method further includes: determining, in each connected subset of the target image C′ 2 of the second layer, the position where the normalized cross-correlation value is the largest corresponds to the A′ 2 Angle, for according to Determine the interval angle of the 2 layers (n 2 is a positive integer).
  • the second layer at the interval angle Performing pattern matching on the target image C' 2 of the second layer using the template image of the second layer according to the step size 2, and obtaining the normalized cross-correlation graph C 2 and the corresponding normalized cross-correlation value greater than the preset threshold.
  • the angle map A 2 and the normalized cross-correlation map C 2 and the corresponding angle map A 2 are upsampled to the target image C' 1 of the first layer and the corresponding angle map A' 1 .
  • FIG C 1 represents the original target image of the original template image and, C corresponding to the area A 1 1 corresponding to the angle of FIG.
  • the position appearing in the corresponding angle angle corresponding to the angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the corresponding angle map A 1 , the region corresponding to C 1 represents the original template image.
  • the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • the method further includes: determining each target image C′ 1 of the first layer Within the connected subset, the position with the largest normalized cross-correlation value corresponds to the angle on A' 1 according to Determine the interval angle of the 1st floor (n 1 is a positive integer).
  • the area corresponding to C 1 represents the position where the original template image appears in the original target image
  • the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • an embodiment of the image pattern matching device provided by the present invention includes:
  • a first obtaining module 401 configured to acquire an original template image and an original target image
  • the module 402 is configured to establish a template image pyramid and a target image pyramid of the k+1 layer.
  • the original template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer.
  • the bottom layer area of the template image pyramid is original.
  • the area of the template image, the target image pyramid from the lowest to the top, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
  • the pattern matching module 403 is configured to perform pattern matching between the template image of each layer and the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle map A with normalized cross-correlation values greater than a preset threshold; Wherein, the pattern of the topmost template image matches the pattern of the topmost target image is a full-angle pattern matching, and the pattern images of the other layer's template image and the corresponding layer's target image are matched to the interval angle pattern; the topmost target image is original. When the target image is reduced to the top layer, the target images of the other layers are all sampled by the previous layer for pattern matching, and the normalized cross-correlation map is sampled to the next layer;
  • a second acquiring module 404 a first layer, obtaining a normalized cross-correlation value greater than a preset threshold value, a normalized cross-correlation C of FIG. 1 and represents the original template, C corresponding to the region corresponding to the angle A 1 1 FIG.
  • the position at which the image appears in the original target image, and the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
  • the pattern matching module 403 is specifically configured to perform a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtain a normalized cross-correlation graph whose normalized cross-correlation value is greater than a preset threshold.
  • C k+1 and the corresponding angle map A k+1 and upsample the normalized cross-correlation map C k+1 and the corresponding angle map A k+1 to the target image C' k of the k-th layer And the corresponding angle map A' k .
  • the full angle is [- ⁇ , ⁇ ],
  • the pattern matching module 403 is further configured to perform pattern matching on the target image of the k+1th layer by using the template image of the k+1th layer according to the step size x k+1 in the full angle [- ⁇ , ⁇ ], x k +1 is a positive integer.
  • the pattern matching module 403 is further configured to perform the interval angle pattern matching of the layer image of the layer a and the target image C′ a of the layer a to obtain a normalized cross-correlation value greater than a preset threshold.
  • the cross-correlation map Ca and the corresponding angle map A a , and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the target image C' a- of the a-1 layer of the a-1st layer 1 and the corresponding angle diagram A' a-1 , 1 ⁇ a ⁇ k, and a is a positive integer.
  • the apparatus further includes:
  • First determining module 405 for determining 'of the communication of each of a subset of the normalized cross-correlation maximum values corresponding to the position A' of each other C object image on an angle a, as
  • a second determining module 406 configured to Determine the interval angle of the a layer (n a is a positive integer).
  • the pattern matching module 403 is specifically used for the interval angle According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, x a is a positive integer.
  • Pattern matching module 403 is also used to specifically target image k + 1 th layer is a template image for pattern matching according to step 2 k k + 1 using the first layer in the whole angle [- ⁇ , ⁇ ] within.
  • FIG. 6 another embodiment of an apparatus for image pattern matching in an embodiment of the present invention includes:
  • the memory 601, the processor 602 and the bus 603; the memory 601 and the processor 602 are connected by a bus 603; the memory 601 is configured to store application code for executing the method executed by the media stream transmitting device in the solution of the present invention, and is controlled by the processor 602. carried out.
  • the processor 602 is configured to execute application code stored in the memory.
  • the memory 601 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type that can store information and instructions.
  • the dynamic storage device can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM) or a Compact Disc Read-Only Memory (CD-ROM). Or other disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry or store expectations in the form of instructions or data structures Program code and any other medium that can be accessed by a computer, but is not limited thereto.
  • the memory can exist independently and be connected to the processor via a bus.
  • the memory can also be integrated with the processor.
  • Processor 602 can be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. It can also be an integrated circuit chip with signal processing capability, which can be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • Bus 603 can include a path for communicating information between the components described above.
  • the processor is used to perform the steps in the foregoing method for image pattern matching in FIG. 1 or FIG. 3, and details are not described herein again.
  • the embodiment of the invention further provides a computer storage medium for storing computer software instructions for the image pattern matching device of FIG. 4 or FIG. 5, which comprises a program designed to execute the above method embodiment.
  • a stored program By executing a stored program, the length of image matching in the pattern matching algorithm can be reduced.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

Provided is a method for image pattern matching for reducing the duration of image matching in a pattern matching algorithm. The method comprises: obtaining an original template image and an original target image; creating k+1 layers of template image pyramid and target image pyramid; obtaining a normalized cross-correlation graph with a normalized cross-correlation value greater than a preset threshold and a corresponding angle graph, wherein the pattern matching between the topmost template image and the topmost target image is a full angle pattern matching, and the pattern matching between the template images of the other layers and the target images of corresponding layers is interval angle pattern matching; and in the first layer, obtaining a normalized cross-correlation graph C1 and a corresponding angle graph A1, wherein the area corresponding to the C1 represents a position where the original template image appears in the original target image, and the corresponding angle graph A1 is a rotation angle corresponding to the original template image.

Description

一种图像模式匹配的方法及装置Method and device for image pattern matching 技术领域Technical field
本发明属于图像处理技术领域及计算机技术领域,尤其涉及一种图像模式匹配的方法及装置。The invention belongs to the technical field of image processing and the field of computer technology, and in particular relates to a method and device for image pattern matching.
背景技术Background technique
图像匹配技术是数字图像处理领域的一项重要研究并已在计算机视觉、虚拟现实场景生成、航空航天遥感测量、医学影像分析、光学和雷达跟踪、景物制导等领域得到了广泛的应用。Image matching technology is an important research in the field of digital image processing and has been widely used in computer vision, virtual reality scene generation, aerospace remote sensing measurement, medical image analysis, optical and radar tracking, and landscape guidance.
一般来说,由于图像在不同时间、不同传感器、不同视角获得的成像条件不同,因此即使是对同一物体,在图像中所表现出来的几何特性、光学特性、空间位置都会有很大的不同,如果考虑到噪声、干扰等影响会使图像发生很大差异,图像匹配就是通过这些不同之处找到它们的相同点。图像匹配算法主要分为两类:一类是基于灰度匹配的方法;另一类是基于特征匹配的方法。Generally speaking, since the imaging conditions obtained by different images at different times, different sensors, and different viewing angles are different, even the geometrical characteristics, optical characteristics, and spatial positions exhibited in the image may be greatly different for the same object. If the effects of noise, interference, etc. are taken into account, the image will be greatly different. Image matching is to find the same point through these differences. Image matching algorithms are mainly divided into two categories: one is based on grayscale matching; the other is based on feature matching.
根据已知模式(模板图),到另一幅图中搜索相匹配的子图像的过程,称为模式匹配。模式匹配是机器视觉中的一类重要算法;灰度值模式匹配是这之中提出最早、应用最广泛的一种算法。灰度值模式匹配一般使用模板图像与目标图像区域之间的归一化互相关(Normalized Cross Correlation,NCC)作为度量相似度标准。更加广义上的模式匹配包括在目标图像中搜索进行了旋转变换、缩放变换的模板图像。According to the known pattern (template map), the process of searching for a matching sub-image into another map is called pattern matching. Pattern matching is an important algorithm in machine vision; gray value pattern matching is one of the earliest and most widely used algorithms. Gray value pattern matching generally uses Normalized Cross Correlation (NCC) between the template image and the target image area as a measure similarity criterion. Pattern matching in a more generalized manner includes searching for a template image in which a rotation transform and a scale transform are performed in the target image.
目前大多数机器视觉软件都实现了基于归一化互相关的灰度值模式匹配模块,并支持全角度搜索和有限的缩放范围搜索。例如,康耐视的In-Sight Explorer支持最大360度旋转角和10%缩放的灰度值模式匹配。现有技术中,不管是在高分辨率的图像中,还是低分辨率的图像中,都使用全角度搜索的模式匹配,这就使得模式匹配的运算复杂度增加了不少。Most machine vision software currently implements a gray-scale pattern matching module based on normalized cross-correlation, and supports full-angle search and limited zoom range search. For example, Cognex's In-Sight Explorer supports a maximum 360 degree rotation angle and a 10% scaled gray value pattern match. In the prior art, pattern matching of full-angle search is used in both high-resolution images and low-resolution images, which increases the computational complexity of pattern matching.
发明内容Summary of the invention
本发明实施例提供了一种图像模式匹配的方法以及装置,用于提高模式匹 配算法中图像匹配的速率。Embodiments of the present invention provide a method and apparatus for image pattern matching, which are used to improve pattern matching. The rate at which images are matched in the algorithm.
有鉴于此,本发明第一方面提供一种图像模式匹配的方法,可包括:In view of this, the first aspect of the present invention provides a method for image pattern matching, which may include:
获取原始的模板图像与原始的目标图像;Acquiring the original template image with the original target image;
建立k+1层的模板图像金字塔和目标图像金字塔,该模板图像金字塔从最底层到最顶层,面积逐层等比缩小,该模板图像金字塔的最底层面积是该原始的模板图像的面积,该目标图像金字塔从最底层到最顶层,面积逐层等比缩小,该目标图像金字塔的最底层面积是该原始的目标图像的面积,k为大于等于1的整数;Establishing a k+1 layer template image pyramid and a target image pyramid, the template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer, and the bottom layer area of the template image pyramid is the area of the original template image, The target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;该最顶层的目标图像为该原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;Performing pattern matching on the template image of each layer and the target image of the corresponding layer to obtain a normalized cross-correlation graph C and a corresponding angle map A with normalized cross-correlation values greater than a preset threshold; wherein, the topmost template image The pattern matching with the topmost target image is a full-angle pattern matching, and the pattern images of the other layer's template image and the corresponding layer's target image are matched to the interval angle pattern matching; the topmost target image is reduced by the original target image. At the top level, the target images of the other layers are all sampled from the normalized cross-correlation map acquired by the pattern matching to the next layer.
第1层时,获取归一化互相关值大于该预置阈值的归一化互相关图C1和对应的角度图A1,该C1对应的区域表示该原始的模板图像在该原始的目标图像中出现的位置,该对应的角度图A1对应的角度表示该原始的模板图像在该原始的目标图像中出现的位置时的旋转角。The first layer 1, to obtain a normalized cross-correlation is normalized cross-correlation value is greater than the predetermined threshold value is a C 1 and an angle corresponding to FIG. A 1, the C 1 corresponding to an area represented by the original template image in the original A position appearing in the target image, the angle corresponding to the corresponding angle map A 1 indicating the rotation angle of the original template image at the position where the original target image appears.
结合本发明实施例的第一方面,在本发明实施例的第一方面的第一种可能的实现方式中,最顶层的模板图像与最顶层的目标图像进行的全角度模式匹配,可包括:将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于该预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将该归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’kWith reference to the first aspect of the embodiments of the present invention, in a first possible implementation manner of the first aspect of the embodiment of the present invention, the matching of the top-most template image with the top-level target image may include: Performing a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtaining a normalized cross-correlation graph Ck+1 with a normalized cross-correlation value greater than the preset threshold and corresponding FIG angle a k + 1, and the normalized cross-correlation C k + 1 and FIG angle corresponding to FIG sample a k + 1 through k-th layer is a layer the target image C k 'k and the corresponding angle a in FIG. ' k .
结合本发明实施例的第一方面的第一种可能的实现方式,在本发明实施例的第一方面的第二种可能的实现方式中,该全角度为[-π,π],With reference to the first possible implementation manner of the first aspect of the embodiment of the present invention, in a second possible implementation manner of the first aspect of the embodiment, the full angle is [-π, π],
该将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,可包括:在该全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,该xk+1为正整数。 The matching of the template image of the k+1th layer with the target image of the k+1th layer may include: using the k+ in the full angle [-π, π] according to the step size x k+1 The template image of the first layer performs pattern matching on the target image of the k+1th layer, and the k k+1 is a positive integer.
结合本发明实施例的第一方面,在本发明实施例的第一方面的第三种可能的实现方式中,其他每层的模板图像与对应层的目标图像进行的区间角度模式匹配,可包括:将第a层的模板图像与第a层的该目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于该预置阈值的归一化互相关图Ca和对应的角度图Aa,并将该归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。With reference to the first aspect of the embodiments of the present invention, in a third possible implementation manner of the first aspect of the embodiment of the present invention, the interval angle pattern matching between the template image of each layer and the target image of the corresponding layer may include : matching the template image of the layer a and the target image C′ a of the layer a to the interval angle pattern of the layer a, and obtaining a normalized cross-correlation graph Ca and a normalized cross-correlation value greater than the preset threshold. Corresponding angle map A a , and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the target image C' a-1 of the a-1 layer and the corresponding angle Figure A' a-1 , 1 < a ≤ k, and a is a positive integer.
结合本发明实施例的第一方面的第三种可能的实现方式,在本发明实施例的第一方面的第四种可能的实现方式中,该方法还可包括:确定该其他每层的目标图像C’a中每个连通子集内,该归一化互相关值最大的位置对应到A’a上的角度,为
Figure PCTCN2016084277-appb-000001
Figure PCTCN2016084277-appb-000002
根据该
Figure PCTCN2016084277-appb-000003
确定a层的区间角度
Figure PCTCN2016084277-appb-000004
(na为正整数)。
With reference to the third possible implementation manner of the first aspect of the embodiment of the present invention, in a fourth possible implementation manner of the first aspect of the embodiments, the method may further include: determining the target of the other each layer In each connected subset of the image C' a , the position of the normalized cross-correlation value corresponding to the angle on A' a is
Figure PCTCN2016084277-appb-000001
The
Figure PCTCN2016084277-appb-000002
According to the
Figure PCTCN2016084277-appb-000003
Determine the interval angle of the a layer
Figure PCTCN2016084277-appb-000004
(n a is a positive integer).
结合本发明实施例的第一方面的第三种可能的实现方式,本发明实施例的第一方面的第四种可能的实现方式,在本发明实施例的第一方面的第五种可能的实现方式中,该将第a层的模板图像与第a层的该目标图像C’a进行a层的区间角度模式匹配,可包括:在该区间角度
Figure PCTCN2016084277-appb-000005
内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,该xa为正整数。
With reference to the third possible implementation manner of the first aspect of the embodiment of the present invention, the fourth possible implementation manner of the first aspect of the embodiment of the present invention, the fifth possible In an implementation manner, the matching the template image of the layer a and the target image C′ a of the layer a to the interval angle pattern of the layer a may include:
Figure PCTCN2016084277-appb-000005
According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, the x a positive integer.
结合本发明实施例的第一方面的第二种可能的实现方式,在本发明实施例的第一方面的第六种可能的实现方式中,当k<3时,xk+1=2k;在该全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,可包括:在该全角度[-π,π]内按照步长2k使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配。With reference to the second possible implementation manner of the first aspect of the embodiment of the present invention, in a sixth possible implementation manner of the first aspect of the embodiment of the present invention, when k<3, x k+1 =2 k Performing pattern matching on the target image of the k+1th layer using the template image of the k+1th layer according to the step size x k+1 in the full angle [-π, π] may include: at the full angle [- π, π] of the target image k + 1 th layer using a template image for pattern matching the first k + 1 2 k layer according to the step.
本发明实施例第二方面提供一种图像模式匹配的装置,包括:A second aspect of the embodiments of the present invention provides an apparatus for image pattern matching, including:
第一获取模块,用于获取原始的模板图像与原始的目标图像;a first acquiring module, configured to acquire an original template image and an original target image;
建立模块,用于建立k+1层的模板图像金字塔和目标图像金字塔,所原始的模板图像金字塔从最底层到最顶层,面积逐层等比缩小,该模板图像金字塔的最底层面积是该原始的模板图像的面积,该目标图像金字塔从最底层到最顶层,面积逐层等比缩小,该目标图像金字塔的最底层面积是该原始的目标图像的面积,该k为大于等于1的整数;A module is created for establishing a template image pyramid and a target image pyramid of the k+1 layer. The original template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer. The bottom layer area of the template image pyramid is the original The area of the template image, the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the original target image, and the k is an integer greater than or equal to 1;
模式匹配模块,用于将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图 A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;该最顶层的目标图像为该原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;The pattern matching module is configured to pattern match the template image of each layer with the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle map with the normalized cross-correlation value greater than a preset threshold. A; wherein the pattern of the topmost template image matches the pattern of the topmost target image is a full angle pattern matching, and the pattern image of the other layer template image matches the target image of the corresponding layer is an interval angle pattern matching; the topmost target image For the original target image to be reduced to the topmost level, the target images of the other layers are all sampled by the previous layer for pattern matching, and the normalized cross-correlation map is sampled to the next layer;
第二获取模块,用于第1层时,获取归一化互相关值大于该预置阈值的归一化互相关图C1和对应的角度图A1,该C1对应的区域表示该原始的模板图像在该原始的目标图像中出现的位置,该对应的角度图A1对应的角度表示该原始的模板图像在该原始的目标图像中出现的位置时的旋转角。a second obtaining module, when used in the first layer, obtains a normalized cross-correlation graph C 1 and a corresponding angle graph A 1 whose normalized cross-correlation value is greater than the preset threshold, and the region corresponding to the C 1 represents the original the template appears in the position of the original image in the target image, a 1 corresponding to an angle corresponding to the angle of the rotation angle view showing the position of the original template image appearing in the original target image.
结合本发明实施例的第二方面,在本发明实施例的第二方面的第一种可能的实现方式中,With reference to the second aspect of the embodiments of the present invention, in a first possible implementation manner of the second aspect of the embodiments of the present invention,
该模式匹配模块,具体用于将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于该预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将该归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’kThe pattern matching module is configured to perform a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtain a normalized cross-correlation whose normalized cross-correlation value is greater than the preset threshold. Figure C k+1 and the corresponding angle map A k+1 , and upsample the normalized cross-correlation map C k+1 and the corresponding angle map A k+1 to the target image C of the kth layer ' k and the corresponding angle map A' k .
结合本发明实施例的第二方面的第一种可能的实现方式,在本发明实施例的第二方面的第二种可能的实现方式中,该全角度为[-π,π],With reference to the first possible implementation manner of the second aspect of the embodiment of the present invention, in a second possible implementation manner of the second aspect of the embodiment, the full angle is [-π, π],
该模式匹配模块,具体还用于在该全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,该xk+1为正整数。The pattern matching module is further configured to perform pattern matching on the target image of the k+1th layer by using the template image of the k+1th layer according to the step size xk+1 in the full angle [-π, π], x k+1 is a positive integer.
结合本发明实施例的第二方面,在本发明实施例的第二方面的第三种可能的实现方式中,该模式匹配模块,具体还用于将第a层的模板图像与第a层的该目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于该预置阈值的归一化互相关图Ca和对应的角度图Aa,并将该归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。With reference to the second aspect of the embodiments of the present invention, in a third possible implementation manner of the second aspect of the embodiment of the present invention, the pattern matching module is further configured to use the template image of the layer a and the layer a The target image C' a performs interval angle pattern matching of the a layer, obtains a normalized cross-correlation map Ca and a corresponding angle map A a whose normalized cross-correlation value is greater than the preset threshold, and normalizes the image The cross-correlation map C a and the corresponding angle map A a are upsampled to the target image C' a-1 of the a-1 layer and the corresponding angle map A' a-1 , 1 < a ≤ k, And a is a positive integer.
结合本发明实施例的第二方面的第三种可能的实现方式,在本发明实施例的第二方面的第四种可能的实现方式中,该装置还包括:With reference to the third possible implementation manner of the second aspect of the embodiment of the present invention, in a fourth possible implementation manner of the second aspect of the embodiment, the device further includes:
第一确定模块,用于确定该其他每层的目标图像C’a中每个连通子集内,该归一化互相关值最大的位置对应到A’a上的角度,为
Figure PCTCN2016084277-appb-000006
Figure PCTCN2016084277-appb-000007
A first determination means for determining 'of each of a subset of the communication, the maximum normalized cross-correlation values corresponding to the position A' of the target image on each other on the angle of a C, to
Figure PCTCN2016084277-appb-000006
The
Figure PCTCN2016084277-appb-000007
第二确定模块,用于根据该
Figure PCTCN2016084277-appb-000008
确定a层的区间角度
Figure PCTCN2016084277-appb-000009
(na为正整数)。
a second determining module for
Figure PCTCN2016084277-appb-000008
Determine the interval angle of the a layer
Figure PCTCN2016084277-appb-000009
(n a is a positive integer).
结合本发明实施例的第二方面的第三种可能的实现方式,本发明的第二方面的第四种可能的实现方式,在本法明实施例第二方面的第五种可能的实现方式中,该模式匹配模块,具体还用于在该区间角度
Figure PCTCN2016084277-appb-000010
内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,该xa为正整数。
With reference to the third possible implementation manner of the second aspect of the embodiment of the present invention, the fourth possible implementation manner of the second aspect of the present invention, the fifth possible implementation manner of the second aspect of the embodiment of the present disclosure In the mode matching module, specifically used in the interval angle
Figure PCTCN2016084277-appb-000010
According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, the x a positive integer.
结合本发明实施例的第二方面的第二种可能的实现方式,在本发明的第二方面的第六种可能的实现方式中,当k<3时,xk+1=2kWith reference to the second possible implementation manner of the second aspect of the embodiment of the present invention, in a sixth possible implementation manner of the second aspect of the present invention, when k<3, x k+1 = 2 k ;
该模式匹配模块,具体还用于在该全角度[-π,π]内按照步长2k使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配。The pattern matching module is further configured to the full angle [-π, π] of the target image k + 1 th layer is a template image for pattern matching according to step 2 k k + 1 using the first layer.
本发明实施例第三方面提供一种图像模式匹配的装置,包括:A third aspect of the embodiments of the present invention provides an apparatus for image pattern matching, including:
处理器、存储器以及总线,处理器与存储器通过总线连接;a processor, a memory, and a bus, the processor and the memory being connected by a bus;
该存储器用于存储程序;The memory is used to store a program;
该处理器用于执行该存储器中的程序,使得该图像模式匹配的装置执行本发明第一方面中的图像模式匹配的方法。The processor is operative to execute a program in the memory such that the image pattern matching device performs the method of image pattern matching in the first aspect of the invention.
本发明实施例第四方面还提供一种存储介质,本发的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产口的形式体现出来,该计算机软件产品存储在一个存储介质中,用于储存为上述电子设备所用的计算机软件指令,其包含用于执行上述第一方面、第二方面以及第三方面所设计的程序。该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。A fourth aspect of the embodiments of the present invention further provides a storage medium. The technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software production port. The computer software product is stored in a storage medium for storing computer software instructions for use in the electronic device, including programs for performing the first, second, and third aspects described above. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
从以上技术方案可以看出,本发明实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
在本发明实施例中,先获取原始的模板图像与原始的目标图像;再建立k+1层的模板图像金字塔和目标图像金字塔,在图像金字塔最顶层使用全角度 模式匹配,在其他每层的图像金字塔上,进行区间角度模式匹配,在确保模式匹配精度的前提下,将模式匹配的主要计算量集中到分辨率最小的金字塔顶层的图像上,从而降低了全角度模式匹配的运算复杂度,提升了运行效率。In the embodiment of the present invention, the original template image and the original target image are first acquired; then the template image pyramid and the target image pyramid of the k+1 layer are established, and the full angle is used at the top layer of the image pyramid. Pattern matching, on the image pyramid of each layer, the interval angle pattern matching, under the premise of ensuring the pattern matching accuracy, the main calculation amount of pattern matching is concentrated on the image of the top layer of the pyramid with the smallest resolution, thereby reducing the total The computational complexity of angle pattern matching improves operational efficiency.
附图说明DRAWINGS
为了更清楚地说明本发明实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments and the prior art description will be briefly described below. Obviously, the drawings in the following description are only some implementations of the present invention. For example, other drawings may be obtained from those skilled in the art without any inventive effort.
图1为本发明实施例中图像模式匹配的方法的一个实施例示意图;1 is a schematic diagram of an embodiment of a method for image pattern matching according to an embodiment of the present invention;
图2为本发明实施例中建立图像金字塔的示意图;2 is a schematic diagram of establishing an image pyramid in an embodiment of the present invention;
图3为本发明实施例中图像模式匹配的方法的另一个实施例示意图;FIG. 3 is a schematic diagram of another embodiment of a method for image pattern matching according to an embodiment of the present invention; FIG.
图4为本发明实施例中图像模式匹配装置的一个实施例示意图;4 is a schematic diagram of an embodiment of an image pattern matching apparatus according to an embodiment of the present invention;
图5为本发明实施例中图像模式匹配装置的另一个实施例示意图;FIG. 5 is a schematic diagram of another embodiment of an image pattern matching apparatus according to an embodiment of the present invention; FIG.
图6为本发明实施例中图像模式匹配装置的另一个实施例示意图。FIG. 6 is a schematic diagram of another embodiment of an image pattern matching apparatus according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供了一种图像模式匹配的方法,用于降低模式匹配算法中图像匹配的时长。Embodiments of the present invention provide a method for image pattern matching, which is used to reduce the duration of image matching in a pattern matching algorithm.
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is an embodiment of the invention, but not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚 地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the specification and claims of the present invention and the above figures are used to distinguish similar objects without having to use To describe a specific order or order. It is to be understood that the data so used may be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than what is illustrated or described herein. In addition, the terms "comprises" and "comprises" and "comprises", and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited Those steps or units listed are included, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
以下通过实施例进行具体描述,请参阅图1所示,本发明一种图像模式匹配的方法的一个实施例包括:The following is specifically described by using an embodiment. Referring to FIG. 1 , an embodiment of a method for image pattern matching according to the present invention includes:
101、获取原始的模板图像与原始的目标图像;101. Obtain an original template image and an original target image;
本实施例中,可以通过传感器获取原始的模板图像和原始的目标图像,原始的模板图像和原始的目标图像的形状多种多样,具体不作限定,一般情况下,原始的模板图像的尺寸小于原始的目标图像的尺寸,原始的模板图像和原始的目标图像的通常为矩形,为便于表达,假设原始的模板图像和原始的目标图像都为正方形图像。In this embodiment, the original template image and the original target image can be obtained by the sensor. The original template image and the original target image have various shapes, which are not limited. Generally, the size of the original template image is smaller than the original. The size of the target image, the original template image and the original target image are usually rectangular, for ease of expression, assuming that both the original template image and the original target image are square images.
102、建立k+1层的模板图像金字塔和目标图像金字塔,模板图像金字塔从最底层到最顶层,面积逐层等比缩小,模板图像金字塔的最底层面积是模板图像的面积,目标图像金字塔从最底层到最顶层,面积逐层等比缩小,目标图像金字塔的最底层面积是目标图像的面积,k为大于等于1的整数;102. Create a k+1 layer template image pyramid and a target image pyramid. The template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the template image pyramid is the area of the template image, and the target image pyramid is from The bottom layer to the top layer, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the target image, and k is an integer greater than or equal to 1;
本实施例中,获取原始的模板图像与原始的目标图像之后,对原始的模板图像和原始的目标图像进行归一化互相关的模式匹配。首先建立k+1层的模板图像金字塔和目标图像金字塔,模板图像金字塔从最底层到最顶层,面积逐层等比缩小,模板图像金字塔的最底层面积是模板图像的面积,目标图像金字塔从最底层到最顶层,面积逐层等比缩小,目标图像金字塔的最底层面积是目标图像的面积,k为大于等于1的整数。In this embodiment, after the original template image and the original target image are acquired, the original template image and the original target image are subjected to pattern matching of normalized cross-correlation. Firstly, the template image pyramid and the target image pyramid of the k+1 layer are established. The template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the template image pyramid is the area of the template image, and the target image pyramid is the most From the bottom layer to the top layer, the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the target image, and k is an integer greater than or equal to 1.
现有技术中,模式匹配算法可以在O(M2log2M)时间内计算一副大小为N×N的模板图像和一副大小为M×M的目标图像之间的归一化互相关值(假设M大于N),在分辨率较高的情况下(M~1000),计算归一化互相关值通常需要数秒的时间;这种效率对于大多机器视觉应用设备来说太长,而利用图像金字塔来进行快速模式匹配,会缩短一定的时间。In the prior art, the pattern matching algorithm can calculate a normalized cross-correlation between a template image of size N×N and a target image of size M×M in O(M 2 log 2 M) time. The value (assuming M is greater than N), in the case of higher resolution (M ~ 1000), it usually takes a few seconds to calculate the normalized cross-correlation value; this efficiency is too long for most machine vision applications, and Using image pyramids for fast pattern matching can shorten a certain amount of time.
一般来说,原始的模板图像的尺寸小于原始的目标图像的尺寸,所以,图像金字塔的高度由原始的模板图像的大小来决定,图像金字塔指是一副图像的一系列向下采样(down sampling)的集合,请参考图2图像金字塔的示意图进行理解,直白地讲即原图像的尺寸及其缩小至原图像尺寸1/2,1/4,1/8…… 的图像的集合,假设有k+1层金字塔,那么图像金字塔从最底层到最顶层,每层图像面积约为上一层的四分之一,M×M,
Figure PCTCN2016084277-appb-000011
……
Figure PCTCN2016084277-appb-000012
在缩小图像的过程中,我们需要进行采样,一般有两种采样方法:高斯采样和拉普拉斯采样,分别对应高斯金字塔和拉普拉斯金字塔,这两种采样方法的区别在于使用低通(高斯)滤波还是使用带通(拉普拉斯)滤波。相较于带通滤波,低通滤波的实现更简单一些,而且使用何种滤波对模板匹配的应用效果并无明显影响,这里我们使用高斯金字塔。
In general, the size of the original template image is smaller than the size of the original target image, so the height of the image pyramid is determined by the size of the original template image, which is a series of down sampling of a pair of images. For the collection of the image pyramid, please refer to the schematic diagram of the image pyramid of Figure 2, which is straightforward to say the size of the original image and the collection of images reduced to 1/2, 1/4, 1/8 of the original image size, assuming K+1 layer pyramid, then the image pyramid from the lowest to the top, each layer of image area is about a quarter of the previous layer, M × M,
Figure PCTCN2016084277-appb-000011
......
Figure PCTCN2016084277-appb-000012
In the process of reducing the image, we need to sample. There are generally two sampling methods: Gaussian sampling and Laplacian sampling, which correspond to Gaussian pyramid and Laplacian pyramid respectively. The difference between the two sampling methods is the use of low pass. (Gaussian) filtering also uses bandpass (Laplace) filtering. Compared to bandpass filtering, the implementation of low-pass filtering is simpler, and the filtering used has no significant effect on the application of template matching. Here we use Gaussian pyramids.
假设根据原始的模板图像的尺寸大小,建立k+1=5层的模板图像金字塔和目标图像金字塔,模板图像金字塔从第1层到第5层,每层面积为上一层面积的四分之一,模板图像金字塔的第1层面积是模板图像的面积,目标图像金字塔从第1层到第5层,每层面积为上一层面积的四分之一,目标图像金字塔的第1层面积是目标图像的面积。Suppose that according to the size of the original template image, a template image pyramid and a target image pyramid of k+1=5 layers are established, and the template image pyramid is from the first layer to the fifth layer, and each layer has an area of four quarters of the upper layer area. First, the first layer area of the template image pyramid is the area of the template image, the target image pyramid is from the first layer to the fifth layer, each layer is one quarter of the area of the upper layer, and the first layer area of the target image pyramid Is the area of the target image.
103、将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;最顶层的目标图像为原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;103. Perform pattern matching on the template image of each layer and the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle graph A with a normalized cross-correlation value greater than a preset threshold; wherein, the topmost layer The pattern matching between the template image and the topmost target image is matched to the full angle mode, and the pattern images of the other layer's template image and the corresponding layer's target image are matched to the interval angle pattern; the topmost target image is the original target image. At the top level, the target images of the other layers are all sampled from the normalized cross-correlation map acquired by the pattern matching to the next layer.
本实施例中,建立k+1层的模板图像金字塔和目标图像金字塔之后,将每一层的模板图像与每一层的目标图像进行模式匹配,其中,将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;最顶层的目标图像为原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的。In this embodiment, after the template image pyramid and the target image pyramid of the k+1 layer are established, the template image of each layer is pattern-matched with the target image of each layer, wherein the template image of each layer and the corresponding layer are Performing pattern matching on the target image, obtaining a normalized cross-correlation map C and a corresponding angle map A whose normalized cross-correlation values are greater than a preset threshold; wherein the pattern of the topmost template image and the topmost target image is matched as Full-angle mode matching, the pattern matching of the template image of the other layer and the target image of the corresponding layer is matched by the interval angle pattern; the top-level target image is obtained when the original target image is reduced to the top layer, and the target image of the other layer is obtained. The normalized cross-correlation map obtained by the pattern matching of the previous layer is sampled to the next layer.
(1)在最顶层,即第k+1层时,进行模式匹配可包括:将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于 预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’k(1) At the top layer, that is, the k+1th layer, pattern matching may include: matching the template image of the k+1th layer with the target image of the k+1th layer to obtain a normalized mutual The normalized cross-correlation graph C k+1 whose correlation value is greater than the preset threshold and the corresponding angle graph A k+1 , and the normalized cross-correlation graph C k+1 and the corresponding angle graph A k+1 are upsampled k to k-th layer is a layer of target image C 'k and a corresponding angle of FIG. a' k.
具体的,全角度可为[-π,π],也可以是[0,2π],具体不作限定。Specifically, the full angle may be [-π, π] or [0, 2π], and is not limited.
那么将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,可包括:在全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,xk+1为正整数。Then, performing the full-angle mode matching on the template image of the k+1th layer and the target image of the k+1th layer may include: using the k+1 in the step size x k+1 in the full angle [-π, π] The template image of the layer performs pattern matching on the target image of the k+1th layer, and x k+1 is a positive integer.
(2)在其他每层进行模式匹配可包括:将第a层的模板图像与第a层的目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图Ca和对应的角度图Aa,并将归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。(2) Performing pattern matching on each of the other layers may include: matching the template image of the layer a and the target image C' a of the layer a to the interval angle pattern of the layer a, and obtaining the normalized cross-correlation value greater than the preset threshold. The normalized cross-correlation map Ca and the corresponding angle map A a , and the normalized cross-correlation map Ca and the corresponding angle map A a are upsampled to the target image of the a-1 layer of the a-1 layer C' a-1 and the corresponding angle diagram A' a-1 , 1 < a ≤ k, and a is a positive integer.
具体的,在其他每层进行模式匹配之前,还包括:Specifically, before pattern matching is performed on each of the other layers, it also includes:
a、确定其他每层的目标图像C’a中每个连通子集内,归一化互相关值最大的位置对应到A’a上的角度,为
Figure PCTCN2016084277-appb-000013
a, OK 'within a communication in each subset, the maximum normalized cross-correlation value corresponding to the position of the A' each other C object image on an angle a, as
Figure PCTCN2016084277-appb-000013
b、根据
Figure PCTCN2016084277-appb-000014
确定a层的区间角度
Figure PCTCN2016084277-appb-000015
(na为正整数)。
b, according to
Figure PCTCN2016084277-appb-000014
Determine the interval angle of the a layer
Figure PCTCN2016084277-appb-000015
(n a is a positive integer).
那么,将第a层的模板图像与第a层的目标图像C’a进行a层的区间角度模式匹配,可包括:在区间角度
Figure PCTCN2016084277-appb-000016
内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,xa为正整数。
Then, the template image of the layer a and the target image C' a of the layer a are matched to the interval angle pattern of the layer a, which may include:
Figure PCTCN2016084277-appb-000016
According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, x a is a positive integer.
下面以示例性的内容来进行说明,若建立的是5层(k=4)模板图像金字塔和目标图像金字塔。The following description is made with an exemplary content, if a 5-layer (k=4) template image pyramid and a target image pyramid are created.
第5层时,即最顶层时:At the fifth level, the top level:
假设步长x5为8,需要说明的是,这里的步长xk+1的大小不做限定,一般步长越大,对机器视觉应用来说工作量越小,得到的值也相对不准确,步长越小,对机器视觉应用来说工作量越大,得到的值也越准确。Assuming that the step size x 5 is 8, it should be noted that the size of the step size x k+1 is not limited, and the larger the step size is, the smaller the workload is for the machine vision application, and the obtained value is relatively small. Accurate, the smaller the step size, the greater the workload for machine vision applications and the more accurate the values obtained.
在全角度[-π,π]内按照步长8使用第5层的模板图像对第5层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C5和对应的角度图A5,归一化互相关图C5和对应的角度图A5上采样至第4层为4 层的目标图像C’4和对应的角度图A’4,其中,第5层的目标图像为原始的目标图像等比缩小至第5层时得到的。Perform pattern matching on the target image of the fifth layer using the template image of the fifth layer according to the step size 8 in the full angle [-π, π], and obtain the normalized cross-correlation graph with the normalized cross-correlation value larger than the preset threshold. C 5 and the corresponding angle map A 5 , the normalized cross-correlation map C 5 and the corresponding angle map A 5 are upsampled to the fourth layer of the four-layer target image C′ 4 and the corresponding angle map A′ 4 , wherein The target image of the fifth layer is obtained when the original target image is reduced to the fifth layer.
具体为,在图像金字塔最顶层,使用基于旋转模板的角度搜索,全角度模式匹配的时候,模板图像旋转的角度是360度旋转,将第5层的模板图像旋转-180度、-172度……172度,共44个可能的角度,分别和第5层的目标图像进行模式匹配,每个旋转角度的模板图像和目标图像都会获取一个归一化互相关图,其中,归一化互相关图上的像素的取值范围为[-1,1],该归一化互相关图上的像素取值为归一化互相关值,那么就会获取44个相同尺寸的归一化互相关图,根据这44个归一化互相关图,计算出每个位置上最大的归一化互相关值及其对应的旋转角度,获取一幅综合后的归一化互相关图及对应的角度图;对综合归一化互相关图和角度图进行阈值处理,假设,设置的预置阈值为0.9,则保留归一化互相关图中大于0.9的区域,同时保留角度图中相同的区域。两张图中保留的区域构成一系列连通区域,分别记为C5和A5。对C5和A5进行上采样映射获取目标图像C’4和对应的角度图A’4Specifically, at the top of the image pyramid, using the angle search based on the rotation template, when the full-angle mode is matched, the angle of the template image rotation is 360 degrees, and the template image of the fifth layer is rotated by -180 degrees, -172 degrees... ...172 degrees, a total of 44 possible angles, respectively, and the 5th layer of the target image for pattern matching, each rotation angle of the template image and the target image will obtain a normalized cross-correlation map, where the normalized cross-correlation The value of the pixel on the graph is [-1,1], and the pixel on the normalized cross-correlation graph takes the normalized cross-correlation value, then 44 normalized cross-correlations of the same size are obtained. According to the 44 normalized cross-correlation maps, the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a combined normalized cross-correlation map and corresponding angles are obtained. Figure; threshold processing of the integrated normalized cross-correlation map and angle map. Assume that if the preset threshold is set to 0.9, the region larger than 0.9 in the normalized cross-correlation graph is retained while retaining the same region in the angle map. The areas reserved in the two figures constitute a series of connected areas, denoted as C 5 and A 5 respectively . The upsampling mapping is performed on C 5 and A 5 to obtain the target image C' 4 and the corresponding angle map A' 4 .
第4层时:At the 4th floor:
a、获取经过C5和A5上采样映射的目标图像C’4和对应的角度图A’4之后,还需确定目标图像C’4中每个连通子集里,归一化互相关值最大的位置对应到A’4上的角度
Figure PCTCN2016084277-appb-000017
这里C’4中有m4个连通子集。
a. After obtaining the target image C' 4 and the corresponding angle map A' 4 after the C 5 and A 5 upsampling mapping, it is also necessary to determine the normalized cross-correlation value in each connected subset of the target image C' 4 The largest position corresponds to the angle on A' 4
Figure PCTCN2016084277-appb-000017
Here C ', there are 4 m 4 interconnecting subsets.
由上述得知,获取的目标图像为C’4和对应的角度图A’4,假设,在目标图像C’4中第一连通子集里互相关值最大位置对应在A’4上的模板图像的旋转角度为28度,则
Figure PCTCN2016084277-appb-000018
度。需要说明的是,这里只是用一个连通子集来进行说明,多个连通子集也适用,是用同样的方法,这里不再赘述,连通子集的个数不做限定。
It is known from the above that the acquired target image is C' 4 and the corresponding angle map A' 4 , assuming that the maximum position of the cross-correlation value in the first connected subset in the target image C' 4 corresponds to the template on A' 4 The angle of rotation of the image is 28 degrees, then
Figure PCTCN2016084277-appb-000018
degree. It should be noted that only a connected subset is used for description, and multiple connected subsets are also applicable. The same method is used, and the details of the connected subset are not limited herein.
b、因为
Figure PCTCN2016084277-appb-000019
在相应的连通子集内归一化互相关值最大,说明对应的模板图像旋转
Figure PCTCN2016084277-appb-000020
出现在目标图像中对应位置上的几率也就越大,在第4层时,对于每个连通子集可以分别在
Figure PCTCN2016084277-appb-000021
角度的周围,也就是关于
Figure PCTCN2016084277-appb-000022
的区间角度再旋转搜索一下,图像模式匹配的概率也就更高,这里假设n4为8,一般来说,这里的n4值不会取太大,因为在最顶层的时候已经经过一次全角度的筛选,已选出第一连通子集内模板图像最有可能的旋转角度
Figure PCTCN2016084277-appb-000023
Figure PCTCN2016084277-appb-000024
的周 围再进一步搜索,所以获取的区间角度为
Figure PCTCN2016084277-appb-000025
b, because
Figure PCTCN2016084277-appb-000019
The normalized cross-correlation value is the largest in the corresponding connected subset, indicating the corresponding template image rotation
Figure PCTCN2016084277-appb-000020
The probability of appearing in the corresponding position in the target image is greater. In the fourth layer, for each connected subset, it can be
Figure PCTCN2016084277-appb-000021
Around the angle, that is, about
Figure PCTCN2016084277-appb-000022
The interval angle is rotated and searched again. The probability of image pattern matching is higher. It is assumed that n 4 is 8. In general, the value of n 4 here will not be too large, because it has already passed once at the top level. Angle screening, the most likely rotation angle of the template image in the first connected subset has been selected
Figure PCTCN2016084277-appb-000023
in
Figure PCTCN2016084277-appb-000024
Further search around, so the angle of the interval obtained is
Figure PCTCN2016084277-appb-000025
c、由上述得知,第4层第一连通子集的区间角度为[20,36],假设步长x4为4。在区间角度[20,36]内按照步长为4使用第4层的模板图像对第4层的目标图像对应于C'4第一连通子集的区域进行模式匹配;若有其他的连通子集,对其他的连通子集进行类似计算,最终结合所有连通子集的归一化互相关计算结果获取归一化互相关值大于预置阈值的归一化互相关图C4和对应的角度图A4,归一化互相关图C4和角度图A4上采样映射至第3层为3层的目标图像C'3和对应的角度图A'3。再确定目标图像C'3中每个连通子集里归一化互相关值最大的位置对应的角度
Figure PCTCN2016084277-appb-000026
根据
Figure PCTCN2016084277-appb-000027
确定第3层的区间角度
Figure PCTCN2016084277-appb-000028
c. It is known from the above that the interval angle of the first connected subset of the fourth layer is [20, 36], and the step size x 4 is assumed to be four. Angle in the interval [20, 36] according to the steps of the template image using the fourth layer 4 of the fourth layer image of the target region corresponding C '4 communicates a first subset pattern matching; if another communication sub Set, perform similar calculations on other connected subsets, and finally obtain a normalized cross-correlation graph C 4 with a normalized cross-correlation value greater than a preset threshold and a corresponding angle in combination with the normalized cross-correlation calculation results of all connected subsets. Figure A 4 , normalized cross-correlation graph C 4 and angle graph A 4 upsampled to the third layer of the 3-layer target image C' 3 and the corresponding angle map A' 3 . Re-determination target image C 3 each connected subset 'in the position of maximum normalized cross-correlation value corresponding to the angle
Figure PCTCN2016084277-appb-000026
according to
Figure PCTCN2016084277-appb-000027
Determine the angle of the third layer
Figure PCTCN2016084277-appb-000028
对于C'4中第一连通子集,使用基于旋转模板图像的角度搜索,将第4层的模板图像旋转
Figure PCTCN2016084277-appb-000029
即20度、24度、28度、32度和36度共5个可能的角度,分别和第4层的目标图像对应于C'4第一连通子集的区域进行模式匹配,每个旋转角度的模板图像和目标图像C'4都会获取一个归一化互相关图,其中,归一化互相关图的取值范围为[-1,1],那么就会获取5个相同尺寸的归一化互相关图,根据这5个归一化互相关图,计算出每个位置上最大的归一化互相关值及其对应的旋转角度,获取一幅综合后的归一化互相关图及对应的角度图;再对于每个连通子集进行类似计算,结合所有结果得出归一化互相关图和对应的角度图。由上述得知设置的预置阈值为0.9,确定大于0.9的归一化互相关值对应的归一化互相关图C4和对应的角度图A4,其中,归一化互相关图C4和角度图A4一系列连通区域,对C4和A4进行上采样映射获取目标图像C'3和对应的角度图A'3
For the first connected subset in C' 4 , use the angle search based on the rotated template image to rotate the template image of the fourth layer
Figure PCTCN2016084277-appb-000029
That is, there are 5 possible angles of 20 degrees, 24 degrees, 28 degrees, 32 degrees, and 36 degrees, respectively, and the target image of the 4th layer corresponds to the area of the C' 4 first connected subset for pattern matching, and each rotation angle Both the template image and the target image C' 4 will obtain a normalized cross-correlation map, where the normalized cross-correlation map has a value range of [-1, 1], then 5 normalized sizes of the same size will be obtained. According to the five normalized cross-correlation maps, the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a comprehensive normalized cross-correlation map is obtained. Corresponding angle map; similar calculations are performed for each connected subset, and all the results are combined to obtain a normalized cross-correlation map and a corresponding angle map. It is known from the above that the preset threshold value is 0.9, and the normalized cross-correlation graph C 4 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 4 are determined , wherein the normalized cross-correlation graph C 4 And a series of connected regions of the angle map A 4 , the upsampling mapping of C 4 and A 4 is performed to obtain the target image C' 3 and the corresponding angle map A' 3 .
第3层时:At the third level:
假设,目标图像C'3中第一连通子集内归一化互相关值最大的位置对应的角度
Figure PCTCN2016084277-appb-000030
为32度,则第3层的第一连通子集区间角度为
Figure PCTCN2016084277-appb-000031
这里假设n3为4,则
Figure PCTCN2016084277-appb-000032
Suppose, a target image C '3 in the position of maximum normalized cross-correlation value of the angle corresponding to a first subset of communication
Figure PCTCN2016084277-appb-000030
32 degrees, the first connected subset interval angle of the third layer is
Figure PCTCN2016084277-appb-000031
Here, assuming n 3 is 4, then
Figure PCTCN2016084277-appb-000032
由上述得知,第3层第一连通子集的区间角度为[28,36],假设步长x3为2。在[28,36]内按照步长为2使用第3层的模板图像对第3层的目标图像对应于C'3第一连通子集的区域进行模式匹配;若有其他的连通子集,对其他的连通子集 进行类似计算,最终结合所有连通子集的归一化互相关计算结果获取归一化互相关值大于预置阈值的归一化互相关图C3和对应的角度图A3,归一化互相关图C3和角度图A3上采样映射至第2层为2层的目标图像C'2和对应的角度图A'2。再确定目标图像C'2中每个连通子集里归一化互相关值最大的位置对应的角度
Figure PCTCN2016084277-appb-000033
根据
Figure PCTCN2016084277-appb-000034
确定第2层的区间角度
Figure PCTCN2016084277-appb-000035
From the above, it is known that the interval angle of the first connected subset of the third layer is [28, 36], and the step size x 3 is assumed to be 2. 2 is used in [28, 36] in steps of a template image within the layer 3 of the object image corresponding to the third layer region C '3 is a first subset of communication pattern matching; if another subset of communication, Perform similar calculations on other connected subsets, and finally obtain a normalized cross-correlation graph C 3 with a normalized cross-correlation value greater than a preset threshold and a corresponding angle graph A in combination with the normalized cross-correlation calculation results of all connected subsets. 3, normalized cross-correlation C 3 and FIG angle a 3-sampled FIG mapped to the second layer as a target image C '2 and FIG angle corresponding a' 2 2 layers. Re-determination target image C 2 each connected subset 'in normalized angular position of the maximum cross-correlation value corresponding to
Figure PCTCN2016084277-appb-000033
according to
Figure PCTCN2016084277-appb-000034
Determine the interval angle of the second layer
Figure PCTCN2016084277-appb-000035
对于C'3中第一连通子集,使用基于旋转模板图像的角度搜索,将第3层的模板图像旋转
Figure PCTCN2016084277-appb-000036
即28度,30度,32度,34度,36度共5个可能的角度,分别和第3层的目标图像对应于C'3第一连通子集的区域进行模式匹配,每个旋转角度的模板图像和目标图像都会获取一个归一化互相关图,其中,归一化互相关图的取值范围为[-1,1],那么就会获取5个相同尺寸的归一化互相关图,根据这5个归一化互相关图,计算出每个位置上最大的归一化互相关值及其对应的旋转角度,获取一幅综合后的归一化互相关图及对应的角度图;再对于C'3的每个连通子集进行类似计算,结合所有结果得出归一化互相关图和对应的角度图。由上述得知设置的预置阈值为0.9,确定大于0.9的归一化互相关值对应的归一化互相关图C3和对应的角度图A3,其中,归一化互相关图C3和A3是一系列连通区域,对C3和A3进行上采样映射获取目标图像C'2和对应的角度图A'2
For the first connected subset in C' 3 , use the angle search based on the rotated template image to rotate the template image of the third layer
Figure PCTCN2016084277-appb-000036
That is, 28 degrees, 30 degrees, 32 degrees, 34 degrees, 36 degrees, a total of 5 possible angles, respectively, and the target image of the 3rd layer corresponds to the area of the C' 3 first connected subset for pattern matching, each rotation angle Both the template image and the target image will obtain a normalized cross-correlation graph, where the normalized cross-correlation graph has a value range of [-1, 1], then 5 normalized cross-correlations of the same size will be obtained. According to the five normalized cross-correlation maps, the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a comprehensive normalized cross-correlation map and corresponding angles are obtained. FIG; then similarly calculated for C '3 each subset of communication, all the results obtained in conjunction with the normalized cross-correlation and corresponds to the angle of FIG. FIG. It is known from the above that the preset threshold value is 0.9, and the normalized cross-correlation graph C 3 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 3 are determined , wherein the normalized cross-correlation graph C 3 And A 3 is a series of connected regions, and C 3 and A 3 are upsampled to obtain a target image C' 2 and a corresponding angle map A' 2 .
第2层时:At the second level:
假设,目标图像C'2中第一连通子集里归一化互相关值最大位置对应的角度
Figure PCTCN2016084277-appb-000037
为30度,则第2层第一连通子集的区间角度为
Figure PCTCN2016084277-appb-000038
这里假设n2为2,则
Figure PCTCN2016084277-appb-000039
Assume that the angle corresponding to the maximum position of the normalized cross-correlation value in the first connected subset of the target image C' 2
Figure PCTCN2016084277-appb-000037
At 30 degrees, the interval angle of the first connected subset of the second layer is
Figure PCTCN2016084277-appb-000038
Here, assuming n 2 is 2, then
Figure PCTCN2016084277-appb-000039
由上述得知,第2层第一连通子集的区间角度为[28,32],假设步长x2为1。在[28,32]内按照步长为1使用第2层的模板图像对第2层的目标图像对应于C'2第一连通子集的区域进行模式匹配;若有其他的连通子集,对其他的连通子集进行类似计算,最终结合所有连通子集的归一化互相关计算结果获取归一化互相关值大于预置阈值的归一化互相关图C2和对应的角度图A2,归一化互相关图C2和角度图A2上采样映射至第1层为1层的目标图像C'1和对应的角度图A'1。再确定目标图像C'1中每个连通子集里归一化互相关值最大的位置对应的角度
Figure PCTCN2016084277-appb-000040
根据
Figure PCTCN2016084277-appb-000041
确定第1层的区间角度
Figure PCTCN2016084277-appb-000042
From the above, it is known that the interval angle of the first connected subset of the second layer is [28, 32], and the step size x 2 is assumed to be 1. Perform pattern matching on the region of the second layer whose target image corresponds to the first connected subset of C' 2 in the [28, 32] using the template image of the second layer in steps of 1; if there are other connected subsets, Perform similar calculations on other connected subsets, and finally obtain a normalized cross-correlation graph C 2 with a normalized cross-correlation value greater than a preset threshold and a corresponding angle graph A in combination with the normalized cross-correlation calculation results of all connected subsets. 2. The normalized cross-correlation graph C 2 and the angle map A 2 are upsampled to the target image C' 1 of the first layer and the corresponding angle map A' 1 . Re-determination target image C 1 of each connected subset 'in normalized cross-correlation value is the largest angle corresponding to the position
Figure PCTCN2016084277-appb-000040
according to
Figure PCTCN2016084277-appb-000041
Determine the angle of the first layer
Figure PCTCN2016084277-appb-000042
对于C'2中第一连通子集,使用基于旋转模板图像的角度搜索,将第2层的模板图像旋转
Figure PCTCN2016084277-appb-000043
即28度、29度、30度、31度、32度共5个可能的角度,分别和第2层的目标图像对应于C'2第一连通子集的区域进行模式匹配,每个旋转角度的模板图像和目标图像都会获取一个归一化互相关图,其中,归一化互相关图的取值范围为[-1,1],那么就会获取5个相同尺寸的归一化互相关图,根据这5个归一化互相关图,计算出每个位置上最大的归一化互相关值及其对应的旋转角度,获取一幅综合后的归一化互相关图及对应的角度图;再对于每个连通子集进行类似计算,结合所有结果得出归一化互相关图和对应的角度图。由上述得知设置的预置阈值为0.9,确定大于0.9的归一化互相关值对应的归一化互相关图C2和对应的角度图A2,其中,归一化互相关图C2和A2是一系列连通区域,对C2和A2进行上采样映射获取目标图像C'1和对应的角度图A'1
For the first connected subset in C' 2 , use the angle search based on the rotated template image to rotate the template image of the second layer
Figure PCTCN2016084277-appb-000043
That is, there are 5 possible angles of 28 degrees, 29 degrees, 30 degrees, 31 degrees, and 32 degrees, and pattern matching is performed respectively with the target image of the second layer corresponding to the area of the C' 2 first connected subset, and each rotation angle Both the template image and the target image will obtain a normalized cross-correlation graph, where the normalized cross-correlation graph has a value range of [-1, 1], then 5 normalized cross-correlations of the same size will be obtained. According to the five normalized cross-correlation maps, the largest normalized cross-correlation value at each position and its corresponding rotation angle are calculated, and a comprehensive normalized cross-correlation map and corresponding angles are obtained. A similar calculation is performed for each connected subset, and all the results are combined to obtain a normalized cross-correlation map and a corresponding angle map. It is known from the above that the preset threshold value is 0.9, and the normalized cross-correlation graph C 2 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 2 are determined , wherein the normalized cross-correlation graph C 2 And A 2 is a series of connected regions, and C 2 and A 2 are upsampled to obtain a target image C' 1 and a corresponding angle map A' 1 .
104、第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。104, when the first layer, obtaining a normalized cross-correlation value greater than a preset threshold value of the normalized cross-correlation FIG C 1 represents the original target image of the original template image and, C corresponding to the area A 1 1 corresponding to the angle of FIG. The position appearing in the corresponding angle angle corresponding to the angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
在本实施例中,第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。In this embodiment, when the first layer is obtained, the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the corresponding angle map A 1 , the area corresponding to C 1 represents the original template image. The position appearing in the original target image, the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
示例性的,第1层时,假设,目标图像C'1中第一连通子集里归一化互相关值最大的归一化互相关图对应的角度
Figure PCTCN2016084277-appb-000044
为29度,则第1层第一连通子集的区间角度为
Figure PCTCN2016084277-appb-000045
这里假设n1为1,则
Figure PCTCN2016084277-appb-000046
Exemplary, when the first layer is assumed that the target image C ', a first subset of the communication in the normalized cross-correlation maximum normalized cross-correlation values corresponding to the angle of FIG.
Figure PCTCN2016084277-appb-000044
At 29 degrees, the interval angle of the first connected subset of the first layer is
Figure PCTCN2016084277-appb-000045
Here, assuming n 1 is 1, then
Figure PCTCN2016084277-appb-000046
由上述得知,第2层第一连通子集的区间角度为[28,30],假设步长x1为1。,在[28,30]内按照步长为1使用第1层的模板图像对第1层的目标图像对应于C'1第一连通子集的区域进行模式匹配;对剩余的连通子集进行类似计算,最终结合所有连通子集的归一化互相关计算结果获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1From the above, it is known that the interval angle of the first connected subset of the second layer is [28, 30], and the step size x 1 is assumed to be 1. In [28, 30] according to the steps of a template image used for the first layer of the object image of the first layer corresponding to the region C '1 of the first subset of communication pattern matching; for the remaining subset of communication Similar to the calculation, the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold and the corresponding angle graph A 1 are finally obtained by combining the normalized cross-correlation calculation results of all connected subsets.
对于C'1中第一连通子集,使用基于旋转模板图像的角度搜索,将第1层 的模板图像旋转
Figure PCTCN2016084277-appb-000047
即28度、29度、30度共3个可能的角度,分别和第1层的目标图像对应于C'1第一连通子集的区域进行模式匹配,每个旋转角度的模板图像和目标图像都会获取一个归一化互相关图,其中,归一化互相关图的取值范围为[-1,1],那么就会获取3个相同尺寸的归一化互相关图,根据这3个归一化互相关图,计算出每个位置上最大的归一化互相关值及其对应的旋转角度,获取一幅综合后的归一化互相关图及对应的角度图;再对于每个连通子集进行类似计算,结合所有结果得出归一化互相关图和对应的角度图。由上述得知设置的预置阈值为0.9,确定大于0.9的归一化互相关值对应的归一化互相关图C1和对应的角度图A1,其中,归一化互相关图C1和A1是一系列连通区域。
For C 1 a first subset of communication ', using the rotation angle of the search based on the template image, the template image of the first layer of rotation
Figure PCTCN2016084277-appb-000047
I.e., 28 degrees, 29 degrees, 30 degrees, a total of three possible angles, respectively, and the object image of the first layer corresponding to the region C '1 of the first subset of communication pattern matching, the template image and the target image for each rotation angle A normalized cross-correlation graph is obtained, wherein the normalized cross-correlation graph has a value range of [-1, 1], then three normalized cross-correlation graphs of the same size are obtained, according to the three Normalize the cross-correlation map, calculate the largest normalized cross-correlation value at each position and its corresponding rotation angle, and obtain a combined normalized cross-correlation map and corresponding angle map; The connected subsets are similarly calculated, and all the results are combined to obtain a normalized cross-correlation map and corresponding angle maps. It is known from the above that the preset threshold value is 0.9, and the normalized cross-correlation graph C 1 corresponding to the normalized cross-correlation value greater than 0.9 and the corresponding angle graph A 1 are determined , wherein the normalized cross-correlation graph C 1 And A 1 is a series of connected areas.
所以,在第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1中每个连通子集归一化互相关值最大的位置表示原始的模板图像在原始的目标图像中最有可能出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像出现的位置时最有可能的旋转角。Therefore, in the first layer, the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the normalized cross-correlation value of each connected subset in the corresponding angle graph A 1 , C 1 is obtained. The largest position represents the most likely position of the original template image in the original target image, and the corresponding angle of the corresponding angle map A 1 represents the most likely rotation angle of the original template image when the original target image appears. .
需要说明的是,上述的示例中,在每层中大于预置阈值的归一化互相关图C'1,C'2,C'3,C'4中,实际上可包含多个连通子集,上述只是用其中的一个,也就是第一连通子集来进行说明,同理,若有多个连通子集时,也同样是这样的计算方法来确定区间角度。It should be noted that, in the above example, the normalized cross-correlation graphs C' 1 , C' 2 , C' 3 , C' 4 which are larger than the preset threshold in each layer may actually include a plurality of connected components. Set, the above is only used to illustrate one of them, that is, the first connected subset. Similarly, if there are multiple connected subsets, the same calculation method is used to determine the interval angle.
在本发明实施例中,在图像金字塔最顶层使用全角度模式匹配,在非最顶层的图像金字塔上,进行区间角度模式匹配,本发明在确保模式匹配精度的前提下,将模式匹配的计算量集中到低分辨率的金字塔图像上,从而降低了全角度模式匹配的运算复杂度,提升了运行效率,由于实际应用中,模式匹配通常都需要进行全角度搜索,因为此发明对于开发实时、高效的机器视觉应用将有非常大的帮助。In the embodiment of the present invention, the full-angle pattern matching is used at the top of the image pyramid, and the interval angle pattern matching is performed on the non-topmost image pyramid. The calculation amount of the pattern matching is ensured by the present invention under the premise of ensuring the pattern matching precision. Focusing on low-resolution pyramid images reduces the computational complexity of full-angle pattern matching and improves operational efficiency. Because of the actual application, pattern matching usually requires full-angle search because the invention is real-time and efficient for development. The machine vision application will be of great help.
请参阅图3所示,本发明一种图像模式匹配的方法的另一个实施例包括:Referring to FIG. 3, another embodiment of a method for image pattern matching according to the present invention includes:
301、获取原始的模板图像与原始的目标图像;301. Obtain an original template image and an original target image;
在本发明实施例中,步骤301和图1所示的步骤101相同,此处不再赘述。In the embodiment of the present invention, step 301 is the same as step 101 shown in FIG. 1, and details are not described herein again.
302、建立3层的模板图像金字塔和目标图像金字塔,模板图像金字塔从最底层到最顶层,面积逐层等比缩小,模板图像金字塔的最底层面积是原始的 模板图像的面积,目标图像金字塔从最底层到最顶层,面积逐层等比缩小,目标图像金字塔的最底层面积是原始的目标图像的面积,k为大于等于1的整数;302. Establish a 3-layer template image pyramid and a target image pyramid. The template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer. The bottom layer area of the template image pyramid is original. The area of the template image, the target image pyramid from the lowest to the top, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
在本发明实施例中,获取原始的模板图像与原始的目标图像之后,建立3层的模板图像金字塔和目标图像金字塔,说明原始的模板图像的面积比较小。模板图像金字塔从最底层到最顶层,面积逐层等比缩小,模板图像金字塔的最底层面积是原始的模板图像的面积;目标图像金字塔从最底层到最顶层,面积逐层等比缩小,目标图像金字塔的最底层面积是原始的目标图像的面积,k为大于等于1的整数。In the embodiment of the present invention, after acquiring the original template image and the original target image, a 3-layer template image pyramid and a target image pyramid are established, indicating that the original template image has a relatively small area. The template image pyramid is from the bottom to the top, and the area is scaled down by layer. The bottom layer area of the template image pyramid is the area of the original template image; the target image pyramid is from the bottom to the top, and the area is scaled down by layer. The bottom layer area of the image pyramid is the area of the original target image, and k is an integer greater than or equal to 1.
303、在第3层时,将第3层的模板图像与第3层的目标图像进行全角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C3和对应的角度图A3,并将归一化互相关图C3和对应的角度图A3上采样至第2层为2层的目标图像C’2和对应的角度图A’2303, when the third layer, the template image and the target image layer, the third layer, the third full angle of pattern matching, obtaining a normalized cross-correlation value greater than a preset threshold value of the normalized cross-correlation FIGS C 3 and the corresponding An angle view A 3 , and upsample the normalized cross-correlation map C 3 and the corresponding angle map A 3 to the second layer of the target image C' 2 of the second layer and the corresponding angle map A'2;
在本发明实施例中,在第3层时,将第3层的模板图像与第3层的目标图像进行全角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C3和对应的角度图A3,并将归一化互相关图C3和对应的角度图A3上采样至第2层为2层的目标图像C’2和对应的角度图A’2In the embodiment of the present invention, in the third layer, the template image of the third layer is matched with the target image of the third layer by full-angle mode, and the normalized cross-correlation whose normalized cross-correlation value is greater than the preset threshold is obtained. C 3 and FIG angles corresponding to FIG. a 3, and normalized cross-correlation C 3 and FIG angle corresponding to FIG sample layer 2 second layer is a target image C '2 and FIG angle corresponding a' on the a 3 2 .
具体的,全角度为[-π,π],可包括:在全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,xk+1为正整数。需要说明的是,因为建立的图像金字塔是k+1层等于3的金字塔,所以,当k<3时,xk+1=2kSpecifically, the full angle is [-π, π], which may include: using the template image of the k+1th layer to the target of the k+1th layer according to the step size x k+1 in the full angle [-π, π] The image is pattern matched and x k+1 is a positive integer. It should be noted that since the established image pyramid is a pyramid with a k+1 layer equal to 3, when k<3, x k+1 = 2 k .
那么,在第3层时,x3=22=4,在全角度[-π,π]内按照步长4使用第3层的模板图像对第3层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C3和对应的角度图A3,并将归一化互相关图C3和对应的角度图A3上采样至第2层为2层的目标图像C’2和对应的角度图A’2Then, in the third layer, x 3 = 2 2 = 4, in the full angle [-π, π] according to the step size 4 using the template image of the third layer to perform pattern matching on the target image of the third layer, obtaining the return Normalized cross-correlation graph C 3 and corresponding angle graph A 3 having a cross-correlation value greater than a preset threshold, and up-sampling the normalized cross-correlation graph C 3 and the corresponding angle graph A 3 to the second layer The 2-layer target image C' 2 and the corresponding angle map A' 2 .
304、在第2层时,将第2层的模板图像与第2层的目标图像C’2进行2层的区间角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C2和对应的角度图A2,并将归一化互相关图C2和对应的角度图A2上采样至第1层为1层的目标图像C’1和对应的角度图A’1304. In the second layer, the template image of the second layer and the target image C' 2 of the second layer are matched by the interval angle pattern of the two layers, and the normalized cross-correlation value is greater than the preset threshold. Correlating the graph C 2 and the corresponding angle map A 2 , and upsampling the normalized cross-correlation graph C 2 and the corresponding angle graph A 2 to the target image C′ 1 of the first layer and the corresponding angle graph A '1;
在本发明实施例中,在第2层时,将第2层的模板图像与第2层的目标图 像C’2进行2层的区间角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C2和对应的角度图A2,并将归一化互相关图C2和对应的角度图A2上采样至第1层为1层的目标图像C’1和对应的角度图A’1In the embodiment of the present invention, in the second layer, the template image of the second layer and the target image C' 2 of the second layer are matched by the two-layer interval angle pattern, and the normalized cross-correlation value is greater than the preset threshold. Normalized cross-correlation graph C 2 and corresponding angle graph A 2 , and upsampled normalized cross-correlation graph C 2 and corresponding angle graph A 2 to target image C' 1 of layer 1 of layer 1 and Corresponding angle diagram A' 1 .
需要说明的是,在进行区间角度模式匹配之前,还包括:确定第2层的目标图像C’2中每个连通子集内,归一化互相关值最大的位置对应到A’2上的角度,为
Figure PCTCN2016084277-appb-000048
根据
Figure PCTCN2016084277-appb-000049
确定2层的区间角度
Figure PCTCN2016084277-appb-000050
(n2为正整数)。这里的n2可以是21=2。
It should be noted that, before the interval angle mode matching is performed, the method further includes: determining, in each connected subset of the target image C′ 2 of the second layer, the position where the normalized cross-correlation value is the largest corresponds to the A′ 2 Angle, for
Figure PCTCN2016084277-appb-000048
according to
Figure PCTCN2016084277-appb-000049
Determine the interval angle of the 2 layers
Figure PCTCN2016084277-appb-000050
(n 2 is a positive integer). Here n 2 can be 2 1 = 2.
具体的,在第2层时,在区间角度
Figure PCTCN2016084277-appb-000051
内按照步长为2使用第2层的模板图像对第2层的目标图像C’2进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C2和对应的角度图A2,并将归一化互相关图C2和对应的角度图A2上采样至第1层为1层的目标图像C’1和对应的角度图A’1
Specifically, in the second layer, at the interval angle
Figure PCTCN2016084277-appb-000051
Performing pattern matching on the target image C' 2 of the second layer using the template image of the second layer according to the step size 2, and obtaining the normalized cross-correlation graph C 2 and the corresponding normalized cross-correlation value greater than the preset threshold. The angle map A 2 and the normalized cross-correlation map C 2 and the corresponding angle map A 2 are upsampled to the target image C' 1 of the first layer and the corresponding angle map A' 1 .
305、第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。305, when the first layer, obtaining a normalized cross-correlation value greater than a preset threshold value of the normalized cross-correlation FIG C 1 represents the original target image of the original template image and, C corresponding to the area A 1 1 corresponding to the angle of FIG. The position appearing in the corresponding angle angle corresponding to the angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
在本发明实施例中,第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。In the embodiment of the present invention, when the first layer is obtained, the normalized cross-correlation graph C 1 with the normalized cross-correlation value greater than the preset threshold is obtained, and the corresponding angle map A 1 , the region corresponding to C 1 represents the original template image. At the position appearing in the original target image, the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
需要说明的是,在获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1之前,还包括:确定第1层的目标图像C’1中每个连通子集内,归一化互相关值最大的位置对应到A’1上的角度,为
Figure PCTCN2016084277-appb-000052
Figure PCTCN2016084277-appb-000053
根据
Figure PCTCN2016084277-appb-000054
确定1层的区间角度
Figure PCTCN2016084277-appb-000055
(n1为正整数)。这里的n1可以是20=1。
It should be noted that, before obtaining the normalized cross-correlation graph C 1 and the corresponding angle graph A 1 whose normalized cross-correlation value is greater than a preset threshold, the method further includes: determining each target image C′ 1 of the first layer Within the connected subset, the position with the largest normalized cross-correlation value corresponds to the angle on A' 1
Figure PCTCN2016084277-appb-000052
Figure PCTCN2016084277-appb-000053
according to
Figure PCTCN2016084277-appb-000054
Determine the interval angle of the 1st floor
Figure PCTCN2016084277-appb-000055
(n 1 is a positive integer). Here n 1 can be 2 0 =1.
具体的,在第1层时,在区间角度
Figure PCTCN2016084277-appb-000056
内按照步长为1使用第1层的模板图像对第1层的目标图像C’1进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1。那么C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。
Specifically, at the first layer, at the interval angle
Figure PCTCN2016084277-appb-000056
Performing pattern matching on the target image C' 1 of the first layer using the template image of the first layer according to the step size of 1 to obtain a normalized cross-correlation graph C 1 with a normalized cross-correlation value greater than a preset threshold and corresponding Angle view A 1 . Then, the area corresponding to C 1 represents the position where the original template image appears in the original target image, and the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
需要说明的是,在本发明实施例中,具体的模式匹配的过程这里没有详细说明,可以参考上述图1中表述的内容。It should be noted that, in the embodiment of the present invention, the specific pattern matching process is not described in detail herein, and the content expressed in FIG. 1 above may be referred to.
上面对图像模式匹配的方法进行描述,该方法应用于图像模式匹配装置,下面对该装置进行描述,请参阅图4所示,本发明提供的图像模式匹配的装置的一个实施例包括:The method for image pattern matching is described above, and the method is applied to the image pattern matching device. The device is described below. Referring to FIG. 4, an embodiment of the image pattern matching device provided by the present invention includes:
第一获取模块401,用于获取原始的模板图像与原始的目标图像;a first obtaining module 401, configured to acquire an original template image and an original target image;
建立模块402,用于建立k+1层的模板图像金字塔和目标图像金字塔,所原始的模板图像金字塔从最底层到最顶层,面积逐层等比缩小,模板图像金字塔的最底层面积是原始的模板图像的面积,目标图像金字塔从最底层到最顶层,面积逐层等比缩小,目标图像金字塔的最底层面积是原始的目标图像的面积,k为大于等于1的整数;The module 402 is configured to establish a template image pyramid and a target image pyramid of the k+1 layer. The original template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer. The bottom layer area of the template image pyramid is original. The area of the template image, the target image pyramid from the lowest to the top, the area is reduced by layer by layer, the bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
模式匹配模块403,用于将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;最顶层的目标图像为原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;The pattern matching module 403 is configured to perform pattern matching between the template image of each layer and the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle map A with normalized cross-correlation values greater than a preset threshold; Wherein, the pattern of the topmost template image matches the pattern of the topmost target image is a full-angle pattern matching, and the pattern images of the other layer's template image and the corresponding layer's target image are matched to the interval angle pattern; the topmost target image is original. When the target image is reduced to the top layer, the target images of the other layers are all sampled by the previous layer for pattern matching, and the normalized cross-correlation map is sampled to the next layer;
第二获取模块404,用于第1层时,获取归一化互相关值大于预置阈值的归一化互相关图C1和对应的角度图A1,C1对应的区域表示原始的模板图像在原始的目标图像中出现的位置,对应的角度图A1对应的角度表示原始的模板图像在原始的目标图像中出现的位置时的旋转角。A second acquiring module 404, a first layer, obtaining a normalized cross-correlation value greater than a preset threshold value, a normalized cross-correlation C of FIG. 1 and represents the original template, C corresponding to the region corresponding to the angle A 1 1 FIG. The position at which the image appears in the original target image, and the angle corresponding to the corresponding angle map A 1 represents the rotation angle of the original template image at the position where the original target image appears.
可选的,在本发明的一些实施例中,Optionally, in some embodiments of the invention,
模式匹配模块403,具体用于将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’kThe pattern matching module 403 is specifically configured to perform a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtain a normalized cross-correlation graph whose normalized cross-correlation value is greater than a preset threshold. C k+1 and the corresponding angle map A k+1 , and upsample the normalized cross-correlation map C k+1 and the corresponding angle map A k+1 to the target image C' k of the k-th layer And the corresponding angle map A' k .
可选的,在本发明的一些实施例中,全角度为[-π,π],Optionally, in some embodiments of the invention, the full angle is [-π, π],
模式匹配模块403,具体还用于在全角度[-π,π]内按照步长xk+1使用第k+1 层的模板图像对第k+1层的目标图像进行模式匹配,xk+1为正整数。The pattern matching module 403 is further configured to perform pattern matching on the target image of the k+1th layer by using the template image of the k+1th layer according to the step size x k+1 in the full angle [-π, π], x k +1 is a positive integer.
可选的,在本发明的一些实施例中,Optionally, in some embodiments of the invention,
模式匹配模块403,具体还用于将第a层的模板图像与第a层的目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图Ca和对应的角度图Aa,并将归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。The pattern matching module 403 is further configured to perform the interval angle pattern matching of the layer image of the layer a and the target image C′ a of the layer a to obtain a normalized cross-correlation value greater than a preset threshold. The cross-correlation map Ca and the corresponding angle map A a , and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the target image C' a- of the a-1 layer of the a-1st layer 1 and the corresponding angle diagram A' a-1 , 1 < a ≤ k, and a is a positive integer.
可选的,在本发明的一些实施例中,在图4所示的基础上,如图5所示,装置还包括:Optionally, in some embodiments of the present invention, as shown in FIG. 4, as shown in FIG. 5, the apparatus further includes:
第一确定模块405,用于确定其他每层的目标图像C’a中每个连通子集内,归一化互相关值最大的位置对应到A’a上的角度,为
Figure PCTCN2016084277-appb-000057
First determining module 405 for determining 'of the communication of each of a subset of the normalized cross-correlation maximum values corresponding to the position A' of each other C object image on an angle a, as
Figure PCTCN2016084277-appb-000057
第二确定模块406,用于根据
Figure PCTCN2016084277-appb-000058
确定a层的区间角度
Figure PCTCN2016084277-appb-000059
(na为正整数)。
a second determining module 406, configured to
Figure PCTCN2016084277-appb-000058
Determine the interval angle of the a layer
Figure PCTCN2016084277-appb-000059
(n a is a positive integer).
可选的,在本发明的一些实施例中,Optionally, in some embodiments of the invention,
模式匹配模块403,具体还用于在区间角度
Figure PCTCN2016084277-appb-000060
内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,xa为正整数。
The pattern matching module 403 is specifically used for the interval angle
Figure PCTCN2016084277-appb-000060
According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, x a is a positive integer.
可选的,在本发明的一些实施例中,当k<3时,xk+1=2kOptionally, in some embodiments of the present invention, when k<3, x k+1 = 2 k ;
模式匹配模块403,具体还用于在全角度[-π,π]内按照步长2k使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配。 Pattern matching module 403, is also used to specifically target image k + 1 th layer is a template image for pattern matching according to step 2 k k + 1 using the first layer in the whole angle [-π, π] within.
如图6所示,本发明实施例中图像模式匹配的装置的另一个实施例包括:As shown in FIG. 6, another embodiment of an apparatus for image pattern matching in an embodiment of the present invention includes:
存储器601,处理器602和总线603;存储器601、处理器602通过总线603连接;存储器601用于存储执行本发明方案中媒体流发送设备所执行方法的应用程序代码,并由处理器602来控制执行。处理器602用于执行存储器中存储的应用程序代码。The memory 601, the processor 602 and the bus 603; the memory 601 and the processor 602 are connected by a bus 603; the memory 601 is configured to store application code for executing the method executed by the media stream transmitting device in the solution of the present invention, and is controlled by the processor 602. carried out. The processor 602 is configured to execute application code stored in the memory.
存储器601可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM) 或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The memory 601 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type that can store information and instructions. The dynamic storage device can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM) or a Compact Disc Read-Only Memory (CD-ROM). Or other disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry or store expectations in the form of instructions or data structures Program code and any other medium that can be accessed by a computer, but is not limited thereto. The memory can exist independently and be connected to the processor via a bus. The memory can also be integrated with the processor.
处理器602可以是一个通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。也可以是一种集成电路芯片,具有信号处理能力,可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中的各方法、步骤及逻辑框图。 Processor 602 can be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. It can also be an integrated circuit chip with signal processing capability, which can be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device. Each of the methods, steps, and logic blocks in the embodiments of the present invention may be implemented or executed by a discrete gate or a transistor logic device or a discrete hardware component.
总线603可包括一通路,在上述组件之间传送信息。 Bus 603 can include a path for communicating information between the components described above.
具体的,处理器用于执行上述图1或图3图像模式匹配的方法中的步骤,此处不再赘述。Specifically, the processor is used to perform the steps in the foregoing method for image pattern matching in FIG. 1 or FIG. 3, and details are not described herein again.
本发明实施例还提供了一种计算机存储介质,用于储存为上述图4或图5的图像模式匹配的装置所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序。通过执行存储的程序,可以降低模式匹配算法中图像匹配的时长。The embodiment of the invention further provides a computer storage medium for storing computer software instructions for the image pattern matching device of FIG. 4 or FIG. 5, which comprises a program designed to execute the above method embodiment. By executing a stored program, the length of image matching in the pattern matching algorithm can be reduced.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。 In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the technical solutions of the embodiments of the present invention.

Claims (15)

  1. 一种图像模式匹配的方法,其特征在于,包括:A method for image pattern matching, comprising:
    获取原始的模板图像与原始的目标图像;Acquiring the original template image with the original target image;
    建立k+1层的模板图像金字塔和目标图像金字塔,所述模板图像金字塔从最底层到最顶层,面积逐层等比缩小,所述模板图像金字塔的最底层面积是所述原始的模板图像的面积,所述目标图像金字塔从最底层到最顶层,面积逐层等比缩小,所述目标图像金字塔的最底层面积是所述原始的目标图像的面积,k为大于等于1的整数;Establishing a template image pyramid and a target image pyramid of a k+1 layer, the template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer, and the bottom layer area of the template image pyramid is the original template image. An area, the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
    将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;所述最顶层的目标图像为所述原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;Performing pattern matching on the template image of each layer and the target image of the corresponding layer to obtain a normalized cross-correlation graph C and a corresponding angle map A with normalized cross-correlation values greater than a preset threshold; wherein, the topmost template image The pattern matching with the topmost target image is matched to the full angle pattern, and the pattern images of the other layer's template image and the target image of the corresponding layer are matched to the interval angle pattern; the topmost target image is the original target image, etc. The normalized cross-correlation map obtained by pattern matching obtained from the previous layer is obtained by zooming to the top layer, and the target image of the other layer is sampled to the next layer.
    第1层时,获取归一化互相关值大于所述预置阈值的归一化互相关图C1和对应的角度图A1,所述C1对应的区域表示所述原始的模板图像在所述原始的目标图像中出现的位置,所述对应的角度图A1对应的角度表示所述原始的模板图像在所述原始的目标图像中出现的位置时的旋转角。In the first layer, a normalized cross-correlation map C 1 having a normalized cross-correlation value greater than the preset threshold is obtained, and a corresponding angle map A 1 , where the area corresponding to C 1 indicates that the original template image is the original position of the target image appears, a 1 corresponds to the angle corresponding to an angle view showing the rotation angle position of the original template image appearing in the original target image.
  2. 根据权利要求1所述的方法,其特征在于,最顶层的模板图像与最顶层的目标图像进行的全角度模式匹配包括:The method of claim 1 wherein the full-angle pattern matching of the topmost template image with the topmost target image comprises:
    将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于所述预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将所述归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’kPerforming a full-angle pattern matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtaining a normalized cross-correlation graph Ck+1 and corresponding to the normalized cross-correlation value greater than the preset threshold An angle map A k+1 , and up-samples the normalized cross-correlation map C k+1 and the corresponding angle map A k+1 to the target image C′ k of the k-th layer and the corresponding angle Figure A' k .
  3. 根据权利要求2所述的方法,其特征在于,所述全角度为[-π,π],The method according to claim 2, wherein said full angle is [-π, π],
    所述将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,包括:The matching the template image of the k+1th layer with the target image of the k+1th layer is performed in an all-angle mode, including:
    在所述全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,所述xk+1为正整数。 Performing pattern matching on the target image of the k+1th layer using the template image of the k+1th layer in the full angle [-π, π] according to the step size x k+1 , the x k+1 being a positive integer .
  4. 根据权利要求1所述的方法,其特征在于,其他每层的模板图像与对应层的目标图像进行的区间角度模式匹配包括:The method according to claim 1, wherein the interval angle pattern matching performed by the template image of each of the other layers and the target image of the corresponding layer comprises:
    将第a层的模板图像与第a层的所述目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于所述预置阈值的归一化互相关图Ca和对应的角度图Aa,并将所述归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。Angle interval pattern matching of a template image and the second layer a layer of the target image C 'a a layer for obtaining a normalized cross-correlation value is greater than the preset threshold value of the normalized cross-correlation C a in FIG. And the corresponding angle map A a , and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the target image C' a-1 of the a-1 layer and corresponding to the a-1 layer FIG angle a 'a-1, 1 < a≤k, a is a positive integer and.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, wherein the method further comprises:
    确定所述其他每层的目标图像C’a中每个连通子集内,所述归一化互相关值最大的位置对应到A’a上的角度,为
    Figure PCTCN2016084277-appb-100001
    所述
    Figure PCTCN2016084277-appb-100002
    Determining, in each connected subset of the target images C' a of each of the other layers, the position of the normalized cross-correlation value corresponding to the angle on A' a is
    Figure PCTCN2016084277-appb-100001
    Said
    Figure PCTCN2016084277-appb-100002
    根据所述
    Figure PCTCN2016084277-appb-100003
    确定a层的区间角度
    Figure PCTCN2016084277-appb-100004
    (na为正整数)。
    According to the
    Figure PCTCN2016084277-appb-100003
    Determine the interval angle of the a layer
    Figure PCTCN2016084277-appb-100004
    (n a is a positive integer).
  6. 根据权利要求4或5所述的方法,其特征在于,Method according to claim 4 or 5, characterized in that
    所述将第a层的模板图像与第a层的所述目标图像C’a进行a层的区间角度模式匹配,包括:The matching the template image of the layer a and the target image C' a of the layer a to the interval angle pattern of the layer a includes:
    在所述区间角度
    Figure PCTCN2016084277-appb-100005
    内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,所述xa为正整数。
    In the interval angle
    Figure PCTCN2016084277-appb-100005
    According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, said x a positive integer.
  7. 根据权利要求3所述的方法,其特征在于,当k<3时,xk+1=2kThe method according to claim 3, wherein when k < 3, x k+1 = 2 k ;
    在所述全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,包括:Performing pattern matching on the target image of the k+1th layer using the template image of the k+1th layer according to the step size xk+1 in the full angle [-π, π], including:
    在所述全角度[-π,π]内按照步长2k使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配。Target image k + 1 th layer is a template image for pattern matching according to step 2 k k + 1 using the first layer in said full angle [-π, π] within.
  8. 一种图像模式匹配的装置,其特征在于,包括:An apparatus for image pattern matching, comprising:
    第一获取模块,用于获取原始的模板图像与原始的目标图像;a first acquiring module, configured to acquire an original template image and an original target image;
    建立模块,用于建立k+1层的模板图像金字塔和目标图像金字塔,所原始的模板图像金字塔从最底层到最顶层,面积逐层等比缩小,所述模板图像金字塔的最底层面积是所述原始的模板图像的面积,所述目标图像金字塔从最底层到最顶层,面积逐层等比缩小,所述目标图像金字塔的最底层面积是所述原始的目标图像的面积,所述k为大于等于1的整数;A module is established for establishing a template image pyramid and a target image pyramid of the k+1 layer, the original template image pyramid is reduced from the lowest layer to the top layer, and the area is reduced by layer by layer, and the bottom layer area of the template image pyramid is The area of the original template image, the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the original target image, and the k is An integer greater than or equal to 1;
    模式匹配模块,用于将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图 A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;所述最顶层的目标图像为所述原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;The pattern matching module is configured to pattern match the template image of each layer with the target image of the corresponding layer, and obtain a normalized cross-correlation graph C and a corresponding angle map with the normalized cross-correlation value greater than a preset threshold. A; wherein the pattern of the topmost template image matches the pattern of the topmost target image is a full angle pattern matching, and the pattern image of the template image of the other layer matches the pattern of the target image of the corresponding layer to the interval angle pattern matching; the topmost target The image is obtained when the original target image is reduced to the topmost level, and the target images of the other layers are all sampled by the previous layer for pattern matching, and the normalized cross-correlation map is sampled to the next layer;
    第二获取模块,用于第1层时,获取归一化互相关值大于所述预置阈值的归一化互相关图C1和对应的角度图A1,所述C1对应的区域表示所述原始的模板图像在所述原始的目标图像中出现的位置,所述对应的角度图A1对应的角度表示所述原始的模板图像在所述原始的目标图像中出现的位置时的旋转角。a second obtaining module, when used in the first layer, obtains a normalized cross-correlation graph C 1 and a corresponding angle graph A 1 whose normalized cross-correlation value is greater than the preset threshold, and the area corresponding to the C 1 a position at which the original template image appears in the original target image, and an angle corresponding to the corresponding angle map A 1 represents a rotation of the original template image at a position appearing in the original target image angle.
  9. 根据权利要求8所述的装置,其特征在于,The device of claim 8 wherein:
    所述模式匹配模块,具体用于将第k+1层的模板图像与第k+1层的目标图像进行全角度模式匹配,获取归一化互相关值大于所述预置阈值的归一化互相关图Ck+1和对应的角度图Ak+1,并将所述归一化互相关图Ck+1和对应的角度图Ak+1上采样至第k层为k层的目标图像C’k和对应的角度图A’kThe mode matching module is configured to perform a full-angle mode matching between the template image of the k+1th layer and the target image of the k+1th layer, and obtain a normalization that the normalized cross-correlation value is greater than the preset threshold. Correlation graph C k+1 and corresponding angle graph A k+1 , and up-sampling the normalized cross-correlation graph C k+1 and the corresponding angle graph A k+1 to the k-th layer The target image C'k and the corresponding angle map A'k .
  10. 根据权利要求9所述的装置,其特征在于,所述全角度为[-π,π],The apparatus according to claim 9, wherein said full angle is [-π, π],
    所述模式匹配模块,具体还用于在所述全角度[-π,π]内按照步长xk+1使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配,所述xk+1为正整数。The pattern matching module is further configured to perform pattern matching on the target image of the k+1th layer by using the template image of the k+1th layer according to the step size x k+1 in the full angle [-π, π] the x k + 1 is a positive integer.
  11. 根据权利要求8所述的装置,其特征在于,The device of claim 8 wherein:
    所述模式匹配模块,具体还用于将第a层的模板图像与第a层的所述目标图像C’a进行a层的区间角度模式匹配,获取归一化互相关值大于所述预置阈值的归一化互相关图Ca和对应的角度图Aa,并将所述归一化互相关图Ca和对应的角度图Aa上采样至第a-1层为a-1层的目标图像C’a-1和对应的角度图A’a-1,1<a≤k,且a为正整数。The pattern matching module is further configured to layer a first template image with the target image of a layer C 'a layer for a pattern matching angle section, obtaining a normalized cross-correlation value is greater than the preset The normalized cross-correlation map C a of the threshold and the corresponding angle map A a , and up-sampling the normalized cross-correlation map Ca and the corresponding angle map A a to the a-1 layer The target image C'a -1 and the corresponding angle map A'a -1 , 1<a≤k, and a is a positive integer.
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, wherein the device further comprises:
    第一确定模块,用于确定所述其他每层的目标图像C’a中每个连通子集内,所述归一化互相关值最大的位置对应到A’a上的角度,为
    Figure PCTCN2016084277-appb-100006
    所述
    Figure PCTCN2016084277-appb-100007
    a first determining module, configured to determine, in each connected subset of the target images C' a of each of the other layers, the position where the normalized cross-correlation value is the largest corresponds to an angle on A' a ,
    Figure PCTCN2016084277-appb-100006
    Said
    Figure PCTCN2016084277-appb-100007
    第二确定模块,用于根据所述
    Figure PCTCN2016084277-appb-100008
    确定a层的区间角度
    Figure PCTCN2016084277-appb-100009
    (na为正整数)。
    a second determining module for
    Figure PCTCN2016084277-appb-100008
    Determine the interval angle of the a layer
    Figure PCTCN2016084277-appb-100009
    (n a is a positive integer).
  13. 根据权利要求11或12所述的装置,其特征在于,Device according to claim 11 or 12, characterized in that
    所述模式匹配模块,具体还用于在所述区间角度
    Figure PCTCN2016084277-appb-100010
    内按照步长为xa使用第a层的模板图像对第a层的目标图像C’a进行模式匹配,所述xa为正整数。
    The pattern matching module is specifically used for the interval angle
    Figure PCTCN2016084277-appb-100010
    According to the steps of using the first layer a x a template image of a target image layer C 'a pattern matching, said x a positive integer.
  14. 根据权利要求10所述的装置,其特征在于,当k<3时,xk+1=2kThe apparatus according to claim 10, wherein when k < 3, x k+1 = 2 k ;
    所述模式匹配模块,具体还用于在所述全角度[-π,π]内按照步长2k使用第k+1层的模板图像对第k+1层的目标图像进行模式匹配。The pattern matching module is further configured to use a template image k + 1 th layer in said full angle [-π, π] 2 k according to the steps of the target image k + 1 th layer pattern matching.
  15. 一种图像模式匹配的装置,其特征在于,包括:An apparatus for image pattern matching, comprising:
    存储器,处理器和总线;Memory, processor and bus;
    存储器、处理器通过总线连接;The memory and the processor are connected by a bus;
    存储器用于存储所述装置执行的应用程序代码,所述处理器被配置为用于执行所述存储器中存储的应用程序;a memory for storing application code executed by the apparatus, the processor being configured to execute an application stored in the memory;
    所述处理器用于获取原始的模板图像与原始的目标图像;The processor is configured to acquire an original template image and an original target image;
    建立k+1层的模板图像金字塔和目标图像金字塔,所述模板图像金字塔从最底层到最顶层,面积逐层等比缩小,所述模板图像金字塔的最底层面积是所述原始的模板图像的面积,所述目标图像金字塔从最底层到最顶层,面积逐层等比缩小,所述目标图像金字塔的最底层面积是所述原始的目标图像的面积,k为大于等于1的整数;Establishing a template image pyramid and a target image pyramid of a k+1 layer, the template image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer, and the bottom layer area of the template image pyramid is the original template image. An area, the target image pyramid is reduced from the lowest layer to the top layer, and the area is scaled down by layer. The bottom layer area of the target image pyramid is the area of the original target image, and k is an integer greater than or equal to 1;
    将每一层的模板图像与对应层的目标图像进行模式匹配,获取归一化互相关值大于预置阈值的归一化互相关图C和对应的角度图A;其中,最顶层的模板图像与最顶层的目标图像的模式匹配为全角度模式匹配,其他层的模板图像与对应层的目标图像的模式匹配为区间角度模式匹配;所述最顶层的目标图像为所述原始的目标图像等比缩小至最顶层时得到的,其他层的目标图像均为上一层进行模式匹配获取的归一化互相关图上采样至下一层得到的;Performing pattern matching on the template image of each layer and the target image of the corresponding layer to obtain a normalized cross-correlation graph C and a corresponding angle map A with normalized cross-correlation values greater than a preset threshold; wherein, the topmost template image The pattern matching with the topmost target image is matched to the full angle pattern, and the pattern images of the other layer's template image and the target image of the corresponding layer are matched to the interval angle pattern; the topmost target image is the original target image, etc. The normalized cross-correlation map obtained by pattern matching obtained from the previous layer is obtained by zooming to the top layer, and the target image of the other layer is sampled to the next layer.
    第1层时,获取归一化互相关值大于所述预置阈值的归一化互相关图C1和对应的角度图A1,所述C1对应的区域表示所述原始的模板图像在所述原始的目标图像中出现的位置,所述对应的角度图A1对应的角度表示所述原始的模板图像在所述原始的目标图像中出现的位置时的旋转角。 In the first layer, a normalized cross-correlation map C 1 having a normalized cross-correlation value greater than the preset threshold is obtained, and a corresponding angle map A 1 , where the area corresponding to C 1 indicates that the original template image is the original position of the target image appears, a 1 corresponds to the angle corresponding to an angle view showing the rotation angle position of the original template image appearing in the original target image.
PCT/CN2016/084277 2016-06-01 2016-06-01 Method and device for image pattern matching WO2017206099A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/084277 WO2017206099A1 (en) 2016-06-01 2016-06-01 Method and device for image pattern matching
CN201680039123.3A CN107851196B (en) 2016-06-01 2016-06-01 Image pattern matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/084277 WO2017206099A1 (en) 2016-06-01 2016-06-01 Method and device for image pattern matching

Publications (1)

Publication Number Publication Date
WO2017206099A1 true WO2017206099A1 (en) 2017-12-07

Family

ID=60479423

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/084277 WO2017206099A1 (en) 2016-06-01 2016-06-01 Method and device for image pattern matching

Country Status (2)

Country Link
CN (1) CN107851196B (en)
WO (1) WO2017206099A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110728326A (en) * 2019-10-15 2020-01-24 易思维(杭州)科技有限公司 Edge template matching method with rotation
CN111862053A (en) * 2020-07-22 2020-10-30 上海米哈游天命科技有限公司 Method, device, equipment and medium for searching gap
CN112541885A (en) * 2020-11-26 2021-03-23 蓝箭航天空间科技股份有限公司 Method and system for detecting liquid level of rocket tank
CN113643370A (en) * 2021-08-24 2021-11-12 凌云光技术股份有限公司 Image positioning method and device based on NCC algorithm
CN116543188A (en) * 2023-07-06 2023-08-04 深圳市睿达科技有限公司 Machine vision matching method and system based on gray level matching

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108986088A (en) * 2018-07-10 2018-12-11 安徽师范大学 A kind of image based on MATLAB automatically extracts optimization method and equipment
CN109559308B (en) * 2018-11-29 2022-11-04 太原理工大学 Machine vision-based liquid crystal panel polaroid code spraying detection method and device
CN111369599B (en) * 2018-12-25 2024-04-16 阿里巴巴集团控股有限公司 Image matching method, device, apparatus and storage medium
CN110210565B (en) * 2019-06-05 2021-04-30 中科新松有限公司 Normalized cross-correlation image template matching realization method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100119162A1 (en) * 2008-11-06 2010-05-13 Yuyu Liu Image processing apparatus, image processing method, and program
CN102654902A (en) * 2012-01-16 2012-09-05 江南大学 Contour vector feature-based embedded real-time image matching method
CN103076338A (en) * 2012-05-31 2013-05-01 西南交通大学 Rapid fuzzy matching method for testing bad conditions of high-speed rail catenary rod type insulators
CN103077527A (en) * 2013-02-05 2013-05-01 湖北工业大学 Robust multi-source satellite remote sensing image registration method
CN103778619A (en) * 2012-10-17 2014-05-07 华中科技大学 Image matching method based on Zernike matrix
CN104252711A (en) * 2014-09-17 2014-12-31 华中科技大学 Matching method based on image gradient direction code

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556694B (en) * 2009-05-15 2011-07-06 广东工业大学 Matching method of rotating images
CN103679702B (en) * 2013-11-20 2016-08-31 华中科技大学 A kind of matching process based on image border vector

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100119162A1 (en) * 2008-11-06 2010-05-13 Yuyu Liu Image processing apparatus, image processing method, and program
CN102654902A (en) * 2012-01-16 2012-09-05 江南大学 Contour vector feature-based embedded real-time image matching method
CN103076338A (en) * 2012-05-31 2013-05-01 西南交通大学 Rapid fuzzy matching method for testing bad conditions of high-speed rail catenary rod type insulators
CN103778619A (en) * 2012-10-17 2014-05-07 华中科技大学 Image matching method based on Zernike matrix
CN103077527A (en) * 2013-02-05 2013-05-01 湖北工业大学 Robust multi-source satellite remote sensing image registration method
CN104252711A (en) * 2014-09-17 2014-12-31 华中科技大学 Matching method based on image gradient direction code

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110728326A (en) * 2019-10-15 2020-01-24 易思维(杭州)科技有限公司 Edge template matching method with rotation
CN111862053A (en) * 2020-07-22 2020-10-30 上海米哈游天命科技有限公司 Method, device, equipment and medium for searching gap
CN111862053B (en) * 2020-07-22 2023-11-28 上海米哈游天命科技有限公司 Method, device, equipment and medium for searching gap
CN112541885A (en) * 2020-11-26 2021-03-23 蓝箭航天空间科技股份有限公司 Method and system for detecting liquid level of rocket tank
CN113643370A (en) * 2021-08-24 2021-11-12 凌云光技术股份有限公司 Image positioning method and device based on NCC algorithm
CN113643370B (en) * 2021-08-24 2024-01-23 凌云光技术股份有限公司 NCC algorithm-based image positioning method and device
CN116543188A (en) * 2023-07-06 2023-08-04 深圳市睿达科技有限公司 Machine vision matching method and system based on gray level matching
CN116543188B (en) * 2023-07-06 2023-10-13 深圳市睿达科技有限公司 Machine vision matching method and system based on gray level matching

Also Published As

Publication number Publication date
CN107851196A (en) 2018-03-27
CN107851196B (en) 2020-02-14

Similar Documents

Publication Publication Date Title
WO2017206099A1 (en) Method and device for image pattern matching
US11210550B2 (en) Image-based feature detection using edge vectors
Walch et al. Image-based localization using lstms for structured feature correlation
US8401276B1 (en) 3-D reconstruction and registration
Lin et al. Line segment extraction for large scale unorganized point clouds
JP6374107B2 (en) Improved calibration for eye tracking system
US11189020B2 (en) Systems and methods for keypoint detection
JP5722502B2 (en) Planar mapping and tracking for mobile devices
CN108765476B (en) Polarized image registration method
US9633281B2 (en) Point cloud matching method
WO2018120038A1 (en) Method and device for target detection
WO2016146001A1 (en) Three-dimensional modelling method and device
WO2022205611A1 (en) Image matching method and apparatus, and device and storage medium
WO2022100065A1 (en) Image registration method and apparatus, electronic device and storage medium
CN115516508A (en) System and method for real-time multi-modal image alignment
CN111767960A (en) Image matching method and system applied to image three-dimensional reconstruction
AliAkbarpour et al. Fast structure from motion for sequential and wide area motion imagery
Lai et al. A real-time range finding system with binocular stereo vision
CN109447022A (en) A kind of lens type recognition methods and device
CN112465876A (en) Stereo matching method and equipment
CN114612575A (en) Camera parameter calibration and three-dimensional data generation method and system
WO2022062853A1 (en) Remote sensing image registration method and apparatus, device, storage medium, and system
WO2018076137A1 (en) Method and device for obtaining hyper-spectral image feature descriptor
Hui et al. Determining shape and motion from monocular camera: A direct approach using normal flows
Jasphin et al. 3D Feature Descriptors and Image Reconstruction Techniques: A Review

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16903484

Country of ref document: EP

Kind code of ref document: A1