Two-dimensional code detection and identification method and device

By combining a lightweight classification network and a high-precision detection network, and dynamically allocating computing resources, highly reliable integrity discrimination and sub-pixel-level positioning of QR codes are achieved. This solves the real-time and accuracy problems of QR code detection on embedded terminals and improves the safety and efficiency of AGV navigation.

CN122023754APending Publication Date: 2026-05-12ZHEJIANG MILEY ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG MILEY ROBOT CO LTD
Filing Date
2026-01-22
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing industrial QR code visual analysis technology cannot simultaneously achieve both high reliability and integrity recognition of QR codes and high real-time sub-pixel positioning on embedded terminals, making it difficult to balance the safety and efficiency of AGV navigation.

Method used

A lightweight classification network is used in conjunction with bottleneck-based multi-scale feature fusion and channel attention mechanism for pre-screening. Through integrity confidence gating decision, computing resources are dynamically allocated, and a high-precision detection network is combined to perform sub-pixel-level corner regression to achieve accurate positioning of QR codes.

Benefits of technology

It improves the accuracy of AGV navigation, reduces the incidence of safety accidents, saves hardware resources, enhances real-time processing capabilities, and meets the real-time requirements of industrial scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023754A_ABST
    Figure CN122023754A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional code detection and identification method and device based on an AGV industrial automatic guided vehicle, and the method comprises the steps: obtaining an image file obtained through a photographing device; preprocessing the image file to generate a multi-scale tensor pyramid which comprises a first-level classification tensor used for integrity discrimination and a second-level detection tensor used for high-precision positioning; inputting the primary classification tensor into a lightweight classification network, and outputting the integrity confidence of the wide-field image based on a bottleneck type multi-scale feature fusion module and a channel attention mechanism; and executing a gating decision in real time based on a comparison result of the integrity confidence and a preset safety threshold. The method has the advantages that a bottleneck type multi-scale feature fusion module and a channel attention mechanism are integrated through a front lightweight classification network, 'simulated truncation 'priori knowledge is injected, invalid frames such as edge truncation, serious damage or pure background can be accurately recognized, and the misjudgment risk of incomplete two-dimensional codes is intercepted from an inference source.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of identification, and more particularly to a method and apparatus for QR code detection and identification. Background Technology

[0002] With the deepening of "Industry 4.0" and intelligent manufacturing, machine vision technology is widely used in logistics warehousing, automated production lines, and other scenarios. Among them, two-dimensional barcodes such as DataMatrix and QRCode have become the core carriers for navigation landmarks and material tracking in industrial automated guided vehicles (AGVs) due to their advantages of large information capacity and strong error correction capabilities. In scenarios where AGVs move at high speeds or industrial production lines operate rapidly, visual navigation systems must simultaneously meet two core requirements: first, to perform high-frequency integrity judgment of QR codes within the field of view to avoid navigation errors; and second, to achieve sub-pixel-level precise positioning to ensure navigation accuracy.

[0003] Current industrial QR code visual analysis technologies primarily rely on single-stage deep learning object detection methods (such as the YOLO series and SSD). These methods employ an end-to-end inference model, directly inputting each captured wide-field-of-view image frame into a deep convolutional neural network. These networks extract multi-scale features through a feature pyramid (FPN), and the detection head synchronously regresses the QR code's bounding box, confidence score, and corner coordinates. To reduce the risk of missed detections, existing systems perform a complete detection and inference process on all frames in the video stream, regardless of whether the image contains a complete QR code target.

[0004] The existing single-stage detection architecture does not perform pre-screening of QR code integrity and dynamic allocation of computing power, which makes it impossible to simultaneously achieve high reliability of QR code integrity judgment and high real-time sub-pixel positioning under the limited hardware resources of embedded terminals. Either it will cause "model illusion" due to forced regression of incomplete QR codes with truncated edges, leading to safety risks such as AGV navigation deviation or collision; or it will cause waste of embedded terminal resources due to performing full high-power calculations on invalid frames, limiting the system's real-time processing frame rate, ultimately making it difficult to balance safety reliability and operating efficiency. Summary of the Invention

[0005] Purpose of the invention: The purpose of this invention is to solve the technical problems in the prior art and provide a method and apparatus for QR code detection and recognition.

[0006] Technical Solution: This application proposes a QR code detection and recognition method based on an AGV (Automated Guided Vehicle), including:

[0007] Acquire image files captured by the camera device;

[0008] The image file is preprocessed to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning.

[0009] The first-level classification tensor is input into a lightweight classification network, and the integrity confidence of the wide field of view image is output based on the bottleneck-type multi-scale feature fusion module and channel attention mechanism.

[0010] Based on the real-time comparison between the integrity confidence level and the preset security threshold, gating decisions are performed:

[0011] If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal.

[0012] If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code;

[0013] The corner points obtained from the regression are geometrically and topologically verified. After verification, they are mapped to navigation pose information in the physical coordinate system.

[0014] Preferably, the preprocessing further includes:

[0015] By employing direct memory mapping or shared memory techniques, image file streams are written directly to page-locked memory regions in physical memory, which are mapped to the GPU's unified address space.

[0016] Preferably, the image file is preprocessed to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning. This includes performing Bayer removal, histogram equalization, and normalization operations on the image file using a pre-compiled CUDA kernel function.

[0017] The normalization formula is as follows:

[0018] ;

[0019] These are preset statistical constants for industrial scenarios;

[0020] Building upon this, a dual-scale tensor pyramid is constructed in parallel using bilinear interpolation operators, which includes a first-level classification tensor. and secondary detection tensor .

[0021] Preferably, the lightweight classification network includes:

[0022] Bottleneck layer, used to compress the number of channels in the input features;

[0023] Multi-path parallel depthwise separable convolutional layers extract multi-scale features using convolutional kernels of different scales;

[0024] The channel attention module is used to adaptively adjust the weights of feature channels based on simulated truncation prior knowledge injected during the training phase.

[0025] The fully connected classification layer, after weighting and labeling the feature vectors, outputs the integrity confidence score via the fully connected classification head. .

[0026] Preferably, the channel attention module is used to adaptively adjust the weights of feature channels based on simulated truncation prior knowledge injected during the training phase, including:

[0027] Global average pooling is performed on the fused feature map using a channel attention mechanism to extract channel statistical descriptors, and a weight vector is generated using two fully connected layers.

[0028] ;

[0029] in, This represents the channel statistics after global average pooling, reflecting the response strength of each feature channel across the entire graph. This is a dimensionality reduction weight matrix used to compress channel features to capture cross-channel interaction information. The ReLU activation function is used to introduce nonlinear characteristics. This is a weighting matrix used to restore the feature dimensions. This is the Sigmoid function, used to map the output to normalized weights between (0,1).

[0030] Preferably, if the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the GPU memory occupied by the secondary detection tensor and output a target-free signal, including:

[0031] Send a termination command to the task scheduler to physically block the enqueuing and execution of subsequent network-related computations.

[0032] Perform atomic operations to release the secondary detection tensor temporarily stored in the video memory buffer. This marks it as writable so that it can serve the next frame;

[0033] Write a targetless signal to the output interface.

[0034] Preferably, if the integrity confidence level is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code, including:

[0035] Trigger activation mode, generate high-priority terminal signal, activate subsequent high-precision detection network dedicated CUDA stream, and process secondary detection tensors. The system is marked as locked and transmitted to the computing unit, officially initiating the subsequent high-precision positioning process.

[0036] Preferably, the high-precision detection network includes:

[0037] The improved CSPDarknet backbone network adopts a hierarchical hybrid activation strategy, including using the computationally simple ReLU activation function in the computationally intensive high-resolution shallow network to reduce memory access latency.

[0038] An edge-enhanced spatial decoupling attention module is used to perform one-dimensional global pooling along the horizontal and vertical directions respectively, preserving spatial location information;

[0039] Taking horizontal feature aggregation as an example, its mathematical expression is as follows:

[0040]

[0041] in, For the input feature map in the channel The response value, The width of the feature map;

[0042] The meaning of this formula is that it is through the horizontal direction... Aggregation is performed to generate feature vectors. Captured the first Long-distance dependencies in the row are preserved, thus retaining precise positional information in the vertical direction, while vertical pooling preserves positional information in the horizontal direction.

[0043] The detection head is used to reconstruct the geometric parameters of the four corner points, including the corner coordinates, center coordinates, and rotation angle of the QR code.

[0044] Preferably, the corner points obtained from the regression are subjected to geometric topology verification, and after verification, they are mapped to navigation pose information in the physical coordinate system, including:

[0045] Obtain the geometric parameters of the four corner points, and calculate the convexity of the quadrilateral formed by the four corner points and the eccentricity of the intersection of the diagonals;

[0046] If a severely distorted geometry is detected, it is predicted to be a false target and forcibly discarded.

[0047] Using the calibrated camera intrinsic parameter matrix and distortion coefficient Using the inverse projection principle of a pinhole camera model, the pixel coordinate system is mapped back to the physical space coordinate system. The mathematical mapping relationship is as follows:

[0048] ;

[0049] in, For pixel coordinates, These are the physical coordinates in the camera coordinate system.

[0050] The precise physical pose of the QR code's center point relative to the AGV body is calculated using perspective transformation. and yaw angle ;

[0051] The data is sent to the AGV motion controller via the TCP / IP protocol.

[0052] Secondly, the present invention provides a QR code detection and recognition device, installed on an AGV (Automated Guided Vehicle), comprising:

[0053] The acquisition unit is used to acquire image files obtained by the shooting device;

[0054] The preprocessing unit is used to preprocess the image file to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning.

[0055] The network processing module is used to input the first-level classification tensor into a lightweight classification network, and output the integrity confidence of the wide field of view image based on the bottleneck-type multi-scale feature fusion module and the channel attention mechanism.

[0056] The comparison module is used to perform gating decisions in real time based on the comparison results between the integrity confidence level and the preset security threshold.

[0057] If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal.

[0058] If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code;

[0059] The verification module is used to perform geometric topology verification on the corner points obtained from the regression, and after verification, it maps them to navigation pose information in the physical coordinate system.

[0060] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory. The memory stores one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device is able to implement any of the possible design methods described in the first aspect.

[0061] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any of the above embodiments.

[0062] Fifthly, embodiments of the present invention also provide a computer program product that, when run on an electronic device, causes the electronic device to perform any possible design method of any of the above aspects.

[0063] Beneficial effects:

[0064] This invention integrates a bottleneck-oriented multi-scale feature fusion scheme and a channel attention (SE-Attention) mechanism into a pre-built lightweight classification network, injecting "simulated truncation" prior knowledge. This enables accurate identification of invalid frames such as edge truncation, severe damage, or pure background, intercepting the risk of misjudgment of incomplete QR codes at the inference source. This design completely avoids the coordinate drift problem caused by "model illusion" in traditional single-stage detection networks, ensuring the accuracy of AGV navigation data and significantly reducing the incidence of safety accidents such as path deviation or collisions.

[0065] The hardware-level dynamic early exit mechanism releases the GPU memory resources corresponding to invalid frames in real time through atomic operations and physically blocks the invalid computation of the subsequent heavy detection network, saving approximately 80% of GPU computing cycles and memory bandwidth. Without increasing hardware configuration costs, it significantly reduces the invalid power consumption of embedded terminals while significantly improving the real-time processing frame rate (FPS) of valid target frames, meeting the real-time requirements of high-speed AGV movement or rapid assembly line operation in industrial scenarios.

[0066] Employing a "coarse-fine coupling" decoupling design, the front-end network focuses on the integrity screening of the global context, enabling the rear-end detection network to focus on the geometric parameter regression of clean targets. Combined with the direction-aware encoding strategy of the edge-enhanced spatial decoupling attention module and a hierarchical hybrid activation strategy, this effectively overcomes the spatial location information loss problem caused by convolutional neural network downsampling. In high-speed dynamic scenes, it can accurately extract sub-pixel-level offsets of QR code corner points, center point coordinates, and rotation angles, ensuring high-precision control of AGV navigation.

[0067] Through lightweight optimization techniques such as tensor pyramid construction, FP16 half-precision acceleration, and operator fusion, the inference time of the pre-classification network is controlled to the millisecond level. Combined with the collaborative optimization of the CUDA parallel computing architecture and the TensorRT inference engine, the entire system runs efficiently on the limited hardware resources of embedded terminals. It meets the triple requirements of high reliability and error prevention, high real-time processing, and high-precision positioning without relying on high-performance servers, offering extremely high deployment flexibility and scenario adaptability. Attached Figure Description

[0068] Figure 1 A schematic diagram of the method framework for this invention is provided;

[0069] Figure 2 A schematic diagram of the method flow framework for this invention is provided;

[0070] Figure 3 A comparative process diagram is provided for this invention;

