Speckle extraction method and apparatus, electronic device, and storage medium

By determining the center point and major and minor axis lengths of the speckle in the speckle map, and optimizing the speckle extraction process using the GT speckle map, the problems of slow speed and low accuracy in the existing technology are solved, and the rapid and high-quality production of speckle projectors is realized.

CN115546102BActive Publication Date: 2026-02-27HEFEI DILUSENSE TECH CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211021394.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-02-27
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

Existing speckle extraction methods are slow and have low precision, which cannot meet the high-speed, high-quality production requirements of speckle projector production lines.

Method used

By determining the corresponding speckles in the first speckle map in the preset GT speckle map, seed points are selected, and the center point and major and minor axis lengths of the speckles are gradually determined based on the preset search step size and ellipse fitting. The speckle extraction process is optimized by using iterative thinking.

Benefits of technology

It improves the speed and accuracy of speckle extraction, ensures the accuracy of speckle projector quality assessment, and supports rapid, high-quality production on the production line.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546102B_ABST
    Figure CN115546102B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to speckle extraction methods, and disclose a speckle extraction method, a speckle extraction device, an electronic device and a storage medium. The speckle extraction method comprises the following steps: determining a second speckle corresponding to each first speckle in a first speckle diagram in a second speckle diagram respectively; selecting a first seed point in the first speckle, and selecting a second seed point in the second speckle corresponding to the first speckle; determining a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle diagram with the same coordinate as the second seed point; searching in a preset search range with the center point of the actual speckle as the center based on a preset search step, and determining a major and minor axis length of the actual speckle; and extracting the actual speckle according to the center point of the actual speckle and the major and minor axis length of the actual speckle, so as to effectively improve the speed and accuracy of speckle extraction, and ensure that a production line produces a speckle projector quickly and with high quality.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of machine vision, and particularly relate to a speckle extraction method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the vigorous development of depth vision technology, it is very important to obtain three-dimensional information of a target scene through a three-dimensional sensing device, which includes an active camera and a passive camera. The 3D solving capability of the active camera is more powerful and stable. Among them, the monocular structured light camera in the active camera has become a standard configuration in high-precision demand scenarios such as face recognition due to its outstanding performance. The core of the monocular structured light camera is a speckle projector and an infrared camera. The speckle projector projects a structured light pattern to a target scene, and the infrared camera captures a speckle pattern obtained by projecting the structured light pattern on the target scene. The camera performs 3D solving based on the speckle pattern to generate a depth map of the target scene. Therefore, the quality of the speckle pattern directly affects the accuracy of the generated depth map, and further affects the effect of applications such as face recognition.

[0003] The present inventors have found that during the production process of the speckle projector, the quality of the projected speckle may not meet the expectations due to the influence of factors such as installation stress, temperature and humidity changes, etc. In order to ensure the quality of the speckle projector out of the factory, the speckle projected by the speckle projector needs to be evaluated in terms of brightness, contrast, uniformity, and effective point number on the production line. Before that, the speckle needs to be extracted from the speckle pattern. However, the speckle extraction method based on binarization, erosion and dilation, and morphological closing in the industry has slow extraction speed and low precision, and the extracted speckle is not reasonable, so it is not possible to accurately evaluate the quality of the speckle pattern, and it is not possible to meet the needs of fast production and high-quality production of the production line. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a speckle extraction method, device, electronic equipment and storage medium, which effectively improves the speed and precision of speckle extraction, and ensures the fast and high-quality production of the speckle projector on the production line.

[0005] To solve the above technical problems, an embodiment of the present application provides a speckle extraction method, comprising the following steps: determining a second speckle corresponding to each first speckle in a first speckle image in a second speckle image respectively, wherein the first speckle image is a photographed speckle image, and the second speckle image is a preset GT speckle image; selecting a first seed point in the first speckle, and selecting a second seed point in the second speckle corresponding to the first speckle; determining a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle image having the same coordinate as the second seed point; performing search in a preset search range centered on the center point of the actual speckle based on a preset search step, and determining a major axis length and a minor axis length of the actual speckle; and extracting the actual speckle according to the center point of the actual speckle and the major axis length and the minor axis length of the actual speckle.

[0006] An embodiment of the present application further provides a speckle extraction device, comprising: a matching corresponding module, configured to determine a second speckle corresponding to each first speckle in a first speckle image in a second speckle image respectively, wherein the first speckle image is a photographed speckle image, and the second speckle image is a preset GT speckle image; a positioning module, configured to select a first seed point in the first speckle, and select a second seed point in the second speckle corresponding to the first speckle; determine a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle image having the same coordinate as the second seed point; a search module, configured to perform search in a preset search range centered on the center point of the actual speckle based on a preset search step, and determine a major axis length and a minor axis length of the actual speckle; and an extraction module, configured to extract the actual speckle according to the center point of the actual speckle and the major axis length and the minor axis length of the actual speckle.

[0007] An embodiment of the present application further provides an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the speckle extraction method described above.

[0008] An embodiment of the present application further provides a computer readable storage medium, storing a computer program, wherein the computer program is executed by a processor to implement the speckle extraction method described above.

[0009] The speckle extraction method, device, electronic equipment and storage medium provided by the embodiment of the present application first determine the corresponding second speckle of each first speckle in the first speckle graph in the second speckle graph, the first speckle graph is a speckle graph obtained by shooting, and the second speckle graph is a preset GT speckle graph. Then, a first seed point is selected in the first speckle, and a second seed point is selected in the second speckle corresponding to the first speckle. According to the first seed point and the point in the first speckle graph with the same coordinates as the second seed point, the center point of the actual speckle corresponding to the first speckle is determined. Then, based on the preset search step, the search is performed in the preset search range with the center point of the actual speckle corresponding to the first speckle as the center to determine the major and minor axis lengths of the actual speckle corresponding to the first speckle. Finally, according to the center point of the actual speckle and the major and minor axis lengths of the actual speckle, the actual speckle corresponding to the first speckle is extracted. Considering that the speckle extraction method in the industry is slow and has low precision, the extracted speckle is not reasonable. The embodiment of the present application uses the GT speckle graph, takes the first speckle in the speckle graph obtained by shooting and the second speckle corresponding to the first speckle in the GT speckle graph as the reference to determine the center and major and minor axis lengths of the actual speckle. According to the center and major and minor axis lengths of the actual speckle in the speckle graph obtained by shooting, the actual speckle region corresponding to the first speckle can be determined. The whole process does not need multiple repeated full graph calculations. The extracted actual speckle is scientific, accurate and can better represent the performance of the speckle projector, which can better guide the production design of the speckle projector and effectively improve the speed and precision of speckle extraction, ensuring that the production line can quickly and high-quality produce the speckle projector.

