Image point area searching and registering method and system of machine vision

By calculating the feature similarity value and structural similarity value between the template area and the search area, accurate image points with the same name are determined, which solves the problem of insufficient registration density and accuracy in the existing technology and improves the accuracy and efficiency of three-dimensional modeling.

CN118608580APending Publication Date: 2024-09-06CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410723367.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing machine vision image registration methods are deficient in the registration density and accuracy of the target image points, resulting in low three-dimensional accuracy of the point cloud of the object to be measured, and even inability to perform three-dimensional modeling.

Method used

A machine vision image point area search and registration method is used to determine the exact image point with the same name by calculating the feature similarity value and structural similarity value between the neighborhood feature matrix of the template area and the neighborhood feature matrix of the search area. And registration is carried out based on this until the precise same-named image points in all images to be registered are obtained.

Benefits of technology

The registration accuracy and density of the target image points are improved, thereby improving the three-dimensional accuracy of the point cloud of the object to be measured, making the three-dimensional modeling proceed smoothly, reducing the amount of registration calculations, and improving the registration efficiency and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608580A
    Figure CN118608580A
Patent Text Reader

Abstract

The invention relates to the technical field of image registration, and provides a machine vision image point area search registration method and system. The method comprises the following steps: setting a first template area by taking a target image point in a registered target image as a center; establishing a search area by taking a mapping image point of the target image point in the second to-be-registered image as a center, and establishing a second template area by taking each image point in the search area as a center; and determining the central image point of the second template region when the weighted sum of the feature similarity value and the structural similarity value between the neighborhood feature matrixes of the two template regions is maximum as the accurate homonymy image point of the target image point, and sequentially obtaining the accurate homonymy image points in all the to-be-registered images. According to the method and the device, the same-name image point which is most similar to the target image point in the registered target image is acquired in the mapping region of each to-be-registered image through the feature similarity value and the structural similarity value, so that the registration precision and the registration density of the target image point are improved, and the three-dimensional precision of the point cloud of the to-be-measured object is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image registration, and in particular to a method and system for image point area search and registration in machine vision. Background Art

[0002] With the development of science and technology, in agricultural production or other industries, in the machine vision image registration method based on distance estimation and camera posture parameters, the registered same-name image points can be obtained in the mapping area of ​​the image to be registered according to the registration target image points, so as to obtain the three-dimensional coordinates of the object point to be measured corresponding to the registration target image points according to each registered same-name image point. In the registration process, the registration density and registration accuracy of the registration target image points determine the three-dimensional measurement accuracy of the point cloud of the object to be measured.

[0003] However, the current registration methods are still lacking in the registration density and registration accuracy of the target image points, resulting in low three-dimensional accuracy of the point cloud of the object to be measured, and even the inability to perform three-dimensional modeling. Summary of the invention

[0004] The embodiments of the present application provide a method and system for image point area search and registration of machine vision, which is used to solve the technical problem that the current registration method is still lacking in the registration density and registration accuracy of the registration target image points, resulting in low three-dimensional accuracy of the point cloud of the object to be measured, and even inability to perform three-dimensional modeling.

[0005] In a first aspect, an embodiment of the present application provides a method for searching and registering image points in a machine vision region, comprising:

[0006] Taking any image point in the registration target image as a target image point, establishing a template area of ​​a first preset size with the target image point as the center, and obtaining a first template area;

[0007] A search area of ​​a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template area of ​​the first preset size is established with each image point in the search area as the center, to obtain a plurality of second template areas;

[0008] Calculating feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0009] Determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0010] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0011] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0012] In one embodiment, the calculating of the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region includes:

[0013] Calculating feature descriptors of neighborhood feature matrices of each template region to obtain a first feature descriptor corresponding to the neighborhood feature matrix of the first template region and a plurality of second feature descriptors corresponding to the neighborhood feature matrices of each second template region;

[0014] Calculate the normalized Hamming distance between the first feature descriptor and each second feature descriptor, and determine the normalized Hamming distance as the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region, wherein the calculation formula of the normalized Hamming distance is as follows:

[0015]

[0016] in:

[0017]

[0018] in, is the camera coordinate system corresponding to the registration target image I1 The first feature descriptor of is the camera coordinate system corresponding to the second image to be registered I2 The second feature descriptor of is the normalized Hamming distance between the two feature descriptors, So The neighborhood feature matrix of the first template area established as the center, is the i-th target image point in the registration target image I1, So The neighborhood feature matrix of the second template area set as the center for any image point k in the search area set as the center, yes The mapping pixel in the second image to be registered I2, D max is the maximum value of the Hamming distance between the first feature descriptor and each second feature descriptor, and r is the number of binary digits of the feature descriptor.

[0019] In one embodiment, the step of calculating the feature descriptor of the neighborhood feature matrix of each template region includes:

[0020] generating a point pair matrix and a first gray value matrix corresponding to the point pair matrix in the first template area;

[0021] Mapping the point pair matrix of the first template area to the second template area of ​​each pixel in the search area to generate a plurality of corresponding second gray value matrices;

[0022] According to each gray value matrix, the binary value of each pixel pair in the corresponding pixel pair matrix is ​​obtained. The specific calculation formula is as follows:

[0023]

[0024] Among them, B r (f; a, b) is the binary value of each pixel pair in the point pair matrices a and b, is the gray value matrix corresponding to matrix a, is the gray value matrix corresponding to matrix b, r = 1...256, and is the coordinate value of the rth image point in matrix a on the xy plane in the camera coordinate system, and is the coordinate value of the rth image point in matrix b on the xy plane in the camera coordinate system, is the gray value of the rth pixel in matrix a, is the gray value of the rth pixel in matrix b;

