A circular hole pose measurement method based on attention mechanism super-resolution reconstruction
By employing attention-based super-resolution reconstruction and semantic segmentation techniques, the high hardware cost in circular hole pose measurement was addressed, achieving high-precision circular hole pose detection and improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2024-03-18
- Publication Date
- 2026-07-10
AI Technical Summary
In automated mechanical production, existing technologies struggle to improve the accuracy of circular hole pose measurement without increasing hardware costs, especially when camera resolution is insufficient, as the circular hole outline is easily blurred and prone to missed detection.
An attention-based super-resolution reconstruction method is adopted. By constructing an attention-based super-resolution reconstruction model and combining it with semantic segmentation technology, the resolution of the circular hole image is improved and its pose is calculated. This includes training the attention-based image super-resolution reconstruction model and the semantic segmentation model, fitting the parameters of the circular hole projection ellipse using the least squares method, and establishing a perspective transformation model between the super-resolution image and the camera coordinate system.
Without increasing hardware costs, the accuracy and precision of circular hole pose measurement are significantly improved, the problems of blurred circular hole contours and missed detection are solved, and high-precision circular hole pose detection is achieved.
Smart Images

Figure CN118446959B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of visual measurement technology and relates to a method for measuring the pose of circular holes based on super-resolution reconstruction using attention mechanisms. It is particularly suitable for detecting the pose of circular holes in industrial parts and for typical assembly and docking scenarios featuring holes. Background Technology
[0002] In the field of automated mechanical production, circular holes are a common feature of industrial parts. The pose of these holes can be used to determine the pose of the entire part, providing accurate navigation guidance for automated assembly. In recent years, binocular vision inspection technology has developed rapidly. As a non-contact inspection technology, it processes image signals to obtain the pose parameters of the target object. In the visual inspection of circular hole poses, accurately extracting the edge features of the hole is crucial for measurement. When the camera resolution is insufficient, the number of pixels occupied by the hole in the image is small, and the hole's outline is easily blurred by noise and lighting intensity. Furthermore, when the measured hole is far from the camera, it is easy to miss detection. Traditional methods to improve image resolution include upgrading camera hardware such as lenses and sensors; however, hardware upgrades have limited effectiveness and are costly. Summary of the Invention
[0003] To address the problems existing in the background technology, this invention proposes a circular hole pose measurement method based on attention mechanism super-resolution reconstruction, which enhances the circular hole contour without increasing hardware costs, thereby improving the detection accuracy of the circular hole.
[0004] The present invention adopts the following technical solution:
[0005] I. A method for measuring the pose of a circular aperture based on super-resolution reconstruction using an attention mechanism
[0006] Step S1: Use a binocular camera to acquire images of the circular holes in the parts with circular holes, and obtain the left image and the right image from the camera.
[0007] Step S2: Construct and train a circular aperture image super-resolution reconstruction model based on an attention mechanism. Use the circular aperture image super-resolution reconstruction model to perform super-resolution reconstruction of the left and right images of the camera to obtain the reconstructed left and right images.
[0008] Step S3: Calculate the parameters of the circular aperture projection ellipse corresponding to the reconstructed left and right images of the camera;
[0009] Step S4: Establish a super-resolution image pixel coordinate system. Based on the mapping relationship between the super-resolution image pixel coordinate system and the original image pixel coordinate system, establish a perspective transformation model of the camera after super-resolution reconstruction. Then, calculate the virtual intrinsic parameter matrix between the super-resolution image pixel coordinate system and the camera coordinate system, and the virtual focal length of the camera after super-resolution reconstruction.
[0010] Step S5: Calculate the pose of the circular hole in the circular hole type part based on the virtual intrinsic parameter matrix, virtual focal length, and the circular hole projection ellipse parameters corresponding to the reconstructed left and right images of the camera.
[0011] In step S2, the image super-resolution reconstruction model based on the attention mechanism is obtained by replacing the residual dense blocks in the super-resolution model based on the enhanced generative adversarial network with residual dense blocks based on the attention mechanism. An enhanced spatial attention mechanism and a contrast perception channel attention mechanism are set sequentially after the dense block of each residual dense block.
[0012] In step S2, the loss function of the attention-based image super-resolution reconstruction model includes edge loss and artifact loss.
[0013] Step S3 specifically involves:
[0014] Step S3.1: After performing semantic segmentation on the reconstructed left and right camera images using the circular aperture semantic segmentation model, the left and right circular aperture masks are obtained.
[0015] Step S3.2: After fitting the left and right circular aperture masks using the least squares method, the parameters of the circular aperture projection ellipse corresponding to the reconstructed left and right images of the camera are obtained respectively.
[0016] In the circular hole semantic segmentation model, the Swing Transformer network is used for feature extraction.
[0017] II. A computer device
[0018] The device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method.
[0019] III. A computer-readable storage medium
[0020] The medium stores a computer program that, when executed by a processor, implements the steps of the method.
[0021] IV. A computer program product
[0022] The product includes a computer program / instructions that, when executed by a processor, implement the steps of the method.
[0023] The beneficial effects of this invention are as follows:
[0024] 1. The present invention provides a method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism. This method applies super-resolution reconstruction technology based on an attention mechanism and semantic segmentation technology to binocular vision detection of the pose of a circular hole, enabling high-precision detection and measurement of the pose of the circular hole without increasing hardware costs.
[0025] 2. This invention establishes a super-resolution image pixel coordinate system, and based on the mapping relationship between the super-resolution image pixel coordinate system and the original image pixel coordinate system, establishes a camera perspective transformation model for the super-resolution image, thereby obtaining the virtual intrinsic parameter matrix between the super-resolution image pixel coordinate system and the camera coordinate system, and the virtual focal length of the camera after super-resolution reconstruction. Attached Figure Description
[0026] Figure 1 This is a flowchart of the method in an embodiment of the present invention.
[0027] Figure 2 This is a schematic diagram illustrating the introduction of an attention mechanism into the residual dense blocks of a super-resolution reconstruction model.
[0028] Figure 3 This is a comparative diagram of the circular holes before and after reconstruction.
[0029] Figure 4 It consists of the circular hole image, the mask detected by the circular hole semantic segmentation model, and the circular hole projection ellipse obtained by least-squares fitting.
[0030] Figure 5 This is a schematic diagram of the camera perspective transformation model after super-resolution reconstruction.
[0031] Figure 6 This is a schematic diagram of the intermediate camera coordinate system. Detailed Implementation
[0032] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0033] like Figure 1 As shown, a method for measuring the pose of a circular aperture based on super-resolution reconstruction using an attention mechanism includes the following steps:
[0034] Step S1: Calibrate the binocular camera to obtain its intrinsic parameter matrix, extrinsic parameter matrix, and distortion coefficients. Correct the camera based on the obtained distortion parameters. Specifically, use Zhang Zhengyou's calibration method to calibrate the binocular camera's intrinsic and extrinsic parameters and distortion coefficients, and correct the images based on the camera distortion coefficients. Use the calibrated binocular camera to acquire images of the circular holes in circular hole-type parts, obtaining the left and right images from the camera.
[0035] Step S2: Construct and train an attention-based super-resolution reconstruction model for circular aperture images. Use this model to perform super-resolution reconstruction of the left and right camera images, obtaining the reconstructed left and right camera images. The images before and after reconstruction are shown below. Figure 3 (a) and Figure 3 As shown in (b);
[0036] Among them, the attention-based super-resolution reconstruction model for circular holes is obtained by replacing the residual dense blocks in the super-resolution model based on Enhanced Super-Resolution Generative Adversarial Networks with residual dense blocks based on the attention mechanism, such as... Figure 2 As shown, Figure 2 (a) is the structure diagram of the original residual dense block. Figure 2 (b) is a structural diagram of residual dense blocks based on attention mechanism. An enhanced spatial attention mechanism and a contrast perception channel attention mechanism are set sequentially after the dense block of each residual dense block.
[0037] The loss function of the attention-based super-resolution reconstruction model for circular hole images includes edge loss and artifact loss.
[0038] The attention-based super-resolution reconstruction model for circular hole images is an improvement upon the super-resolution model based on Enhanced Super-Resolution Generative Adversarial Networks (ERNs). The ERN generator extracts features by connecting residual-in-residual dense blocks (RRDBs) across layers, containing a total of 23 RRDB modules. Each RRDB module comprises three residual dense blocks, with the output of each block serving as the input to the next. The residual dense blocks are improved by introducing enhanced spatial attention and contrast-aware channel attention mechanisms. The enhanced spatial attention mechanism focuses residual features on the key circular hole image space, while the contrast-aware channel attention mechanism utilizes the contrast information of the sum of the feature mean and standard deviation to calculate a channel attention mask, thereby better capturing the relationships between different channels of the extracted deep features of the circular hole image and focusing on important channel information. This paper adds the attention mechanism to the residual dense blocks in the last five RRDB modules of the ERN generator; the attention mechanism is not required in the preceding RRDB modules. U-Net with spectral normalization is used as the discriminator for the generative adversarial network.
[0039] Accurate extraction of the circular aperture edge is crucial for binocular vision measurement of circular apertures. To better reconstruct the edge, an edge loss is introduced into the loss function. The specific calculation formula is as follows:
[0040]
[0041] Wherein G(x) i ) represents the super-resolution reconstructed image of the circular aperture, y i This represents a high-resolution image of a real circular aperture. F() denotes the Canny operator. ||F(G(x) i ))-F(y i )||1 represents the 1-norm distance between the reconstructed high-resolution image and the real high-resolution image. This indicates that the average value of each batch of data is taken during the training process.
[0042] Images reconstructed by generative adversarial networks often contain artifacts. Artifacts around the circular hole can affect the edge extraction of the circular hole. In order to reduce the artifacts generated after the circular hole image is reconstructed, artifact loss is introduced (Liang J, Zeng H, Zhang L. Details or Artifacts: A Logically Discriminative Learning Approach to RealisticImage Super-Resolution[J]. 2022.).
[0043] The specific formula for calculating artifact loss is as follows:
[0044]
[0045] in, Indicates artifact discrimination loss, I HR Represents a high-resolution image of a true circular aperture, I SR1 This represents a high-resolution image of the reconstructed circular aperture. M refine This represents the artifact feature map generated from the image. This indicates that the average value of each batch of data is taken during the training process.
[0046] In summary, the formula for calculating the total generator loss of a generative adversarial network is as follows:
[0047]
[0048] in, This represents the overall loss of the generator. This represents the generative loss of a generative adversarial network. This represents the L1 loss based on the pixel dimension. Represents perceived loss. λ, η, κ, β is used to control the weights between different losses.
[0049] The learning process of the attention-based image super-resolution reconstruction model is as follows: Low-resolution image I LR Input to ψ and ψ EMA In the two super-resolution models, the output I SR1 and I SR2 Where ψ is the super-resolution model obtained after optimizing the super-resolution model constructed above through dynamic gradient descent, ψ EMA To obtain a more stable model from ψ using the exponential moving average (EMA) method, a real high-resolution image I was subsequently used. HR with I SR1 and I SR2 Constructing the artifact map M refine Through I HR I SR1 The artifact loss is calculated using Ψ. Finally, the overall loss of the model generator is used. To optimize the model ψ and recalculate ψ EMA Repeat this process until the model training is complete.
[0050] A training and testing set for industrial circular hole parts was established, including high-resolution images of circular holes and corresponding low-resolution images. The dataset construction process is as follows: high-resolution images of circular hole parts were acquired using a high-resolution camera, and then the high-resolution images were degraded using bicubic interpolation to obtain low-resolution images scaled up by a factor of two. These low-resolution images were then blurred and Gaussian noise was added. After the dataset was constructed, a super-resolution reconstruction model was trained on the training set.
[0051] Step S3: Calculate the parameters of the circular aperture projection ellipse corresponding to the reconstructed left and right images of the camera;
[0052] Step S3 is as follows:
[0053] Step S3.1: After semantically segmenting the reconstructed left and right camera images using the circular aperture semantic segmentation model, left and right circular aperture masks are obtained. In this embodiment, the circular aperture semantic segmentation model uses SwinTransformer for feature extraction and Mask2Former for semantic segmentation. Circular apertures in the images are labeled to construct a circular aperture semantic segmentation dataset, including a training set and a validation set. The circular aperture semantic segmentation model is trained on the training set.
[0054] Step S3.2: After fitting the left and right circular aperture masks using the least squares method, the projection ellipse parameters of the circular aperture corresponding to the reconstructed left and right camera images are obtained respectively. Based on the geometric relationship of the perspective projection of a circle, the projection of a circular aperture on the image is often an ellipse. The least squares method is used to fit the masks to obtain the projection ellipse parameters of the circular aperture. The fitted ellipse parameters are: a represents the major semi-axis, b represents the minor semi-axis, (c... x ,c y The ellipse represents the center coordinates, and θ represents the tilt angle of the ellipse. Figure 4 of (a), Figure 4 (b) and Figure 4 (c) represents the circular hole image, the mask detected by the circular hole semantic segmentation model, and the schematic diagram of the circular hole contour obtained by least squares fitting, respectively.
[0055] Step S4: Establish a super-resolution image pixel coordinate system. Based on the mapping relationship between the super-resolution image pixel coordinate system and the original image pixel coordinate system, establish a perspective transformation model of the camera after super-resolution reconstruction. Then, calculate the virtual intrinsic parameter matrix between the super-resolution image pixel coordinate system and the camera coordinate system, and the virtual focal length of the camera after super-resolution reconstruction.
[0056] Step S4 is as follows:
[0057] Step S4.1: In this embodiment, the resolution of the reconstructed image from the super-resolution model is twice that of the original image. If the elliptical parameters of the circular hole detected based on the reconstructed image are directly used as the elliptical parameters on the original imaging plane to calculate the hole's pose, it will lead to errors in the hole's pose measurement. To address the image scale transformation problem caused by super-resolution reconstruction, a pixel coordinate system for the super-resolution image is first established, such as... Figure 5 As shown, the coordinate axes of the super-resolution image pixel coordinate system are in the same direction as the original image pixel coordinate system. The origin of the coordinate system lies on the same straight line as the camera optical center and the origin of the original image pixel coordinate system, and the distance from the camera optical center is f. r The coordinates of a point in the physical world are (X, Y, Z). i ,Y i Z i After perspective projection by the camera, the coordinates of this point in the original image pixel coordinate system are (u i ,v i After being reconstructed at twice the resolution, the coordinates in the super-resolution image pixel coordinate system are (u ri ,v ri The correspondence between the pixel coordinate system of the super-resolution image and the pixel coordinate system of the original image is as follows:
[0058] (u ri ,v ri )=2(u i ,vi )
[0059] The camera has already been calibrated in step S1, obtaining its intrinsic and extrinsic parameter matrices. The camera's intrinsic parameter matrix describes the correspondence between the camera coordinate system and the original image pixel coordinate system. After the circular aperture image is reconstructed at twice the super-resolution, it is necessary to calculate the correspondence between the super-resolution image pixel coordinate system and the camera coordinate system. Therefore, it is necessary to establish a perspective transformation model of the reconstructed camera to obtain the virtual intrinsic parameter matrix between the super-resolution image pixel coordinate system and the camera coordinate system, as well as the virtual focal length of the reconstructed camera. The specific calculation formula is as follows:
[0060]
[0061] Where f represents the camera's focal length, f0 r This represents the virtual focal length of the camera after super-resolution reconstruction, where u0 represents the pixel coordinates of the origin of the image coordinate system in the u direction, v0 represents the pixel coordinates of the origin of the image coordinate system in the v direction, and f... x The pixel representation of the camera's focal length in the u direction, f y This represents the camera's focal length in pixels along the v direction. K r This represents the virtual intrinsic parameter matrix of the camera after super-resolution reconstruction. The extrinsic parameter matrix of the camera describes the transformation relationship between the left and right camera coordinate systems. After super-resolution reconstruction, the transformation relationship between the left and right camera coordinate systems does not change, so it does not need to be recalculated.
[0062] Step S4.2: Calculate the pose of the circular hole in the part based on the projection ellipse parameters of the circular hole in the reconstructed left and right images, including the coordinates of the hole's center and the normal vector of the hole's plane. The camera intrinsic parameter matrix used in the calculation is the virtual intrinsic parameter matrix K of the camera after super-resolution reconstruction. r The focal length used is the virtual focal length f of the camera after super-resolution reconstruction. r .
[0063] Step S5: Based on the virtual intrinsic parameter matrix and virtual focal length, and the circular hole projection ellipse parameters corresponding to the reconstructed left and right camera images, calculate the circular hole pose in the circular hole type part, including the center coordinates of the circular hole and the normal vector of the circular hole plane.
[0064] Based on the fitted ellipse parameters, the parameter matrix Y of the left and right ellipses in the image coordinate system is calculated. l and Y r The specific calculation formula is as follows:
[0065]
[0066]
[0067] Where a represents the major semi-axis of the ellipse, b represents the minor semi-axis, and (c x ,c y The ellipse represents the center coordinates, and θ represents the tilt angle of the ellipse.
[0068] Based on the virtual intrinsic parameter matrix K corresponding to the left and right cameras r Find the parameter matrices A1 and A2 of the left and right ellipses in the camera coordinate system. The calculation formula is:
[0069] A i =K r Y l、r K r
[0070] like Figure 6 As shown, the optical centers of the left and right cameras are G. L and G R The optical center of the left camera is G. L The optical center of the right camera is G. R Construct the coordinate system of the intermediate camera corresponding to the left camera, and the spatial target circular aperture plane and the camera optical center G. L Form a cone that passes through an ellipse on the image. Find two points p and q on the ellipse such that these two points are parallel to the camera's optical center G. L The angle formed is the largest; based on the plane L formed by the two points and the camera optical center, determine another plane L⊥ that is perpendicular to the plane and passes through the camera optical center, and find two other points b and c on the ellipse through L⊥; based on the two points p and q found on the ellipse and the camera optical center G... L Construct an intermediate camera coordinate system, with G as the coordinate center. L The unit vectors of the three coordinate axes are θ and μ. The calculation formulas are as follows:
[0071]
[0072]
[0073]
[0074] Where p and q represent two points found on the ellipse, and G... L ∠pG represents the optical center. L q is maximum, μ gp and μ gq It is a vector G L p and G L The unit vector of q, θ and μ represent the unit vectors of the three coordinate axes of the intermediate camera coordinate system.
[0075] Keeping the camera's optical center position constant, rotate the camera so that the optical axis is aligned with the unit vector. When they coincide, the x-axis and y-axis of the corresponding left camera image plane physical coordinate system coincide with the unit vectors θ and μ, respectively. At this time, the point corresponding to the ellipse E' obtained by the image plane intercepting the observation cone is p'q'b'c' on the new imaging plane.
[0076] In the intermediate camera coordinate system, the coordinates of the four points p'q'b'c' are represented as follows:
[0077]
[0078] Among them, f r This represents the virtual focal length of the camera after super-resolution reconstruction, v b' Represents the y-axis coordinate of b', v c' Represents the y-axis coordinate of c', u p' Represents the x-axis coordinate of p', u q' This represents the x-axis coordinate of q';
[0079] The coordinates of PQBC are obtained from p'q'b'c':
[0080]
[0081] Where α, β, and γ are proportionality coefficients, the center O of the circular hole is the midpoint of BC, and M is the midpoint of PQ. Therefore:
[0082]
[0083]
[0084] The formula for calculating the normal vector of a circle in space is:
[0085]
[0086] Combining the properties of circles and the similarity relationship of triangles, the following equations can be derived:
[0087]
[0088] Where r represents the radius of the circular hole.
[0089] By solving the above equations simultaneously, the center O of the circular hole can be obtained. l 'and normal vector n l Two sets of solutions:
[0090]
[0091]
[0092] Among them, O l1 '、n l1 '、Ol2 '、n l2 ' represents the two sets of circle centers and normal vectors in the coordinate system corresponding to the left camera. The formula for transforming these to the left camera coordinate system is as follows:
[0093]
[0094] Similarly, we obtain two sets of solutions for the center of the circle and the normal vector under the right camera: O r1 n r1 O r2 n r2 .
[0095] The two centers O in the right camera coordinate system r1 and O r1 Represented as O in the left camera coordinate system r1 'and O r2 The calculation formula is:
[0096]
[0097] Where R and T are the rotation and translation matrices of the extrinsic parameter matrix obtained from the binocular camera calibration;
[0098] Since the center coordinates of a spatial circle have only one value, the correct center coordinates can be obtained through this constraint; calculate the coordinates of the two sets of circles below the left camera from point O. r1 and O r2 The distance, take d 11 d 12 d 21 d 22 The minimum value is the correct left and right center pair, calculated using the following formula:
[0099]
[0100] The coordinates of the center of the circular hole have a unique solution, and the calculation process is as follows:
[0101]
[0102] Find O l Then, the normal vector n of the circular hole in the left camera coordinate system can be obtained. l The calculation process is as follows:
[0103]
[0104] Similarly, find the corresponding O in the right camera coordinate system. r The correct center of the circle and the corresponding normal vector n r The coordinates of the center of the hole contain an unknown parameter r, which needs to be further solved using the geometric properties of conic sections.
[0105] Assuming the origin of the world coordinate system is the center of the circular hole, the X-axis of the world coordinate system... w Y w The shaft lies on the plane containing the circular hole and Z w The axis is perpendicular to the plane containing the circular hole. A point x on the circular hole in space... w and its corresponding point x on the left / right camera coordinate system image. i Satisfy the following equation:
[0106] x i =R i x w +t i
[0107] Where i = 1, 2, corresponding to the left and right cameras, x i R i t i These represent the coordinates of the corresponding points on the left / right camera images in the camera coordinate system, and the external parameter rotation and translation matrices of the left / right cameras relative to the world coordinate system, respectively.
[0108] Transform the formula into x i =G i u w (1), where G i =(r i1 ,r i2 ,t i ), r i1 and r i2 It is R i The first two column vectors, u w It is x w The homogeneous coordinates of the target circle in space. The equation of the circle is expressed as: Q represents the parameter matrix of the spatial target circle. Since the circle is a special type of ellipse, Q is solved in the same way as Y, where Y represents the parameter matrix of the ellipse in the image coordinate system. Similarly, the projection equations of the ellipse on the left / right images are expressed as follows: A i This represents the parameter matrix of the ellipse on the left and right images. i These are the homogeneous coordinates obtained by transforming the coordinates of the corresponding points in the left / right image in the pixel coordinate system, and u i =x i / f r (4), combining (1), (2), (3), and (4), we obtain the geometric constraint equations for the conic section:
[0109]
[0110] Where G1 is (r 11 ,r 12 ,t1), K iThese are unknown scale parameters, which are eliminated in subsequent solution processes;
[0111] Based on the normal vector n of the circular hole in the left camera coordinate system l unit vector r 13 The matrix H is calculated using the following formula:
[0112]
[0113] Because r 11 r 12 Let r be the eigenvector corresponding to the two non-zero eigenvalues of H. Therefore, r can be solved by finding the eigenvectors of H. 11 r 12 ;
[0114] Based on r 11 r 12 Solve the system of geometric constraint equations for conic sections:
[0115]
[0116] Where R represents the rotation matrix in the stereo camera's extrinsic parameters matrix, and t represents the translation matrix in the stereo camera's extrinsic parameters matrix. Based on the system of equations, O is calculated. l (x1,y1,z1), O r (x2,y2,z2), O l O r The coordinates of the center of the circular hole in the left and right camera coordinate systems are shown below. At this point, the coordinates O of the center of the circular hole and the normal vector n have been solved, yielding the pose of the circular hole.
[0117] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism, characterized in that, Includes the following steps: Step S1: Use a binocular camera to acquire images of the circular holes in the parts with circular holes, and obtain the left image and the right image from the camera. Step S2: Construct and train a circular aperture image super-resolution reconstruction model based on an attention mechanism. Use the circular aperture image super-resolution reconstruction model to perform super-resolution reconstruction of the left and right images of the camera to obtain the reconstructed left and right images. Step S3: Calculate the parameters of the circular aperture projection ellipse corresponding to the reconstructed left and right images of the camera; Step S4: Establish a super-resolution image pixel coordinate system. Based on the mapping relationship between the super-resolution image pixel coordinate system and the original image pixel coordinate system, establish a perspective transformation model of the camera after super-resolution reconstruction. Then, calculate the virtual intrinsic parameter matrix between the super-resolution image pixel coordinate system and the camera coordinate system, and the virtual focal length of the camera after super-resolution reconstruction. Step S5: Calculate the pose of the circular hole in the circular hole type part based on the virtual intrinsic parameter matrix, virtual focal length, and the circular hole projection ellipse parameters corresponding to the reconstructed left and right images of the camera.
2. The method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism as described in claim 1, characterized in that, In step S2, the image super-resolution reconstruction model based on the attention mechanism is obtained by replacing the residual dense blocks in the super-resolution model based on the enhanced generative adversarial network with residual dense blocks based on the attention mechanism. An enhanced spatial attention mechanism and a contrast perception channel attention mechanism are set sequentially after the dense block of each residual dense block.
3. The method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism as described in claim 1, characterized in that, In step S2, the loss function of the attention-based image super-resolution reconstruction model includes edge loss and artifact loss.
4. The method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism as described in claim 1, characterized in that, Step S3 specifically involves: Step S3.1: After performing semantic segmentation on the reconstructed left and right camera images using the circular aperture semantic segmentation model, the left and right circular aperture masks are obtained. Step S3.2: After fitting the left and right circular aperture masks using the least squares method, the parameters of the circular aperture projection ellipse corresponding to the reconstructed left and right images of the camera are obtained respectively.
5. The method for measuring the pose of a circular hole based on super-resolution reconstruction using an attention mechanism according to claim 4, characterized in that, In the circular hole semantic segmentation model, the Swing Transformer network is used for feature extraction.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 5.