[0010] In addition, the first seed point is a centroid point of the first speckle, the second seed point is a centroid point of a second speckle corresponding to the first speckle, and the center point of the actual speckle corresponding to the first speckle is determined according to the first seed point and a point in the first speckle map having the same coordinates as the second seed point, comprising: taking the centroid point of the second speckle corresponding to the first speckle as a first reference point, and determining a point in the first speckle map having the same coordinates as the first reference point as a second reference point; taking the second reference point as the center, constructing a first ellipse according to a preset major and minor axis length and a preset tilt angle, and determining a centroid point of the first ellipse according to pixel values of each pixel point in the first ellipse; wherein the preset tilt angle is an included angle between the preset major axis and an x-axis; if the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold, the centroid point of the first ellipse is determined as the center point of the actual speckle corresponding to the first speckle. Due to the difference in the actual test scene, the first speckle in the speckle map obtained by shooting and the corresponding second speckle in the GT image have certain differences in position and size, so it is unreasonable to directly extract the first speckle as the actual speckle or to directly extract the corresponding position of the second speckle in the first speckle map as the actual speckle. The centroid point can well represent the overall level of a speckle, so the application re-determines the centroid point of the first speckle by ellipse fitting according to the data of the second speckle in the first speckle map, and then determines the center point of the actual speckle corresponding to the first speckle, thereby accurately determining the reference position of the actual speckle and laying a solid foundation for the extraction of the actual speckle.

[0011] In addition, after the centroid point of the first ellipse is determined according to the pixel values of each pixel point in the first ellipse, the method further comprises: if the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is greater than or equal to the preset threshold, the centroid point of the first ellipse is updated as the centroid point of the first speckle; taking the updated centroid point of the first speckle as the center, constructing a second ellipse according to the preset major and minor axis length and the preset tilt angle, and determining a centroid point of the second ellipse according to pixel values of each pixel point in the second ellipse; if the Euclidean distance between the centroid point of the second ellipse and the updated centroid point of the first speckle is less than the preset threshold, the centroid point of the second ellipse is determined as the center point of the actual speckle corresponding to the first speckle. In order to further improve the effect of speckle extraction, the application introduces the iterative idea to gradually demarcate the ellipse region until the Euclidean distance between the centroid point of the ellipse and the centroid point of the first speckle is less than the preset threshold, so as to more accurately locate the center point of the actual speckle corresponding to the first speckle.

[0012] In addition, the preset search range is a third ellipse, a center of the third ellipse is the center point of the actual speckle, lengths of major and minor axes of the third ellipse are equal to a preset search multiple multiplied by preset lengths of major and minor axes, an inclination angle of the third ellipse is a preset inclination angle, and the searching in the preset search range with the center point of the actual speckle as the center based on the preset search step length, and the determination of the lengths of major and minor axes of the actual speckle include: calculating a sum of pixel values of each pixel point in the third ellipse; constructing a fourth ellipse according to the preset inclination angle and a search step length multiplied by the preset lengths of major and minor axes by g times with the center point of the actual speckle as the center, and calculating a sum of pixel values of each pixel point in the fourth ellipse; wherein g is an integer greater than 0 and less than the search multiple; if the sum of the pixel values of each pixel point in the third ellipse is equal to f times the sum of the pixel values of each pixel point in the fourth ellipse, lengths of major and minor axes of the fourth ellipse are taken as the lengths of major and minor axes of the actual speckle; wherein f is a number greater than 0 and less than 1; if the sum of the pixel values of each pixel point in the third ellipse is not equal to f times the sum of the pixel values of each pixel point in the fourth ellipse, the fourth ellipse is updated according to the preset inclination angle and a search step length multiplied by the preset lengths of major and minor axes by (g+1) times with the center point of the actual speckle as the center. The iterative idea is introduced when the lengths of major and minor axes of the actual speckle are determined. The fourth ellipse is gradually updated based on the search step length within the third ellipse. Until the sum of the pixel values of each pixel point in the third ellipse is equal to f times the sum of the pixel values of each pixel point in the fourth ellipse, the fourth ellipse at this time meets the theoretical value of the Gaussian light spot. The lengths of major and minor axes of the fourth ellipse at this time are taken as the lengths of major and minor axes of the actual speckle, which is more scientific and reasonable, and the actual speckle corresponding to the first speckle is better extracted.

[0013] In addition, the extracting the actual speckle according to the center point of the actual speckle and the lengths of major and minor axes of the actual speckle includes: constructing a fifth ellipse according to the lengths of major and minor axes of the actual speckle and a preset inclination angle with the center point of the actual speckle as the center; and extracting each pixel point in the fifth ellipse to obtain the actual speckle. Due to the diffraction characteristics of the diffractive optical element, the actual speckle will not be stretched into an ellipse, and will appear a certain angle of inclination. The inclination can be considered to be consistent with the inclination of the second speckle in the GT speckle diagram. Therefore, when the actual speckle is extracted, the fifth ellipse is constructed according to the lengths of major and minor axes of the actual speckle and the preset inclination angle with the center point of the actual speckle as the center, and the fifth ellipse is taken as the actual speckle. The extracted actual speckle is more accurate.

