Optical measurement method and device and electronic equipment
By acquiring the light spot in the initial and measurement states, and using transformation matrix and feature point matching to constrain rotation and scaling dimensions, the problem of inaccurate measurement of the position change of the light spot when it is occluded is solved, realizing the rapid and accurate determination of the change in the position of the light spot, and improving the accuracy and efficiency of the measurement results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CORE VISION (BEIJING) TECHNOLOGY CO LTD
- Filing Date
- 2024-11-04
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for measuring changes in the position of a light spot are inaccurate when the spot is partially obscured, leading to inaccurate measurement results.
By acquiring the light spot in the initial and measured states, the positional changes between the light spots are determined using the transformation matrix, especially by constraining the rotation and scaling dimensions. Combined with feature point matching and the transformation matrix, the positional changes of the light spots are determined quickly and accurately.
Even if the light spot is blocked, the change in the position of the light spot can be accurately determined, which improves the accuracy, reliability and efficiency of the measurement results.
Smart Images

Figure CN121994126A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of measurement technology, and in particular to an optical measurement method and apparatus, and electronic equipment. Background Technology
[0002] The change in the position of the light spot usually refers to the phenomenon that, under certain conditions, the position of the light beam's focal point or spot changes during its propagation due to the influence of certain factors (such as the movement of optical components).
[0003] By determining the positional changes of the light spot, measurement results can be obtained in different scenarios. However, the accuracy of existing measurement results needs improvement, especially when the light spot is partially obscured, making it even more difficult to obtain accurate results. Summary of the Invention
[0004] In view of this, this disclosure proposes an optical measurement scheme.
[0005] According to one aspect of this disclosure, an optical measurement method is provided, the method comprising: acquiring a first light spot in an initial state; acquiring a second light spot in a measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices; determining a transformation matrix between the first light spot and the second light spot; constraining the rotation dimension and scaling dimension of the transformation matrix to obtain a constrained transformation matrix; and determining a positional change between the first light spot and the second light spot based on the constrained transformation matrix, the positional change being used to determine an optical measurement result.
[0006] In one possible implementation, determining the transformation matrix between the first light spot and the second light spot includes: determining at least three first feature points and a first feature descriptor corresponding to each first feature point based on the first light spot; determining at least three second feature points and a second feature descriptor corresponding to each second feature point based on the second light spot; matching each first feature descriptor with each second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point; and determining the transformation matrix based on each feature point pair.
[0007] In one possible implementation, matching the first feature descriptor with the second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point includes: determining a first similarity between each of the first feature descriptors and each of the second feature descriptors, where a single similarity corresponds to a first feature point and a first feature descriptor corresponding to the first feature point, and also corresponds to a second feature point and a second feature descriptor corresponding to the second feature point; if the first similarity is greater than a first similarity threshold, the first feature point and the second feature point corresponding to the first similarity are determined as a feature point pair.
[0008] In one possible implementation, the method further includes: determining the nearest neighbor second feature point and the second nearest second feature point for each first feature point based on the first similarity; determining the nearest neighbor distance and the second nearest neighbor distance for each first feature point based on each first feature point and the corresponding nearest neighbor second feature point and the second nearest neighbor second feature point; and if the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than a distance threshold, using the first feature point and the second feature point used to determine the nearest neighbor distance as a usable feature point pair.
[0009] In one possible implementation, the initial state includes a first initial state, which is the state in which the first incident light passes through a first standard object; the measurement state includes a first measurement state, which is the state in which the first incident light passes through the object under test; the position change includes a first position change between the light spots formed by the first incident light in the first initial state and the first measurement state; the measurement result is the target value of the first target parameter of the object under test; and the method further includes: obtaining a mapping response relationship of the first target parameter, wherein the mapping response relationship is used to characterize the position change corresponding to the first target parameter under different values; and determining the target value based on the mapping response relationship and the first position change.
[0010] In one possible implementation, the initial state includes a second initial state, which is the state in which the second incident light passes through the first standard object; the measurement state includes a second measurement state, which is the state in which the second incident light passes through the second standard object; and the step of obtaining the mapping response relationship of the first target parameter includes: obtaining second target parameters of a plurality of second standard objects; determining a second position change amount corresponding to each of the plurality of second standard objects, wherein the second position change amount is the second position change amount between the light spots formed by the second incident light in the first initial state and the second initial state; and determining the mapping response relationship based on the plurality of second position change amounts and the second target parameters corresponding to the plurality of second position change amounts.
[0011] In one possible implementation, the initial state includes a third initial state, wherein the third initial state is: emitting a third incident light at a first moment; the measurement state includes a third measurement state, wherein the third measurement state is: emitting the third incident light at a second moment; the position change includes: a third position change between the light spots formed by the third incident light in the third initial state and the third measurement state; the measurement result is the accuracy of the device emitting the third incident light; the method further includes: determining statistical data of the third position change based on multiple third position change values; determining the accuracy based on the statistical data of the third position change; and, if the accuracy does not meet a first condition, adjusting the device until the accuracy meets the first condition.
[0012] In one possible implementation, the first and second light spots are cross-shaped.
[0013] According to another aspect of this disclosure, an optical measuring device is provided, the device comprising:
[0014] The first light spot acquisition unit is used to acquire the first light spot including the initial state;
[0015] The second light spot acquisition unit is used to acquire a second light spot including the measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices;
[0016] A transformation matrix acquisition unit is used to determine the transformation matrix between the first light spot and the second light spot;
[0017] A transformation matrix constraint unit is used to constrain the rotation and scaling dimensions of the transformation matrix to obtain a constrained transformation matrix.
[0018] The position change determination unit is used to determine the position change between the first light spot and the second light spot based on the constrained transformation matrix, and the position change is used to determine the measurement result.
[0019] In one possible implementation, the transformation matrix acquisition unit is used for:
[0020] Based on the first light spot, at least three first feature points and a first feature descriptor corresponding to each first feature point are determined;
[0021] Based on the second light spot, at least three second feature points and a second feature descriptor corresponding to each second feature point are determined;
[0022] Each of the first feature descriptors is matched with each of the second feature descriptors to determine a feature point pair consisting of the first feature point and the second feature point;
[0023] The transformation matrix is determined based on each of the aforementioned feature point pairs.
[0024] In one possible implementation, matching the first feature descriptor with the second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point includes:
[0025] Determine the first similarity between each of the first feature descriptors and each of the second feature descriptors. Each similarity corresponds to a first feature point and a first feature descriptor corresponding to the first feature point, and also corresponds to a second feature point and a second feature descriptor corresponding to the second feature point.
[0026] If the first similarity is greater than the first similarity threshold, the first feature point and the second feature point corresponding to the first similarity are determined as a feature point pair.
[0027] In one possible implementation, the device further includes:
[0028] The second feature point determination unit is used to determine the nearest and next nearest second feature points of each first feature point based on the first similarity.
[0029] A distance determination unit is used to determine the nearest neighbor distance and the second nearest neighbor distance of each first feature point based on each first feature point and the corresponding nearest and second nearest second feature points.
[0030] The available feature point determination unit is used to determine the first and second feature points used to determine the nearest neighbor distance as a pair of available feature points when the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than a distance threshold.
[0031] In one possible implementation, the initial state includes a first initial state, which is the state in which the first incident light passes through a first standard object; the measurement state includes a first measurement state, which is the state in which the first incident light passes through the object under test; the position change includes a first position change between the light spots formed by the first incident light in the first initial state and the first measurement state; the measurement result is the target value of a first target parameter of the object under test; and the device further includes:
[0032] A mapping response relationship acquisition unit is used to acquire the mapping response relationship of the first target parameter, wherein the mapping response relationship is used to characterize the position change of the first target parameter under different values;
[0033] The target value determination unit is used to determine the target value based on the mapping response relationship and the first position change amount.
[0034] In one possible implementation, the initial state includes a second initial state, which is the state of the second incident light passing through the first standard object; the measurement state includes a second measurement state; and the mapping response relationship acquisition unit is used to:
[0035] Obtain the second target parameters of multiple second standard objects;
[0036] Determine the second position change amount corresponding to each of the multiple second standard objects, where the second position change amount is the second position change amount between the light spots formed by the second incident light in the first initial state and the second initial state, respectively.
[0037] The mapping response relationship is determined based on a plurality of second position changes and second target parameters corresponding to the plurality of second position changes.
[0038] In one possible implementation, the initial state includes a third initial state, wherein the third initial state is: emitting a third incident light at a first moment; the measurement state includes a third measurement state, wherein the third measurement state is: emitting the third incident light at a second moment; the position change includes: a third position change between the light spots formed by the third incident light in the third initial state and the third measurement state; the measurement result is the accuracy of the device emitting the third incident light; and the device further includes:
[0039] The third position change statistical data determination unit is used to determine the third position change statistical data based on multiple third position change quantities.
[0040] An accuracy determination unit is used to determine the accuracy based on the statistical data of the third position change.
[0041] A debugging unit is used to debug the device until the accuracy meets the first condition if the accuracy does not meet the first condition.
[0042] In one possible implementation, the first and second light spots are cross-shaped.
[0043] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the above-described method when executing instructions stored in the memory.
[0044] In this embodiment, a first and a second light spot with three vertices are used, making it easy to determine the transformation matrix between them. By constraining the rotation and scaling dimensions from the transformation matrix, the positional change of the first light spot in the initial state and the second light spot in the measurement state can be determined more quickly. This positional change can be used to obtain the measurement result. Even if the light spot is occluded, the positional change can be accurately determined. Furthermore, using a first and a second light spot with three vertices, since such a light spot has feature points that remain invariant under transformation, combined with the determined transformation matrix, allows for a more efficient and rapid determination of the positional change of the light spot, thereby improving the accuracy, reliability, and efficiency of the measurement results.
[0045] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0046] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0047] Figure 1 This is a schematic flowchart of an optical measurement method provided in an embodiment of the present disclosure.
[0048] Figure 2 This is a schematic diagram of the shape of the laser spot provided in an embodiment of this disclosure.
[0049] Figure 3 This is a schematic diagram of the structure of the optical measurement device provided in an embodiment of this disclosure.
[0050] Figure 4 This is a schematic diagram of the structure of an electronic device for optical measurement provided in an embodiment of this disclosure. Detailed Implementation
[0051] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0052] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0053] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0054] Figure 1 This is a schematic flowchart of an optical measurement method provided in an embodiment of this disclosure. Figure 1 As shown, the method includes:
[0055] S11, acquire the first light spot including the initial state.
[0056] The first light spot can be a light spot captured by an image sensor. The image sensor can be a sensor containing a charge-coupled device (CCD) or a sensor containing a complementary metal-oxide-semiconductor (CMOS), etc. The first light spot can be an RGB image, a grayscale image, or an infrared image, etc. The first light spot can be a portion of an RGB image or a grayscale image. The first light spot can be a cross-shaped spot, a pentagon, or an irregular shape, etc., containing at least three vertices. In one embodiment, the light spot can be obtained by passing incident light through a "spot-controlled image" with a specific shape, for example, forming a hole structure with a corresponding shape on an opaque medium. Temporally, the initial state is the state prior to the measurement state. The first light spot can characterize the spatial distribution of incident light in the initial state. For example, when measuring solution concentration, the first light spot can be a spot formed after incident light enters and passes through an empty container, or after incident light enters and passes through a solvent (excluding the solution to be measured). For example, when testing a laser device, the first light spot can be the light spot formed by the first laser emission during two laser emission processes. This disclosure does not limit the specific scenario for the initial state.
[0057] S12, acquire a second light spot including the measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices.
[0058] In this embodiment of the disclosure, the three vertices of the first light spot and the second light spot may not be on the same straight line. Here, the vertex can be the intersection point between the edge lines that characterize the shape of the light spot (the first light spot or the second light spot). For example, if the light spot is rectangular, it has four edge lines connected end to end, and the intersection point of the connected edge lines can be used as a vertex.
[0059] The second light spot can be a light spot captured by an image sensor. The second light spot can be a cross-shaped, pentagonal, or irregular shape, containing at least three vertices. The image sensor can be a sensor containing a charge-coupled device (CCD) or a sensor containing a complementary metal-oxide-semiconductor (CMOS). The second light spot can be an RGB image or a grayscale image. The second light spot can be a portion of an RGB image or a grayscale image. The second light spot can be the same type as or different from the first light spot; for example, if the first light spot is an RGB image, the second light spot can be either an RGB image or a grayscale image. The second light spot and the first light spot can be formed by the same incident light from the same light source or by different incident light. The incident light can be natural light, artificial light, preferably laser light. In time, the measurement state is the state after the initial state. The second light spot can be the spatial distribution of the incident light in the measurement state. For example, when measuring solution concentration, the second light spot can be the light spot formed after incident light passes through the container containing the solution to be measured, or after incident light passes through the solvent added to the solution to be measured. As another example, when testing a laser device, the second light spot can be the laser spot formed by the second laser emission during a two-stage laser emission process. This disclosure does not limit the specific scenario of the measurement state.
[0060] S13, determine the transformation matrix between the first light spot and the second light spot.
[0061] In this embodiment, the transformation matrix can be determined based on feature points on the first and second light spots. Feature points can be salient, easily identifiable points in the image, such as corner points, edge points, or unique texture points. Feature points are points that remain unchanged under certain transformations (e.g., stretching, scaling, affine transformations, etc.). The higher the specificity of the feature points, the higher the registration accuracy. Feature points are determined based on the distribution of the inverse direction vector field near a point. Feature points can be discontinuous. Feature points can include the vertices of the light spots (first light spot, second light spot). Since the light spots in this embodiment contain at least three vertices, and the purpose of determining the transformation matrix is to determine the change in the position of the light spots, the vertices of the light spots can also be used directly to determine the transformation matrix. Alternatively, at least three points can be selected from the points located on the light spots (vertices, center points, points constituting the light spots) to determine the transformation matrix. The transformation matrix can be a shear matrix, an affine transformation matrix, etc. This embodiment does not limit the form of the transformation matrix.
[0062] S14, constrain the rotation and scaling dimensions of the transformation matrix to obtain the constrained transformation matrix.
[0063] Since this disclosure focuses on the change in the position of the light spot, the rotation and scaling of the second light spot relative to the first light spot can be ignored. This allows for constraints on the rotation and scaling dimensions of the transformation matrix, ensuring that the second light spot does not rotate or scale relative to the first light spot. Consequently, these two dimensions do not need to be considered when solving the transformation matrix. This reduces the difficulty of the solution and improves the efficiency and accuracy of determining the transformation matrix.
[0064] S15, based on the constrained transformation matrix, determine the positional change between the first light spot and the second light spot, the positional change being used to determine the measurement result.
[0065] The measurement results here can include: measurement results of the laser measuring device on the object being measured, or measurement results of the laser measuring device's measurement performance. For example, when the object being measured is a liquid, the measurement result can be the concentration of the liquid. As another example, when the object being measured is an intelligent agent, the measurement result can be the agent's motion state. Yet another example is the measurement accuracy or stability of the laser device. This disclosure does not limit the specific form of the measurement results.
[0066] The position change of a circular light spot is usually determined by the centroid method. However, when the circular light spot is blocked, the centroid of that light spot cannot be accurately determined, and thus the accurate amount of position change of the light spot cannot be obtained.
[0067] In this embodiment, a first and second light spot with three vertices are used, making it easy to determine the transformation matrix between them. By constraining the rotation and scaling dimensions from the transformation matrix, the positional change of the first light spot in the initial state and the second light spot in the measurement state can be determined more quickly. This positional change can be used to obtain the measurement result. Even if the light spot is occluded, the positional change can be accurately determined. Furthermore, using a first and second light spot with three vertices, since such a light spot has feature points that remain invariant under certain transformations, combined with the determined transformation matrix, allows for a more efficient and rapid determination of the positional change of the light spot, thereby improving the accuracy, reliability, and efficiency of the measurement results.
[0068] In one possible implementation, determining the transformation matrix between the first light spot and the second light spot includes: determining at least three first feature points and a first feature descriptor corresponding to each first feature point based on the first light spot; determining at least three second feature points and a second feature descriptor corresponding to each second feature point based on the second light spot; matching each first feature descriptor with each second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point; and determining the transformation matrix based on each feature point pair.
[0069] The at least three first feature points may include the vertex and center point of the laser spot on the first light spot, as well as the points that make up the laser spot within the first light spot. The at least three second feature points may include the vertex and center point of the laser spot on the second light spot, as well as the points that make up the laser spot within the second light spot. Moreover, three of the determined first feature points and three of the determined second feature points are not collinear. Feature descriptions can be performed on individual first feature points or individual second feature points to obtain first feature descriptors or second feature descriptors. There is a one-to-one correspondence between the first feature points and the first feature descriptors; there is also a one-to-one correspondence between the second feature points and the second feature descriptors. The first feature descriptor can encode the local image information around the first feature point; the second feature descriptor can encode the local image information around the second feature point. Even when the image is scaled or rotated, the first feature point (second feature point) corresponding to the first feature descriptor (second feature descriptor) can be determined using the first feature descriptor (second feature descriptor).
[0070] In this embodiment, brute-force matching algorithms, SIFT (Scale-invariant feature transform) algorithms, ORB (Oriented FAST and Rotated BRIEF) algorithms, etc., can be used to match the first feature descriptor and the second feature descriptor to obtain feature point pairs. Therefore, the first feature descriptor and the second feature descriptor can be constructed according to the feature point matching algorithm used.
[0071] For example, the first feature descriptor and the second feature descriptor can be rotation descriptors. A circular range can be defined with the first feature point (or second feature point) as the center of gravity, with a preset radius. The centroid of this circular range is determined based on the grayscale values of the pixels within it. The centroid is typically located at the first moment of the light intensity distribution of the light spot. The direction from the center of this circular range to the centroid is taken as the principal direction of the first feature point (or second feature point). The grayscale value difference between the first feature point and its surrounding points is determined according to this principal direction, and these differences are binarized to generate a binary string. This binary string is used as the first feature descriptor (or second feature descriptor). The first and second feature descriptors ensure rotation invariance for the first and second feature points, allowing them to be matched to identify feature point pairs.
[0072] In this embodiment of the disclosure, the transformation matrix can be an affine transformation matrix. The affine transformation matrix is determined based on each of the feature point pairs, for example, by using the least squares method or singular value decomposition.
[0073] Since the vertex of the laser spot can be used as the first feature point and the second feature point, the transformation matrix determined in this way can more accurately determine the first position change of the spot, which is more suitable for the scenario in this disclosure.
[0074] In one possible implementation, matching the first feature descriptor with the second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point includes: determining a first similarity between each of the first feature descriptors and each of the second feature descriptors, where a single similarity corresponds to a first feature point and a first feature descriptor corresponding to the first feature point, and also corresponds to a second feature point and a second feature descriptor corresponding to the second feature point; if the first similarity is greater than a first similarity threshold, the first feature point and the second feature point corresponding to the first similarity are determined as a feature point pair.
[0075] In this embodiment of the disclosure, a first similarity between each first feature descriptor and each second feature descriptor can be determined. For example, the Euclidean distance, cosine similarity, or Hamming distance between each first feature descriptor and each second feature descriptor can be used as the first similarity. Feature point pairs are determined based on the first similarity. For example, first feature points and second feature points with a similarity greater than the first similarity threshold are determined as feature point pairs. At least three feature point pairs are determined.
[0076] For ease of understanding, Euclidean distance is used to represent the first similarity between the first and second feature descriptors. Euclidean similarity is used to represent the first similarity between the first and second feature descriptors.
[0077]
[0078] Among them, a i b represents the i-th element in the first feature descriptor. i The first feature descriptor contains the i-th element; n represents that the first and second feature descriptors each contain n elements. d represents the Euclidean distance between the first and second feature descriptors.
[0079]
[0080] Here, cosθ represents the cosine similarity between the first feature descriptor and the second feature descriptor.
[0081] In this embodiment of the disclosure, feature point pairs are determined by determining a first similarity, which is simple, easy to implement, and highly parallel, thus improving the efficiency of determining feature point pairs.
[0082] In one possible implementation, the method further includes: determining the nearest and next nearest second feature points of each first feature point based on the first similarity; determining the nearest and next nearest distances of each first feature point based on each first feature point and the corresponding nearest and next nearest second feature points; and, if the ratio of the nearest distance to the next nearest distance is less than a distance threshold, using the first and second feature points used to determine the nearest distance as a pair of usable feature points.
[0083] In this embodiment of the disclosure, feature point pairs can be further filtered. In this embodiment, a first similarity score can be determined between each first descriptor and each second descriptor. For a single first feature point, based on the value of the first similarity score, the two second feature points corresponding to the highest first similarity scores can be determined as the nearest and second nearest second feature points of that single first feature point. Each first feature point can correspond to one nearest and one second nearest second feature point. Then, the distance between each first feature point and its corresponding nearest second feature point is calculated; for ease of description below, this distance is named the nearest distance. The distance between each first feature point and its corresponding second nearest second feature point is also calculated; for ease of description below, this distance is named the second nearest distance. If the ratio of the nearest distance to the second nearest distance of a single first feature point is less than a distance threshold, the single first feature point and its nearest second feature point can be considered as a usable feature point pair. Alternatively, ratio testing, cross-validation, or geometric constraints can be used to filter usable feature point pairs from the feature point pairs. A transformation matrix is determined based on the usable feature point pairs.
[0084] In this embodiment of the disclosure, the feature point pairs are further filtered to select available feature point pairs with higher matching degree, thereby further improving the accuracy of determining the transformation matrix.
[0085] In one possible implementation, the transformation matrix includes a first parameter to be solved, and determining the transformation matrix based on each of the feature point pairs includes: constructing a first system of linear equations including the first parameter; and determining the first parameter based on the feature point pairs and the first system of linear equations.
[0086] The first linear equation system can be defined with the x-coordinates of the first and second characteristic points as independent variables and the y-coordinates of the first and second characteristic points as dependent variables. For ease of understanding, the coefficients of the equation system are named the first parameter. The first parameter can be an element of the transformation matrix. The first parameter can be obtained by substituting the coordinates of at least three first characteristic points and the coordinates of the second characteristic point into the first linear equation system. In this way, the transformation matrix can be determined.
[0087] For ease of understanding, formulas (3) and (4) are used to represent the process of determining the transformation matrix.
[0088] The transformation matrix is a 3x3 matrix, and is characterized by formula (3).
[0089]
[0090] Where a, b, c, d, e, and f are parameters (elements) in the matrix transformation.
[0091] The first system of linear equations is represented by formula (4).
[0092]
[0093] Where x is the x-coordinate of the first feature point, y is the y-coordinate of the first feature point, and x... ′ The x-coordinate and y-coordinate of the second feature point ′ y is the ordinate of the first feature point.
[0094] Substitute the coordinates of the first feature point and the second feature point into formula (4) to solve for the parameters in the transformation matrix, thus obtaining the transformation matrix.
[0095] In one possible implementation, the first parameter includes a horizontal scaling parameter, a vertical scaling parameter, a horizontal rotation parameter, and a vertical rotation parameter. The constraint on the linear equation system in the rotation dimension and the scaling dimension includes: setting the horizontal scaling parameter and the vertical scaling parameter to be equal and to a first preset value; and setting the horizontal scaling parameter and the vertical rotation parameter to be equal and to a second preset value.
[0096] The parameters representing the scaling dimension in the transformation matrix can include: horizontal scaling parameters and vertical scaling parameters. The parameters representing the rotation dimension in the transformation matrix can include: horizontal rotation parameters and vertical rotation parameters.
[0097] Take the transformation matrix represented by formula (3) as an example. Where a represents the horizontal scaling parameter, e represents the vertical scaling parameter, b represents the horizontal rotation parameter, and d represents the vertical rotation parameter.
[0098] In this embodiment, the first preset value can be 1, and the second preset value can be 0. a, e, b, and d can be determined from the first system of linear equations. Furthermore, a is set to be equal to e and equal to 1 to ensure that the second light spot is not scaled relative to the first light spot; b is set to be equal to d and equal to 0 to ensure that the second light spot is not rotated relative to the first light spot. This reduces the number of first parameters to be solved, improving the efficiency and accuracy of determining the transformation matrix.
[0099] In one possible implementation, the initial state includes a first initial state, which is the state in which the first incident light passes through a first standard object; the measurement state includes a first measurement state, which is the state in which the first incident light passes through the object under test; the position change includes a first position change between the light spots formed by the first incident light in the first initial state and the second initial state; the measurement result is the target value of the first target parameter of the object under test; and the method further includes: obtaining a mapping response relationship of the first target parameter, wherein the mapping response relationship is used to characterize the position change corresponding to the first target parameter under different values; and determining the target value based on the mapping response relationship and the first position change.
[0100] In this embodiment, the first standard object may include a solvent, which can be a solution of known concentration, such as pure water. Alternatively, the solvent may be air, i.e., a situation without any liquid. The test object may include the test solution. The first target parameter may be the concentration of the test solution. When the first incident light passes through the first standard object, optical phenomena such as refraction, reflection, and transmission may occur, preferably refraction.
[0101] For example, the first incident light can be a first laser beam. The laser device can include a laser emitter and a laser receiver. A transparent container, such as a transparent groove, is disposed between the laser emitter and the laser receiver. The laser emitter can emit the first laser beam. The first laser beam passes through the transparent groove and reaches the laser receiver. The first initial state can be that a first standard object is placed in the transparent groove. The laser emitter emits the first laser beam, which passes through the transparent groove containing solvent and reaches the laser receiver, resulting in a first light spot. The first measurement state can be that the groove contains a solution to be tested. The laser emitter emits the first laser beam, which passes through the transparent groove containing the solution to be tested and reaches the laser receiver, resulting in a second light spot. In this way, the laser receiver obtains the first light spot and the second light spot respectively. A first positional change between the first light spot and the second light spot can then be determined. In practical applications, the relative positions of the laser emitter, the laser receiver, and the groove are fixed. Therefore, the position coordinates of the first light spot can also be preset to improve the efficiency of determining the positional change.
[0102] For example, the laser emitting device can be located on one side of a transparent container, and the backplate can be located on the other side of the transparent container. A first laser beam passes through the transparent container containing the solvent and reaches the backplate, where it forms a laser spot. An imaging device can be used to acquire this first spot on the backplate. A test solution is added to the transparent container, and the first laser beam passes through the container with the test solution added and reaches the backplate, where it forms a laser spot. An imaging device can be used to acquire this second spot on the backplate. Based on the first and second spots, a transformation matrix can be determined to obtain a first positional change. The relative positions of the laser emitting device, the backplate, and the image sensor remain unchanged when acquiring the first and second spots.
[0103] In this embodiment of the disclosure, the mapping response relationship can be a pre-determined mapping relationship between the position change and the concentration value. Given a first position change, the concentration value corresponding to the first position change can be determined based on the mapping response relationship, and this concentration value can be used as the concentration of the solution to be tested.
[0104] As previously stated, the method of this disclosure can improve the accuracy of the first position change. Consequently, the accuracy of the target value of the test object determined using the first position change is also improved.
[0105] In one possible implementation, the initial state includes a second initial state, which is the state in which the second incident light passes through the first standard object; the measurement state includes a second measurement state, which is the state in which the second incident light passes through the second standard object; and the step of obtaining the mapping response relationship of the first target parameter includes: obtaining second target parameters of a plurality of second standard objects; determining a second position change amount corresponding to each of the plurality of second standard objects, wherein the second position change amount is the second position change amount between the light spots formed by the second incident light in the first initial state and the second initial state; and determining the mapping response relationship based on the plurality of second position change amounts and the second target parameters corresponding to the plurality of second position change amounts.
[0106] In this embodiment, a second position change can be determined using a method for determining a first position change. Multiple second standard objects can be prepared. The second standard objects may include standard solutions with known second target parameters. The second target parameter may include the concentration of the standard solution. The concentration of the standard solution can vary according to a pattern and can cover the desired concentration range. Based on the requirements of the measurement system, the positions and parameters of the light source, lens, grating, and other optical elements are adjusted to obtain an optical path configuration suitable for measuring liquid concentration. The second incident light can be a laser. The second initial state can be when the transparent groove contains solvent; the laser emitter provides the second incident light, which passes through the transparent groove containing solvent and reaches the laser receiver to obtain a first light spot. The second measurement state can be when the groove contains a standard solution; the laser emitter provides the second incident light, which passes through the transparent groove containing standard solution and reaches the laser receiver to obtain a second light spot. Furthermore, the second position changes of the first and second light spots can be determined, and then these second position changes can be correlated with the concentration of the standard solution.
[0107] Using statistical methods or curve fitting techniques, such as linear regression or polynomial fitting, the mapping relationship between the change in the second position and the concentration of the standard solution is determined, i.e., the mapping response relationship.
[0108] Additionally, the position of the light spot obtained by the second incident light passing through the solvent can be preset. For example, the center coordinates of this light spot can be preset. This way, during the determination of the second position change, the preset center coordinates can be directly obtained as the position of the first light spot. This reduces the probability of emitting the second incident light and improves the efficiency of determining the second position change.
[0109] In addition, some standard solutions of known concentrations can be prepared in advance to verify the mapping response relationship, thereby improving the accuracy of the mapping response relationship.
[0110] In this embodiment of the disclosure, the second position change in the mapping response relationship can be determined using the method for determining the first position change in this disclosure. Since the laser spot itself contains at least three vertices, the accuracy of determining the second position change is improved, thereby improving the accuracy of the mapping response relationship.
[0111] In one possible implementation, the initial state includes a third initial state, wherein the third initial state is: emitting a third incident light at a first moment; the measurement state includes a third measurement state, wherein the third measurement state is: emitting the third incident light at a second moment; the position change includes: a third position change between the light spots formed by the third incident light in the first initial state and the second initial state; the measurement result is the accuracy of the device emitting the third incident light; the method further includes: determining statistical data of the third position change based on multiple third position change data; determining the accuracy based on the statistical data of the third position change; and, if the accuracy does not meet a first condition, adjusting the device until the accuracy meets the first condition.
[0112] In this embodiment, the third incident light can be a laser. The device can be a laser device capable of emitting laser light. The device may include a laser emitter and a laser receiver. Alternatively, the device may only include a laser emitter, while the laser receiver can be located outside the device. The device positions can be the same at the first and second moments, and the relative positions of the laser emitter and laser receiver do not change at these two moments to minimize the impact of device position changes on determining the third position change. At the first moment, the laser emitter emits the third incident light towards the laser receiver to obtain a first light spot. At the second moment, the laser emitter emits the third incident light towards the laser receiver to obtain a second light spot. The third position change between the first and second light spots can be determined according to the method of this disclosure. The third incident light can be emitted multiple times to determine multiple third position changes. The accuracy of these third position changes is calculated, for example, the standard deviation or root mean square error. If the accuracy meets a first condition, it indicates that the device stability meets the requirements. The first condition can be that the accuracy is not greater than an accuracy threshold. If the accuracy does not meet the first condition, it indicates that the stability of the laser emitted by the device does not meet the requirements. Further investigation is needed to find the cause and take corresponding measures until the accuracy meets the first condition.
[0113] Because the method disclosed herein improves the accuracy of determining the change in the third position, it enhances the precision of the assessment, thus aiding in the accurate evaluation of the stability of laser equipment. This is particularly beneficial in scenarios involving high-precision machining using laser equipment, enabling precise evaluation of its stability.
[0114] In one possible implementation, the first and second light spots are cross-shaped.
[0115] By measuring the change in the position of the light spot, and based on this change, measurement results in many scenarios can be further determined. The center of gravity of the light spot is easy to detect, and the distance from the center of gravity can be used as the change in position. However, when the light spot is partially obscured, it is difficult to accurately obtain the center of gravity, and therefore, it is impossible to accurately determine the change in position.
[0116] Figure 2 This is a schematic diagram illustrating the shape of the laser spot provided in an embodiment of this disclosure. Figure 2 As shown, the laser spot is cross-shaped. A single black dot in the image can represent a first feature point or a second feature point. The cross-shaped spot can be formed by horizontally arranged light dots (…). Figure 2 The first ray consists of a black dot in the center, and vertically arranged light spots ( Figure 2 The second ray is composed of a black dot in the center. Therefore, it can be seen that using a cross-shaped laser spot can identify twenty-one feature point pairs, which is sufficient. Moreover, compared to circular or elliptical laser spots, all points on the entire laser spot can be used as feature points, making them easy to detect and allowing for rapid and accurate identification of feature points on the laser spot. This improves the accuracy and efficiency of determining the first positional change.
[0117] Furthermore, when a circular or elliptical laser spot is obstructed, it is difficult to accurately detect the center of gravity of the spot. However, using the cross-shaped laser spot in this embodiment, the intersection of the first and second rays is the center of gravity. Therefore, even if the cross-shaped laser spot is partially obstructed, the probability of accurately detecting the center of gravity is increased, and the probability of directly using the center of gravity of the laser spot to determine the change in position is also increased. Using the center of gravity to determine the change in position is faster and more efficient.
[0118] In one possible implementation, before determining the transformation matrix between the first light spot and the second light spot, the method further includes:
[0119] A first occlusion detection is performed on the second light spot to obtain a first detection result;
[0120] If the first detection result indicates that the second light spot is blocked, determine whether to determine the transformation matrix based on the severity of the blocking of the second light spot;
[0121] If the first detection result indicates that the second light spot is not blocked, the first distance between the centroids of the first light spot and the second light spot is taken as the position change.
[0122] In this embodiment, the first and second light spots can be denoised. Since the first and second light spots are formed by incident light from the same light source, after denoising, only the second light spot in the measurement state can be subjected to first occlusion detection. First occlusion detection may include: extracting an effective light spot region using methods such as threshold segmentation, edge detection, or feature extraction. Alternatively, first occlusion detection may include: determining an effective light spot region using template matching. This embodiment does not limit the method for determining the effective light spot region. Then, the effective light spot region is compared with a preset unoccluded light spot region to obtain a first detection result. The preset unoccluded light spot region can be obtained based on the first light spot in the initial state. For example, if the overlap rate between the effective light spot region and the unoccluded light spot region is greater than an overlap threshold, the first detection result is that the second light spot is not occluded; if the overlap rate is not greater than the overlap threshold, the first detection result is that the second light spot is occluded.
[0123] In one example, several low-order relative moments of momentum can be determined based on the second light spot. For instance, the abscissa x and ordinate y of the barycenter of the second light spot can be determined, and x can be... 2 xy, y 2 As low-order relative moments of momentum, a moment of momentum threshold can be preset for each low-order relative moment of momentum. If one, several, or all of the low-order relative moments of momentum are greater than their respective corresponding moment of momentum thresholds, the first detection result is that the second spot is blocked. If several or all of the low-order relative moments of momentum are not greater than their respective corresponding moment of momentum thresholds, the first detection result is that the second spot is not blocked.
[0124] If the second light spot is obstructed, its centroid may not be accurately determined. Therefore, it is necessary to assess the severity of the obstruction to determine whether the centroid can be accurately determined under obstruction conditions. This, in turn, determines whether a transformation matrix needs to be determined. If the second light spot is not obstructed, the centroid method can be used to determine the first distance between the centroids of the first and second light spots, and the second distance can be used as the positional change.
[0125] In this embodiment, a first occlusion detection is performed on the second light spot to determine whether the position change can be directly measured using the centroid method. While ensuring accuracy, the most efficient method is employed to improve the efficiency of determining the position change.
[0126] In one possible implementation, if the first detection result indicates that the second light spot is obstructed, determining whether to determine the transformation matrix based on the severity of the obstruction of the second light spot includes:
[0127] Construct multiple contour lines for the second light spot, where each contour line is composed of points with the same gray level on the second light spot;
[0128] Obtain the second center point of each contour line of the second light spot, and determine the distribution of the second center points;
[0129] The transformation matrix is determined when the distribution of the second center point is greater than the first distribution threshold;
[0130] If the distribution of the second center point is not greater than the first distribution threshold, the transformation matrix is not determined, and the first distance is used as the position change amount.
[0131] In this embodiment, multiple sets of points with equal gray values can be determined on the second light spot, with each point in each set having the same gray value. The curve formed by connecting the points in the same set is considered a contour line of the second light spot. This allows for the determination of multiple contour lines of the second light spot. The second center point can be the geometric center of the contour line, depending on the actual scene. Each contour line of the second light spot corresponds to one second center point. The contour lines of the light spot can characterize the intensity differences of light at different locations within the light spot.
[0132] In one example, the distribution of the second center point can be the maximum value of the distances between any two second center points. If the ratio of this maximum value to the resolution is greater than a pre-set first distribution threshold, it indicates that the centroid of the second spot is occluded, and the centroid method cannot be used; therefore, the transformation matrices of the first and second spots need to be determined. If the ratio of this maximum value to the resolution is not greater than the pre-set first distribution threshold, it indicates that the centroid of the second spot can be accurately determined, and the first distance can be directly used as the position change.
[0133] In another example, the distribution of the second center points can be the standard deviation of the distances between any two second center points. If the standard deviation is greater than the first distribution threshold, it means that the centroid of the second spot cannot be accurately determined and the centroid method cannot be used; therefore, the transformation matrix of the first and second spots needs to be determined. If the standard deviation is not greater than the first distribution threshold, it means that the first distance can be directly used as the positional change.
[0134] If the second light spot is determined to be obstructed, the severity of the obstruction is assessed. If the second center distribution is not greater than the first distribution threshold, the obstruction is not severe and will not negatively impact the accuracy of the measurement results. Therefore, there is no need to determine a transformation matrix; the centroid method can be used directly to determine the positional change between the first and second light spots, reducing computation and improving efficiency. If the second center distribution is greater than the first distribution threshold, the obstruction is severe and will negatively impact the accuracy of the measurement results. In this case, the transformation matrices for the first and second light spots need to be determined to ascertain the positional change. This way, even if the second light spot is obstructed, the accuracy of the measurement results can still be improved.
[0135] In one possible implementation, before acquiring the first light spot and the second light spot, the method further includes:
[0136] Acquire the third light spot in the initial state and the fourth light spot in the measurement state. The third light spot and the fourth light spot are circular or elliptical light spots formed by incident light from the same light source.
[0137] A second occlusion detection is performed on the fourth light spot to obtain a second detection result;
[0138] If the second detection result indicates that the fourth light spot is blocked, determine whether to acquire the first light spot and the second light spot based on the severity of the blockage of the fourth light spot;
[0139] If the second detection result indicates that the fourth light spot is not blocked, the second distance between the three light spots and the fourth light spot is taken as the position change amount.
[0140] The third and fourth light spots can be light spots formed by the image sensor capturing incident light from the same light source. The third light spot can be the light spot acquired in the initial state, and the fourth light spot can be the light spot acquired in the measurement state.
[0141] In this embodiment, the third and fourth light spots can be denoised. Since the third and fourth light spots are formed by incident light from the same light source, after denoising, only the fourth light spot in the measurement state can be subjected to the second occlusion detection. The second occlusion detection may include: extracting the effective light spot region using methods such as threshold segmentation, edge detection, or feature extraction. Alternatively, the second occlusion detection may include: determining the effective light spot region using a template matching method. This embodiment does not limit the method for determining the effective light spot region. Then, the effective light spot region is compared with a preset unoccluded light spot region to obtain a second detection result. The preset unoccluded light spot region can be obtained based on the third light spot in the initial state. For example, if the overlap rate between the effective light spot region and the unoccluded light spot region is greater than the overlap threshold, the second detection result is that the fourth light spot is not occluded; if the overlap rate between the effective light spot region and the unoccluded light spot region is not greater than the overlap threshold, the second detection result is that the fourth light spot is occluded.
[0142] In one example, several low-order relative moments of momentum can be determined based on the fourth light spot. For instance, the abscissa x and ordinate y of the centroid of the fourth light spot can be determined, and x can be... 2 xy, y 2 As low-order relative moments of momentum, a moment of momentum threshold can be preset for each low-order relative moment of momentum. If one, several, or all of the low-order relative moments of momentum are greater than their respective corresponding moment of momentum thresholds, the second detection result is that the fourth spot is blocked. If several or all of the low-order relative moments of momentum are not greater than their respective corresponding moment of momentum thresholds, the second detection result is that the fourth spot is not blocked.
[0143] If the fourth light spot is not obstructed, the centroid method can be used to determine the second distance between the centroids of the third and fourth light spots, and this second distance can be used as the change in position. If the fourth light spot is obstructed, its centroid may not be accurately determined. Therefore, it is necessary to assess the severity of the obstruction to determine whether the centroid of the fourth light spot can still be accurately determined under obstruction conditions. Furthermore, it can be determined whether it is necessary to acquire the first and second light spots.
[0144] In this embodiment, before acquiring the first and second light spots, occlusion detection is performed on the already acquired fourth light spot. If the fourth light spot is not occluded, the first and second light spots do not need to be acquired, and the centroid method is used to determine the second distance, which is then used as the position change. This improves computational efficiency while accurately measuring the position change of the light spot. If the fourth light spot is occluded, the severity of the occlusion is assessed to determine whether the position change needs to be obtained by determining a change matrix or by using the centroid method. Therefore, the method of this disclosure can accurately measure the position change regardless of whether the light spot is occluded. This makes the entire method more flexible and improves its applicability.
[0145] In one possible implementation, when the second detection result indicates that the fourth light spot is blocked, determining whether to acquire the first light spot and the second light spot based on the severity of the blockage of the fourth light spot includes:
[0146] Construct multiple contour lines for the fourth light spot, wherein each contour line for the fourth light spot is composed of points with the same gray level on the fourth light spot;
[0147] Obtain the fourth center point of each of the fourth light spot contour lines, and determine the distribution of the fourth center points;
[0148] When the distribution of the fourth center point is greater than the second distribution threshold, the first light spot and the second light spot are acquired;
[0149] If the distribution of the fourth center point is not greater than the second distribution threshold, the second distance is used as the position change.
[0150] In this embodiment, multiple sets of points with equal gray values can be determined on the fourth light spot, with each point in each set having the same gray value. The curve formed by connecting the points in the same set is a contour line of the fourth light spot. In this way, multiple contour lines of the fourth light spot can be determined. The fourth center point can be the geometric center of the contour line of the fourth light spot, depending on the actual scene. Each contour line of the fourth light spot corresponds to one fourth center point.
[0151] In one example, the distribution of the fourth center point can be the maximum value of the distances between any two fourth center points. If the ratio of this maximum value to the resolution is greater than a preset second distribution threshold, the first light spot and the second light spot are acquired. If the ratio of this maximum value to the resolution is not greater than a preset first distribution threshold, it indicates that the centroid of the fourth light spot can be accurately determined, and the second distance can be directly used as the positional change.
[0152] In another example, the distribution of the fourth center point can be the standard deviation of the distances between any two fourth center points. If the standard deviation is greater than the second distribution threshold, the first spot and the second spot need to be acquired. If the standard deviation is not greater than the first distribution threshold, it means that the centroid of the fourth spot can be accurately determined, and the second distance can be directly used as the positional change.
[0153] If the fourth light spot is determined to be obstructed, the severity of the obstruction is assessed. If the fourth center distribution is no greater than the second distribution threshold, the obstruction is not severe and will not negatively impact the accuracy of the measurement results. In this case, there is no need to acquire the first and second light spots, reducing workload and improving computational efficiency. If the fourth center distribution is greater than the second distribution threshold, the obstruction is severe and will negatively impact the accuracy of the measurement results. In this case, it is necessary to acquire the first and second light spots and determine their transformation matrices to determine the positional changes and improve the accuracy of the measurement results.
[0154] Figure 3 This is a schematic diagram of the structure of the optical measurement device provided in an embodiment of this disclosure. Figure 3 As shown, the device includes:
[0155] The first light spot acquisition unit is used to acquire the first light spot including the initial state;
[0156] The second light spot acquisition unit is used to acquire a second light spot including the measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices;
[0157] A transformation matrix acquisition unit is used to determine the transformation matrix between the first light spot and the second light spot;
[0158] A transformation matrix constraint unit is used to constrain the rotation and scaling dimensions of the transformation matrix to obtain a constrained transformation matrix.
[0159] The position change determination unit is used to determine the position change between the first light spot and the second light spot based on the constrained transformation matrix, and the position change is used to determine the measurement result.
[0160] In one possible implementation, the transformation matrix acquisition unit is used for:
[0161] Based on the first light spot, at least three first feature points and a first feature descriptor corresponding to each first feature point are determined;
[0162] Based on the second light spot, at least three second feature points and a second feature descriptor corresponding to each second feature point are determined;
[0163] Each of the first feature descriptors is matched with each of the second feature descriptors to determine a feature point pair consisting of the first feature point and the second feature point;
[0164] The transformation matrix is determined based on each of the aforementioned feature point pairs.
[0165] In one possible implementation, matching the first feature descriptor with the second feature descriptor to determine a feature point pair consisting of the first feature point and the second feature point includes:
[0166] Determine the first similarity between each of the first feature descriptors and each of the second feature descriptors. Each similarity corresponds to a first feature point and a first feature descriptor corresponding to the first feature point, and also corresponds to a second feature point and a second feature descriptor corresponding to the second feature point.
[0167] If the first similarity is greater than the first similarity threshold, the first feature point and the second feature point corresponding to the first similarity are determined as a feature point pair.
[0168] In one possible implementation, the device further includes:
[0169] The second feature point determination unit is used to determine the nearest and next nearest second feature points of each first feature point based on the first similarity.
[0170] A distance determination unit is used to determine the nearest neighbor distance and the second nearest neighbor distance of each first feature point based on each first feature point and the corresponding nearest and second nearest second feature points.
[0171] The available feature point determination unit is used to determine the first and second feature points used to determine the nearest neighbor distance as a pair of available feature points when the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than a distance threshold.
[0172] In one possible implementation, the initial state includes a first initial state, which is the state in which the first incident light passes through a first standard object; the measurement state includes a first measurement state, which is the state in which the first incident light passes through the object under test; the position change includes a first position change between the light spots formed by the first incident light in the first initial state and the first measurement state; the measurement result is the target value of a first target parameter of the object under test; and the device further includes:
[0173] A mapping response relationship acquisition unit is used to acquire the mapping response relationship of the first target parameter, wherein the mapping response relationship is used to characterize the position change of the first target parameter under different values;
[0174] The target value determination unit is used to determine the target value based on the mapping response relationship and the first position change amount.
[0175] In one possible implementation, the initial state includes a second initial state, which is the state of the second incident light passing through the first standard object; the measurement state includes a second measurement state; and the mapping response relationship acquisition unit is used to:
[0176] Obtain the second target parameters of multiple second standard objects;
[0177] Determine the second position change amount corresponding to each of the multiple second standard objects, where the second position change amount is the second position change amount between the light spots formed by the second incident light in the first initial state and the second initial state, respectively.
[0178] The mapping response relationship is determined based on a plurality of second position changes and second target parameters corresponding to the plurality of second position changes.
[0179] In one possible implementation, the initial state includes a third initial state, wherein the third initial state is: emitting a third incident light at a first moment; the measurement state includes a third measurement state, wherein the third measurement state is: emitting the third incident light at a second moment; the position change includes: a third position change between the light spots formed by the third incident light in the third initial state and the third measurement state; the measurement result is the accuracy of the device emitting the third incident light; and the device further includes:
[0180] The third position change statistical data determination unit is used to determine the third position change statistical data based on multiple third position change quantities.
[0181] An accuracy determination unit is used to determine the accuracy based on the statistical data of the third position change.
[0182] A debugging unit is used to debug the device until the accuracy meets the first condition if the accuracy does not meet the first condition.
[0183] In one possible implementation, the first and second light spots are cross-shaped.
[0184] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0185] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium can be volatile or non-volatile.
[0186] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.
[0187] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described method.
[0188] Figure 4 This is a schematic diagram of an electronic device for optical measurement provided in an embodiment of this disclosure. For example, the electronic device 1900 can be provided as a server or a terminal device. (Refer to...) Figure 4 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.
[0189] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). Electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM FreeBSD TM Or similar.
[0190] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.
[0191] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0192] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0193] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0194] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0195] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0196] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0197] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0198] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0199] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An optical measurement method, characterized in that, include: Obtain the first light spot containing the initial state; Acquire a second light spot in the measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices; Determine the transformation matrix between the first light spot and the second light spot; By constraining the rotation and scaling dimensions of the transformation matrix, the constrained transformation matrix is obtained. Based on the constrained transformation matrix, the positional change between the first light spot and the second light spot is determined, and the positional change is used to determine the optical measurement result.
2. The method according to claim 1, characterized in that, Determining the transformation matrix between the first light spot and the second light spot includes: Based on the first light spot, at least three first feature points and a first feature descriptor corresponding to each first feature point are determined; Based on the second light spot, at least three second feature points and a second feature descriptor corresponding to each second feature point are determined; Each of the first feature descriptors is matched with each of the second feature descriptors to determine a feature point pair consisting of the first feature point and the second feature point; The transformation matrix is determined based on each of the aforementioned feature point pairs.
3. The method according to claim 2, characterized in that, Matching the first feature descriptor with the second feature descriptor to determine feature point pairs consisting of the first feature point and the second feature point includes: Determine the first similarity between each of the first feature descriptors and each of the second feature descriptors. Each similarity corresponds to a first feature point and a first feature descriptor corresponding to the first feature point, and also corresponds to a second feature point and a second feature descriptor corresponding to the second feature point. If the first similarity is greater than the first similarity threshold, the first feature point and the second feature point corresponding to the first similarity are determined as a feature point pair.
4. The method according to claim 3, characterized in that, The method further includes: Based on the first similarity, determine the nearest and second nearest second feature points of each first feature point; Based on each of the first feature points, and the corresponding nearest and next nearest second feature points, the nearest and next nearest distances of each of the first feature points are determined respectively. If the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than a distance threshold, the first feature point and the second feature point used to determine the nearest neighbor distance are used as a pair of usable feature points.
5. The method according to claim 1, characterized in that, The initial state includes a first initial state, which is the state in which the first incident light passes through the first standard object. The measurement state includes a first measurement state, which is the state in which the first incident light passes through the object under test. The position change includes the first position change between the light spots formed by the first incident light in the first initial state and the first measurement state. The measurement result is the target value of the first target parameter of the object under test. The method further includes: Obtain the mapping response relationship of the first target parameter, wherein the mapping response relationship is used to characterize the position change of the first target parameter under different values; The target value is determined based on the mapping response relationship and the first position change.
6. The method according to claim 5, characterized in that, The initial state includes a second initial state, which is the state in which the second incident light passes through the first standard object. The measurement state includes a second measurement state, which is the state in which the second incident light passes through the second standard object. Obtaining the mapping response relationship of the first target parameter includes: Obtain the second target parameters of multiple second standard objects; Determine the second position change amount corresponding to each of the multiple second standard objects, where the second position change amount is the second position change amount between the light spots formed by the second incident light in the first initial state and the second initial state, respectively. The mapping response relationship is determined based on a plurality of second position changes and second target parameters corresponding to the plurality of second position changes.
7. The method according to claim 1, characterized in that, The initial state includes a third initial state, wherein the third initial state is: emitting the third incident light at a first moment; the measurement state includes a third measurement state, wherein the third measurement state is: emitting the third incident light at a second moment; the position change includes: the third position change between the light spots formed by the third incident light in the third initial state and the third measurement state; the measurement result is the accuracy of the device emitting the third incident light; the method further includes: Based on multiple changes in the third position, determine the statistical data of the changes in the third position; The accuracy is determined based on the statistical data of the third position change. If the accuracy does not meet the first condition, the device is adjusted until the accuracy meets the first condition.
8. The method according to any one of claims 1-7, characterized in that, The first and second light spots are cross-shaped.
9. An optical measuring device, characterized in that, include: The first light spot acquisition unit is used to acquire the first light spot including the initial state; The second light spot acquisition unit is used to acquire a second light spot including the measurement state, wherein the first light spot and the second light spot are formed by incident light provided by the same light source, and both the first light spot and the second light spot contain at least three vertices; A transformation matrix acquisition unit is used to determine the transformation matrix between the first light spot and the second light spot; A transformation matrix constraint unit is used to constrain the rotation and scaling dimensions of the transformation matrix to obtain a constrained transformation matrix. The position change determination unit is used to determine the position change between the first light spot and the second light spot based on the constrained transformation matrix, and the position change is used to determine the measurement result.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 8 when executing instructions stored in the memory.