WO2021082018A1 - 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质 - Google Patents

散斑图匹配方法、散斑图匹配装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2021082018A1
WO2021082018A1 PCT/CN2019/115169 CN2019115169W WO2021082018A1 WO 2021082018 A1 WO2021082018 A1 WO 2021082018A1 CN 2019115169 W CN2019115169 W CN 2019115169W WO 2021082018 A1 WO2021082018 A1 WO 2021082018A1
Authority
WO
WIPO (PCT)
Prior art keywords
speckle
matching
window
test
pattern
Prior art date
Application number
PCT/CN2019/115169
Other languages
English (en)
French (fr)
Inventor
毛一杰
吴勇辉
刘川熙
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Priority to CN201980002762.6A priority Critical patent/CN113168682A/zh
Priority to PCT/CN2019/115169 priority patent/WO2021082018A1/zh
Publication of WO2021082018A1 publication Critical patent/WO2021082018A1/zh

Links

Images

Classifications

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

Definitions

  • This application relates to the field of three-dimensional image processing, and in particular to a speckle pattern matching method, a speckle pattern matching device, electronic equipment, and a storage medium.
  • speckle-based structured light pattern matching is a common technique, which realizes the depth reconstruction method based on the principle of triangulation by matching the speckles on the measured object with the calibration or ideal speckles .
  • the measured object usually has a certain surface structure, its speckle distribution will be different from the calibration or ideal speckle, which leads to speckle matching that requires a certain tolerance for distribution changes.
  • speckle matching will use window correlation algorithm, that is, perform some processing on the speckle (such as Gaussian blur, etc.), and then the matching window will be correlated with the window to be matched.
  • the local matching involves the calculation of the matching range, which is performed within the search range. Relevance matching of multiple matching windows to find the optimal result leads to an increase in the overall matching times and a corresponding increase in time-consuming.
  • the purpose of some embodiments of this application is to provide a speckle pattern matching method, a speckle pattern matching device, electronic equipment and storage medium, so that in the three-dimensional speckle pattern matching, under the premise of ensuring high accuracy, the overall matching times are reduced , Shorten the matching time.
  • the embodiment of the present application provides a speckle pattern matching method, including: obtaining a test speckle pattern, wherein the test speckle pattern includes a plurality of speckles; and comparing a first speckle of the plurality of speckles with a calibration speckle The corresponding speckles in the figure are matched. If the matching is successful, the first pre-matching window is determined according to the position of the first speckle; and each speckle in the first pre-matching window of the test speckle image is compared with all the speckles in the first pre-matching window.
  • the positions of the speckles in the first pre-matching window of the calibrated speckle pattern correspond to each other, where if the second speckles in the speckles in the first pre-matching window of the test speckle pattern correspond to the calibrated scatter If the position of the second speckle in the first pre-matching window of the pattern corresponds, it is determined that the second speckle pre-match is successful; when the number of successful pre-matching of the second speckle in the test speckle image exceeds the first threshold , It is determined that the second speckle pattern is successfully matched; if each speckle in the test speckle pattern is successfully matched with each corresponding speckle pattern in the calibrated speckle pattern, it is determined that the test speckle pattern is matched successfully .
  • the embodiment of the present application also provides a speckle pattern matching device.
  • the speckle pattern matching device includes: an acquisition module for acquiring a test speckle pattern, wherein the test speckle pattern includes a plurality of speckles; a first matching module , For matching the first speckle of the plurality of speckles with the corresponding speckle in the calibrated speckle image, and if the matching is successful, determine the first pre-matching window based on the position of the first speckle;
  • the comparison module is used to compare whether each speckle in the first pre-matching window of the test speckle pattern corresponds to the position of each speckle in the first pre-matching window of the calibrated speckle pattern, wherein, if the If the second speckle in each speckle in the first pre-matching window of the test speckle image corresponds to the position of the second speckle in the first pre-match window of the calibration speckle image, the second speckle is determined
  • the spot pre-matching succeeds; the second matching module is used to determine that the second speckles
  • the embodiment of the present application also provides an electronic device, including: at least one processor; and, a memory communicatively connected with the at least one processor; wherein the memory stores a memory that can be executed by the at least one processor; Instructions, the instructions are executed by the at least one processor, so that the at least one processor can execute the speckle pattern matching method as described above.
  • the embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the above-mentioned speckle pattern matching method is implemented.
  • this application uses a point A that is successfully matched to pre-match the surrounding points of the point A.
  • this application uses a point A that is successfully matched to pre-match the surrounding points of the point A.
  • point B is found in the relative position of the calibration map, it is determined that the pre-matching of point B is successful.
  • the number of pre-matching of a certain point exceeds a certain value, it is determined that the point is successfully matched, and there is no need to determine whether it matches.
  • test speckle image and the calibration speckle image are represented in a matrix form
  • the background point is set to 0, and a non-zero value is used to represent the center of the speckle.
  • the above scheme is used for matching confirmation in the form of a matrix, which is convenient for data processing.
  • the first pre-matching window is a window with the first speckle as a center and a radius smaller than a first preset value.
  • the first preset value is confirmed according to the distance between two adjacent speckle spots.
  • the above scheme clarifies a confirmation method for the first preset value.
  • the matching of the first speckles in the plurality of speckles with corresponding points in the calibrated speckle image includes: determining in the calibrated speckle image according to the position of the first speckles The search range; the matching window corresponding to the first speckle is compared with the matching window corresponding to each speckle in the search range, and if a distribution of points in the matching window is found to match the first speckle According to the distribution of the points in the matching window, it is determined that the first speckles are successfully matched, wherein the matching windows corresponding to the first speckles and the matching windows corresponding to the respective speckles have the same size.
  • the above scheme clarifies the confirmation mechanism for a certain point to be successfully matched. When a matching window is matched, each point in the window is matched separately, avoiding the use of the existing comparison similarity method, and also avoiding the threshold sensitivity in the similarity comparison The problem.
  • the distribution of the points in a matching window matches the distribution of the points in the matching window corresponding to the first speckle: the number of points with the same distribution is the largest, and the number exceeds the second threshold .
  • the matching window corresponding to the speckle in the search range is a window with the speckle as a center and a radius smaller than the second preset value and greater than the radius of the first pre-matching window.
  • the method before determining that the second speckle is successfully matched, further includes: if there is a third speckle, when the third speckle is successfully matched, the position of the third speckle is used to determine The second pre-matching window, and the second pre-matching window covers the second speckles, when comparing each speckle in the second pre-matching window of the test speckle pattern with the calibration speckle pattern When the position of each speckle in the second pre-matching window corresponds, it is determined whether the second speckle is successfully pre-matched.
  • it also includes: obtaining the positions of the speckle in the test speckle image and the calibration speckle image respectively; determining the distance between the two positions; confirming whether the distance is within a preset range
  • the speckles in the test speckle map correspond to the positions of the speckles in the calibration speckle map.
  • Fig. 1 is a flowchart of a speckle pattern matching method according to the first embodiment of the present application
  • 2a, 2b, and 2c are respectively a schematic diagram of a test speckle pattern and a corresponding test speckle matrix according to an example in the speckle pattern matching method in the first embodiment of the present application;
  • FIG. 3 is a flowchart of pre-matching a point in the speckle pattern matching method according to the first embodiment of the present application
  • Fig. 4a is a schematic diagram of a calibrated speckle matrix according to an example in a speckle pattern matching method in the first embodiment of the present application;
  • Fig. 4b is a schematic diagram of an expanded calibrated speckle matrix according to an example in the speckle pattern matching method in the first embodiment of the present application;
  • FIG. 4c is a schematic diagram of a test speckle matrix according to an example of a speckle pattern matching method in the first embodiment of the present application;
  • FIG. 5 is a flowchart of a speckle pattern matching method according to the second embodiment of the present application.
  • Fig. 6 is a schematic diagram of a speckle pattern matching device according to a third embodiment of the present application.
  • Fig. 7 is a schematic diagram of the structure of an electronic device according to a fourth embodiment of the present application.
  • the first embodiment of the present application relates to a speckle pattern matching method.
  • the core method of speckle pattern matching in this embodiment includes: when the test speckle pattern is matched with the calibration speckle pattern, if each speckle in the test speckle pattern is successfully matched with each corresponding speckle pattern in the calibration speckle pattern, it is determined The test speckle pattern is successfully matched; among them, when the first speckle in each speckle is successfully matched, the position of the first speckle is used to determine the pre-matching window; the points in the pre-match window of the test speckle are compared with the calibration Whether the position of each point in the pre-matching window of the speckle map corresponds; where, if the second speckle in the pre-matching window of the test speckle map corresponds to the position of the second speckle in the pre-matching window of the calibrated speckle map, then It is determined that the pre-matching of the second speckle is successful; when the number of successful pre-matching of a certain point in the test speckle pattern exceeds the first threshold, it is determined that the point is successfully matched.
  • Step 101 Obtain a test speckle image and a calibration speckle image.
  • the speckle image is a depth image based on speckle structured light.
  • the speckle structured light is projected to the human face, and the image sensor receives the structured light reflected from the human face and outputs an image.
  • the structured light source can be near-infrared light or infrared light.
  • the calibrated speckle image can be pre-stored in the system, and the test speckle image can be obtained in real-time in actual application scenarios, for example, when the face is unlocked through the image sensor.
  • the calibrated speckle image can be an image output by the image sensor after the speckle structured light is projected to a reference plane at a predetermined distance from the image sensor or the structured light projector, and used for calibration.
  • the test speckle pattern and the calibration speckle pattern can be represented in a matrix form.
  • the size of the matrix is equivalent to the speckle image, as shown in Figure 2a and Figure 2b.
  • Figure 2a is the test speckle image
  • Figure 2b is the test speckle matrix after conversion to the matrix.
  • the corresponding matrix value at the center of the speckle is 1, and the rest are 0, that is, the background point is set to 0, and the center of the speckle is represented by a non-zero value.
  • the corresponding matrix value at the center of the scatter spot can also be a value other than "1".
  • the index number of each scatter spot is used as the corresponding position matrix value to facilitate the algorithm to find each scatter spot.
  • the converted speckle test matrix and speckle calibration matrix can also be directly obtained, which will not be listed here.
  • Step 102 Extract a speckle in the test speckle image.
  • the position of the speckles is determined according to the positions where the value is not 0, and one of the speckles is extracted in this step.
  • a serial number can be added to each speckle in the test speckle pattern first, and then extracted according to the sequence of the serial number. In actual applications, in addition to the above methods, it can also be extracted according to the coordinate position, which will not be listed here.
  • Step 103 Determine whether the number of successful pre-matching of the extracted speckles exceeds a first threshold; if yes, execute step 104; if not, execute step 105.
  • the parameter can be preset, which is used to record the number of times that each speckle spot is successfully pre-matched.
  • the specific process of pre-matching is described in detail in the subsequent step 109. In this step, it is necessary to determine the number of successful pre-matching of a certain speckle.
  • the number of times can be recorded by additionally setting a first auxiliary matrix corresponding to the test speckle matrix.
  • the first auxiliary matrix used to store the number of successful pre-matching of each point may not be separately set, and the stored partial values thereof can be distinguished by coding.
  • Step 104 Mark the speckle as a point that is successfully matched.
  • the speckle when the matching is successful, the speckle can be marked as a point that is successfully matched.
  • a second auxiliary matrix corresponding to the test speckle matrix may be additionally provided, and the second auxiliary matrix is used to store the index values of the points that are successfully matched.
  • the index value of the corresponding position in the second auxiliary matrix is recorded as a mark, and the number of points that are successfully matched can be determined by the number of non-zeros in the second auxiliary matrix.
  • the second auxiliary matrix used to store the successfully matched speckles may also not be set separately, but the stored partial values can be distinguished by coding.
  • Step 105 Match the scattered spots.
  • the speckle in this step may be a point that has not been pre-matched, or it may be a point where the number of successful pre-matching does not reach the first threshold, then the speckle needs to be matched in this step.
  • Step 106 Determine whether the speckle matching is successful; if yes, execute step 108; if not, execute step 107.
  • the specific matching method may include: obtaining the positions of the speckle in the test speckle image and the calibration speckle image respectively; determining the distance between the two positions; and confirming whether the distance is within a preset range.
  • the speckles in the test speckle map correspond to the positions of the speckles in the calibration speckle map. It can be seen that by testing the position of the speckle in the speckle image, finding the location of the corresponding point of the speckle in the calibration speckle image, and determining whether the distance difference between the position coordinates of the point in the two speckle images is within the preset range If the distance difference exceeds the preset range, or the point cannot be found in the calibration map, it is deemed that the point matching fails.
  • the preset range can be determined according to the required tolerance, such as less than or equal to 2.
  • the above-mentioned method for finding corresponding points may be as follows: set a serial number for each speckle in the calibrated speckle pattern and the test speckle pattern in advance, and if the serial numbers are the same, they are the corresponding points. For example, when matching the No. 17 speckle on the test speckle pattern, find the No. 17 speckle from the calibrated speckle graph, which is the corresponding point of the No. 17 speckle that needs to be matched. After confirming the positions of No. 17 scatter spots in their respective pictures, and then determining the distance difference between the two positions, you can determine whether the matching is successful according to the determined distance difference.
  • Step 107 Mark the speckles as unsuccessful matching points.
  • the speckle can be marked as a point that was not successfully matched.
  • this step is not necessary in practical applications, such as orderly traversal when extracting matching points, only marking the points that are successfully matched, ignoring the points that are not successfully matched, and then you can determine whether the test pattern is tested by counting the number of points that are successfully matched The match is successful.
  • Step 108 Mark the speckle as a point that is successfully matched.
  • the speckle can be marked as a point that is successfully matched.
  • the method of recording the points that are successfully matched in this step is similar to that of step 104, and will not be repeated here.
  • Step 109 Perform pre-matching on the unmarked speckles around the above-mentioned successfully matched points.
  • this step performs pre-matching on the points adjacent to the successfully matched point. Due to the proximity, the error is small. If the point is pre-matched successfully, the actual point may be successfully matched with higher accuracy.
  • the first threshold is used to limit the number of successful pre-matching times that need to reach the first threshold to determine that the point is successfully matched, so that the matching accuracy is further improved.
  • This step specifically includes the following steps, as shown in Figure 3:
  • Step 1091 Determine the pre-matching window based on the position of the first speckle.
  • the first speckle is the above-mentioned successfully matched point. For example, if the 20th point is matched in step 105, and the 20th point is determined to be matched successfully in step 106, then the 20th point is the first speckle in this step.
  • the pre-matching window is a window that includes the location of the first speckle. Specifically, it may be a window with the first speckle as the center and a radius smaller than a first preset value.
  • the first preset value may be based on the speckle. Confirm the distance R between two adjacent speckle spots in the picture, such as 1/2R, and if the radius of the pre-matching window is 1/3R, in actual application, test the distance between the speckle pattern and the calibrated speckle pattern It can be the same.
  • the first speckle is taken as the center, the position difference between the first speckle and the other points in the pre-matching window is within a certain range.
  • the pre-matching window in this embodiment may be square, and in an example, it may also have other shapes, which will not be listed here.
  • Step 1092 compare whether each point in the pre-matching window of the test speckle image corresponds to the position of each point in the pre-matching window of the calibrated speckle image; if they correspond, perform step 1093; if they do not correspond, perform step 1094.
  • the distance difference between the position coordinates of the points in the test speckle image and the calibration speckle image is within the preset range can be used to confirm the difference between the points in the test speckle image and the points in the calibration speckle image.
  • Position correspondence where the preset range can be less than or equal to 2. More specifically, the matching window corresponding to the first speckle spot and the matching window corresponding to each speckle spot have the same size.
  • Step 1093 It is determined that the second speckle spot pre-matching is successful.
  • Step 1094 It is determined that the second speckle pre-matching is unsuccessful.
  • the distance difference can be judged by expanding the non-zero points in the speckle calibration matrix.
  • the expansion radius can be less than 1/2 point distance, which is the error tolerance.
  • Figure 4a is the calibrated speckle matrix
  • Figure 4b is the expanded calibrated speckle matrix. It can be seen that a non-zero point extends to adjacent points to form a 3* The non-zero area of 3
  • Figure 4c is the test speckle matrix.
  • steps 1091 to 1094 specifically describe the process of pre-matching one of the other speckles in the pre-matching window except for the points that are successfully matched. In practical applications, it is also necessary to compare other speckles in the pre-matching window. , Until all speckles in the pre-matching window have been compared once.
  • the second speckle has been pre-matched once.
  • the second pre-matching window is determined by the position of the third speckle pattern, and the second pre-matching window covers the second speckle pattern, then when comparing the second pre-matching window of the test speckle pattern When each speckle is corresponding to the position of each speckle in the second pre-matching window of the calibrated speckle pattern, it is determined whether the second speckle is pre-matched successfully.
  • the second speckle may be pre-matched multiple times in different pre-matching windows, so when it is determined in step 103 that the number of successful pre-matching of the second speckle exceeds the first threshold, it can be based on the success of the pre-matching. The number of times is determined.
  • Step 110 Mark the points where the pre-matching is successful.
  • the specific marking method can be similar to that in step 104, recording through a separate auxiliary matrix, or recording through encoding, which will not be repeated here.
  • steps 103 to 110 are the specific process of matching and confirming a speckle.
  • step 104 step 107, and step 110 are executed, continue to execute:
  • Step 111 Determine whether there are unmarked speckles in the test pattern; if yes, return to step 102; if not, end the speckle pattern matching method in this embodiment.
  • step 104 it can be known that the marked points, that is, the matched speckles, and then the unmarked speckles are confirmed based on this. If there are no unmarked speckles, then It is confirmed that all speckles in the test image are matched. If there are unmarked speckles, then return to step 102 to continue to extract the next point for matching confirmation.
  • the number threshold may be determined according to the total number of points in the test speckle pattern. If each speckle in the test speckle image is successfully matched with the corresponding points in the calibrated speckle image, it is determined that the test speckle image is successfully matched.
  • this embodiment uses a point A that is successfully matched to pre-match the surrounding points of the point A.
  • the point B in the test chart is at the relative position of the calibration chart If it is found, it is determined that the pre-matching of point B is successful.
  • the number of pre-matching of a certain point exceeds a certain value, it is determined that the point is successfully matched, and there is no need to determine whether it matches.
  • the matching point A Since the matching point A has been determined to be successfully matched, the surrounding point B has a small error due to its close distance, so after multiple pre-matching successes, it is deemed that point B has been matched successfully, which also ensures the accuracy of point B matching, so that there is no need Perform multiple matching window comparisons within the search range for point B alone. In short, while ensuring the matching accuracy, the overall matching times are greatly reduced and the matching time is shortened. In addition, since the speckles are characterized by non-zero points in this embodiment, the existing characterization using intensity values is avoided, which makes the threshold confirmation sensitive during the comparison.
  • the second embodiment of the present application relates to a speckle pattern matching method.
  • step 105 of the first embodiment when matching a certain speckle, it is determined whether the distance difference between the test speckle image and the calibration speckle image is within the coordinates of the point. It is determined whether the point is successfully matched within the preset range.
  • the matching window with high distribution similarity of the points in the matching window is found within the search range of the calibrated speckle map. If it is found, it is determined to be a matching window. Success means that before determining that the matching is successful, multiple points in the same matching window need to be matched, and within the search range, multiple matching windows are matched, so that it is determined that the matched result is the best result in the search range.
  • FIG. 5 the flow chart of the speckle pattern matching method in this embodiment is shown in FIG. 5, and the details are as follows:
  • Steps 501 to 504 in this embodiment are similar to steps 101 to 104 in the first embodiment, and will not be repeated here.
  • Step 505 Determine the search range according to the position of the speckle.
  • this step can determine the search range based on the three-dimensional reconstruction theory, which will not be repeated here.
  • Step 506 Compare the matching window corresponding to the speckle with the matching window corresponding to each point in the search range.
  • Step 507 Determine whether the distribution of points in a matching window is found to match the distribution of points in the matching window corresponding to the point; if yes, go to step 509; if not, go to step 508.
  • the distribution of points in a matching window matches the distribution of points in the matching window corresponding to the first speckle: the number of points with the same distribution is the largest, and the number exceeds the second threshold.
  • the matching window corresponding to a certain point is a window with the point as the center and a radius smaller than the second preset value and larger than the radius of the pre-matching window, where the second preset value can be based on the distance between two adjacent points Confirm, if the radius of the matching window is 1/2R.
  • step 508 to step 512 are similar to step 107 to step 111 in the first embodiment, and will not be repeated here.
  • the third embodiment of the present application also relates to a speckle pattern matching device.
  • the speckle pattern matching device in this embodiment specifically includes:
  • the acquiring module is used to acquire a test speckle image, where the test speckle image includes a plurality of speckles.
  • the first matching module is used to match the first speckle of the plurality of speckles with the corresponding speckle in the calibrated speckle image. If the matching is successful, the position of the first speckle is used to determine the first speckle. Pre-matching window.
  • the pre-matching module is used to compare whether each speckle in the first pre-matching window of the test speckle pattern corresponds to the position of each speckle in the first pre-matching window of the calibrated speckle pattern. If the second speckle in each speckle in the first pre-matching window of the test speckle image corresponds to the position of the second speckle in the first pre-match window of the calibration speckle image, the second speckle is determined Spot pre-matching succeeded.
  • the second matching module is configured to determine that the second speckles are successfully matched when the number of successful pre-matching of the second speckles in the test speckle pattern exceeds a first threshold.
  • the processing module is configured to determine that the test speckle pattern is successfully matched when each speckle in the test speckle pattern is successfully matched with each corresponding speckle pattern in the calibrated speckle pattern.
  • the test speckle pattern and the calibration speckle pattern are represented in the form of a matrix.
  • the background point is set to 0, and a non-zero value is used to represent the center of the speckle.
  • the above-mentioned pre-matching window is a window with a first speckle as a center and a radius smaller than a first preset value.
  • the first preset value is confirmed according to the distance between two adjacent speckle spots.
  • the first matching module further includes:
  • the search range determination sub-module is configured to determine the search range in the calibrated speckle image according to the position of the first speckle
  • the comparison sub-module is used to compare the matching window corresponding to the first speckle with the matching window corresponding to each speckle in the search range, and the distribution of the speckle in the matching window is found to match the matching window corresponding to the first speckle When the midpoints are distributed, it is determined that the first speckles are successfully matched, wherein the matching windows corresponding to the first speckles and the matching windows corresponding to the respective speckles have the same size.
  • the second comparison module determines that the distribution of points in a matching window matches the distribution of points in the matching window corresponding to the first speckle by the largest number of points with consistent distribution and the number exceeds the second threshold.
  • the matching window corresponding to the speckle in the search range is a window with the speckle as a center and a radius smaller than the second preset value and greater than the radius of the pre-matching window.
  • the above-mentioned matching window is square.
  • the pre-matching module is further configured to determine a second pre-matching window based on the position of the third speckle if there is a third speckle spot, when the third speckle spot is successfully matched, and the first speckle Two pre-matching windows cover the second speckles, then when comparing each speckle in the second pre-matching window of the test speckle pattern with that of each speckle in the second pre-matching window of the calibration speckle pattern When the positions are corresponding, it is determined whether the second speckles are pre-matched successfully.
  • the first matching module further includes:
  • the obtaining sub-module is used to obtain the positions of the speckles in the test speckle image and the calibration speckle image respectively.
  • the first determining sub-module is used to determine the distance between two positions.
  • the second determining sub-module is configured to confirm that the speckle in the test speckle image corresponds to the position of the speckle in the calibration speckle image according to whether the distance is within a preset range.
  • this embodiment adopts the pre-matching mechanism, after determining a successfully matched point A, pre-matching the surrounding points of the point A, if the point B in the test chart is found in the relative position of the calibration chart, it is determined Point B is pre-matched successfully.
  • the number of pre-matching times of a point exceeds a certain value, it is determined that the point is successfully matched, and there is no need to determine whether it matches.
  • the matching point A Since the matching point A has been determined to be successfully matched, the surrounding point B has a small error due to its close distance, so after multiple pre-matching successes, it is deemed that point B has been matched successfully, which also ensures the accuracy of point B matching, so that there is no need Perform multiple matching window comparisons within the search range for point B alone. In short, while ensuring the matching accuracy, the overall matching times are greatly reduced and the matching time is shortened.
  • the fourth embodiment of the present invention relates to an electronic device, as shown in FIG. 7, which specifically includes:
  • At least one processor and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute The speckle pattern matching method mentioned in any one of the first embodiment or the second embodiment.
  • the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are all known in the art, and therefore, no further description will be given herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory can be used to store data used by the processor when performing operations.
  • the fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the embodiment of the speckle pattern matching method mentioned in any one of the first embodiment to the third embodiment is implemented.
  • the program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

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