[0014] In addition, the determining the corresponding second speckle of each first speckle in the first speckle diagram in the second speckle diagram respectively comprises: selecting one second speckle in each diffraction order region of the second speckle diagram respectively, taking the centroid point of the second speckle as a third reference point, and determining the point with the same coordinate as the third reference point in the first speckle diagram as a fourth reference point; performing two-dimensional matching in a first preset matching window centered on the fourth reference point according to a preset matching algorithm and the third reference point, taking the point with the maximum matching similarity with the third reference point in the first preset matching window as the homonym of the third reference point; calculating the transmission transformation matrix between the first speckle diagram and the second speckle diagram according to each third reference point and the homonym of each third reference point; determining the homonym of the centroid point of the first speckle in the second speckle diagram according to the centroid point of the first speckle and the transmission transformation matrix, taking the second speckle where the homonym of the centroid point of the first speckle is located as the corresponding second speckle of the first speckle, which does not need to perform matching calculation for each first speckle, but only needs to select one second speckle in each diffraction order region, calculates the transmission transformation matrix based on these second speckles which can represent the actual situation of the whole second speckle diagram, and directly performs transmission transformation on each first speckle according to the transmission transformation matrix, so that the first speckle and the second speckle can be quickly and accurately corresponded, the matching calculation amount is greatly reduced, and the efficiency of speckle extraction is improved.

[0015] In addition, the determining the homonym of the centroid point of the first speckle in the second speckle diagram according to the centroid point of the first speckle and the transmission transformation matrix comprises: determining the coordinate after transmission transformation according to the coordinate of the centroid point of the first speckle and the transmission transformation matrix, and taking the point on the coordinate after transmission transformation as a fifth reference point; performing two-dimensional matching in a second preset matching window centered on the fifth reference point according to a preset matching algorithm and the centroid point of the first speckle, and taking the point with the maximum matching similarity with the centroid point of the first speckle in the second preset matching window as the homonym of the centroid point of the first speckle; wherein the size of the second preset matching window is smaller than that of the first preset matching window, and the two-dimensional matching in a small range is also performed during transmission transformation, which can further improve the correspondence accuracy of the first speckle and the second speckle, and further improve the accuracy of speckle extraction. BRIEF DESCRIPTION OF DRAWINGS

[0016] One or more embodiments are illustrated by way of example in the figures that form a part of this patent document, and which do not limit the scope of embodiments.

[0017] Figure 1 is a schematic diagram of the internal structure and working principle of speckle projection;

[0018] Figure 2 is a flow chart of the speckle extraction method provided by an embodiment of the present application;

[0019] Figure 3 is a flow chart of determining the center point of the actual speckle corresponding to the first speckle according to the first seed point and the point in the first speckle map with the same coordinates as the second seed point in an embodiment of the present application;

[0020] Figure 4 is a flow chart of determining the major and minor axis lengths of the actual speckle based on the preset search step and searching in the preset search range centered on the center point of the actual speckle in an embodiment of the present application;

[0021] Figure 5 is a flow chart of respectively determining the second speckle corresponding to each first speckle in the first speckle map in the second speckle map in an embodiment of the present application;

[0022] Figure 6 is a schematic diagram of the speckle extraction device provided by another embodiment of the present application;

[0023] Figure 7 is a structural schematic diagram of the electronic device provided by another embodiment of the present application. DETAILED DESCRIPTION

[0024] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that, in the embodiments of the present application, many technical details are presented in order to make the readers better understand the present application. However, the technical solutions claimed by the present application can be implemented even without these technical details and based on various changes and modifications of the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present application, and the embodiments can be combined and referenced with each other on the premise of no contradiction.

[0025] To facilitate the understanding of the embodiments of the present application, first, the related content of the speckle projector and its working principle is introduced.

[0026] When laser light is diffused on the surface of a diffuser or through a transparent diffuser (e.g., ground glass), a random distribution of bright and dark spots can be observed in the light field near the surface of the diffuser. These spots are called laser speckles. Laser speckles are usually projected by a speckle projector, which is generally composed of a conventional vertical cavity surface emitting laser (VCSEL), a collimator, and a diffractive optical element (DOE). The VCSEL emits light, which is then collimated by the collimator. The collimated light is then diffracted by the DOE to replicate a certain number of speckles. The composition and working principle of the speckle projector can be as shown in Figure 1

[0027] The speckle projector is a relatively precise device, which is easily affected by installation stress, temperature changes, humidity changes, and the like during production, resulting in speckles projected by the speckle projector not meeting the expected quality. When the speckle projector is installed in a structured light camera, it is also affected by a certain installation stress. Therefore, it is very important to evaluate the quality of the speckle projector produced. The speckle projector production line pursues production speed and production quality. Therefore, when evaluating the quality of the speckle projector, not only should the evaluation be fast, but also should be of high precision. Currently, the industry evaluates the quality of the speckle projector by detecting the global or local quality of the speckle pattern projected by the speckle projector, such as detecting the brightness, contrast, uniformity, and effective point number of the speckles. The prerequisite for these detections is to extract each speckle in the speckle image.

[0028] However, the speckle extraction method in the industry generally performs preprocessing such as binarization on the speckle pattern first, and then performs operations such as erosion and dilation, ellipse fitting, and morphological closing on the preprocessed speckle pattern to extract each speckle in the speckle pattern. However, the preprocessing of the speckle pattern can result in poor robustness of the entire process, and the precision of the speckle profile extracted by the operations such as erosion and dilation, ellipse fitting, and morphological closing is also relatively low.

[0029] To solve the technical problems of slow extraction speed, low precision of extracted speckles, and unreasonable speckles in the above speckle extraction process, one embodiment of the present application proposes a speckle extraction method applied to an electronic device, wherein the electronic device can be a terminal or a server. In this embodiment and each of the following embodiments, the electronic device is taken as an example of a server. The implementation details of the speckle extraction method of this embodiment are described below. The following content is only provided for the implementation details for easy understanding, and is not necessary for implementing the present solution.

[0030] The specific process of the speckle extraction method of this embodiment can be as shown in​Figure 2 As shown, comprising:

[0031] Step 101, respectively determine the corresponding second speckle of each first speckle in the second speckle in the first speckle, the first speckle is the speckle diagram obtained by shooting, and the second speckle is the preset GT speckle diagram.

[0032] In a specific implementation, the server first acquires the speckle diagram obtained by shooting, that is, first calls the to-be-tested speckle projector to project the structured light pattern to the target scene, and then uses the infrared camera to shoot the projection of the structured light pattern on the target scene to obtain the speckle diagram corresponding to the to-be-tested speckle projector. The speckle diagram obtained by shooting is the first speckle diagram, and the server selects the preset GT speckle diagram as the second speckle diagram. The server traverses each first speckle in the first speckle diagram, and respectively determines the corresponding second speckle of each first speckle in the second speckle diagram.