[0025] The binary value of each pixel pair is determined as the feature descriptor of the neighborhood feature matrix corresponding to the template area.

[0026] In one embodiment, the step of calculating the feature descriptor of the neighborhood feature matrix of each template region includes:

[0027] generating a point pair matrix and a first gray value matrix corresponding to the point pair matrix in the first template area;

[0028] Sequentially mapping the point pair matrix of the first template area to the second template area of ​​each pixel in the search area to generate a plurality of corresponding second gray value matrices;

[0029] In each sequential mapping, a new point pair matrix and a corresponding first gray value matrix need to be regenerated in the first template area to sequentially traverse and map to each second template area, and calculate the feature descriptor of the neighborhood feature matrix of each second template area.

[0030] In one embodiment, calculating the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region includes:

[0031] The structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region is calculated using the SSIM index, specifically including:

[0032] Calculating the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of the first template area to obtain a first average value and a first variance;

[0033] Calculate the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of each second template region to obtain a second average value and a second variance;

[0034] Calculating the covariance of the grayscale of the pixels in the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area;

[0035] A structural similarity value between a neighborhood feature matrix of the first template region and neighborhood feature matrices of each second template region is obtained according to the first average value, the second average value, the first variance, the second variance, and the covariance.

[0036] In one embodiment, the step of determining the central image point of the second template region corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact same-name image point of the target image point in the sequential second image to be registered comprises:

[0037] The weighted sum of the feature similarity value and the structure similarity value is calculated according to the following formula:

[0038]

[0039] Among them, H k is the weighted sum of the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of the second template area established with any pixel k in the search area as the center, W D yes The weight, W s yes The weight of is the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of the second template region, is the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of the second template region;

[0040] Traverse each image point in the search area, and determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact same-name image point of the target image point in the sequential second image to be registered. The specific calculation formula is as follows:

[0041]

[0042] in, is the exact coordinate of the target image point in the second image to be registered, and N*N is the pixel size of the search area.

[0043] In one embodiment, the mapping image points are determined based on the following method:

[0044] Convert the coordinates of the target image point in the registration target image into the camera coordinate system of the registration target image to obtain a first camera coordinate;

[0045] Converting the first camera coordinates into a measurement coordinate system of the visual measurement system to obtain measurement coordinates;

[0046] Converting the measured coordinates into the camera coordinate system of the sequential second image to be registered to obtain second camera coordinates;

[0047] The second camera coordinates are converted into the coordinate system of the sequential second image to be registered to obtain the mapping image points.

[0048] In one embodiment, after obtaining the precise image points with the same name in all the images to be registered, the following steps are included:

[0049] Perform aberration correction on the exact same-name image points in all the images to be registered to obtain corrected same-name image points;

[0050] The corrected image points with the same name are used to perform forward intersection measurement to obtain the precise three-dimensional coordinates of the object point to be measured.

[0051] In a second aspect, an embodiment of the present application provides a machine vision image point area search and registration system, comprising:

[0052] A first template region generating module is used to: take any image point in the registration target image as a target image point, establish a template region of a first preset size with the target image point as the center, and obtain a first template region;

[0053] A second template region generating module is used to: establish a search region of a second preset size with a mapping image point of the target image point in the sequential second image to be registered as the center, and establish a template region of the first preset size with each image point in the search region as the center, to obtain a plurality of second template regions;

[0054] A similarity value calculation module, used to: calculate the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area;

[0055] An image point area search and registration module is used to: determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0056] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0057] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0058] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the image point area search and registration method of machine vision described in the first aspect are implemented.

[0059] The present application provides a method and system for searching and registering image points in a machine vision region. Any image point in a registration target image is used as a target image point, a template region of a first preset size is established with the target image point as the center to obtain a first template region, a search region of a second preset size is established with the mapping image point of the target image point in a sequential second image to be registered as the center, a template region of the first preset size is established with each image point in the search region as the center to obtain multiple second template regions, feature similarity values ​​and structural similarity values ​​between a neighborhood feature matrix of the first template region and neighborhood feature matrices of each second template region are calculated, a central image point of the second template region corresponding to the maximum weighted sum of the feature similarity value and the structural similarity value is determined as the exact same-name image point of the target image point in the sequential second image to be registered, the exact same-name image point is used as a new target image point, the sequential second image to be registered is used as a new registration target image, all images to be registered are sequentially traversed to perform same-name image point registration until the exact same-name image points in all images to be registered are obtained, wherein the first template region does not change with the update of the registration target image. On the one hand, by calculating the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region, and determining the central image point of the second template region corresponding to the maximum weighted sum of the two as the exact same-name image point of the target image point in the sequential second image to be registered, the same-name image point that is most similar to the target image point, that is, the exact same-name image point, can be obtained in the sequential second image to be registered, thereby improving the registration accuracy of the target image point, and sequentially mapping is continued with this exact same-name image point as the new target image point, thereby obtaining a new second template region in other images to be registered, and then obtaining the same-name image point that is most similar to the target image point on the registered target image, that is, the exact same-name image point, in the new second template region, thereby obtaining the exact same-name image point on all images to be registered, thereby further improving the registration accuracy of the target image point; on the other hand, the improvement of the registration accuracy of the target image point enables the availability of more target image points in the registered target image to be increased, thereby greatly improving the registration density of the target image points in the registered target image. To summarize, the present application obtains the same-name image points that are most similar to the target image points in the registration target image in multiple images to be registered through feature similarity values ​​and structural similarity values, thereby improving the registration accuracy and registration density of the target image points, thereby improving the three-dimensional accuracy of the point cloud of the object to be measured, and allowing three-dimensional modeling to proceed smoothly. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0061] Figure 1 This is one of the flow charts of the image point area search and registration method of machine vision provided in the embodiment of the present application;