本申请涉及三维图像处理领域,提供了一种散斑图匹配方法、散斑图匹配装置、电子设备和存储介质,本申请实施方式中散斑图匹配方法,包括:当获取测试散斑图,其中测试散斑图包括多个散斑点;将多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以第一散斑点的位置确定预匹配窗;比对测试散斑图的预匹配窗中各散斑点与标定散斑图的预匹配窗中各散斑点的位置是否对应,当测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定第二散斑点被成功匹配;若测试散斑图中各散斑点与标定散斑图中对应的各散斑点成功匹配,则确定测试散斑图匹配成功,减少整体匹配次数,缩短匹配时间。

Description

散斑图匹配方法、散斑图匹配装置、电子设备和存储介质 技术领域
本申请涉及三维图像处理领域,特别涉及一种散斑图匹配方法、散斑图匹配装置、电子设备和存储介质。
背景技术
在三维图像处理中,三维重建阶段,基于散斑的结构光图匹配是一种常用技术,其通过被测物体上的散斑与标定或理想散斑的匹配,实现三角测量原理的深度重建方法。由于被测物体通常存在一定的面型结构,因此其散斑分布与标定或理想散斑会有一定的差异,这导致散斑的匹配需要对分布的变化具有一定的容忍度。通常散斑的匹配会使用窗口相关算法,即对散斑进行某种处理(如高斯模糊等),然后匹配窗口与待匹配窗口进行相关,局部匹配时涉及匹配范围的计算,在搜索范围内进行多次匹配窗相关性匹配,寻找最优结果,导致整体匹配次数增加,耗时相应增加。
发明内容
本申请部分实施方式的目的在于提供一种散斑图匹配方法、散斑图匹配装置、电子设备和存储介质,使得在三维散斑图匹配中,在保证高精度的前提下,减少整体匹配次数,缩短匹配时间。
本申请实施方式提供了一种散斑图匹配方法,包括:获取测试散斑图,其中测试散斑图包括多个散斑点;将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以所述第一散斑点的位置确定第一预匹配窗;比对所述测试散斑图的第一预匹配窗中各散斑点与所述标定散斑图的第一预匹配窗中各散斑点的位置是否对应,其中,若所述测试散斑图的第一预匹配窗中各散斑点中的第二散斑点与所述标定散斑图的第一预匹配窗中第二散斑点的位置对应,则确定所述第二散斑点预匹配成功;当所述测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定所述第二散斑点被成功匹配;若所述测试散斑图中各散斑点与所述标定散斑图中对应的各散斑点成功匹配,则确定所述测试散斑图匹配成功。
本申请实施方式还提供了一种散斑图匹配装置,所述散斑图匹配装置包括:获取模块,用于获取测试散斑图,其中测试散斑图包括多个散斑点;第一匹配模块,用于将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以所述第一散斑点的位置确定第一预匹配窗;比对模块,用于比对所述测试散斑图的第一预匹配窗中各散斑点与所述标定散斑图的第一预匹配窗中各散斑点的位置是否对应,其中,若所述测试散斑图的第一预匹配窗中各散斑点中的第二散斑点与所述标定散斑图的第一预匹配窗中第二散斑点的位置对应,则确定所述第二散斑点预匹配成功;第二匹配模块,用于当所述测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定所述第二散斑点被成功匹配;处理模块,用于当所述测试散斑图中各散斑点与所述标定散斑图中对应的各散斑点成功匹配,确定所述测试散斑图匹配成功。
本申请实施方式还提供了一种电子设备,包括:至少一个处理器;以及, 与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上述的散斑图匹配方法。
本申请实施方式还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述的散斑图匹配方法。
本申请实施方式相对于现有技术而言,主要区别及其效果在于:本申请利用一个匹配成功的点A,对该点A的周围点进行预匹配,预匹配过程中,如果测试图中的一点B在标定图的相对位置被找到,则确定点B预匹配成功,当某点的预匹配次数超过一定值时,即确定该点成功匹配,而无需另行确定是否匹配。由于匹配点A已确定匹配成功,其周围点B由于距离近,误差较小,所以在多次预匹配成功后认定为点B被匹配成功,同样保证了点B匹配的准确度,这样就无需对点B单独进行搜索范围内多次匹配窗对比,可见,在整个散斑图匹配的过程中,部分点不再进行单独匹配,可以在保证匹配精准度的同时,大大减少整体的匹配次数,缩短匹配时间。
作为进一步改进,以矩阵形式表征所述测试散斑图和所述标定散斑图,将背景点置0,以非0值表征散斑点中心。上述方案以矩阵形式进行匹配确认,便于数据的运算处理。
作为进一步改进,所述第一预匹配窗为以所述第一散斑点为中心,半径小于第一预设值的窗口。上述方案以成功匹配的点为中心确定第一预匹配窗,使得窗口中各点至成功匹配点的距离差尽量小,从而使得窗口中各点与成功匹配点的误差尽量小。
作为进一步改进,所述第一预设值根据相邻两个散斑点的距离确认。上 述方案明确第一预设值的一种确认方法。
作为进一步改进,所述将所述多个散斑点中的第一散斑点与标定散斑图中对应的点进行匹配包括:根据所述第一散斑点的位置确定在所述标定散斑图中的搜索范围;将所述第一散斑点对应的匹配窗与所述搜索范围中各散斑点对应的匹配窗分别比对,若找到一匹配窗中点的分布符合所述第一散斑点对应的匹配窗中点的分布,则确定所述第一散斑点成功匹配,其中,所述第一散斑点对应的匹配窗和所述各散斑点对应的匹配窗的尺寸相同。上述方案明确某点成功匹配的确认机制,其中,对一个匹配窗匹配时,分别匹配该窗口内各点,避免使用现有比对相似度的方式,也就避免了相似度比对时阈值敏感的问题。
作为进一步改进,根据以下条件确定找到一匹配窗中点的分布符合所述第一散斑点对应的匹配窗中点的分布:分布一致的点的个数最多,且所述个数超过第二阈值。
作为进一步改进,所述搜索范围内的散斑点对应的匹配窗为以该散斑点为中心,半径小于第二预设值且大于所述第一预匹配窗半径的窗口。上述方案以待匹配点为中心确定匹配窗,使得窗口中各点至散斑点的距离差尽量小,从而使得窗口中各点与散斑点的误差尽量小。
作为进一步改进,所述确定所述第二散斑点被成功匹配之前,还包括:若存在第三散斑点,当所述第三散斑点匹配成功后,以所述第三散斑点的位置确定出第二预匹配窗,且所述第二预匹配窗覆盖所述第二散斑点,则当比对所述测试散斑图的第二预匹配窗中各散斑点与所述标定散斑图的第二预匹配窗中各散斑点的位置是否对应时,确定所述第二散斑点是否预匹配成功。
作为进一步改进,还包括:分别获取散斑点在所述测试散斑图和在所述 标定散斑图中的位置;确定两个位置间的间距;根据所述间距是否在预设范围内,确认所述测试散斑图中的散斑点与所述标定散斑图中的散斑点的位置对应。上述方案明确位置对应的确认机制,同时通过预设范围给出一定的容忍度。
附图说明
一个或多个实施方式通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施方式的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是根据本申请第一实施方式中散斑图匹配方法的流程图;
图2a、图2b和图2c分别是根据本申请第一实施方式中散斑图匹配方法中示例的测试散斑图和对应的测试散斑矩阵示意图;
图3是根据本申请第一实施方式中散斑图匹配方法中对一个点预匹配的流程图;
图4a根据本申请第一实施方式中散斑图匹配方法中示例的标定散斑矩阵示意图;
图4b根据本申请第一实施方式中散斑图匹配方法中示例的扩展后的标定散斑矩阵示意图;
图4c根据本申请第一实施方式中散斑图匹配方法中示例的测试散斑矩阵示意图;
图5是根据本申请第二实施方式中散斑图匹配方法的流程图;
图6是根据本申请第三实施方式中散斑图匹配装置的示意图;
图7是根据本申请第四实施方式中电子设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施方式,对本申请部分实施方式进行进一步详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本申请,并不用于限定本申请。
本申请第一实施方式涉及一种散斑图匹配方法。
本实施方式中散斑图匹配核心方法包括:当匹配测试散斑图和标定散斑图时,若测试散斑图中各散斑点与标定散斑图中对应的各散斑点成功匹配,则确定测试散斑图匹配成功;其中,当各散斑点中第一散斑点被成功匹配后,以第一散斑点的位置确定预匹配窗;比对测试散斑图的预匹配窗中各点与标定散斑图的预匹配窗中各点的位置是否对应;其中,若测试散斑图的预匹配窗中第二散斑点与标定散斑图的预匹配窗中第二散斑点的位置对应,则确定第二散斑点预匹配成功;当测试散斑图中某点的预匹配成功次数超过第一阈值,则确定该点被成功匹配。下面以执行步骤进行分别说明:
本实施方式中的散斑图匹配方法流程图如图1所示,具体如下:
步骤101,获取测试散斑图和标定散斑图。
具体的说,散斑图为基于散斑结构光的深度图像,比如向人脸投射散斑结构光,通过图像传感器接收从人脸反射的结构光而输出的图像。结构光光源可以是近红外光或者红外光等。其中,标定散斑图可以预存于系统,测试散斑图则可以在实际应用场景中实时获取,比如在进行人脸解锁时通过图像传感器采集得到。标定散斑图可以是散斑结构光投射到距离图像传感器或结构光投射器一个预定距离的参考平面后,经图像传感器输出的图像,作为标定之用。
更具体的说,为了便于后续数据的运算简便,可以矩阵形式表征测试散斑图和标定散斑图。矩阵大小与散斑图像等同,如图2a和图2b所示,图2a为测试散斑图,图2b为转换为矩阵后的测试散斑矩阵。其中,散斑中心点处对应矩阵值为1,其余均为0,也就是说,将背景点置0,以非0值表征散斑点中心。实际应用中,散斑点中心处对应矩阵值还可以是除“1”以外的其他值,如图2c所示,采用各散斑点的索引号作为对应位置矩阵值,便于算法中查找各个散斑点。
实际应用中,也可以直接获取转换后的散斑测试矩阵和散斑标定矩阵,在此不再一一列举。
步骤102,提取测试散斑图中一散斑点。
具体的说,以上述矩阵为例,根据其中值非0的位置确定散斑点的位置,本步骤提取出其中一个散斑点。
在一个例子中,可以任意提取一个,具体的说,当一散斑点被匹配一次后,无论是否匹配成功,都为该散斑点进行标记(标记匹配成功或匹配不成功),那么本步骤中在提取散斑点时,可以提取未标记过的散斑点未标记过的散斑点(即还未被匹配过的散斑点)。
在另一个例子中,可以先为测试散斑图中的各散斑点添加序号,根据序列号顺序提取。实际应用中,除上述方式外也可以根据坐标位置提取,在此不再一一列举。
步骤103,判断提取的散斑点的预匹配成功次数是否超过第一阈值;若是,则执行步骤104;若否,则执行步骤105。
具体的说,可以预设参数——预匹配成功次数,用于记录每个散斑点被 预匹配成功的次数。预匹配的具体过程在后续步骤109中具体说明,本步骤需判断某散斑点的预匹配成功的次数,该次数可以通过另设与测试散斑矩阵对应的第一辅助矩阵进行记录。
实际应用中,用于保存各点预匹配成功次数的第一辅助矩阵也可以不另行设置,而通过编码区分其存储的各部分值。
步骤104,将该散斑点标记为被成功匹配的点。
具体的说,当匹配成功时,可以将该散斑点标记为被成功匹配的点。可以另设与测试散斑矩阵对应的第二辅助矩阵,第二辅助矩阵用于保存匹配成功的点的索引值。当某点被匹配成功时,通过在第二辅助矩阵中对应位置记录其索引值作为标记,后续可以通过第二辅助矩阵中非0的个数确定匹配成功的点的个数。
实际应用中,用于保存被成功匹配的散斑点的第二辅助矩阵也可以不另行设置,而通过编码区分其存储的各部分值。
步骤105,匹配该散斑点。
具体的说,本步骤中散斑点可能是未经预匹配的点,也可能是预匹配成功次数不达第一阈值的点,那么在本步骤中需对该散斑点进行匹配。
步骤106,判断该散斑点是否匹配成功;若是,则执行步骤108;若否,则执行步骤107。
具体匹配方式可以包括:分别获取散斑点在所述测试散斑图和在所述标定散斑图中的位置;确定两个位置间的间距;根据所述间距是否在预设范围内,确认所述测试散斑图中的散斑点与所述标定散斑图中的散斑点的位置对应。可以看出,通过测试散斑图中该散斑点的位置,查找标定散斑图中该散斑点对应 点的所在位置,确定两个散斑图中该点位置坐标的距离差是否在预设范围内,在预设范围内,则认为匹配成功,若距离差超过预设范围,或标定图中找不到该点,则认为该点匹配失败。其中,预设范围可以根据所需容忍度确定,如小于或等于2。
在一个例子中,上述查找对应点的方式可以如下:预先为标定散斑图和测试散斑图中的各散斑点设置序号,如果序号相同,则为对应的点。如匹配测试散斑图上17号散斑点时,从标定散斑图中查找出序号为17号的散斑点,即为需匹配的17号散斑点的对应点。之后分别确认17号散斑点在各自图中的位置,进而确定两个位置的距离差,就可以根据确定出的距离差确定是否匹配成功。
步骤107,将该散斑点标记为未成功匹配的点。
具体的说,当匹配结果确认为匹配失败时,可以将该散斑点标记为未成功匹配的点。另外,实际应用中可以没有本步骤,如在提取匹配点时有序遍历,只标记被成功匹配的点,忽略不成功匹配的点,之后可以通过统计匹配成功的点的个数确定测试图是否匹配成功。
步骤108,将散斑点标记为被成功匹配的点。
具体的说,当匹配结果确认为匹配成功时,可以将该散斑点标记为被成功匹配的点。本步骤中关于对成功匹配的点的记录方式与步骤104相类似,在此不再赘述。
步骤109,对上述成功匹配的点的周围的未标记散斑点进行预匹配。
具体的说,本步骤对成功匹配的点邻近的点进行预匹配,由于距离邻近,所以误差较小,那么如果该点预匹配成功,那么实际该点可能被成功匹配的准 确度较高。本实施方式通过第一阈值限定预匹配成功次数需达到第一阈值才确定该点被成功匹配,从而使得匹配准确度进一步提高。本步骤具体包括以下步骤,具体如图3所示:
步骤1091,以第一散斑点的位置确定预匹配窗。
具体的说,第一散斑点是上述成功匹配的点,如步骤105中匹配20号点,在步骤106中确定20号点匹配成功,则20号点即为本步骤中的第一散斑点。
更具体的说,预匹配窗是包括第一散斑点所在位置的窗口,具体可为以第一散斑点为中心,半径小于第一预设值的窗口,其中第一预设值可以根据散斑点所在图中相邻两个散斑点的距离R确认,如取1/2R,又如预匹配窗的半径为1/3R,实际应用中,测试散斑图和标定散斑图中散斑点的间距可以相同。以第一散斑点为中心时,第一散斑点至预匹配窗中其他各点的位置差值在一定范围内,由于散斑图中两点距离越远,其可能的误差越大,所以将距离尽可能控制在一定范围内,保证预匹配窗中各点可能的误差总和尽量小。值得一提的是,本实施方式中预匹配窗可以为方形,在一个例子中,也可以是其他形状,在此不再一一列举。
步骤1092,比对测试散斑图的预匹配窗中各点与标定散斑图的预匹配窗中各点的位置是否对应;若对应,则执行步骤1093;若不对应,则执行步骤1094。
具体的说,本步骤可以通过点在测试散斑图和标定散斑图中的位置坐标的距离差是否在预设范围内,确认测试散斑图中的点与标定散斑图中的点的位置对应,其中,预设范围可以是小于或等于2。更具体的说,第一散斑点对应的匹配窗和所述各散斑点对应的匹配窗的尺寸相同。
步骤1093,确定第二散斑点预匹配成功。
步骤1094,确定第二散斑点预匹配不成功。
实际应用中,可以通过对散斑标定矩阵中非0点进行扩展,从而判断距离差,扩展半径可以小于1/2点距,是误差容忍度。如以图4a、图4b和图4c为例进行说明,图4a是标定散斑矩阵,图4b是扩展后的标定散斑矩阵,可以看出原本一个非0点向邻近点扩展,形成3*3的非0区域,图4c是测试散斑矩阵,在比对时,以点17为例,其位置坐标为[3,3],在图4b中查找时,找到左上角点[2,2]、点[2,4]、点[4,1]等任意一个值不为0的点,即可知道测试散斑图中的点17与标定散斑图中点位置的距离差小于2,从而确定点17预匹配成功,如果在标定散斑图的对应位置找不到散斑点,则确定预匹配不成功。
可见,上述步骤1091至步骤1094具体描述对预匹配窗中除成功匹配的点外的一个其他散斑点进行预匹配的过程,实际应用中,还需对预匹配窗中其他散斑点也进行比对,直至预匹配窗中所有散斑点均被比对一次。
还需要说明的是,上述步骤1091至步骤1094中可以看出第二散斑点被预匹配了一次,实际应用中,如果存在第三散斑点,当所述第三散斑点匹配成功后,会继续以所述第三散斑点的位置确定出第二预匹配窗,且所述第二预匹配窗覆盖所述第二散斑点,则当比对所述测试散斑图的第二预匹配窗中各散斑点与所述标定散斑图的第二预匹配窗中各散斑点的位置是否对应时,确定所述第二散斑点是否预匹配成功。也就是说,第二散斑点可能在不同的预匹配窗中进行多次预匹配,所以当步骤103中判断第二散斑点的预匹配成功次数超过第一阈值时,就可以根据其预匹配成功次数确定。
步骤110,标记预匹配成功的点。
具体的说,对上述步骤109中确定预匹配成功的点进行标记,具体标记 方法可以和步骤104相类似,通过另设的辅助矩阵记录,也可以通过编码记录,在此不再赘述。
可见,上述步骤103至步骤110为针对一个散斑点进行匹配确认的具体过程。
继续说明,上述步骤104、步骤107和步骤110执行完后,继续执行:
步骤111,判断测试图中是否存在未标记的散斑点;若是,则返回执行步骤102;若否,则结束本实施方式中的散斑图匹配方法。
具体的说,根据步骤104、步骤107和步骤108可知已标记过的点,也就是已匹配的散斑点,之后据此再确认出未标记的散斑点,如果不存在未标记的散斑点,那么确认测试图中所有散斑点均匹配完毕,如果存在未标记的散斑点,那么就返回步骤102继续提取下一个点进行匹配确认。
具体的说,实际应用中,后续可以根据已标记的点中被标记为成功匹配的点的个数确定测试散斑图是否匹配成功,个数阈值可以根据测试散斑图中的总点数确定。如当测试散斑图中各散斑点与标定散斑图中对应的各点均成功匹配,则确定测试散斑图匹配成功。
本实施方式相对于现有技术而言,本申请利用一个匹配成功的点A,对该点A的周围点进行预匹配,预匹配过程中,如果测试图中的一点B在标定图的相对位置被找到,则确定点B预匹配成功,当某点的预匹配次数超过一定值时,即确定该点成功匹配,而无需另行确定是否匹配。由于匹配点A已确定匹配成功,其周围点B由于距离近,误差较小,所以在多次预匹配成功后认定为点B被匹配成功,同样保证了点B匹配的准确度,这样就无需对点B单独进行搜索范围内多次匹配窗对比,总之,在保证匹配精准度的同时,大大减少整体 的匹配次数,缩短匹配时间。另外,由于本实施方式中表征散斑点是通过非0点表征,避免现有采用强度值表征,使得比对时阈值确认敏感的问题。
本申请第二实施方式涉及散斑图匹配方法。
本实施方式和第一实施方式大致相同,主要区别在于:第一实施方式步骤105中在匹配某散斑点时,通过确定测试散斑图和标定散斑图中该点位置坐标的距离差是否在预设范围内来确定该点是否匹配成功,而本实施方式中通过在标定散斑图的搜索范围内,查找匹配窗中点的分布相似度高的匹配窗,若查找到,则确定为匹配成功,使得在确定匹配成功之前,需要进行同一匹配窗中多点的匹配,以及在搜索范围内,进行多个匹配窗的匹配,使得确定匹配到的结果是搜索范围内的最优结果。
具体的说,本实施方式中散斑图匹配方法的流程图如图5所示,具体如下:
本实施方式中步骤501至步骤504与第一实施方式中步骤101至步骤104相类似,在此不再赘述。
步骤505,根据散斑点的位置确定搜索范围。
具体的说,本步骤可以基于三维重建理论确定出搜索范围,在此不再赘述。
步骤506,分别比对散斑点对应的匹配窗与搜索范围中各点对应的匹配窗。
步骤507,判断是否找到一匹配窗中点的分布符合该点对应的匹配窗中点的分布;若是,则执行步骤509;若否,则执行步骤508。
具体的说,根据以下条件确定找到一匹配窗中点的分布符合第一散斑点对应的匹配窗中点的分布:分布一致的点的个数最多,且个数超过第二阈值。
更具体的说,某点对应的匹配窗为以该点为中心,半径小于第二预设值且大于预匹配窗半径的窗口,其中,第二预设值可以根据相邻两个点的距离确认,如匹配窗的半径为1/2R。
实际应用中,可以遍历搜索范围内的所有匹配窗,先确定匹配窗中分布一致点的个数,找出分布一致点的个数最多的点的匹配窗,再确认找出的匹配窗中分布一致点的个数是否超过第二阈值,如果超过,则认为匹配成功,如果不超过,则认为匹配不成功。可以看出,利用上述方式找到的匹配窗是搜索范围内的最优结果。
之后,步骤508至步骤512与第一实施方式中步骤107至步骤111相类似,在此不再赘述。
可见,本实施方式通过进行同一匹配窗中多点的匹配,以及在搜索范围内,进行多个匹配窗的匹配,使得确定匹配到的结果是搜索范围内的最优结果,增加匹配结果的准确度。其中,对一个匹配窗匹配时,分别匹配该窗口内各点,避免使用现有比对相似度的方式,也就避免了相似度比对时阈值敏感的问题。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本申请第三实施方式同样涉及一种散斑图匹配装置。
本实施方式中散斑图匹配装置,如图6所示,具体包括:
获取模块,用于获取测试散斑图,其中测试散斑图包括多个散斑点。
第一匹配模块,用于将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以所述第一散斑点的位置确定第一预匹配窗。
预匹配模块,用于比对所述测试散斑图的第一预匹配窗中各散斑点与所述标定散斑图的第一预匹配窗中各散斑点的位置是否对应,其中,若所述测试散斑图的第一预匹配窗中各散斑点中的第二散斑点与所述标定散斑图的第一预匹配窗中第二散斑点的位置对应,则确定所述第二散斑点预匹配成功。
第二匹配模块,用于当所述测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定所述第二散斑点被成功匹配。
处理模块,用于当所述测试散斑图中各散斑点与所述标定散斑图中对应的各散斑点成功匹配,确定所述测试散斑图匹配成功。
在一个例子中,以矩阵形式表征测试散斑图和标定散斑图。其中,将背景点置0,以非0值表征散斑点中心。
在一个例子中,上述预匹配窗为以第一散斑点为中心,半径小于第一预设值的窗口。
在一个例子中,第一预设值根据相邻两个散斑点的距离确认。
在一个例子中,第一匹配模块还包括:
搜索范围确定子模块,用于根据第一散斑点的位置确定在所述标定散斑图中的搜索范围;
比对子模块,用于将第一散斑点对应的匹配窗与搜索范围中各散斑点对 应的匹配窗分别比对,在找到一匹配窗中散斑点的分布符合第一散斑点对应的匹配窗中点的分布时,确定第一散斑点成功匹配,其中,所述第一散斑点对应的匹配窗和所述各散斑点对应的匹配窗的尺寸相同。
在一个例子中,第二比对模块通过分布一致的点的个数最多,且个数超过第二阈值,确定找到一匹配窗中点的分布符合第一散斑点对应的匹配窗中点的分布。
在一个例子中,搜索范围内的散斑点对应的匹配窗为以该散斑点为中心,半径小于第二预设值且大于预匹配窗半径的窗口。
在一个例子中,上述匹配窗为方形。
在一个例子中,预匹配模块还用于若存在第三散斑点,当所述第三散斑点匹配成功后,以所述第三散斑点的位置确定出第二预匹配窗,且所述第二预匹配窗覆盖所述第二散斑点,则当比对所述测试散斑图的第二预匹配窗中各散斑点与所述标定散斑图的第二预匹配窗中各散斑点的位置是否对应时,确定所述第二散斑点是否预匹配成功。
在一个例子中,第一匹配模块还包括:
获取子模块,用于分别获取散斑点在所述测试散斑图和在所述标定散斑图中的位置。
第一确定子模块,用于确定两个位置间的间距。
第二确定子模块,用于根据所述间距是否在预设范围内,确认所述测试散斑图中的散斑点与所述标定散斑图中的散斑点的位置对应。
可见,本实施方式通过预匹配机制,在确定出一个匹配成功的点A后,对该点A的周围点进行预匹配,如果测试图中的一点B在标定图的相对位置被 找到,则确定点B预匹配成功,当某点的预匹配次数超过一定值时,即确定该点成功匹配,而无需另行确定是否匹配。由于匹配点A已确定匹配成功,其周围点B由于距离近,误差较小,所以在多次预匹配成功后认定为点B被匹配成功,同样保证了点B匹配的准确度,这样就无需对点B单独进行搜索范围内多次匹配窗对比,总之,在保证匹配精准度的同时,大大减少整体的匹配次数,缩短匹配时间。
本发明第四实施方式涉及一种电子设备,如图7所示,具体包括:
至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一实施方式或第二实施方式中任意一个提到的散斑图匹配方法。
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储 处理器在执行操作时所使用的数据。
本发明第五实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现第一实施方式至第三实施方式中任一个提到的散斑图匹配方法实施例。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施方式,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。