[0033] In one example, the server traverses each first speckle in the first speckle diagram, acquires the coordinates of the center point of the circumscribed rectangle of the current first speckle, and finds the same point in the second speckle diagram. The second speckle in which the same point as the coordinates is taken as the second speckle corresponding to the target first speckle.

[0034] Step 102, selecting a first seed point in the first speckle, and selecting a second seed point in the second speckle corresponding to the first speckle, and determining the center point of the actual speckle corresponding to the first speckle according to the first seed point and the point in the first speckle diagram with the same coordinates as the second seed point.

[0035] Specifically, after determining the second speckle corresponding to the first speckle, the server can first select a first seed point in the first speckle, and select a second seed point in the second speckle corresponding to the first speckle. Continue to find the point in the first speckle diagram with the same coordinates as the second seed point, and finally determine the center point of the actual speckle corresponding to the first speckle according to the first seed point and the point in the first speckle diagram with the same coordinates as the second seed point, that is, realize the basic positioning of the actual speckle corresponding to the first speckle.

[0036] In one example, the server can select the center of mass point of the first speckle as the first seed point, or select the center point of the circumscribed rectangle of the first speckle as the first seed point, or select the center point of the inscribed rectangle of the first speckle as the first seed point. Correspondingly, the server can select the center of mass point of the second speckle as the second seed point, or select the center point of the circumscribed rectangle of the second speckle as the second seed point, or select the center point of the inscribed rectangle of the second speckle as the second seed point.

[0037] In one example, the first seed point is the center point of the first speckle, and the second seed point is the center point of the second speckle. The server can connect the center point of the first speckle and a point in the first speckle image corresponding to the center point of the second speckle, take the midpoint of the line segment as a positioning reference point, perform two-dimensional matching in a preset positioning search range centered on the positioning reference point according to a preset matching algorithm and the center point of the second speckle, and take a point in the positioning search range having the maximum matching similarity with the center point of the second speckle as the center point of the actual speckle corresponding to the first speckle.

[0038] In one example, the server can determine the center point of the first speckle according to the pixel values of the pixel points in the first speckle, and determine the center point of the second speckle according to the pixel values of the pixel points in the second speckle.

[0039] In one example, the server can determine the center point of the first speckle according to the pixel values of the pixel points in the first speckle, and determine the center point of the second speckle according to the pixel values of the pixel points in the second speckle.

[0040] In one example, the server can determine the center point of the first speckle according to the pixel values of the pixel points in the first speckle, and determine the center point of the second speckle according to the pixel values of the pixel points in the second speckle.

[0041] In one example, due to the influence of the diffraction characteristics of the DOE, the first speckle, the second speckle, and the actual speckle are all elliptical.

[0042] In one example, the server can perform elliptical fitting on the second speckle to obtain an ellipse corresponding to the second speckle, calculate the sum of the pixel values of the pixel points in the ellipse corresponding to the second speckle, and based on a preset search step, establish a plurality of ellipses in the first speckle image with the center point of the actual speckle as the center, and calculate the sum of the pixel values of the pixel points in these ellipses. The server selects an ellipse in which the sum of the pixel values of the pixel points is closest to the sum of the pixel values of the pixel points in the ellipse corresponding to the second speckle, and takes the major and minor axis lengths of the selected ellipse as the major and minor axis lengths of the actual speckle corresponding to the first speckle.

[0043] In one example, the server can determine the center point of the first speckle according to the pixel values of the pixel points in the first speckle, and determine the center point of the second speckle according to the pixel values of the pixel points in the second speckle.

[0044] In one example, the server can determine the center point of the first speckle according to the pixel values of the pixel points in the first speckle, and determine the center point of the second speckle according to the pixel values of the pixel points in the second speckle.

[0045] In one example, after determining the center point of the actual speckle and the length of the major and minor axes of the actual speckle, the server can construct an ellipse with the center point of the actual speckle as the center and according to the length of the major and minor axes of the actual speckle. The ellipse is the actual speckle corresponding to the first speckle.

[0046] In this embodiment, the server first determines the second speckle corresponding to each first speckle in the first speckle image, where the first speckle image is the obtained speckle image, and the second speckle image is the preset GT speckle image. Then, the server selects a first seed point in the first speckle and a second seed point in the second speckle corresponding to the first speckle. According to the first seed point and the point in the first speckle image with the same coordinates as the second seed point, the server determines the center point of the actual speckle corresponding to the first speckle. Then, based on a preset search step, the server searches within a preset search range centered on the center point of the actual speckle corresponding to the first speckle to determine the length of the major and minor axes of the actual speckle corresponding to the first speckle. Finally, according to the center point of the actual speckle and the length of the major and minor axes of the actual speckle, the server extracts the actual speckle corresponding to the first speckle. Considering that the speckle extraction method in the industry is slow and has low precision, the extracted speckle is not reasonable. The embodiments of the present application use the GT speckle image as a reference, determine the center and the length of the major and minor axes of the actual speckle based on the first speckle in the obtained speckle image and the second speckle corresponding to the first speckle in the GT speckle image, and determine the actual speckle region corresponding to the first speckle according to the center and the length of the major and minor axes of the actual speckle in the obtained speckle image. The entire process does not require repeated full-image calculation, the extracted actual speckle is scientific, accurate, and better represents the performance of the speckle projector, which can better guide the production and design of the speckle projector and effectively improve the speed and precision of speckle extraction, ensuring that the production line can quickly and high-quality produce the speckle projector.

[0047] In one embodiment, the first seed point is the centroid point of the first speckle, and the second seed point is the centroid point of the second speckle corresponding to the first speckle. The server determines the center point of the actual speckle corresponding to the first speckle according to the first seed point and the point in the first speckle image with the same coordinates as the second seed point, which can be achieved through the steps shown in FIG. 8A, and specifically includes: Figure 3

[0048] Step 201: Taking the centroid point of the second speckle corresponding to the first speckle as a first reference point, and determining a point in the first speckle image with the same coordinates as the first reference point as a second reference point.