[0062] Figure 2 It is a schematic diagram of the application of the image point area search and registration method of machine vision provided by an embodiment of the present application in a two-degree-of-freedom vision measurement system;

[0063] Figure 3 It is a schematic diagram of the application of the image point area search and registration method of machine vision provided by an embodiment of the present application in a three-degree-of-freedom or higher degree-of-freedom visual measurement system;

[0064] Figure 4 It is a schematic diagram of the application of the image point area search and registration method of machine vision provided by an embodiment of the present application in a fixedly installed visual measurement system;

[0065] Figure 5 This is the second flow chart of the image point area search and registration method of machine vision provided in the embodiment of the present application;

[0066] Figure 6 This is the third flow chart of the image point area search and registration method of machine vision provided in the embodiment of the present application;

[0067] Figure 7 This is a fourth flow chart of the image point area search and registration method of machine vision provided in an embodiment of the present application;

[0068] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0070] It should be noted that in the description of the embodiments of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those skilled in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0071] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0072] Figure 1 This is one of the flow charts of the image point area search and registration method of machine vision provided in the embodiment of the present application;

[0073] Figure 2 It is a schematic diagram of the application of the image point area search and registration method of machine vision provided by an embodiment of the present application in a two-degree-of-freedom vision measurement system;

[0074] Figure 3 It is a schematic diagram of the application of the image point area search and registration method of machine vision provided by an embodiment of the present application in a three-degree-of-freedom or higher degree-of-freedom visual measurement system;

[0075] Figure 4It is a schematic diagram of the application of the image point area search and registration method of machine vision provided in an embodiment of the present application in a fixedly installed visual measurement system.

[0076] Reference Figure 1 The present application embodiment provides a method for searching and registering image points in a machine vision region, which may include:

[0077] 101. Taking any image point in the registration target image as a target image point, establishing a template region of a first preset size with the target image point as the center, and obtaining a first template region;

[0078] 102. A search region of a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template region of a first preset size is established with each image point in the search region as the center, to obtain a plurality of second template regions;

[0079] 103. Calculate feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0080] 104. Determine the central image point of the second template region corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name of the target image point in the sequential second image to be registered;

[0081] 105. Using the exact image points with the same name as new target image points, using the second image to be registered in sequence as a new registration target image, and sequentially traversing all images to be registered to perform image point registration with the same name until the exact image points with the same name in all images to be registered are obtained.

[0082] The first template area does not change with the update of the registration target image.

[0083] The registration target image I1 is to use the visual measurement system to register the i-th target image point at the first moment in the sequence Corresponding object point B i The image to be registered is obtained by shooting, and the second image to be registered I2 is a picture of the same object point B at the previous moment or the next moment of the first moment by using the visual measurement system. i Shooting is performed to obtain an image to be registered that meets the parallax threshold.

[0084] Reference Figures 2 to 4 This embodiment can be applied to a two-degree-of-freedom vision measurement system, a three-degree-of-freedom or higher-degree-of-freedom vision measurement system, and a fixedly installed vision measurement system. The images to be registered taken by these measurement systems are all grayscale images. The equipment conditions mainly refer to the camera resolution and viewing distance, etc. The parallax threshold refers to the threshold maximum value of the main optical axis angle between the sequentially taken images to be registered.

[0085] In step 101, any image point in the registration target image I1 is used as the target image point Take the target image point A template area of ​​a first preset size, i.e., a size of n*n pixels, is established as the center to obtain a first template area p1;

[0086] In step 102, the target image point Mapping pixels in the second sequential image to be registered I2 A second preset size, i.e., a search area p of N*N pixels in size, is set as the center s , to search area p s Taking each image point in as the center, a template area of ​​a first preset size, i.e., a size of n*n pixels, is established to obtain a plurality of second template areas;

[0087] In step 103, feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region are calculated respectively to obtain a plurality of feature similarity values ​​and a plurality of structural similarity values;

[0088] In step 104, the feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of any second template region are weighted and summed to obtain a weighted sum corresponding to the second template region, and the maximum value is selected from the weighted sums corresponding to all second template regions, and the central image point of the second template region corresponding to the maximum value is determined as the target image point. The exact same-name image points in the second image to be registered I2

[0089] In step 105, after obtaining the exact same-name image points Afterwards, it is necessary to obtain the exact same-name image points in the third image to be registered I3 in the same manner. Until the mth image to be registered I is obtained m The mapping points in and exact same-name image points Where m is the number of images to be registered.