[0071] Figure 4 This invention provides a geometric topology verification and physical coordinate inverse transformation diagram;

[0072] Figure 5 This is a block diagram of a device structure provided in one embodiment of this application;

[0073] Figure 6 This is a block diagram of an electronic device structure provided in one embodiment of this application. Detailed Implementation

[0074] To make the technical solution of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0075] Example 1

[0076] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "including" and similar expressions used herein mean that the element or object preceding the term covers the element or object listed after the term and its equivalents, but do not exclude other elements or objects.

[0077] In response to the problems existing in the current technology, such as Figure 1-2 As shown, a QR code detection and recognition method based on an AGV (Automated Guided Vehicle) is proposed, including:

[0078] Step S1: Acquire the image file (RAW format image) obtained by the shooting device.

[0079] Step S2: Preprocess the image file to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning;

[0080] Step S3: Input the first-level classification tensor into a lightweight classification network. Based on the bottleneck-type multi-scale feature fusion module and channel attention mechanism, output the integrity confidence of the wide field of view image. This step, as the "outpost" perception unit of the cascaded inference system, does not pursue pixel-level geometric localization, but uses a lightweight network to quickly parse the global context of the wide field of view image to identify the integrity status of the image.

[0081] The network is compiled into a high-throughput execution plan with operator fusion and memory optimization within the embedded inference engine TensorRT. The data flow processing logic within the GPU core first passes through a bottleneck-based multi-scale feature fusion (BMS-FDM) module. To balance feature richness and computational load on edge devices, this module employs a "compression-split-fusion" topology.

[0082] Step S4: Based on the comparison result between the integrity confidence level and the preset security threshold, perform a gating decision in real time.

[0083] This step is the core control node for the cascaded inference system to achieve dynamic allocation of computing power and error prevention. Essentially, it involves inserting a threshold-based conditional branching module into the GPU inference pipeline to control the scheduling of subsequent computing kernels and the allocation of GPU memory resources.

[0084] The system incorporates a hardware-level comparator within the inference engine's control logic. This comparator reads the integrity confidence score (POK) output in step S3 in real time and compares it with a preset security threshold (τ = 0.95 in this embodiment). This comparison process triggers two mutually exclusive execution paths, such as... Figure 3 As shown;

[0085] If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal.

[0086] If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code;

[0087] Step S5: Perform geometric topology verification on the corner points obtained from the regression, and after verification, map them into navigation pose information in the physical coordinate system.

[0088] This step is the output stage of the cascaded inference system. Its core task is to map the two-dimensional pixel coordinates on the image plane to three-dimensional navigation coordinates in the physical world. To meet the high real-time requirements of AGV navigation, this step only performs pure geometric calculations based on the geometric contour features of the QR code, without consuming computing power to decode or parse the data stream inside the QR code.

[0089] This invention details a cascaded QR code-based real-time positioning system deployed on an embedded edge computing terminal, based on integrity prior screening. This system is primarily applied to the visual navigation module of industrial automated guided vehicles (AGVs), aiming to solve the misnavigation problem caused by truncation of the field of view in high-speed motion scenarios and optimize the allocation of computing power on the edge.

[0090] In practice, the hardware operating environment for this implementation can be an NVIDIA Jetson Xavier NX embedded computing platform, equipped with an industrial-grade global shutter camera, with an image acquisition resolution of 1280×1024 and a frame rate of 60FPS. The system software environment is based on the Linux operating system, using the TensorRT high-performance inference engine for model acceleration, and utilizing the CUDA parallel computing architecture to achieve pipelined parallelism of image preprocessing and model inference.

[0091] The preprocessing process also includes:

[0092] By employing direct memory mapping or shared memory techniques, the image file stream is directly written to a page-locked memory region in physical memory, which is mapped to the GPU's unified address space. This step aims to overcome the data transfer bottleneck between the CPU and GPU, achieving extremely low-latency image preprocessing. The system uses direct memory mapping or shared memory techniques to directly write the acquired RAW format image stream to a page-locked memory region in physical memory. This region is mapped to the GPU's unified address space, thus avoiding the data copying overhead from CPU to GPU in traditional methods.

[0093] The image file is preprocessed to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning. This includes performing Bayer removal, histogram equalization, and normalization operations on the image file using a pre-compiled CUDA kernel function.