[0049] Step 202: Constructing a first ellipse with the second reference point as the center according to a preset length of the major and minor axes and a preset tilt angle, and determining the centroid point of the first ellipse according to the pixel values of the pixel points in the first ellipse.

[0050] ​In a specific implementation, after determining the second speckle corresponding to the first speckle, the server can determine the centroid point of the second speckle corresponding to the first speckle as the first reference point, determine a point in the first speckle diagram with the same coordinates as the first reference point as the second reference point, and then construct a first ellipse with the second reference point as the center according to the preset major and minor axis length and the preset tilt angle, and determine the centroid point of the first ellipse according to the pixel values of the pixel points in the first ellipse. The preset tilt angle is the angle between the preset major axis and the x-axis, and the preset major and minor axis length and the preset tilt angle can be set by the person skilled in the art according to actual needs.

[0051] In one example, the preset major and minor axis length and the preset tilt angle are stored in the GT speckle diagram, each second speckle in the GT speckle diagram is an oval with the same size and the same tilt angle, and the preset major and minor axis length is actually the major and minor axis length of the second speckle, and the preset tilt angle is actually the angle between the major axis of the second speckle and the x-axis.

[0052] In one example, the server can determine the centroid point of the first ellipse according to the pixel values of the pixel points in the first ellipse by the following formula:

[0053]

[0054] In the formula, I(x i ,y i ) is the pixel value of the i-th pixel point in the first ellipse, x i is the horizontal coordinate of the i-th pixel point in the first ellipse, y i is the vertical coordinate of the i-th pixel point in the first ellipse, x0 is the horizontal coordinate of the centroid point of the first ellipse, and y0 is the vertical coordinate of the centroid point of the first ellipse.

[0055] In step 203, if the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold, the centroid point of the first ellipse is determined as the center point of the actual speckle corresponding to the first speckle.

[0056] In a specific implementation, after determining the centroid point of the first ellipse, the server can calculate the Euclidean distance between the centroid point of the ellipse and the centroid point of the first speckle, and determine whether the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold. If the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than the preset threshold, it indicates that the centroid point of the first ellipse can accurately locate the actual speckle corresponding to the first speckle, and the server directly determines the centroid point of the first ellipse as the center point of the actual speckle corresponding to the first speckle. The preset threshold can be set by the person skilled in the art according to actual needs, and the embodiments of the present application do not make specific limitations thereto.

[0057] In this embodiment, considering that due to the difference of the actual test scene, the first speckle in the speckle diagram obtained by shooting and the corresponding second speckle in the GT image have certain differences in position and size, it is unreasonable to directly extract the first speckle as the actual speckle or to directly extract the corresponding position of the second speckle in the first speckle diagram as the actual speckle, and the centroid point can well represent the overall level of a speckle, therefore, in this embodiment, the centroid point of the first speckle is re-determined according to the ellipse fitting of the data of the second speckle in the first speckle diagram, and then the center point of the actual speckle corresponding to the first speckle is determined, so as to accurately determine the reference position of the actual speckle and lay a solid foundation for the extraction of the actual speckle.

[0058] In one embodiment, after the server determines the centroid point of the first ellipse, the server can calculate the Euclidean distance between the centroid point of the ellipse and the centroid point of the first speckle, and determine whether the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold. If the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is greater than or equal to the preset threshold, it indicates that the centroid point of the first ellipse cannot accurately locate the center point of the actual speckle corresponding to the first speckle. At this time, the server updates the centroid point of the first speckle as the centroid point of the first ellipse, and constructs a second ellipse based on the updated centroid point of the first speckle, the preset major and minor axis length, and the preset tilt angle. The server determines the centroid point of the second ellipse according to the pixel value of each pixel point in the second ellipse. If the Euclidean distance between the centroid point of the second ellipse and the updated centroid point of the first speckle is less than the preset threshold, the centroid point of the second ellipse is determined as the center point of the actual speckle corresponding to the first speckle. If the Euclidean distance between the centroid point of the second ellipse and the updated centroid point of the first speckle is still greater than or equal to the preset threshold, it indicates that the centroid point of the second ellipse cannot accurately locate the center point of the actual speckle corresponding to the first speckle. The server continues to update the centroid point of the first speckle, establishes a new ellipse, and iterates until the Euclidean distance between the centroid point of the constructed ellipse and the updated centroid point of the first speckle is less than the preset threshold.

[0059] In this embodiment, in order to further improve the effect of speckle extraction, the iterative idea is introduced to gradually demarcate the ellipse region until the Euclidean distance between the centroid point of the ellipse and the centroid point of the first speckle is less than the preset threshold, so as to more accurately locate the center point of the actual speckle corresponding to the first speckle.

[0060] In one embodiment, the preset search range is a third ellipse, the center of the third ellipse is the center point of the actual speckle, the major and minor axis length of the third ellipse is equal to the preset search multiple multiplied by the preset major and minor axis length, and the tilt angle of the third ellipse is the preset tilt angle. The server searches in the preset search range centered on the center point of the actual speckle based on the preset search step, and determines the major and minor axis length of the actual speckle. The major and minor axis length of the actual speckle can be determined by, for example,Figure 4 The steps shown are implemented, specifically including:

[0061] Step 301, calculating the sum of pixel values of each pixel point in the third ellipse.

[0062] In a specific implementation, the preset search range is a third ellipse with the center point of the actual speckle as the center, and the server can calculate the sum of pixel values of each pixel point in the third ellipse according to the pixel values of each pixel point in the third ellipse.

[0063] In one example, the major and minor axis length of the third ellipse is 3 times the preset major and minor axis length.

[0064] Step 302, constructing a fourth ellipse with the center point of the actual speckle as the center according to the preset tilt angle and the search step g times the preset major and minor axis length, and calculating the sum of pixel values of each pixel point in the fourth ellipse.

[0065] In a specific implementation, the server can construct a fourth ellipse with the center point of the actual speckle as the center according to the preset tilt angle and the search step g times the preset major and minor axis length, and calculate the sum of pixel values of each pixel point in the fourth ellipse, where g is an integer greater than 0 and less than the search multiple.

[0066] In one example, the preset search step is 0.1, so the server constructs the fourth ellipse starting from the preset major and minor axis length of 0.1 times.