[0090] Specifically, refer to Figure 2 , the exact same-name image point As the new target image point, Mapping pixels in the third sequential image to be registered I3 A search area of ​​N*N pixels is established as the center, and a template area of ​​n*n pixels is established with each image point in the search area as the center, and then the feature similarity value and structural similarity value between the neighborhood feature matrix of the template area on the registration target image I1 and the neighborhood feature matrix of each template area on the sequential third image to be registered I3 are calculated, and the feature similarity value and structural similarity value between the neighborhood feature matrix of the template area on the registration target image I1 and the neighborhood feature matrix of any template area on the sequential third image to be registered I3 are weighted and summed to obtain a weighted sum formula corresponding to the template area on the sequential third image to be registered I3, and the maximum value is selected from the weighted sum formulas corresponding to all template areas on the sequential third image to be registered I3, and the central image point of the template area corresponding to the maximum value is determined as the target image point The exact same-name image points in the third image to be registered I3 Similarly, when the first template area remains unchanged, the target image point on the registration target image I1 is searched in each second template area of ​​each image to be registered. The exact same-name image points are obtained until the mth image to be registered I is obtained. m The mapping points in and exact same-name image points Among them, N>n.

[0091] The image point area search and registration method for machine vision provided in the present embodiment takes any image point in the registration target image as the target image point, establishes a template area of ​​a first preset size with the target image point as the center to obtain the first template area, establishes a search area of ​​a second preset size with the mapping image point of the target image point in the sequential second image to be registered as the center, establishes a template area of ​​the first preset size with each image point in the search area as the center to obtain multiple second template areas, calculates the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area, determines the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structural similarity value as the exact same-name image point of the target image point in the sequential second image to be registered, takes the exact same-name image point as the new target image point, takes the sequential second image to be registered as the new registration target image, sequentially traverses all images to be registered to perform same-name image point registration until the exact same-name image points in all images to be registered are obtained, wherein the first template area does not change with the update of the registration target image. On the one hand, by calculating the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region, and determining the central image point of the second template region corresponding to the maximum weighted sum of the two as the exact same-name image point of the target image point in the sequential second image to be registered, the same-name image point that is most similar to the target image point, that is, the exact same-name image point, can be obtained in the sequential second image to be registered, thereby improving the registration accuracy of the target image point, and sequentially mapping is continued with this exact same-name image point as the new target image point, thereby obtaining a new second template region in other images to be registered, and then obtaining the same-name image point that is most similar to the target image point on the registered target image, that is, the exact same-name image point, in the new second template region, thereby obtaining the exact same-name image point on all images to be registered, thereby further improving the registration accuracy of the target image point; on the other hand, the improvement of the registration accuracy of the target image point enables the availability of more target image points in the registered target image to be increased, thereby greatly improving the registration density of the target image points in the registered target image. To sum up, this embodiment obtains the same-name image points that are most similar to the target image points in the registration target image in multiple images to be registered through feature similarity values ​​and structural similarity values, thereby improving the registration accuracy and registration density of the target image points, thereby improving the three-dimensional accuracy of the point cloud of the object to be measured, and allowing three-dimensional modeling to proceed smoothly.

[0092] Furthermore, since the present embodiment searches for precise image points of the same name in a smaller template area, compared with the conventional registration method in which image points of a large area are registered between two images, the amount of registration calculation can be greatly reduced, thereby improving the registration efficiency.

[0093] Furthermore, since this embodiment is applicable to machine vision measurement systems with multiple degrees of freedom, such as two-degree-of-freedom vision measurement systems, three or more-degree-of-freedom vision measurement systems, and fixed-mounted vision measurement systems, the real-time and robustness of image area registration in machine vision measurements with multiple degrees of freedom are improved on the basis of the existing machine vision image registration method based on distance estimation and camera posture parameters.

[0094] Figure 5 This is a flow chart of the second method for searching and registering image points in a machine vision system according to an embodiment of the present application; Figure 5 In one embodiment, calculating the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region may include:

[0095] 501. Calculate the feature descriptors of the neighborhood feature matrix of each template region to obtain a first feature descriptor corresponding to the neighborhood feature matrix of the first template region and a plurality of second feature descriptors corresponding to the neighborhood feature matrix of each second template region;

[0096] 502. Calculate the normalized Hamming distance between the first feature descriptor and each second feature descriptor, and determine the normalized Hamming distance as a feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region.

[0097] In step 502, the Hamming distance between the first feature descriptor and any second feature descriptor can be obtained according to the following XOR operation:

[0098]

[0099] The above operation is to and Each corresponding bit is XORed and then added.

[0100] Normalize the Hamming distance to get the normalized Hamming distance

[0101]

[0102] in, is the camera coordinate system corresponding to the registration target image I1 The first feature descriptor of is the camera coordinate system corresponding to the second image to be registered I2 The second feature descriptor of is the normalized Hamming distance between the two feature descriptors, So The neighborhood feature matrix of the first template area established as the center, is the i-th target image point in the registration target image I1, So The neighborhood feature matrix of the second template area set as the center for any image point k in the search area set as the center, yes The mapping pixel in the second image to be registered I2, D max is the maximum value of the Hamming distance between the first feature descriptor and each second feature descriptor, and r is the number of binary digits of the feature descriptor.

[0103] but That is, the feature similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of any second template area.

[0104] By traversing k to take values ​​between 1 and N*N, the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region is obtained.

[0105] In this embodiment, a second template area is established by traversing all image points in the search area of ​​the sequential second image to be registered, and a normalized Hamming distance is calculated for the first template area and each second template area based on a feature descriptor, so that the feature similarity value between the neighborhood feature matrices of the two template areas can be accurately characterized by the normalized Hamming distance.

[0106] In one embodiment, the feature descriptor of the neighborhood feature matrix of each template region may be calculated by a single random process method, as follows:

[0107] A point pair matrix and a first gray value matrix corresponding to the point pair matrix are generated in the first template area, the point pair matrix is ​​mapped to the second template area of ​​each pixel in the search area, a plurality of corresponding second gray value matrices are generated, and the binary value of each pixel pair in the corresponding point pair matrix is ​​obtained according to each gray value matrix, and the binary value of each pixel pair is determined as a feature descriptor of the neighborhood feature matrix of the corresponding template area.

[0108] Specifically, a uniformly distributed point pair matrix is ​​generated in the first template area. and and the first gray value matrix corresponding to matrix a and the first gray value matrix corresponding to matrix b Any random generation method may be used, and is not limited here. In this embodiment, the Mersenne Twister algorithm may be used for random generation. Where r = 1…256, and is the coordinate value of the rth image point in matrix a on the xy plane in the camera coordinate system, and is the coordinate value of the rth image point in matrix b on the xy plane in the camera coordinate system, is the gray value of the rth pixel in matrix a, is the grayscale value of the rth pixel in matrix b.

[0109] The binary value B of each image point pair in the point pair matrix a and b r (f; a, b) can be calculated by the following formula:

[0110]

[0111] The B r (f; a, b) is the feature descriptor of the neighborhood feature matrix of the first template region. Since both the point pair matrices a and b include 256 image point pairs, the binary value obtained is also 256 bits.

[0112] When the point pair matrix of the first template area is mapped to the sequential second image to be registered, only one random generation process is performed in the first template area, and the obtained point pair matrix is ​​mapped to all the second template areas, and the corresponding second gray value matrix is ​​obtained. r (f; a, b) to obtain the binary value of each image point pair in each mapping point pair matrix, thereby obtaining the feature descriptor of the neighborhood feature matrix of each second template area.

[0113] This embodiment generates a point pair matrix through a single random process in the first template area, maps it to all the second template areas, and then performs binary encoding on the point pair matrix of each template area. By combining single randomization with binary encoding, accurate calculation of the feature similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of the second template area is achieved, thereby improving the accuracy of subsequent alignment.

[0114] In one embodiment, the feature descriptor of the neighborhood feature matrix of each template region may be calculated by using a multiple random process method, as follows:

[0115] A point pair matrix and a first gray value matrix corresponding to the point pair matrix are generated in the first template area, and the point pair matrix of the first template area is sequentially mapped to the second template area of ​​each pixel in the search area to generate multiple corresponding second gray value matrices. In each sequential mapping, a new point pair matrix and a corresponding first gray value matrix need to be regenerated in the first template area to sequentially traverse and map to each second template area, and calculate the feature descriptor of the neighborhood feature matrix of each second template area.

[0116] Specifically, first, the point pair matrix and the corresponding first gray value matrix are obtained by the same method as the single random process, and mapped to the second template area of ​​the first order to generate the corresponding second gray value matrix. The difference is that when mapping the second template area of ​​the second order, a new point pair matrix is ​​regenerated in the first template area, and then the new point pair matrix is ​​mapped to the second template area of ​​the second order to generate the corresponding second gray value matrix in the second template area of ​​the second order. By analogy, a new point pair matrix and the corresponding first gray value matrix are regenerated in the first module area at each mapping until the sequential mapping of each second template area and the generation of the second gray value matrix are completed. The subsequent binary encoding process is the same as the single random process and will not be repeated here.

[0117] This embodiment generates multiple point pair matrices through multiple random processes in the first template area, and maps them to each second template area respectively, and then performs binary encoding on the point pair matrix of each template area. By combining multiple random processes with binary encoding, the accuracy of feature similarity value calculation between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of the second template area is further improved, thereby further improving the accuracy of subsequent alignment.

[0118] Figure 6 This is a flow chart of the third method for searching and registering image points in a machine vision system according to an embodiment of the present application; Figure 6 In one embodiment, calculating the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region may include:

[0119] The structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region is calculated using the SSIM (Structural Similarity) index, specifically including:

[0120] 601. Calculate the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of the first template region to obtain a first average value and a first variance;

[0121] 602. Calculate the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of each second template region to obtain a second average value and a second variance;

[0122] 603. Calculate the covariance of the grayscale of the image points in the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0123] 604. Obtain a structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrices of each second template region according to the first average value, the second average value, the first variance, the second variance, and the covariance.

[0124] In step 604, the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of the second template region set up with any pixel k in the search region as the center is It can be calculated according to the following formula:

[0125]

[0126] in, is the first average, is the second mean, is the first variance, is the second variance, is the covariance.

[0127] By traversing k to take values ​​between 1 and N*N, the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region is obtained.

[0128] Further, the weighted sum H of the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of any second template region can be calculated according to the following formula: k :

[0129]

[0130] Among them, W D yes The weight, W S yes The weight of H is obtained by traversing k between 1 and N*N. k The maximum value of the center image point of the second template area corresponding to the maximum value is the target image point The exact coordinates of the same-name image points in the second image to be registered I2 The specific formula is as follows:

[0131]

[0132] in, is the exact coordinate of the target image point in the second image to be registered, and N*N is the pixel size of the search area.

[0133] In practical applications, there is no strict timing relationship between step 601, step 602 and step 603; that is, they can be executed simultaneously, or any one step can be executed first, depending on actual needs and is not limited here.

[0134] This embodiment calculates the mean value and variance of the grayscale of the image points in the neighborhood feature matrix of each template area, and the covariance of the grayscale of the image points in the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area. Based on the grayscale features of the image points in the neighborhood feature matrix of each template area and the grayscale features between the neighborhood feature matrices of each template area, it is possible to accurately calculate the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrices of each second template area, thereby improving the accuracy of subsequent alignment.