Claims (14)

  1. 一种散斑图匹配方法,其特征在于,包括:
    获取测试散斑图,其中测试散斑图包括多个散斑点;
    将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以所述第一散斑点的位置确定第一预匹配窗;
    比对所述测试散斑图的第一预匹配窗中各散斑点与所述标定散斑图的第一预匹配窗中各散斑点的位置是否对应,其中,若所述测试散斑图的第一预匹配窗中各散斑点中的第二散斑点与所述标定散斑图的第一预匹配窗中第二散斑点的位置对应,则确定所述第二散斑点预匹配成功;当所述测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定所述第二散斑点被成功匹配;
    若所述测试散斑图中各散斑点与所述标定散斑图中对应的各散斑点成功匹配,则确定所述测试散斑图匹配成功。
  2. 如权利要求1所述的散斑图匹配方法,其特征在于,以矩阵形式表征所述测试散斑图和所述标定散斑图,将背景点置0,以非0值表征散斑点中心。
  3. 如权利要求1所述的散斑图匹配方法,其特征在于,所述第一预匹配窗为以所述第一散斑点为中心,半径小于第一预设值的窗口。
  4. 如权利要求3所述的散斑图匹配方法,其特征在于,所述第一预设值根据相邻两个散斑点的距离确认。
  5. 如权利要求1所述的散斑图匹配方法,其特征在于,所述将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配包括:
    根据所述第一散斑点的位置确定在所述标定散斑图中的搜索范围;
    将所述第一散斑点对应的匹配窗与所述搜索范围中各散斑点对应的匹配窗分别比对,若找到一匹配窗中点的分布符合所述第一散斑点对应的匹配窗中点的分布,则确定所述第一散斑点成功匹配,其中,所述第一散斑点对应的匹配窗和所述各散斑点对应的匹配窗的尺寸相同。
  6. 如权利要求5所述的散斑图匹配方法,其特征在于,根据以下条件确定找到一匹配窗中点的分布符合所述第一散斑点对应的匹配窗中点的分布:
    分布一致的点的个数最多,且所述个数超过第二阈值。
  7. 如权利要求5所述的散斑图匹配方法,其特征在于,所述搜索范围内的散斑点对应的匹配窗为以该散斑点为中心,半径小于第二预设值且大于所述第一预匹配窗半径的窗口。
  8. 如权利要求7所述的散斑图匹配方法,其特征在于,所述匹配窗为方形。
  9. 如权利要求1所述的散斑图匹配方法,其特征在于,所述确定所述第二散斑点被成功匹配之前,还包括:
    若存在第三散斑点,当所述第三散斑点匹配成功后,以所述第三散斑点的位置确定出第二预匹配窗,且所述第二预匹配窗覆盖所述第二散斑点,则当比对所述测试散斑图的第二预匹配窗中各散斑点与所述标定散斑图的第二预匹配窗中各散斑点的位置是否对应时,确定所述第二散斑点是否预匹配成功。
  10. 如权利要求1所述的散斑图匹配方法,其特征在于,所述将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配包括:
    分别获取散斑点在所述测试散斑图和在所述标定散斑图中的位置;
    确定两个位置间的间距;
    根据所述间距是否在预设范围内,确认所述测试散斑图中的散斑点与所述标定散斑图中的散斑点的位置对应。
  11. 如权利要求1所述的散斑图匹配方法,其特征在于,所述第一散斑点为所述多个散斑点中的第一顺位的散斑点,或所述多个散斑点中的任一散斑点。
  12. 一种散斑图匹配装置,其特征在于,所述散斑图匹配装置包括:
    获取模块,用于获取测试散斑图,其中测试散斑图包括多个散斑点;
    第一匹配模块,用于将所述多个散斑点中的第一散斑点与标定散斑图中对应的散斑点进行匹配,若匹配成功,则以所述第一散斑点的位置确定第一预匹配窗;
    比对模块,用于比对所述测试散斑图的第一预匹配窗中各散斑点与所述标定散斑图的第一预匹配窗中各散斑点的位置是否对应,其中,若所述测试散斑图的第一预匹配窗中各散斑点中的第二散斑点与所述标定散斑图的第一预匹配窗中第二散斑点的位置对应,则确定所述第二散斑点预匹配成功;
    第二匹配模块,用于当所述测试散斑图中第二散斑点的预匹配成功次数超过第一阈值,则确定所述第二散斑点被成功匹配;
    处理模块,用于当所述测试散斑图中各散斑点与所述标定散斑图中对应的各散斑点成功匹配,确定所述测试散斑图匹配成功。
  13. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至11中任一项所述的散斑图匹配方法。
  14. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至11中任一项所述的散斑图匹配方法。
