3D positioning method and system based on holder
By extracting image feature points, generating descriptors and matching them, combined with error correction of reference point deviations, the problem of insufficient 3D positioning accuracy of existing PTZ equipment is solved, and high-precision 3D positioning is achieved for different types of PTZ equipment.
Patent Information
- Application Number
- CN202411461043.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-21
AI Technical Summary
In 3D positioning, existing gimbal equipment has inaccurate positioning due to insufficient mechanical structure operation accuracy and data accuracy, and cannot adapt to the positioning needs of different observation distances. There is a lack of positioning compensation methods for different types of gimbal equipment.
By extracting geometric feature points of the image, descriptors are generated and matched to determine the reference point, and the 3D positioning error is corrected through the reference point deviation to achieve high-precision 3D positioning.
It significantly improves the accuracy of 3D positioning and avoids the problem of low positioning accuracy caused by structural design and assembly errors. It is suitable for different types of pan-tilt equipment.
Smart Images

Figure CN119339103A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pan / tilt devices, and in particular to a pan / tilt-based 3D positioning method and system. Background Art
[0002] In existing gimbal equipment, the realization of 3D positioning function depends on good mechanical structure operation accuracy and data accuracy, including the positioning accuracy of the gimbal itself, the accuracy of obtaining the lens focal length value under the current magnification, and the accuracy of optical axis consistency. Therefore, in actual application, the above factors often affect the final gimbal 3D positioning effect. For example, it cannot adapt to the positioning requirements of different observation distances, resulting in inaccurate positioning, and lacks positioning compensation methods suitable for different types of gimbals. Summary of the invention
[0003] The purpose of the present invention is to provide a gimbal-based 3D positioning method and system, which extracts geometric feature points of an image, generates descriptors and matches them to determine reference points, and finally corrects the 3D positioning error through the reference point deviation to complete 3D positioning, which can greatly improve the accuracy of 3D positioning.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] On the one hand, a 3D positioning method based on a gimbal is provided, which comprises the following steps:
[0006] Acquire an original image according to a camera connected to the gimbal, and acquire a theoretical rotation angle of the gimbal according to the original image;
[0007] Control the gimbal to rotate according to the theoretical rotation angle so that the center point of the region of interest is located at the center of the image to obtain a 3D positioning image;
[0008] Extracting image feature points of the original image and the 3D positioning image respectively, and determining the reference points of the original image and the 3D positioning image based on the feature descriptors of the original image and the 3D positioning image to complete image feature point matching;
[0009] The 3D positioning error is corrected according to the deviation between the original image reference point and the 3D positioning image reference point to complete the 3D positioning.
[0010] Preferably, the theoretical rotation angle includes a horizontal theoretical rotation angle and / or a vertical theoretical rotation angle, and the horizontal theoretical rotation angle and the vertical theoretical rotation angle are obtained by the following formulas respectively:
[0011]
[0012] Among them, ∠P h OO' is the horizontal theoretical rotation angle, Ph is the horizontal projection of the center point of the region of interest; P h O' is the projection P h The horizontal offset relative to the center of the image; AO' is 1 / 2 of the image width of the original image; ∠AOO' is 1 / 2 of the horizontal field of view of the camera at the current magnification;
[0013]
[0014] Among them, ∠P v OO' is the vertical theoretical rotation angle, P v is the projection of the center point of the region of interest in the vertical direction; P v O' is the projection P v The vertical offset relative to the center of the image; BO' is 1 / 2 of the image height of the original image; ∠BOO' is 1 / 2 of the vertical field of view at the current magnification of the camera.
[0015] Preferably, the extraction of image feature points includes the following steps:
[0016] Extract geometric feature points of the image;
[0017] Determine whether the geometric feature point is an image feature point.
[0018] Preferably, judging whether the geometric feature point is an image feature point based on the Sar-Harris scale space specifically includes the following steps:
[0019] Construct the scale space corresponding function R(x,y,σ), where the scale space corresponding function R(x,y,σ) is expressed as follows:
[0020]
[0021] R(x,y,σ)=det(C SH (x,y,σ))+t×tr(C SH (x,y,σ) 2
[0022] Among them, C SH (x, y, σ) represents the gradient covariance matrix at the current geometric feature point (x, y); σ is the scale parameter; represents the Gaussian kernel; det(*) represents the value of the matrix determinant; tr(*) represents the trace of the matrix; t represents the matrix coefficient; G h , G v are the image gradients in the horizontal and vertical directions respectively;
[0023] If in the current scale space, the R(x,y,σ) function value of the current geometric feature point (x,y) is the maximum value of the R(x,y,σ) function values of all pixel points in the n*n neighborhood, and is greater than or equal to the pixel value threshold at the same time, then the geometric feature point (x,y) is determined to be an image feature point.
[0024] Preferably, the image gradient G in the horizontal direction h , the image gradient G in the vertical direction v Obtained through the following formula:
[0025] G h =log(m left -m reight )
[0026] G v =log(m up -m down )
[0027] Among them, m up 、m down 、m left 、m right They are the upper convolution value, the lower convolution value, the left convolution value, and the right convolution value respectively.
[0028] Preferably, determining the original image reference point and the 3D positioning image reference point based on the feature descriptors of the original image and the 3D positioning image to complete the image feature point matching includes the following steps:
[0029] Generate feature descriptor X of the original image i1 ;
[0030] Adjusting the image size of the 3D positioning image to obtain a 3D positioning correction image;
[0031] Generate feature descriptor X of 3D positioning correction image i2 ;
[0032] Get all feature descriptors X i1 , X i2 The Euclidean distance between them, and the pair of feature descriptors X with the smallest Euclidean distance i1 , X i2 As the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n ).
[0033] Preferably, the image size of the 3D positioning image is adjusted to (m / x)*(n / x) to obtain a 3D positioning corrected image, wherein m and n are respectively the width and height of the original image T0, and x is a positive integer ≥2.
[0034] Preferably, the feature descriptor X of the original image i1 Generate the feature descriptor X of the 3D positioning corrected image by GLOH descriptor or SIFT feature descriptor and / or i2 Generated by GLOH descriptor or SIFT feature descriptor.
[0035] Preferably, the 3D positioning error correction is performed according to the deviation between the original image reference point and the 3D positioning image reference point, comprising the following steps:
[0036] Obtain the horizontal rotation compensation angle according to the following formula And vertical rotation compensation angle
[0037]
[0038] Among them, O and O' are the center point of the camera lens and the image center point of the original image respectively; x0 and y0 are the horizontal coordinate and vertical coordinate of the image center point O' respectively; P0 is the center point of the area to be located on the original image, x p ,y p are the horizontal and vertical coordinates of the center point P0 respectively; ∠AOO' is the 1 / 2 horizontal field angle of the camera at the current magnification; ∠BOO' is the 1 / 2 vertical field angle of the camera at the current magnification; AO' and BO' are the 1 / 2 image height of the original image T0 and the 1 / 2 image height of the original image T0 respectively;
[0039] And, the horizontal rotation compensation angle of the gimbal and / or, rotate the vertical rotation compensation angle in the vertical direction Make the center point of the area to be located at the center of the image.
[0040] On the other hand, a 3D positioning system is also provided, comprising:
[0041] PTZ;
[0042] A camera connected to the gimbal;
[0043] A theoretical rotation angle acquisition module is used to acquire the theoretical rotation angle of the gimbal; the gimbal rotates according to the theoretical rotation angle so that the center point of the region of interest is located at the center of the image to obtain a 3D positioning image;
[0044] The feature point matching module is used to extract the image feature points of the original image and the 3D positioning image respectively, and perform image feature point matching to obtain the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n );
[0045] The compensation angle acquisition unit is used to obtain the compensation angle according to the original image reference point t k (x k ,y k ), 3D positioning correction image reference point t n (x n ,y n ) Get the horizontal rotation compensation angle And vertical rotation compensation angle
[0046] A control unit connected to the pan-tilt head is used to control the pan-tilt head to rotate horizontally to a compensation angle. and / or, rotate the vertical rotation compensation angle in the vertical direction Make the center point of the area to be positioned at the center of the image to complete 3D positioning.
[0047] In summary, the present invention has the following beneficial effects compared with the prior art:
[0048] The present invention calculates a theoretical rotation angle according to the field of view angle of the lens, and drives the pan / tilt to rotate according to the theoretical rotation angle to determine a 3D positioning image, further extracts geometric feature points of the image, generates descriptors and matches them, thereby determining a reference point, and finally corrects the 3D positioning error through the reference point deviation, thereby avoiding the problem of low 3D positioning accuracy caused by structural design, assembly errors, etc. and difficulty in obtaining an accurate focal length value, and can greatly improve the accuracy of 3D positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flowchart of the steps of the 3D positioning method of the present invention;
[0050] Figure 2 Schematic diagram of the positional relationship between the camera center point and the original image T0 in the present invention;
[0051] Figure 3a It is a schematic diagram of the projection of the center point of the region of interest in the present invention in the horizontal direction;
[0052] Figure 3b It is a schematic diagram of the projection of the center point of the region of interest in the vertical direction in the present invention;
[0053] Figure 4 Schematic diagram of the positional relationship between the camera center point and the 3D positioning image T1 in the present invention;
[0054] Figure 5 is a schematic diagram of the GLOH descriptor in the present invention;
[0055] Figure 6 It is a schematic diagram of the positional relationship among the camera center point, the original image T0, the 3D positioning image T1, and the 3D positioning correction image T1' in the present invention;
[0056] Figure 7 It is a schematic diagram of the projection of the center point of the area to be positioned in the horizontal direction in the present invention;
[0057] Figure 8 It is a schematic diagram of the projection of the center point of the area to be positioned in the vertical direction in the present invention;
[0058] Fig. 9 It is a structural schematic diagram of the 3D positioning system in the present invention. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0060] Example 1
[0061] like Figure 1 As shown, this embodiment provides a 3D positioning method based on a gimbal, wherein the gimbal can be connected to a camera and a movable device (such as an unmanned device such as a drone or an unmanned vehicle) or an immovable device (such as a fixed-position mounting frame, etc.), and the gimbal drives the camera to move by a rotation action to generate corresponding displacements on the X-axis, the Y-axis, and the Z-axis; on this basis, the 3D positioning method based on the gimbal includes the following steps:
[0062] S1, such as Figure 2As shown, an original image T0 is obtained according to the camera connected to the gimbal, and a theoretical rotation angle of the gimbal is obtained according to the original image T0, wherein the theoretical rotation angle includes a theoretical rotation angle of the gimbal in the horizontal direction, i.e., a horizontal theoretical rotation angle, and / or a theoretical rotation angle in the vertical direction, i.e., a vertical theoretical rotation angle; and the original image T0 has an image center point O' and a center point P of an area of interest; when performing 3D positioning, the gimbal needs to be rotated by a predetermined angle in the horizontal and vertical directions to place the center point P of the area of interest at the center of the image, and at this time, the predetermined angles that the gimbal needs to rotate in the horizontal and vertical directions are the horizontal theoretical rotation angle and the vertical theoretical rotation angle, respectively;
[0063] Specifically, Figure 3a-3b As shown, the horizontal theoretical rotation angle and the vertical theoretical rotation angle are obtained according to formulas (1)-(2) respectively:
[0064]
[0065] Among them, ∠P h OO' is the horizontal theoretical rotation angle, O is the center point of the camera lens, P h is the horizontal projection of the center point P of the region of interest; h O' is the projection P h The horizontal offset relative to the center point O' of the image; AO' is 1 / 2 image width of the original image T0, A is the boundary point in the horizontal direction of the image; ∠AOO' is 1 / 2 horizontal field of view angle at the current magnification of the camera;
[0066]
[0067] Among them, ∠P v OO' is the vertical theoretical rotation angle, P v is the projection of the center point P of the region of interest in the vertical direction; P v O' is the projection P v The vertical offset relative to the center point O' of the image; ∠BOO' is the 1 / 2 vertical field of view angle of the camera at the current magnification; BO' is the 1 / 2 image height of the original image T0, and B is the boundary point in the vertical direction of the image;
[0068] Furthermore, Wherein, WidthHf and HeightHf are 1 / 2 of the image sensor width and 1 / 2 of the image sensor height (the image sensor is included in the camera), and F is the focal length of the camera;
[0069] As mentioned above, when calculating the horizontal theoretical rotation angle and the vertical theoretical rotation angle, it is necessary to obtain the precise focal length F at different magnifications. However, during the zooming process of the zoom lens, it is difficult to obtain the precise focal length value at different magnifications due to structural design and assembly errors. In addition, when calculating tangent and inverse tangent, the conversion of angles will cause the data accuracy to continue to decrease. At the same time, the accuracy of the gimbal rotation structure, the consistency of the camera optical axis, the accuracy of the gimbal motor, the offset between the camera rotation axis and the actual rotation axis, and other errors introduced by the installation and coordination of the mechanical structure will further cause the 3D positioning accuracy error to gradually accumulate, resulting in a poor user experience.
[0070] S2, control the PTZ to rotate according to the theoretical rotation angle so that the center point P of the region of interest is located at the center of the image, so as to obtain a 3D positioning image T1 (such as Figure 4 shown);
[0071] S3, extracting image feature points of the original image T0 and the 3D positioning image T1 respectively, and performing image feature point matching;
[0072] Specifically, in this embodiment, extracting image feature points of the original image T0 / 3D positioning image T1 includes the following steps:
[0073] The geometric feature points of the images (i.e., the original image T0 or the 3D positioning image T1) are extracted respectively by using the SAR-SIFT algorithm and other methods;
[0074] Judging whether the geometric feature point is an image feature point based on the Sar-Harris scale space specifically includes the following steps:
[0075] Construct the scale space corresponding function R(x,y,σ), where the scale space corresponding function R(x,y,σ) is expressed as follows:
[0076]
[0077] R(x,y,σ)=det(C SH (x,y,σ))+t×tr(C SH (x,y,σ) 2
[0078] Among them, C SH (x, y, σ) represents the gradient covariance matrix at the current geometric feature point (x, y). This matrix is related to the scale parameter σ, and the value range of the scale parameter σ is [1, 5]. represents the Gaussian kernel; det(*) represents the value of the matrix determinant; tr(*) represents the trace of the matrix; t represents the matrix coefficient, and its value is [0.03, 0.08], preferably [0.04, 0.06]; G h, G v are the image gradients in the horizontal and vertical directions respectively, and G h =log(m left -m reight ) and G v =log(m up -m down ), m up 、m down 、m left 、m right They are respectively the upper convolution value, the lower convolution value, the left convolution value, and the right convolution value, and the acquisition of the four convolution values includes the following steps: using 4 templates, respectively performing convolution operations on the upper, lower, left, and right directions of the center point of the image (i.e., the original image T0 or the 3D positioning image T1) to obtain the upper convolution value m up , the lower convolution value m down , left convolution value m left , right convolution value m right , where one template is used for convolution operation in each direction, and the convolution kernel size of the template is 3*3;
[0079] If in the current scale space, the R(x, y, σ) function value of the current geometric feature point (x, y) is the maximum value of the R(x, y, σ) function values of all pixel points in the n*n neighborhood (n=3 in this embodiment), and is greater than or equal to the pixel value threshold at the same time, then the geometric feature point (x, y) is determined as an image feature point, and the process is repeated to determine the image feature points in each layer of the scale space; in this embodiment, the pixel value threshold has a value range of [0, 1], which can be appropriately adjusted according to the image noise and clarity. For example, the higher the image clarity, the larger the pixel value threshold;
[0080] At the same time, the gradient amplitude m(x, y) and gradient direction θ(x, y) of the image feature points are calculated according to the following formula:
[0081]
[0082] Furthermore, performing image feature point matching includes the following steps:
[0083] Generate feature descriptor X of original image T0 i1 , for example, in this embodiment, Figure 5 As shown, a feature descriptor can be generated based on the GLOH (Gradient location-orientation histogram) descriptor, which specifically includes the following steps:
[0084] 1) Determine the main direction of the feature point: first count the gradient amplitude m(x, y) within the m*m neighborhood of the image feature point (in this embodiment, m=3), and determine the gradient direction θ(x, y) of the image feature point corresponding to the maximum value of the gradient amplitude m(x, y) as the main direction of the image feature point;
[0085] 2) Rotate the coordinate axis to the main direction of the feature point;
[0086] 3) Determine the neighborhood range of the feature point, and divide the neighborhood area of the feature point in the polar coordinate system (such as taking the m*m neighborhood area in the main direction and the vertical direction of the main direction as the neighborhood area of the feature point), and divide the neighborhood area into 17 radial and concentric location bins;
[0087] 4) Generate feature vectors based on all gradient magnitudes m(x, y) and gradient directions θ(x, y) in each location bin, and finally generate feature vectors of 17×16=272 dimensions.
[0088] 5) Perform PCA dimensionality reduction processing on the above 272-dimensional feature vector to obtain a 128-dimensional feature vector as the feature descriptor X of the original image T0 i1 ;
[0089] This improves the robustness of the feature descriptor and reduces the impact of rotation and visual changes. It should be noted that, in addition to the above GLOH descriptor, this embodiment can also generate a feature descriptor based on SIFT (Scale Invariant Feature Transform) feature descriptor and other methods;
[0090] The image size of the 3D positioning image T1 is adjusted to (m / x)*(n / x) to obtain a 3D positioning corrected image T1', where m and n are the width and height of the original image T0, respectively, and x is a positive integer ≥ 2. At the same time, the center points of the original image T0, the 3D positioning image T1, the 3D positioning corrected image T1' and the camera lens center point O are all on the optical axis of the camera; and a feature descriptor X of the 3D positioning corrected image T1' is generated. i2 , where the feature descriptor X i2 The generation method can be the same as the feature descriptor X i1 same;
[0091] All feature descriptors X are obtained by the following formula i1 , X i2 The Euclidean distance d between them is used as the similarity:
[0092]
[0093] The pair of feature descriptors X with the smallest Euclidean distance d i1 , X i2 As the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n ), thereby completing the image feature point matching;
[0094] S4, according to the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n ) to correct the 3D positioning error, which specifically includes the following steps:
[0095] like Figure 6-8 As shown, the horizontal rotation compensation angle is obtained according to the following formula And vertical rotation compensation angle
[0096]
[0097]
[0098] Among them, O and O' are the center point of the camera lens and the image center point of the original image T0, respectively; x0 and y0 are the horizontal and vertical coordinates of the image center point O', respectively; P0 is the center point of the area to be located on the original image T0, x p ,y p are the horizontal and vertical coordinates of the center point P0 respectively; ∠AOO' is the 1 / 2 horizontal field angle of the camera at the current magnification; ∠BOO' is the 1 / 2 vertical field angle of the camera at the current magnification, and its acquisition process is the same as step S1, which will not be repeated; AO' and BO' are 1 / 2 image height of the original image T0 and 1 / 2 image height of the original image T0 respectively, and A and B are boundary points in the horizontal and vertical directions of the image;
[0099] Furthermore, the difference between the line connecting the center points P0 and O' on the x and y axes is the theoretical offset value when the image center point O' is moved to the center point P0 of the area to be positioned. The original image reference point t k , 3D positioning correction image reference point t nThe difference on the x and y axes is the actual offset value when the image center point O' is moved to the center point P0 of the area to be positioned. The difference between the theoretical offset value and the actual offset value is the correction value. Finally, the correction value can be converted into the rotation compensation angle in the horizontal and vertical directions of the gimbal through the corresponding angle conversion relationship:
[0100] The horizontal rotation compensation angle of the gimbal and / or, rotate the vertical rotation compensation angle in the vertical direction The center point P0 of the area to be positioned is located at the center of the image, and 3D positioning is completed.
[0101] Therefore, this embodiment first calculates the theoretical rotation angle according to the lens field of view angle, and drives the gimbal to rotate according to the theoretical rotation angle to determine the 3D positioning image, further extracts the geometric feature points of the image, generates descriptors and matches them, thereby determining the reference point, and finally corrects the 3D positioning error through the reference point deviation, thereby avoiding the problem of low 3D positioning accuracy caused by structural design, assembly errors, etc. and difficulty in obtaining an accurate focal length value, which can greatly improve the accuracy of 3D positioning and improve user experience.
[0102] Embodiment 2:
[0103] This embodiment provides a 3D positioning system for implementing the 3D positioning method described in Embodiment 1, such as Fig. 9 As shown, it includes:
[0104] PTZ 1;
[0105] A camera 2 connected to the gimbal 1;
[0106] Theoretical rotation angle acquisition module 3 is used to obtain the theoretical rotation angle of the gimbal, and its process is the same as step S1; the gimbal 1 rotates according to the theoretical rotation angle so that the center point P of the region of interest is located at the center of the image, so as to obtain a 3D positioning image T1 with the same width and height as the original image T0;
[0107] The feature point matching module 4 is used to extract the image feature points of the original image T0 and the 3D positioning image T1 respectively, and perform image feature point matching to obtain the original image reference point t k (x k ,y k ), 3D positioning correction image reference point t n (x n ,y n ), the process is the same as step S3;
[0108] The compensation angle acquisition unit 5 is used to obtain the compensation angle according to the original image reference point t k (x k ,yk ), 3D positioning image reference point t n (x n ,y n ) Get the horizontal rotation compensation angle And vertical rotation compensation angle The process is the same as step S4;
[0109] The control unit 6 is connected to the pan / tilt platform 1 and is used to control the pan / tilt platform to rotate horizontally and to compensate for the rotation angle. and / or, rotate the vertical rotation compensation angle in the vertical direction The center point P0 of the area to be positioned is located at the center of the image to complete 3D positioning.
[0110] To summarize, the present invention first calculates the theoretical rotation angle according to the lens field of view angle, and drives the gimbal to rotate according to the theoretical rotation angle to determine the 3D positioning image, further extracts the geometric feature points of the image, generates descriptors and matches them, thereby determining the reference point, and finally corrects the 3D positioning error through the reference point deviation, thereby avoiding the problem of low 3D positioning accuracy caused by structural design, assembly errors, etc. and difficulty in obtaining an accurate focal length value, and can greatly improve the accuracy of 3D positioning.
[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A 3D positioning method based on a pan / tilt system, characterized in that: The steps include: Acquire an original image according to a camera connected to the gimbal, and acquire a theoretical rotation angle of the gimbal according to the original image; Control the gimbal to rotate according to the theoretical rotation angle so that the center point of the region of interest is located at the center of the image to obtain a 3D positioning image; Extracting image feature points of the original image and the 3D positioning image respectively, and determining the reference points of the original image and the 3D positioning image based on the feature descriptors of the original image and the 3D positioning image to complete image feature point matching; The 3D positioning error is corrected according to the deviation between the original image reference point and the 3D positioning image reference point to complete the 3D positioning.
2. The 3D positioning method according to claim 1, characterized in that: The theoretical rotation angle includes a horizontal theoretical rotation angle and / or a vertical theoretical rotation angle, and the horizontal theoretical rotation angle and the vertical theoretical rotation angle are obtained by the following formulas respectively: Among them, ∠P h OO' is the horizontal theoretical rotation angle, P h is the horizontal projection of the center point of the region of interest; P h O' is the projection P h The horizontal offset relative to the center of the image; AO' is 1 / 2 of the image width of the original image; ∠AOO' is 1 / 2 of the horizontal field of view of the camera at the current magnification; Among them, ∠P v OO' is the vertical theoretical rotation angle, P v is the projection of the center point of the region of interest in the vertical direction; P v O' is the projection P v The vertical offset relative to the center of the image; BO' is 1 / 2 of the image height of the original image; ∠BOO' is 1 / 2 of the vertical field of view at the current magnification of the camera.
3. The 3D positioning method according to claim 1, characterized in that: The extraction of image feature points includes the following steps: Extract geometric feature points of the image; Determine whether the geometric feature point is an image feature point.
4. The 3D positioning method according to claim 3, characterized in that: Judging whether the geometric feature point is an image feature point based on the Sar-Harris scale space specifically includes the following steps: Construct the scale space corresponding function R(x,y,σ), where the scale space corresponding function R(x,y,σ) is expressed as follows: R(x,y,σ)=det(C SH (x,y,σ))+t×tr(C SH (x,y,σ)) 2 Among them, C SH (x, y, σ) represents the gradient covariance matrix at the current geometric feature point (x, y); σ is the scale parameter; represents the Gaussian kernel; det(*) represents the value of the matrix determinant; tr(*) represents the trace of the matrix; t represents the matrix coefficient; G h , G v are the image gradients in the horizontal and vertical directions respectively; If in the current scale space, the R(x,y,σ) function value of the current geometric feature point (x,y) is the maximum value of the R(x,y,σ) function values of all pixel points in the n*n neighborhood, and is greater than or equal to the pixel value threshold at the same time, then the geometric feature point (x,y) is determined to be an image feature point.
5. The 3D positioning method according to claim 4, characterized in that: The image gradient G in the horizontal direction h , the image gradient G in the vertical direction v Obtained through the following formula: G h =log(m left -m reight ) G v =log(m up -m down ) Among them, m up 、m down 、m left 、m right They are the upper convolution value, the lower convolution value, the left convolution value, and the right convolution value respectively.
6. The 3D positioning method according to claim 1, characterized in that: Based on the feature descriptors of the original image and the 3D positioning image, the reference points of the original image and the 3D positioning image are determined to complete the image feature point matching, including the following steps: Generate feature descriptor X of the original image i1 ; Adjusting the image size of the 3D positioning image to obtain a 3D positioning correction image; Generate feature descriptor X of 3D positioning correction image i2 ; Get all feature descriptors X i1 , X i2 The Euclidean distance between them, and the pair of feature descriptors X with the smallest Euclidean distance i1 , X i2 As the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n ).
7. The 3D positioning method according to claim 6, characterized in that: The image size of the 3D positioning image is adjusted to (m / x)*(n / x) to obtain a 3D positioning corrected image, where m and n are the width and height of the original image T0, respectively, and x is a positive integer ≥ 2.
8. The 3D positioning method according to claim 6, characterized in that: Feature descriptor X of the original image i1 Generate the feature descriptor X of the 3D positioning corrected image by GLOH descriptor or SIFT feature descriptor and / or i2 Generated by GLOH descriptor or SIFT feature descriptor.
9. The 3D positioning method according to claim 6, characterized in that: The 3D positioning error correction is performed based on the deviation between the original image reference point and the 3D positioning image reference point, including the following steps: Obtain the horizontal rotation compensation angle according to the following formula And vertical rotation compensation angle Among them, O and O' are the center point of the camera lens and the image center point of the original image respectively; x0 and y0 are the horizontal coordinate and vertical coordinate of the image center point O' respectively; P0 is the center point of the area to be located on the original image, x p ,y p are the horizontal and vertical coordinates of the center point P0 respectively; ∠AOO' is the 1 / 2 horizontal field angle of the camera at the current magnification; ∠BOO' is the 1 / 2 vertical field angle of the camera at the current magnification; AO' and BO' are the 1 / 2 image height of the original image T0 and the 1 / 2 image height of the original image T0 respectively; And, the horizontal rotation compensation angle of the gimbal and / or, rotate the vertical rotation compensation angle in the vertical direction Make the center point of the area to be located at the center of the image.
10. A 3D positioning system, characterized in that: include: PTZ; A camera connected to the gimbal; A theoretical rotation angle acquisition module is used to acquire the theoretical rotation angle of the gimbal; the gimbal rotates according to the theoretical rotation angle so that the center point of the region of interest is located at the center of the image to obtain a 3D positioning image; The feature point matching module is used to extract the image feature points of the original image and the 3D positioning image respectively, and perform image feature point matching to obtain the original image reference point t k (x k ,y k ), 3D positioning image reference point t n (x n ,y n ); The compensation angle acquisition unit is used to obtain the compensation angle according to the original image reference point t k (x k ,y k ), 3D positioning correction image reference point t n (x n ,y n ) Get the horizontal rotation compensation angle And vertical rotation compensation angle A control unit connected to the pan-tilt head is used to control the pan-tilt head to rotate horizontally to a compensation angle. and / or, rotate the vertical rotation compensation angle in the vertical direction Make the center point of the area to be positioned at the center of the image to complete 3D positioning.
Citation Information
Cited By
PCB defect detection method and system based on AI vision
CN120823208A