[0135] Figure 7 This is a fourth flow chart of the image point area search and registration method of machine vision provided in an embodiment of the present application; Figure 7 In one embodiment, the mapping image point can be determined based on the following method:

[0136] 701. Convert the coordinates of the target image point in the registration target image into the camera coordinate system of the registration target image to obtain a first camera coordinate.

[0137] 702. Convert the first camera coordinates into a measurement coordinate system of the visual measurement system to obtain measurement coordinates;

[0138] 703. Convert the measured coordinates into the camera coordinate system of the second image to be registered, to obtain second camera coordinates;

[0139] 704 . Convert the second camera coordinates into the coordinate system of the sequential second image to be registered to obtain mapping image points.

[0140] Reference Figures 2 to 4 :

[0141] In step 701, using the distance estimation value Projection scale factor and optical vector algorithm to estimate target image points Corresponding to the object to be measured point B i In the camera coordinate system of the registration target image I1 The estimated point coordinates in The estimated point coordinates are the first camera coordinates, where A i is the distance reference point;

[0142] In step 702, the first camera coordinates are converted into Transform to measurement coordinate system O M In the measurement coordinates

[0143] In step 703, the measurement coordinates are measured by using the structural parameters of the visual measurement system. Convert to the camera coordinate system of the second image to be registered I2 The second camera coordinates are obtained

[0144] In step 704, the distance estimate is used again Projection scale factor and optical vector algorithm to estimate the second camera coordinates The estimated point coordinates in the second image to be registered I2 The estimated point is the mapping image point, and the The exact same-name image point

[0145] Among them, the structural parameters of the visual measurement system refer to the intersection distance and the main optical axis rotation radius.

[0146] Reference Figure 2 , in the subsequent cycle, As the new target image point, the object point B to be measured is obtained in the same way i In the camera coordinate system of the second image I2 to be registered The estimated point coordinates in And then transform it into the measurement coordinate system and then transform it into the third image to be registered I3 in the sequence. Determined accordingly The exact same-name image point Then As the new target image point, the object point B is obtained in the same way. i In the camera coordinate system of the third image I3 to be registered The estimated point coordinates in By analogy, refer to Figures 2 to 4 , and finally get the sequential mth image to be registered I m In Determined based on this The exact same-name image point is the mth image to be registered I m The camera coordinate system.

[0147] This embodiment uses distance estimation values, projection scale factors, optical vector algorithms, and structural parameters of a visual measurement system to continuously estimate the coordinates and transform the coordinate system of target image points, and can accurately map them to the second sequential image to be registered to obtain corresponding mapping image points.

[0148] In one embodiment, after obtaining the precise image points with the same name in all the images to be registered, the following steps may be performed:

[0149] The aberration correction is performed on the precise same-name image points in all the images to be registered to obtain the corrected same-name image points, and the corrected same-name image points are used to perform forward intersection measurement to obtain the precise three-dimensional coordinates of the object points to be measured.

[0150] All the exact same-name image points in the images to be registered can be transformed back to the measurement coordinate system O M In the process, the converted precise image points with the same name are subjected to aberration correction, and the corrected image points with the same name are used to perform forward intersection measurement to obtain the precise three-dimensional coordinates of the object point to be measured;

[0151] Furthermore, by performing the same operation on multiple target image points in the registration target image, accurate three-dimensional coordinates of multiple object points of the object to be measured are obtained, thereby obtaining accurate three-dimensional coordinates of the point cloud of the object to be measured.

[0152] The experimental test results show that: on ordinary non-professional measuring cameras or ordinary monitoring equipment, using the method of the present application within a measuring distance range of 1.5 meters to 2 meters, for plant leaves with an area of ​​about 0.01 square meters, in the process of using arbitrarily selected plant leaf target image points in the registration target image to obtain the same-name image points in other images to be registered, the registration accuracy of the target image points is significantly improved, and the availability of the target image points is greater than 70%, which greatly improves the registration density of the target image points. With the improvement of the registration accuracy and the registration density, the three-dimensional coordinate accuracy of the point cloud of the object to be measured is improved, and the error of the plant leaf area measured by this method is less than 1%.

[0153] This embodiment further improves the accuracy of the three-dimensional coordinates of the object points to be measured by further converting and correcting the precise same-name image points and performing forward intersection measurement. Based on this, multiple target image points are aligned to further improve the accuracy of the three-dimensional coordinates of the point cloud of the object to be measured.

[0154] The image point area search and registration system of machine vision provided in an embodiment of the present application is described below. The image point area search and registration system of machine vision described below and the image point area search and registration method of machine vision described above can be referenced to each other.

[0155] The present application embodiment provides a machine vision image point area search and registration system, which may include:

[0156] A first template region generating module is used to: take any image point in the registration target image as a target image point, establish a template region of a first preset size with the target image point as the center, and obtain a first template region;

[0157] A second template region generating module is used to: establish a search region of a second preset size with a mapping image point of the target image point in the sequential second image to be registered as the center, and establish a template region of the first preset size with each image point in the search region as the center, to obtain a plurality of second template regions;

[0158] A similarity value calculation module, used to: calculate the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area;