PCT/CN2019/115169 2019-11-01 2019-11-01 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质 WO2021082018A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980002762.6A CN113168682A (zh) 2019-11-01 2019-11-01 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质
PCT/CN2019/115169 WO2021082018A1 (zh) 2019-11-01 2019-11-01 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/115169 WO2021082018A1 (zh) 2019-11-01 2019-11-01 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021082018A1 true WO2021082018A1 (zh) 2021-05-06

Family

ID=75715743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115169 WO2021082018A1 (zh) 2019-11-01 2019-11-01 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113168682A (zh)
WO (1) WO2021082018A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810708A (zh) * 2014-02-13 2014-05-21 西安交通大学 一种激光散斑图像深度感知方法及装置
CN103839258A (zh) * 2014-02-13 2014-06-04 西安交通大学 一种二值化激光散斑图像的深度感知方法
US20180246194A1 (en) * 2017-02-27 2018-08-30 Seiko Epson Corporation Ultrasonic image processing apparatus and ultrasonic image processing method
KR20180121082A (ko) * 2017-04-28 2018-11-07 포항공과대학교 산학협력단 정맥혈관 네비게이터 시스템 및 그 방법
CN110264573A (zh) * 2019-05-31 2019-09-20 中国科学院深圳先进技术研究院 基于结构光的三维重建方法、装置、终端设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4917615B2 (ja) * 2006-02-27 2012-04-18 プライム センス リミティド スペックルの無相関を使用した距離マッピング(rangemapping)
US20190172180A1 (en) * 2017-12-04 2019-06-06 Canon U.S.A., Inc. Apparatus, system and method for dynamic encoding of speckle reduction compensation
CN109461181B (zh) * 2018-10-17 2020-10-27 北京华捷艾米科技有限公司 基于散斑结构光的深度图像获取方法及系统
CN109405765B (zh) * 2018-10-23 2020-11-20 北京的卢深视科技有限公司 一种基于散斑结构光的高精度深度计算方法及系统
CN110009673B (zh) * 2019-04-01 2020-04-21 四川深瑞视科技有限公司 深度信息检测方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810708A (zh) * 2014-02-13 2014-05-21 西安交通大学 一种激光散斑图像深度感知方法及装置
CN103839258A (zh) * 2014-02-13 2014-06-04 西安交通大学 一种二值化激光散斑图像的深度感知方法
US20180246194A1 (en) * 2017-02-27 2018-08-30 Seiko Epson Corporation Ultrasonic image processing apparatus and ultrasonic image processing method
KR20180121082A (ko) * 2017-04-28 2018-11-07 포항공과대학교 산학협력단 정맥혈관 네비게이터 시스템 및 그 방법
CN110264573A (zh) * 2019-05-31 2019-09-20 中国科学院深圳先进技术研究院 基于结构光的三维重建方法、装置、终端设备及存储介质