[0094] The normalization formula is as follows:

[0095] ;

[0096] These are preset statistical constants for industrial scenarios;

[0097] Building upon this, a dual-scale tensor pyramid is constructed in parallel using bilinear interpolation operators, which includes a first-level classification tensor. and secondary detection tensor .

[0098] First-level classification tensor Downsampling to The resolution and data type are converted to FP16 for use in first-level integrity assessment.

[0099] Secondary detection tensor :Keep High resolution; this data stream is associated with the original image data and is only transmitted to the detection network for processing upon receiving a subsequent "activation" instruction.

[0100] The lightweight classification network includes:

[0101] The bottleneck layer is used to compress the number of channels in the input features. First, a 1×1 convolution is used to construct the bottleneck layer, which compresses the number of channels in the high-dimensional features to significantly reduce the number of floating-point operations (FLOPs) in subsequent convolution operations.

[0102] Multi-path, depthwise separable convolutional layers are implemented in parallel, each employing convolutional kernels of different scales to extract multi-scale features. The compressed features are then distributed to three parallel depthwise separable convolutional branches, using 3×3, 5×5, and 7×7 convolutional kernels, respectively. Physically, the small-scale branch focuses on capturing microscopic texture interruptions (high-frequency features) in the data codeword region, while the large-scale branch focuses on perceiving macroscopic topological structure deficiencies and large-area background filling in the finder pattern (low-frequency features). The three features are ultimately concatenated along the channel dimension, achieving comprehensive coverage of the mixed defect pattern of "edge truncation."

[0103] The channel attention module adaptively adjusts the weights of feature channels based on simulated truncation prior knowledge injected during training, including:

[0104] Global average pooling is performed on the fused feature map using a channel attention mechanism to extract channel statistical descriptors, and a weight vector is generated using two fully connected layers.

[0105] ;

[0106] in, This represents the channel statistics after global average pooling, reflecting the response strength of each feature channel across the entire graph. This is a dimensionality reduction weight matrix used to compress channel features to capture cross-channel interaction information. The ReLU activation function is used to introduce nonlinear characteristics. This is a weighting matrix used to restore the feature dimensions. This is the Sigmoid function, used to map the output to normalized weights between (0, 1).

[0107] A channel attention (SE-Attention) mechanism is embedded before the network output layer, aiming to adaptively suppress interference from complex industrial backgrounds by utilizing prior knowledge of "simulated truncation" injected during training. This mechanism first performs global average pooling on the fused feature map to extract channel statistical descriptors, and then uses two fully connected layers to capture the non-linear dependencies between channels to generate weight vectors.

[0108] The fully connected classification layer, after weighting and labeling the feature vectors, outputs the integrity confidence score via the fully connected classification head. .

[0109] In engineering simulations, the weight vector s automatically reduces the response values ​​of channels sensitive to environmental noise such as metal reflections and conveyor belt scratches (i.e., assigns weights close to 0), while enhancing the response to QR code texture features.

[0110] Finally, the recalibrated feature vectors are passed through a fully connected classification head to output a normalized integrity confidence score POK∈[0,1]. This value quantitatively reflects whether a complete QR code target exists in the current field of view, providing a direct basis for subsequent gating decisions. Thanks to the FP16 half-precision acceleration and the aforementioned lightweight design, the end-to-end inference time at this stage is strictly controlled within milliseconds, ensuring high-precision error prevention screening is completed without blocking the pipeline.

[0111] If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the GPU memory occupied by the secondary detection tensor and output a no-target signal, including:

[0112] Send a termination command to the task scheduler to physically block the enqueuing and execution of subsequent network-related computations.

[0113] Perform atomic operations to release the secondary detection tensor temporarily stored in the video memory buffer. This marks it as writable so that it can serve the next frame;

[0114] Write a targetless signal to the output interface.

[0115] when When the system determines that the image within the current field of view is an "invalid frame" (characterized by truncated edge textures, severe damage, or pure background noise), the control logic immediately triggers the early exit mechanism.

[0116] First, the system sends a "terminate" command to the task scheduler, physically blocking the enqueuing and execution of subsequent detection network-related CUDAKernels, thereby completely avoiding the unnecessary occupation of GPU computing power by heavy networks.

[0117] Secondly, perform an atomic operation to release the secondary detection tensor temporarily stored in the video memory buffer. This marks it as "overwriteable" so that it can be used in the next frame;