[0159] An image point area search and registration module is used to: determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0160] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0161] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0162] The image point area search and registration system of machine vision provided by the present embodiment takes any image point in the registration target image as the target image point, establishes a template area of ​​a first preset size with the target image point as the center to obtain the first template area, establishes a search area of ​​a second preset size with the mapping image point of the target image point in the sequential second image to be registered as the center, establishes a template area of ​​the first preset size with each image point in the search area as the center to obtain multiple second template areas, calculates the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area, determines the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structural similarity value as the exact same-name image point of the target image point in the sequential second image to be registered, takes the exact same-name image point as the new target image point, takes the sequential second image to be registered as the new registration target image, sequentially traverses all images to be registered to perform same-name image point registration until the exact same-name image points in all images to be registered are obtained, wherein the first template area does not change with the update of the registration target image. On the one hand, by calculating the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region, and determining the central image point of the second template region corresponding to the maximum weighted sum of the two as the exact same-name image point of the target image point in the sequential second image to be registered, the same-name image point that is most similar to the target image point, that is, the exact same-name image point, can be obtained in the sequential second image to be registered, thereby improving the registration accuracy of the target image point, and sequentially mapping is continued with this exact same-name image point as the new target image point, thereby obtaining a new second template region in other images to be registered, and then obtaining the same-name image point that is most similar to the target image point on the registered target image, that is, the exact same-name image point, in the new second template region, thereby obtaining the exact same-name image point on all images to be registered, thereby further improving the registration accuracy of the target image point; on the other hand, the improvement of the registration accuracy of the target image point enables the availability of more target image points in the registered target image to be increased, thereby greatly improving the registration density of the target image points in the registered target image. To sum up, this embodiment obtains the same-name image points that are most similar to the target image points in the registration target image in multiple images to be registered through feature similarity values ​​and structural similarity values, thereby improving the registration accuracy and registration density of the target image points, thereby improving the three-dimensional accuracy of the point cloud of the object to be measured, and allowing three-dimensional modeling to proceed smoothly.

[0163] Furthermore, since the present embodiment searches for precise image points of the same name in a smaller template area, compared with the conventional registration method in which image points of a large area are registered between two images, the amount of registration calculation can be greatly reduced, thereby improving the registration efficiency.

[0164] Furthermore, since this embodiment is applicable to machine vision measurement systems with multiple degrees of freedom, such as two-degree-of-freedom vision measurement systems, three or more-degree-of-freedom vision measurement systems, and fixed-mounted vision measurement systems, the real-time and robustness of image area registration in machine vision measurements with multiple degrees of freedom are improved on the basis of the existing machine vision image registration method based on distance estimation and camera posture parameters.

[0165] Figure 8 An example of a structural diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the computer program in the memory 830 to execute the steps of the image point area search and registration method of machine vision, for example, including:

[0166] Taking any image point in the registration target image as a target image point, establishing a template area of ​​a first preset size with the target image point as the center, and obtaining a first template area;

[0167] A search area of ​​a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template area of ​​the first preset size is established with each image point in the search area as the center, to obtain a plurality of second template areas;

[0168] Calculating feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0169] Determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0170] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0171] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0172] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0173] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the steps of the image point area search and registration method of machine vision provided in the above embodiments, for example, including:

[0174] Taking any image point in the registration target image as a target image point, establishing a template area of ​​a first preset size with the target image point as the center, and obtaining a first template area;

[0175] A search area of ​​a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template area of ​​the first preset size is established with each image point in the search area as the center, to obtain a plurality of second template areas;

[0176] Calculating feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0177] Determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0178] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0179] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0180] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored, wherein the computer program is used to enable a processor to execute the steps of the image point area search and registration method for machine vision provided in the above embodiments, for example, including:

[0181] Taking any image point in the registration target image as a target image point, establishing a template area of ​​a first preset size with the target image point as the center, and obtaining a first template area;

[0182] A search area of ​​a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template area of ​​the first preset size is established with each image point in the search area as the center, to obtain a plurality of second template areas;

[0183] Calculating feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region;

[0184] Determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered;

[0185] The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image;

[0186] The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

[0187] The non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0188] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A machine vision image point area search and registration method, It is characterized in that include: Taking any image point in the registration target image as a target image point, establishing a template area of ​​a first preset size with the target image point as the center, and obtaining a first template area; A search area of ​​a second preset size is established with a mapping image point of the target image point in the sequential second image to be registered as the center, and a template area of ​​the first preset size is established with each image point in the search area as the center, to obtain a plurality of second template areas; Calculating feature similarity values ​​and structural similarity values ​​between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region; Determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered; The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image; The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

2. The image point area search and registration method of machine vision according to claim 1, It is characterized in that The calculating of the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region includes: Calculating feature descriptors of neighborhood feature matrices of each template region to obtain a first feature descriptor corresponding to the neighborhood feature matrix of the first template region and a plurality of second feature descriptors corresponding to the neighborhood feature matrices of each second template region; Calculate the normalized Hamming distance between the first feature descriptor and each second feature descriptor, and determine the normalized Hamming distance as the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region, wherein the calculation formula of the normalized Hamming distance is as follows: in: in, is the image corresponding to the registration target image I 1 The camera coordinate system The first feature descriptor of is the image I corresponding to the second image to be registered 2 The camera coordinate system The second feature descriptor of is the normalized Hamming distance between the two feature descriptors, So The neighborhood feature matrix of the first template area established as the center, is the registration target image I 1 The i-th target image point in So The neighborhood feature matrix of the second template area set as the center for any image point k in the search area set as the center, yes In the order of the second image to be registered I 2 The mapping image point in D max is the maximum value of the Hamming distance between the first feature descriptor and each second feature descriptor, and r is the number of binary digits of the feature descriptor.