[0067] Step 303, determining whether the sum of pixel values of each pixel point in the third ellipse is equal to f times the sum of pixel values of each pixel point in the fourth ellipse, if so, executing step 304, otherwise, executing step 305.

[0068] Step 304, taking the major and minor axis length of the fourth ellipse as the major and minor axis length of the actual speckle.

[0069] Step 305, updating the fourth ellipse with the center point of the actual speckle as the center according to the preset tilt angle and the search step g+1 times the preset major and minor axis length.

[0070] Specifically, after the fourth ellipse is constructed, the server can determine whether the sum of the pixel values of the pixel points in the third ellipse is equal to f times the sum of the pixel values of the pixel points in the fourth ellipse, f being a number greater than 0 and less than 1. If the sum of the pixel values of the pixel points in the third ellipse is equal to f times the sum of the pixel values of the pixel points in the fourth ellipse, it indicates that the actual speckle corresponding to the first speckle has been found. The server takes the major and minor axis lengths of the fourth ellipse as the major and minor axis lengths of the actual speckle. If the sum of the pixel values of the pixel points in the third ellipse is not equal to f times the sum of the pixel values of the pixel points in the fourth ellipse, the actual speckle has not been found. In fact, the embodiment is iterated from small to large. Therefore, the sum of the pixel values of the pixel points in the third ellipse is not equal to f times the sum of the pixel values of the pixel points in the fourth ellipse, that is, the sum of the pixel values of the pixel points in the third ellipse is greater than f times the sum of the pixel values of the pixel points in the fourth ellipse. At this time, the server continues to iterate by taking the center point of the actual speckle as the center, updating the fourth ellipse according to the preset tilt angle and the search step length multiplied by the preset major and minor axis lengths, until the sum of the pixel values of the pixel points in the third ellipse is equal to f times the sum of the pixel values of the pixel points in the fourth ellipse.

[0071] In one example, f is equal to 0.86, that is, it is determined whether the sum of the pixel values of the pixel points in the third ellipse is equal to 0.86 times the sum of the pixel values of the pixel points in the fourth ellipse.

[0072] In this embodiment, the iterative idea is also introduced when the major and minor axis lengths of the actual speckle are determined. Based on the search step length, the fourth ellipse is updated gradually until the sum of the pixel values of the pixel points in the third ellipse is equal to f times the sum of the pixel values of the pixel points in the fourth ellipse. At this time, the fourth ellipse meets the theoretical value of the Gaussian light spot. Taking the major and minor axis lengths of the fourth ellipse at this time as the major and minor axis lengths of the actual speckle is more scientific and reasonable, and the actual speckle corresponding to the first speckle is extracted better.

[0073] In one embodiment, when the actual speckle is extracted according to the center point of the actual speckle and the major and minor axis lengths of the actual speckle, a fifth ellipse can be constructed according to the center point of the actual speckle, the major and minor axis lengths of the actual speckle, and the preset tilt angle. The actual speckle is extracted from the pixel points in the fifth ellipse. Due to the diffraction characteristics of the diffractive optical element, the actual speckle will not be stretched into an ellipse, and will have a certain angle of inclination. The inclination can be considered to be consistent with the inclination of the second speckle in the GT speckle diagram. Therefore, when the actual speckle is extracted, a fifth ellipse is constructed according to the center point of the actual speckle, the major and minor axis lengths of the actual speckle, and the preset tilt angle. The fifth ellipse is taken as the actual speckle. The extracted actual speckle is more accurate.

[0074] In one embodiment, the server determines the corresponding second speckle of each first speckle in the first speckle pattern respectively, which can be achieved by the steps as shown in Figure 5 Specifically, the server determines the corresponding second speckle of each first speckle in the first speckle pattern respectively, which can be achieved by the steps as shown in

[0075] In step 401, one second speckle is selected in each diffraction order region of the second speckle pattern, the centroid point of the second speckle is taken as a third reference point, and a point in the first speckle pattern with the same coordinates as the third reference point is determined as a fourth reference point.

[0076] Specifically, when the server determines the corresponding second speckle of each first speckle in the first speckle pattern, one second speckle can be selected in each diffraction order region of the second speckle pattern first, the centroid point of the second speckle is taken as a third reference point, and a point in the first speckle pattern with the same coordinates as the third reference point is determined as a fourth reference point.

[0077] In one example, the second speckle pattern contains 7x11 diffraction orders, and the server can select one second speckle in each of the 77 diffraction order regions.

[0078] In one example, the server can select the second speckle closest to the center of each diffraction order region.

[0079] In step 402, according to a preset matching algorithm and the third reference point, two-dimensional matching is performed in a first preset matching window centered on the fourth reference point, and a point in the first preset matching window with the maximum matching similarity with the third reference point is taken as the homonym of the third reference point.

[0080] In a specific implementation, after determining the third reference point and the fourth reference point, the server can perform two-dimensional matching in a first preset matching window centered on the fourth reference point according to a preset matching algorithm and the third reference point, and a point in the first preset matching window with the maximum matching similarity with the third reference point is taken as the homonym of the third reference point. The preset matching algorithm can be set by those skilled in the art according to actual needs, and the embodiments of the present application do not make specific limitations thereto.

[0081] In one example, the size of the first preset matching window is 50pxx50px.

[0082] In step 403, the transmission transformation matrix between the first speckle pattern and the second speckle pattern is calculated according to each third reference point and the homonym of each third reference point.

[0083] Specifically, after determining each third reference point and the homonym of each third reference point, the server can calculate the transmission transformation matrix between the first speckle pattern and the second speckle pattern according to each third reference point and the homonym of each third reference point.

[0084] At step 404, according to the centroid point of the first speckle and the transmission transformation matrix, the homonym point of the centroid point of the first speckle is determined in the second speckle diagram, and the second speckle in which the homonym point of the centroid point of the first speckle is located is taken as the second speckle corresponding to the first speckle.

[0085] In a specific implementation, according to the coordinates of the centroid point of the first speckle, the transmission transformation is performed according to the calculated transmission transformation matrix, the point on the coordinate after the transmission transformation in the second speckle diagram is the homonym point of the centroid point of the first speckle, and the server directly takes the second speckle in which the homonym point of the centroid point of the first speckle is located as the second speckle corresponding to the first speckle.