[0118] Finally, the system directly writes "No Target" to the output interface. This mechanism has dual value. In terms of efficiency, it can save approximately 80% of GPU computing cycles and memory bandwidth, significantly reducing device power consumption, especially for blank or invalid frames that frequently occur in industrial settings. In terms of safety, by physically cutting off the data stream of defective products in the pre-detection stage, it eliminates the "model illusion" and coordinate jump risks caused by the forced regression of edge half-codes in traditional detection models at the source.

[0119] If the integrity confidence level is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code, including:

[0120] Trigger activation mode, generate high-priority terminal signal, activate subsequent high-precision detection network dedicated CUDA stream, and process secondary detection tensors. The system is marked as locked and transmitted to the computing unit, officially initiating the subsequent high-precision positioning process.

[0121] when When the system determines that the image contains a complete and valid QR code, the control logic generates a high-priority internal interrupt signal or event, activating the dormant second-level detection network-specific CUDA stream.

[0122] The data stream then retrieved the data from the standby memory. It is marked as "locked" and transmitted to the computing unit, officially starting the subsequent high-precision positioning process.

[0123] The high-precision detection network includes: an improved CSPDarknet backbone network, employing a hierarchical hybrid activation strategy, including using the computationally simple ReLU activation function in the computationally intensive high-resolution shallow network to reduce memory access latency; the activated second-level detection network is based on the improved CSPDarknet backbone architecture. To balance inference speed and feature representation capability under limited embedded computing power, the network adopts a hierarchical hybrid activation strategy: in the computationally intensive high-resolution shallow network (Stem and Stage 1), the computationally simple ReLU activation function is used to reduce memory access latency; in the semantically rich deep network (Stage 2 and Neck), it automatically switches to the SiLU activation function to enhance nonlinear fitting capability; to address the inherent defect of convolutional neural networks that inevitably lead to the loss of spatial location information during multiple downsampling processes, this invention embeds an edge-enhanced spatial decoupling attention (E-CA) module at the end of the feature extraction network.

[0124] The edge-enhanced spatial decoupling attention module performs one-dimensional global pooling along the horizontal and vertical directions respectively, preserving spatial location information. The E-CA module abandons the traditional global pooling approach of compressing the feature map into a single scalar, instead employing a direction-aware feature encoding strategy. This module performs one-dimensional global pooling along the horizontal (X) and vertical (Y) directions respectively, decomposing and encoding the two-dimensional location information into feature vectors in two orthogonal directions.

[0125] Taking horizontal feature aggregation as an example, its mathematical expression is as follows:

[0126]

[0127] in, For the input feature map in the channel The response value, The width of the feature map;

[0128] The meaning of this formula is that it is through the horizontal direction... Aggregation is performed to generate feature vectors. Captured the first The long-distance dependencies of rows are preserved, thus retaining the precise positional information in the vertical direction. Similarly, vertical pooling preserves the positional information in the horizontal direction.

[0129] The detection head is used to regress the geometric parameters of the four corner points, including the corner coordinates, center coordinates, and rotation angle of the QR code. Utilizing this spatial decoupling mechanism, the network can keenly perceive the pixel-level positions of the QR code edges and corner points. Finally, the detection head regresses in parallel the sub-pixel offsets (Δx, Δy) of the four corner points relative to the grid anchors, the center coordinates, and the rotation angle θ, achieving high-precision pose calculation.

[0130] This step, as the "precision calculator" unit of the cascaded inference system, is only started after step S4 confirms that the image is complete and valid and issues an activation command. Its core task is to perform sub-pixel-level geometric parameter regression using high-resolution feature maps.

[0131] Combination Figure 5 The corner points obtained from the regression are subjected to geometric topology verification. After passing the verification, they are mapped to navigation pose information in the physical coordinate system, including:

[0132] The system obtains the geometric parameters of the four corner points and calculates the convexity of the quadrilateral formed by the four corner points and the eccentricity of the diagonal intersection point. The system first performs geometric topology verification on the four corner points regressed in step S4. Based on the rigid structural characteristics of the QR code, the system calculates the convexity of the quadrilateral formed by the four corner points and the eccentricity of the diagonal intersection point.