Also Published As

Publication number Publication date
CN113168682A (zh) 2021-07-23

Similar Documents

Publication Publication Date Title
US11422261B2 (en) Robot relocalization method and apparatus and robot using the same
KR101617948B1 (ko) Ocr를 기반으로 지도 이미지를 인식하는 시스템과 방법, 그리고 기록 매체 및 파일 배포 시스템
WO2017045331A1 (zh) 指纹识别方法、装置及电子设备
US20200005478A1 (en) Measuring Method and Apparatus for Damaged Part of Vehicle
JP2019145085A (ja) 点群データ収集軌跡を調整するための方法、装置、およびコンピュータ読み取り可能な媒体
CN112330751B (zh) 一种结构光相机行偏差检测方法及装置
WO2021103824A1 (zh) 基于标定块的机器人手眼标定中关键点位置确定方法与装置
US11506755B2 (en) Recording medium recording information processing program, information processing apparatus, and information processing method
KR102082272B1 (ko) 엑스선 장치의 캘리브레이션 방법 및 이를 위한 캘리브레이션 장치
US9582721B2 (en) Method and apparatus for determining movement
CN113706473B (zh) 超声图像中病灶区域的长短轴确定方法和超声设备
US20230351635A1 (en) Optical axis calibration method and apparatus of optical axis detection system, terminal, system, and medium
CN109213090A (zh) 位置控制系统、位置检测装置及记录介质
US11619741B2 (en) Surveying data processing device, surveying data processing method, and surveying data processing program
JP2014203311A (ja) 画像処理装置、画像処理方法、およびプログラム
CN111814914A (zh) 一种目标对象识别方法及装置
KR101768522B1 (ko) Ocr를 기반으로 지도 이미지를 인식하는 시스템과 방법, 그리고 기록 매체 및 파일 배포 시스템
WO2021082018A1 (zh) 散斑图匹配方法、散斑图匹配装置、电子设备和存储介质
EP3709873A2 (en) Marker element and application method with ecg
US20150193925A1 (en) System and method for determining whether an apparatus or an assembly process is acceptable
KR102280668B1 (ko) 치수 품질 검사 방법 및 그 시스템
KR20220112010A (ko) 대상물체의 3차원 형상을 파악하는 방법 및 장치
KR101475742B1 (ko) 사진 계측 장치 및 방법
CN112284391B (zh) 室内行走物定位方法、装置、计算机设备
CN115761280A (zh) 图像点检比对方法、电子设备和计算机可读存储介质

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

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

Country of ref document: EP

Kind code of ref document: A1