[0086] In this embodiment, it is not necessary to perform matching calculation for each first speckle, but only to select a second speckle in each diffraction order region, to calculate the transmission transformation matrix based on these second speckles which can represent the actual situation of the whole second speckle diagram, and to directly perform transmission transformation on each first speckle according to the transmission transformation matrix, so that the first speckle and the second speckle can be quickly and accurately corresponded, and the matching calculation amount is greatly reduced, and the efficiency of speckle extraction is improved.

[0087] In one embodiment, when the server determines the homonym point of the centroid point of the first speckle in the second speckle diagram according to the centroid point of the first speckle and the transmission transformation matrix, the coordinate after the transmission transformation can be determined according to the coordinates of the centroid point of the first speckle and the transmission transformation matrix, the point on the coordinate after the transmission transformation in the second speckle diagram is taken as the fifth reference point, the second preset matching window centered on the fifth reference point is used for two-dimensional matching according to the preset matching algorithm and the centroid point of the first speckle, and the point in the second preset matching window with the maximum matching similarity with the centroid point of the first speckle is taken as the homonym point of the centroid point of the first speckle, wherein the size of the second preset matching window is smaller than that of the first preset matching window, that is, when the transmission transformation is performed, small-range two-dimensional matching is also performed, which can further improve the accuracy of the correspondence between the first speckle and the second speckle, and further improve the accuracy of speckle extraction.

[0088] In one example, the size of the second preset matching window can be 10px*10px.

[0089] The step division of the above various methods is only for the purpose of clear description, and can be combined into one step or split into multiple steps in implementation, as long as the same logical relationship is included, and all are within the protection scope of the patent; adding irrelevant modifications or introducing irrelevant designs in the algorithm or process, but not changing the core design of the algorithm and process are within the protection scope of the patent.

[0090] Another embodiment of the present application relates to a speckle extraction device, and implementation details of the speckle extraction device of the present embodiment are specifically described as follows. The implementation details provided below are only for the convenience of understanding, and are not necessary for implementing the present embodiment. A schematic diagram of the speckle extraction device of the present embodiment can be as shown in Figure 6 The speckle extraction device of the present embodiment comprises:

[0091] A matching module 501 is configured to determine a second speckle corresponding to each first speckle in a first speckle pattern in a second speckle pattern, respectively. The first speckle pattern is a speckle pattern obtained by shooting, and the second speckle pattern is a preset GT speckle pattern.

[0092] A positioning module 502 is configured to select a first seed point in the first speckle, select a second seed point in the second speckle corresponding to the first speckle, and determine a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle pattern having the same coordinate as the second seed point.

[0093] A searching module 503 is configured to search in a preset search range centered on the center point of the actual speckle based on a preset search step, and determine a major axis length and a minor axis length of the actual speckle.

[0094] An extraction module 504 is configured to extract the actual speckle according to the center point of the actual speckle and the major axis length and the minor axis length of the actual speckle.

[0095] It is worth mentioning that each module involved in the present embodiment is a logical module. In actual application, one logical unit can be one physical unit, or a part of one physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present application, units not closely related to solving the technical problems proposed in the present application are not introduced in the present embodiment, but this does not mean that there are no other units in the present embodiment.

[0096] Another embodiment of the present application relates to an electronic device, as shown in Figure 7 The electronic device comprises at least one processor 601 and a memory 602 connected with the at least one processor 601. The memory 602 stores instructions executable by the at least one processor 601. The instructions are executed by the at least one processor 601 to enable the at least one processor 601 to perform the speckle extraction method in each of the above embodiments.

[0097] The memory and the processor are connected by a bus. The bus can include any number of interconnecting buses and bridges depending on the specific application of the mobile terminal. The bus connects the various circuits of the memory and the processor together and mediates data communication among different components. The bus can also connect with the peripheral devices such as the peripheral device, voltage stabilizer, and power management circuit, etc. which are well-known in the art, and thus, further description will not be given. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components such as a plurality of receivers and transmitters, which provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted through the antenna on the wireless medium, and further, the antenna also receives data and transmits the data to the processor.

[0098] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory can be used to store data used by the processor in performing operations.

[0099] Another embodiment of the present application relates to a computer readable storage medium, which stores a computer program. The computer program is executed by the processor to implement the method embodiments.

[0100] That is, those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by a program instructing related hardware, the program is stored in a storage medium, and includes a plurality of instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0101] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.

Claims

1. A speckle extraction method, characterized by, The method comprises the steps of: respectively determining a second speckle corresponding to each first speckle in a first speckle pattern in a second speckle pattern; wherein the first speckle pattern is a speckle pattern obtained by shooting, and the second speckle pattern is a preset GT speckle pattern; selecting a first seed point in the first speckle and a second seed point in the second speckle corresponding to the first speckle, and determining a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle pattern having the same coordinates as the second seed point, wherein the first seed point is a centroid point of the first speckle, and the second seed point is a centroid point of the second speckle corresponding to the first speckle; searching in a preset search range centered on the center point of the actual speckle based on a preset search step, and determining the major and minor axis lengths of the actual speckle; extracting the actual speckle according to the center point of the actual speckle and the major and minor axis lengths of the actual speckle; The method comprises the steps of: taking the centroid point of the second speckle corresponding to the first speckle as a first reference point, and determining a point in the first speckle pattern having the same coordinates as the first reference point as a second reference point; constructing a first ellipse centered on the second reference point according to a preset major and minor axis length and a preset tilt angle, and determining a centroid point of the first ellipse according to the pixel values of the pixel points in the first ellipse; wherein the preset tilt angle is the included angle between the preset major axis and the x-axis; if the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold, determining the centroid point of the first ellipse as the center point of the actual speckle corresponding to the first speckle.

2. The speckle extraction method of claim 1, wherein, The method further comprises the steps of: if the Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is greater than or equal to the preset threshold, updating the centroid point of the first ellipse to the centroid point of the first speckle; constructing a second ellipse centered on the updated centroid point of the first speckle according to the preset major and minor axis length and the preset tilt angle, and determining a centroid point of the second ellipse according to the pixel values of the pixel points in the second ellipse; if the Euclidean distance between the centroid point of the second ellipse and the updated centroid point of the first speckle is less than the preset threshold, determining the centroid point of the second ellipse as the center point of the actual speckle corresponding to the first speckle.