[0133] If a severely distorted geometry is detected, it is predicted as a false target and forcibly discarded. If a severely distorted geometry is detected (e.g., the difference between the side length and aspect ratio exceeds a preset threshold, or the quadrilaterals intersect), the system will determine that the prediction is a false target generated by "model illusion" and forcibly discard it, thereby blocking the transmission of erroneous coordinates at the physical level.

[0134] After verifying the valid corner coordinates (u,v), the system proceeds to the pose calculation module, which uses the calibrated camera intrinsic parameter matrix. and distortion coefficient Using the inverse projection principle of a pinhole camera model, the pixel coordinate system is mapped back to the physical space coordinate system. The mathematical mapping relationship is as follows:

[0135] ;

[0136] in, For pixel coordinates, These are the physical coordinates in the camera coordinate system.

[0137] The precise physical pose of the QR code's center point relative to the AGV body is calculated using perspective transformation. and yaw angle ;

[0138] The data is sent to the AGV motion controller via TCP / IP protocol to complete visual closed-loop control. This process is completely independent of content decoding, ensuring extremely low latency in the navigation data stream.

[0139] In other embodiments of the invention, combined with Figure 6 This invention discloses a QR code detection and recognition device, installed on an AGV (Automated Guided Vehicle), comprising:

[0140] Acquisition unit 201 is used to acquire image files acquired by the shooting device;

[0141] Preprocessing unit 202 is used to preprocess the image file to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning.

[0142] The network processing module 203 is used to input the first-level classification tensor into a lightweight classification network, and output the integrity confidence of the wide field of view image based on the bottleneck-type multi-scale feature fusion module and the channel attention mechanism.

[0143] Comparison module 204 is used to perform gating decisions in real time based on the comparison results between the integrity confidence level and the preset security threshold.

[0144] If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal.

[0145] If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code;

[0146] The verification module 205 is used to perform geometric topology verification on the corner points obtained from the regression, and after verification, it is mapped to navigation pose information in the physical coordinate system.

[0147] In other embodiments of the present invention, an electronic device 400 is disclosed, such as... Figure 6 As shown, the electronic device may include: one or more processors 401; a memory 402; a display 403; one or more application programs (not shown); and one or more computer programs 404. These devices can be connected via one or more communication buses 405. The one or more computer programs 404 are stored in the memory 402 and configured to be executed by the one or more processors 401. The one or more computer programs 404 include instructions that can be used to perform actions such as... Figure 1 And the various steps in the corresponding embodiments.

[0148] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0149] In the various embodiments of this invention, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0151] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present invention should be covered within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.

Claims

1. A QR code detection and recognition method, based on AGV (Automated Guided Vehicle), characterized in that, include: Acquire image files captured by the camera device; The image file is preprocessed to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning. The first-level classification tensor is input into a lightweight classification network, and the integrity confidence of the image is output based on the bottleneck-type multi-scale feature fusion module and channel attention mechanism. Based on the real-time comparison between the integrity confidence level and the preset security threshold, gating decisions are performed: If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal. If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code; The corner points obtained from the regression are geometrically and topologically verified. After verification, they are mapped to navigation pose information in the physical coordinate system.

2. The QR code detection and recognition method according to claim 1, characterized in that, The preprocessing process also includes: By employing direct memory mapping or shared memory techniques, image file streams are written directly to page-locked memory regions in physical memory, which are mapped to the GPU's unified address space.

3. The QR code detection and recognition method according to claim 1, characterized in that, The image file is preprocessed to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning. This includes performing Bayer removal, histogram equalization, and normalization operations on the image file using a pre-compiled CUDA kernel function. The normalization formula is as follows: ; These are preset statistical constants for industrial scenarios. It is an image file; Building upon this, a dual-scale tensor pyramid is constructed in parallel using bilinear interpolation operators, which includes a first-level classification tensor. and secondary detection tensor .

4. The QR code detection and recognition method according to claim 1, characterized in that, The lightweight classification network includes: Bottleneck layer, used to compress the number of channels in the input features; Multi-path parallel depthwise separable convolutional layers extract multi-scale features using convolutional kernels of different scales; The channel attention module is used to adaptively adjust the weights of feature channels based on simulated truncation prior knowledge injected during the training phase. The fully connected classification layer, after weighting and labeling the feature vectors, outputs the integrity confidence score via the fully connected classification head. .