3. The image point area search and registration method of machine vision according to claim 2, It is characterized in that The feature descriptor of the neighborhood feature matrix of each template region is calculated, including: generating a point pair matrix and a first gray value matrix corresponding to the point pair matrix in the first template area; Mapping the point pair matrix of the first template area to the second template area of ​​each pixel in the search area to generate a plurality of corresponding second gray value matrices; According to each gray value matrix, the binary value of each pixel pair in the corresponding pixel pair matrix is ​​obtained. The specific calculation formula is as follows: Among them, B r (f; a, b) is the binary value of each pixel pair in the point pair matrices a and b, is the gray value matrix corresponding to matrix a, is the gray value matrix corresponding to matrix b, r = 1...256, and is the coordinate value of the rth image point in matrix a on the xy plane in the camera coordinate system, and is the coordinate value of the rth image point in matrix b on the xy plane in the camera coordinate system, is the gray value of the rth pixel in matrix a, is the gray value of the rth pixel in matrix b; The binary value of each pixel pair is determined as the feature descriptor of the neighborhood feature matrix corresponding to the template area.

4. The image point area search and registration method of machine vision according to claim 2, It is characterized in that The feature descriptor of the neighborhood feature matrix of each template region is calculated, including: generating a point pair matrix and a first gray value matrix corresponding to the point pair matrix in the first template area; Sequentially mapping the point pair matrix of the first template area to the second template area of ​​each pixel in the search area to generate a plurality of corresponding second gray value matrices; In each sequential mapping, a new point pair matrix and a corresponding first gray value matrix need to be regenerated in the first template area to sequentially traverse and map to each second template area, and calculate the feature descriptor of the neighborhood feature matrix of each second template area.

5. The image point area search and registration method of machine vision according to claim 1, It is characterized in that The calculating of the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region includes: The structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of each second template region is calculated using the SSIM index, specifically including: Calculating the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of the first template area to obtain a first average value and a first variance; Calculate the average value and variance of the grayscale of the pixels in the neighborhood feature matrix of each second template region to obtain a second average value and a second variance; Calculating the covariance of the grayscale of the pixels in the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area; A structural similarity value between a neighborhood feature matrix of the first template region and neighborhood feature matrices of each second template region is obtained according to the first average value, the second average value, the first variance, the second variance, and the covariance.

6. The image point area search and registration method of machine vision according to claim 1, It is characterized in that The step of determining the central image point of the second template region corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name of the target image point in the sequential second image to be registered comprises: The weighted sum of the feature similarity value and the structure similarity value is calculated according to the following formula: Among them, H k is the weighted sum of the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of the second template area established with any pixel k in the search area as the center, W D yes The weight, W S yes The weight of is the feature similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of the second template region, is the structural similarity value between the neighborhood feature matrix of the first template region and the neighborhood feature matrix of the second template region; Traverse each image point in the search area, and determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact same-name image point of the target image point in the sequential second image to be registered. The specific calculation formula is as follows: in, is the exact coordinate of the target image point in the second image to be registered, and N*N is the pixel size of the search area.

7. The image point area search and registration method of machine vision according to claim 1, It is characterized in that The mapping image points are determined based on the following method: Convert the coordinates of the target image point in the registration target image into the camera coordinate system of the registration target image to obtain a first camera coordinate; Converting the first camera coordinates into a measurement coordinate system of the visual measurement system to obtain measurement coordinates; Converting the measured coordinates into the camera coordinate system of the sequential second image to be registered to obtain second camera coordinates; The second camera coordinates are converted into the coordinate system of the sequential second image to be registered to obtain the mapping image points.

8. The image point area search and registration method of machine vision according to claim 1, It is characterized in that After obtaining the accurate image points with the same name in all the images to be registered, the method includes: Perform aberration correction on the exact same-name image points in all the images to be registered to obtain corrected same-name image points; The corrected image points with the same name are used to perform forward intersection measurement to obtain the precise three-dimensional coordinates of the object point to be measured.

9. A machine vision image point area search and registration system, It is characterized in that include: A first template region generating module is used to: take any image point in the registration target image as a target image point, establish a template region of a first preset size with the target image point as the center, and obtain a first template region; A second template region generating module is used to: establish a search region of a second preset size with a mapping image point of the target image point in the sequential second image to be registered as the center, and establish a template region of the first preset size with each image point in the search region as the center, to obtain a plurality of second template regions; A similarity value calculation module, used to: calculate the feature similarity value and the structural similarity value between the neighborhood feature matrix of the first template area and the neighborhood feature matrix of each second template area; An image point area search and registration module is used to: determine the central image point of the second template area corresponding to the maximum weighted sum of the feature similarity value and the structure similarity value as the exact image point with the same name as the target image point in the sequential second image to be registered; The precise image points with the same name are used as new target image points, the sequential second image to be registered is used as a new registration target image, and all images to be registered are sequentially traversed to perform registration of the same name image points until the precise image points with the same name in all images to be registered are obtained; wherein the first template area does not change with the update of the registration target image; The registration target image is an image to be registered obtained by photographing the object point to be measured corresponding to the target image point at a first sequential moment using a visual measurement system, and the second sequential image to be registered is an image to be registered that meets the parallax threshold by photographing the same object point to be measured at the previous moment or the next moment using the visual measurement system.

10. An electronic device comprising a processor and a memory storing a computer program, It is characterized in that When the processor executes the computer program, the steps of the image point area search and registration method of machine vision described in any one of claims 1 to 8 are implemented.