3. The speckle extraction method according to any one of claims 1 or 2, characterized in that, The centroid point of the first ellipse is determined according to the pixel values of the pixel points in the first ellipse by the following formula: wherein, is a pixel value of the i-th pixel point in the first ellipse, is an abscissa of the i-th pixel point in the first ellipse, is an ordinate of the i-th pixel point in the first ellipse, is an abscissa of a centroid point of the first ellipse, is an ordinate of the centroid point of the first ellipse.

4. The speckle extraction method according to any one of claims 1 to 2, characterized in that, The preset search range is a third ellipse, a center of the third ellipse is a center point of the actual speckle, lengths of major and minor axes of the third ellipse are equal to a preset search multiple multiplied by preset lengths of major and minor axes, an inclination angle of the third ellipse is a preset inclination angle, and searching is performed in the preset search range centered on the center point of the actual speckle based on a preset search step length to determine lengths of major and minor axes of the actual speckle, and the searching includes: calculating a sum of pixel values of each pixel point in the third ellipse; constructing a fourth ellipse according to the preset inclination angle and a search step length of g times the preset lengths of major and minor axes, and calculating a sum of pixel values of each pixel point in the fourth ellipse, with the center point of the actual speckle as a center; wherein g is an integer greater than 0 and less than the search multiple; if the sum of the pixel values of each pixel point in the third ellipse is equal to f times the sum of the pixel values of each pixel point in the fourth ellipse, lengths of major and minor axes of the fourth ellipse are taken as the lengths of major and minor axes of the actual speckle; wherein f is a number greater than 0 and less than 1; if the sum of the pixel values of each pixel point in the third ellipse is not equal to f times the sum of the pixel values of each pixel point in the fourth ellipse, the fourth ellipse is updated according to the preset inclination angle and a search step length of (g+1) times the preset lengths of major and minor axes, with the center point of the actual speckle as a center.

5. The speckle extraction method of claim 4, wherein, The f is equal to 0.

86.

6. The speckle extraction method according to any one of claims 1 to 2, characterized in that, The extracting the actual speckle according to the center point of the actual speckle and the lengths of major and minor axes of the actual speckle includes: constructing a fifth ellipse according to the lengths of major and minor axes of the actual speckle and the preset inclination angle, with the center point of the actual speckle as a center; extracting each pixel point in the fifth ellipse to obtain the actual speckle.

7. The speckle extraction method according to any one of claims 1 to 2, characterized in that, The determining a corresponding second speckle of each first speckle in the first speckle pattern in the second speckle pattern includes: selecting one second speckle in each diffraction order region of the second speckle pattern, taking a centroid point of the second speckle as a third reference point, and determining a point in the first speckle pattern with the same coordinates as the third reference point as a fourth reference point; performing two-dimensional matching in a first preset matching window centered on the fourth reference point according to a preset matching algorithm and the third reference point, taking a point in the first preset matching window with the maximum matching similarity with the third reference point as a homonym point of the third reference point; calculating a transmission transformation matrix between the first speckle pattern and the second speckle pattern according to each third reference point and the homonym point of each third reference point; determining a homonym point of the centroid point of the first speckle in the second speckle pattern according to the centroid point of the first speckle and the transmission transformation matrix, and taking a second speckle where the homonym point of the centroid point of the first speckle is located as the corresponding second speckle of the first speckle.

8. The speckle extraction method of claim 7, wherein, The determining a homonym point of the centroid point of the first speckle in the second speckle pattern according to the centroid point of the first speckle and the transmission transformation matrix includes: determine a coordinate after the transmission transformation according to the coordinate of the centroid point of the first speckle and the transmission transformation matrix, and take a point on the coordinate after the transmission transformation as a fifth reference point; perform two-dimensional matching in a second preset matching window centered on the fifth reference point according to a preset matching algorithm and the centroid point of the first speckle, and take a point in the second preset matching window with the greatest matching similarity with the centroid point of the first speckle as the homonym of the centroid point of the first speckle; wherein the size of the second preset matching window is smaller than that of the first preset matching window.

9. A speckle extraction device, characterized by, comprise: a matching corresponding module configured to determine a corresponding second speckle of each first speckle in a first speckle pattern in a second speckle pattern, the first speckle pattern being a photographed speckle pattern, and the second speckle pattern being a preset GT speckle pattern; a positioning module configured to select a first seed point in the first speckle, select a second seed point in the second speckle corresponding to the first speckle, and determine a center point of an actual speckle corresponding to the first speckle according to the first seed point and a point in the first speckle pattern with the same coordinate as the second seed point, wherein the first seed point is a centroid point of the first speckle, and the second seed point is a centroid point of the second speckle corresponding to the first speckle; the positioning module is further configured to take the centroid point of the second speckle corresponding to the first speckle as a first reference point, determine a point in the first speckle pattern with the same coordinate as the first reference point as a second reference point, construct a first ellipse according to a preset major and minor axis length and a preset tilt angle with the second reference point as the center of the first ellipse, and determine a centroid point of the first ellipse according to pixel values of each pixel point in the first ellipse; wherein the preset tilt angle is an included angle between the preset major axis and an x-axis; and if an Euclidean distance between the centroid point of the first ellipse and the centroid point of the first speckle is less than a preset threshold, determine the centroid point of the first ellipse as the center point of the actual speckle corresponding to the first speckle; a searching module configured to search in a preset search range centered on the center point of the actual speckle based on a preset search step, and determine a major and minor axis length of the actual speckle; an extracting module configured to extract the actual speckle according to the center point of the actual speckle and the major and minor axis length of the actual speckle.

10. An electronic device, comprising: comprise: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the speckle extraction method in any one of claims 1 to 8.

11. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the speckle extraction method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Speckle pattern matching method, speckle pattern matching apparatus, electronic device, and storage medium

    CN113168682A

  • Laser spot monitoring method, system and equipment based on ring filtering

    CN114659627A