5. The QR code detection and recognition method according to claim 1, characterized in that, The channel attention module adaptively adjusts the weights of feature channels based on simulated truncation prior knowledge injected during training, including: Global average pooling is performed on the fused feature map using a channel attention mechanism to extract channel statistical descriptors, and a weight vector is generated using two fully connected layers. ; in, This represents the channel statistics after global average pooling, reflecting the response strength of each feature channel across the entire graph. This is a dimensionality reduction weight matrix used to compress channel features to capture cross-channel interaction information. The ReLU activation function is used to introduce nonlinear characteristics. This is a weighting matrix used to restore the feature dimensions. This is the Sigmoid function, used to map the output to normalized weights between (0, 1).

6. The QR code detection and recognition method according to claim 1, characterized in that, If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the GPU memory occupied by the secondary detection tensor and output a no-target signal, including: Send a termination command to the task scheduler to physically block the enqueuing and execution of subsequent network-related computations. Perform atomic operations to release the secondary detection tensor temporarily stored in the video memory buffer. This marks it as writable so that it can serve the next frame; Write a targetless signal to the output interface.

7. The QR code detection and recognition method according to claim 1, characterized in that, If the integrity confidence level is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code, including: Trigger activation mode, generate high-priority terminal signal, activate subsequent high-precision detection network dedicated CUDA stream, and process secondary detection tensors. The system is marked as locked and transmitted to the computing unit, officially initiating the subsequent high-precision positioning process.

8. A QR code detection and recognition method according to claim 1 or 7, characterized in that, The high-precision detection network includes: The improved CSPDarknet backbone network adopts a hierarchical hybrid activation strategy, including using the computationally simple ReLU activation function in the computationally intensive high-resolution shallow network to reduce memory access latency. An edge-enhanced spatial decoupling attention module is used to perform one-dimensional global pooling along the horizontal and vertical directions respectively, preserving spatial location information; Taking horizontal feature aggregation as an example, its mathematical expression is as follows: in, For the input feature map in the channel The response value, The width of the feature map; The meaning of this formula is that it is obtained by moving along the horizontal direction. Aggregation is performed to generate feature vectors. Captured the first Long-distance dependencies in the row are preserved, thus retaining precise positional information in the vertical direction, while vertical pooling preserves positional information in the horizontal direction. The detection head is used to reconstruct the geometric parameters of the four corner points, including the corner coordinates, center coordinates, and rotation angle of the QR code.

9. The QR code detection and recognition method according to claim 1, characterized in that, The corner points obtained from the regression are subjected to geometric topology verification. After passing the verification, they are mapped to navigation pose information in the physical coordinate system, including: Obtain the geometric parameters of the four corner points, and calculate the convexity of the quadrilateral formed by the four corner points and the eccentricity of the intersection of the diagonals; If a severely distorted geometry is detected, it is predicted to be a false target and forcibly discarded. Using the calibrated camera intrinsic parameter matrix and distortion coefficient Using the inverse projection principle of a pinhole camera model, the pixel coordinate system is mapped back to the physical space coordinate system. The mathematical mapping relationship is as follows: ; in, For pixel coordinates, These are the physical coordinates in the camera coordinate system. The precise physical pose of the QR code's center point relative to the AGV body was calculated using perspective transformation. and yaw angle ; The data is sent to the AGV motion controller via the TCP / IP protocol.

10. A QR code detection and recognition device, installed on an AGV (Automated Guided Vehicle), characterized in that, include: The acquisition unit is used to acquire image files obtained by the shooting device; The preprocessing unit is used to preprocess the image file to generate a multi-scale tensor pyramid, including a first-level classification tensor for integrity determination and a second-level detection tensor for high-precision positioning. The network processing module is used to input the first-level classification tensor into a lightweight classification network, and output the integrity confidence of the wide field of view image based on the bottleneck-type multi-scale feature fusion module and the channel attention mechanism. The comparison module is used to perform gating decisions in real time based on the comparison results between the integrity confidence level and the preset security threshold. If the integrity confidence level is lower than the security threshold, an early termination mechanism is triggered to release the video memory occupied by the secondary detection tensor and output a no-target signal. If the integrity confidence is not lower than the security threshold, then the high-precision detection network is activated to perform sub-pixel-level corner regression on the secondary detection tensor to obtain the geometric parameters of the QR code; The verification module is used to perform geometric topology verification on the corner points obtained from the regression, and after verification, it maps them to navigation pose information in the physical coordinate system.