A paper roll ridge stripe detection system and method
By combining a dual-wavelength imaging system and a deep learning network, the problems of low efficiency and poor stability in traditional paper roll ridge detection methods are solved, achieving high-precision and robust detection of minute ridges.
Patent Information
- Application Number
- CN202511594673.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-05-26
- Estimated Expiration
- 2045-11-03
AI Technical Summary
Traditional paper roll ridge detection methods are inefficient, struggle to identify minute ridge defects, and exhibit poor stability under different paper types and lighting conditions.
A dual-wavelength imaging system employing alternating projections of a 532nm green laser and a 650nm red laser, combined with subpixel-level image registration and dual-wavelength contrast enhancement formulas, achieves adaptive detection through feature extraction and pattern recognition via a ResNet-50 backbone network and a dual-wavelength feature cross-attention module.
It significantly improves the detection accuracy and robustness of micro-bulges, adapts to different paper backgrounds, reduces the impact of noise, and improves the continuity and stability of detection time.
Smart Images

Figure CN121259305B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and in particular to a paper roll ridge stripe detection system and method. Background Technology
[0002] Traditional paper roll ridge inspection relies primarily on simple mechanical measurement methods. These methods are not only inefficient but also struggle to accurately identify minute ridge defects formed in their early stages. In particular, ridges less than 0.5 mm in height often go undetected, allowing them to gradually expand during production and ultimately affecting the quality of the entire batch. Furthermore, existing technologies, mainly based on fixed thresholds and simple edge detection methods, lack the ability to adapt to complex paper textures and backgrounds, resulting in poor detection stability under different paper types and lighting conditions. Summary of the Invention
[0003] This invention provides a paper roll ridge detection system and method. This invention can automatically optimize detection parameters for different types of paper, solving the problem of poor adaptability caused by fixed threshold settings in the prior art. Compared with single-task methods, it has higher detection accuracy and robustness.
[0004] The first aspect of the present invention provides a method for detecting paper roll ridges, the method comprising:
[0005] The surface of the paper roll is irradiated with a first laser to obtain a first wavelength image, and the surface of the paper roll is alternately irradiated with a second laser to obtain a second wavelength image;
[0006] Geometric registration is performed on the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image;
[0007] Scattering intensity difference operation is performed on the first registered image and the second registered image to obtain the ridge enhancement feature map;
[0008] Cross-attention recognition is performed on the enhanced feature map of the ridge to obtain the ridge location mask and height prediction results.
[0009] In conjunction with the first aspect, in a first implementation of the first aspect of the present invention, the step of using a first laser to irradiate the surface of the paper roll to obtain a first wavelength image, and using a second laser to alternately irradiate the surface of the paper roll to obtain a second wavelength image, includes:
[0010] Configure the pixel resolution and frame rate of the CCD image sensor, and install a filter wheel driven by a stepper motor in front of the sensor, which includes a first bandpass filter for the first laser and a second bandpass filter for the second laser;
[0011] A timing controller is established to make the first laser and the second laser alternately project at a preset frequency, while driving the filter wheel to switch to the corresponding first bandpass filter or second bandpass filter.
[0012] Based on the timing controller, the CCD image sensor is controlled to capture a paper roll surface image filtered by the first bandpass filter as a first wavelength image when the first laser illuminates it, and to capture a paper roll surface image filtered by the second bandpass filter as a second wavelength image when the second laser illuminates it.
[0013] In conjunction with the first aspect, in a second implementation of the first aspect of the present invention, the step of geometrically registering the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image includes:
[0014] Feature points are extracted from the first wavelength image and the second wavelength image respectively to obtain the first wavelength feature point set and the second wavelength feature point set;
[0015] Feature point matching is performed based on the first wavelength feature point set and the second wavelength feature point set to obtain matched feature point pairs, and affine transformation is performed on the matched feature point pairs to obtain geometric transformation matrices;
[0016] Based on the geometric transformation matrix, the first wavelength image and the second wavelength image are resampled by bicubic interpolation to obtain the first registration image and the second registration image.
[0017] In conjunction with the first aspect, in a third implementation of the first aspect of the present invention, the step of performing bicubic interpolation resampling on the first wavelength image and the second wavelength image according to the geometric transformation matrix to obtain a first registration image and a second registration image includes:
[0018] An output coordinate system is established and the pixel size of the registered image is determined. The geometric transformation matrix is used to perform an inverse transformation calculation on each pixel position in the output coordinate system to obtain the corresponding source coordinates in the first wavelength image and the second wavelength image, respectively.
[0019] Detect whether the source coordinates are non-integer positions. When the source coordinates are non-integer, determine the pixel neighborhood around the source coordinates in the first wavelength image and the second wavelength image, respectively.
[0020] Calculate the coordinate distance from each pixel in the pixel neighborhood to the source coordinates, and use a bicubic convolution kernel function to calculate the weight of the coordinate distance to obtain the interpolation weight coefficients;
[0021] The pixel gray values of the pixel neighborhood in the first wavelength image and the second wavelength image are weighted and summed with the interpolation weight coefficients to obtain the interpolated pixel values of the source coordinates. Based on the interpolated pixel values, resampling is performed to generate the first registration image and the second registration image, respectively.
[0022] In conjunction with the first aspect, in a fourth implementation of the first aspect of the present invention, the step of performing a scattering intensity difference operation on the first registered image and the second registered image to obtain a ridge enhancement feature map includes:
[0023] Extract the pixel intensity values of green light scattering in the first registered image to obtain a first intensity matrix, and extract the pixel intensity values of red light scattering in the second registered image to obtain a second intensity matrix;
[0024] A dual-wavelength contrast enhancement operation is performed based on the first intensity matrix and the second intensity matrix to obtain the contrast enhancement coefficient;
[0025] Based on the contrast enhancement coefficient, noise suppression and fusion are performed on the first registered image and the second registered image to obtain an enhanced image after noise suppression;
[0026] The mean and standard deviation of the enhanced image after noise suppression are calculated. Based on the mean and standard deviation, the pixel values are converted into a zero-mean unit variance distribution. Then, the pixel values are mapped to the standard dynamic range through histogram equalization to obtain the ridge enhancement feature map.
[0027] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present invention, the step of performing a dual-wavelength contrast enhancement operation based on the first intensity matrix and the second intensity matrix to obtain a contrast enhancement coefficient includes:
[0028] Spatial alignment verification is performed on the first intensity matrix and the second intensity matrix to ensure that pixels with the same coordinate position in the first intensity matrix and the second intensity matrix correspond to the same paper roll surface area, thus obtaining position-paired intensity data;
[0029] Based on the intensity data of the location pairing, the intensity difference between the first intensity matrix and the second intensity matrix is calculated pixel by pixel, and the intensity difference is squared to obtain the intensity difference square matrix.
[0030] The intensity sum between the first intensity matrix and the second intensity matrix is calculated pixel by pixel based on the intensity data of the location pairing, and the intensity sum is squared to obtain the intensity sum square matrix;
[0031] Divide each element of the first matrix in the intensity difference square matrix by the corresponding element of the second matrix in the intensity sum square matrix to obtain the contrast enhancement coefficient.
[0032] In conjunction with the first aspect, in the sixth implementation of the first aspect of the present invention, the step of performing cross-attention recognition on the ridge enhancement feature map to obtain the ridge position mask and height prediction results includes:
[0033] The enhanced feature map of the ridge is input into the ResNet-50 backbone network for feature extraction. The ResNet-50 backbone network includes res2, res3, res4 and res5 layers.
[0034] The first feature map output from the res3 layer is input into the dual-wavelength feature cross-attention module, and the second feature map output from the res4 layer is input into the dual-wavelength feature cross-attention module for matrix multiplication to obtain the fused feature map.
[0035] Gradient-aware convolution and boundary localization are performed on the fused feature map to obtain a directionally enhanced ridge feature map;
[0036] The enhanced ridge feature map is input into the height regression branch and the binary segmentation branch respectively for dual-task parallel processing to obtain the height prediction result and the ridge position mask.
[0037] In conjunction with the first aspect, in the seventh implementation of the first aspect of the present invention, the step of performing gradient-aware convolution processing and boundary localization on the fused feature map to obtain a directionally enhanced ridge feature map includes:
[0038] The fused feature map is convolved with each directional convolution kernel in the multi-directional convolution kernel group to obtain gradient response maps in multiple different directions.
[0039] Second-order partial derivatives are calculated for multiple gradient response maps, and boundary change regions are identified in each gradient response map to obtain boundary localization results;
[0040] Based on the boundary localization results, the multiple gradient response maps are superimposed and merged to obtain a directionally enhanced ridge feature map.
[0041] In conjunction with the first aspect, in the eighth implementation of the first aspect of the present invention, the paper roll ridge strip detection method further includes:
[0042] Optical flow estimation is performed based on the ridge position mask and height prediction results of consecutive frames to solve the motion vector of each pixel. Then, geometric transformation correction is performed on the ridge position mask and height prediction results of the previous frame based on the motion vector to obtain ridge detection data.
[0043] The texture complexity index of the paper roll surface is calculated based on the ridge detection data, and a calibration threshold is obtained by linear interpolation based on the texture complexity index.
[0044] The ridge detection data is subjected to ridge identification according to the calibration threshold to obtain the ridge identification result;
[0045] Based on the ridge recognition results, the spatial coordinates, geometric dimensions, height values, and confidence scores of the ridges are standardized and encapsulated in JSON format, and a detection report is output.
[0046] A second aspect of the present invention provides a paper roll ridge strip detection system, the paper roll ridge strip detection system comprising:
[0047] An illumination module is used to illuminate the surface of a paper roll with a first laser to obtain a first wavelength image, and to alternately illuminate the surface of the paper roll with a second laser to obtain a second wavelength image;
[0048] A geometric registration module is used to perform geometric registration on the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image;
[0049] The scattering intensity difference operation module is used to perform scattering intensity difference operation on the first registered image and the second registered image to obtain the ridge enhancement feature map;
[0050] The cross-attention recognition module is used to perform cross-attention recognition on the ridge enhancement feature map to obtain the ridge position mask and height prediction results.
[0051] Compared with existing technologies, this invention has the following advantages: It employs a dual-wavelength imaging system that alternately projects a 532nm green laser and a 650nm red laser, fully utilizing the scattering differences generated by different wavelengths on the paper surface. Compared to existing single-wavelength detection technologies, this significantly enhances the contrast of minute ridges, effectively solving the problem of insufficient sensitivity to minute height changes in traditional methods. Through sub-pixel-level image registration and combined with the dual-wavelength contrast enhancement formula for scattering intensity difference calculation, the influence of the spatial position difference between the two lasers can be accurately eliminated, ensuring accurate fusion of dual-wavelength information. The constructed ResNet-50 backbone network, combined with a dual-wavelength feature cross-attention module, can automatically learn the correlation between 532nm and 650nm wavelength features, exhibiting stronger feature extraction and pattern recognition capabilities compared to traditional fixed algorithms, making it particularly suitable for detecting minute ridges against complex paper backgrounds. The use of learnable directional convolutional kernels can adaptively adjust the detection direction to cover the complete angular range from 0° to 360°, effectively solving the problem of insufficient recognition capability for gradient ridges in existing technologies and significantly improving the detection accuracy of ridges with different orientations. Simultaneously, a dual-task learning mechanism is implemented, combining height regression and location segmentation. The height regression branch provides precise quantification information, while the binary segmentation branch provides accurate location information. These two branches complement and constrain each other, resulting in higher detection accuracy and robustness compared to single-task methods. A spatiotemporal consistency constraint mechanism based on optical flow estimation utilizes temporal information between consecutive frames to eliminate false detections caused by noise or illumination variations, exhibiting better temporal continuity and stability compared to existing static detection methods. An adaptive threshold adjustment mechanism based on paper texture complexity indicators automatically optimizes detection parameters for different paper types, resolving the poor adaptability issue caused by fixed threshold settings in existing technologies. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] The structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0054] Figure 1This is a schematic flowchart of the paper roll ridge stripe detection method provided in an embodiment of the present invention;
[0055] Figure 2 This is a schematic block diagram of the paper roll ridge detection system provided in an embodiment of the present invention. Detailed Implementation
[0056] The technical solutions of the embodiments of the present 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 the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0058] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0059] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items, and all possible combinations, and includes such combinations. See also Figure 1 One embodiment of the paper roll ridge stripe detection method of the present invention includes:
[0060] Step 100: Irradiate the surface of the paper roll with a first laser to obtain a first wavelength image, and alternately irradiate the surface of the paper roll with a second laser to obtain a second wavelength image;
[0061] Specifically, a dual-wavelength image acquisition system with a synchronization mechanism is constructed. This system uses a CCD image sensor as its core, working in conjunction with a filter wheel driven by a stepper motor, dual lasers, and a timing controller to collaboratively complete the image acquisition process. During the hardware configuration phase, a high-speed CCD image sensor with a pixel resolution of at least 2048×1536 and a frame rate of at least 200 frames per second is selected to synchronously acquire images under high-frequency operating conditions of alternating laser illumination. A rotatable filter wheel is installed in front of the sensor, its rotation angle controlled by a stepper motor to ensure complete alignment of different filters with the sensor's imaging surface. The filter wheel contains two bandpass filters: a first bandpass filter with a center wavelength of 530-535 nm and an optical density greater than 4.0, used to filter reflected light signals from a 532 nm green laser; and a second bandpass filter with a center wavelength of 645-655 nm and an optical density also greater than 4.0, used to match reflected light signals from a 650 nm red laser. By configuring a timing controller, a linkage relationship is established between the laser and the filter wheel, enabling the first and second lasers to alternately emit laser pulses at a frequency of 100Hz, with each emission lasting less than 5 milliseconds. Simultaneously, the filter wheel is controlled to switch to the filter channel corresponding to the current laser, ensuring spectral matching during the imaging process. After the laser irradiation and filter switching actions are completed, the CCD image sensor is controlled to synchronously trigger the exposure operation. During the first laser irradiation phase, it captures image data passing through the first bandpass filter as the first wavelength image, and during the second laser irradiation phase, it captures image data passing through the second bandpass filter as the second wavelength image, achieving high-quality image acquisition of the same location on the paper roll surface under different wavelength conditions.
[0062] Step 200: Perform geometric registration on the first wavelength image and the second wavelength image to obtain the first registered image and the second registered image;
[0063] Specifically, corner detection algorithms are executed in the first and second wavelength images respectively to extract key local structures as stable feature points. The Harris corner detection method or an improved Shi-Tomasi algorithm is selected to improve robustness and anti-interference ability, constructing a first-wavelength feature point set and a second-wavelength feature point set. Feature point matching is performed between the two sets using descriptor-based matching methods such as SIFT or ORB. Candidate matching pairs are established using Euclidean distance metric, and robust filtering is performed using the RANSAC algorithm to eliminate mismatches, forming a set of matched feature point pairs. The geometric mapping relationship between the images is calculated based on the matched feature point pairs. A coordinate transformation matrix from the source image to the target image is established using an affine transformation model. The obtained geometric transformation matrix can describe the rotation, scaling, translation, and shearing relationships between the images. Based on the geometric transformation matrix, resampling operations are performed simultaneously on the first and second wavelength images to complete image alignment. A bicubic interpolation algorithm is used to perform grayscale interpolation and spatial mapping calculations on the original images, generating a first-registered image and a second-registered image respectively.
[0064] Step 300: Perform scattering intensity difference operation on the first registered image and the second registered image to obtain the ridge enhancement feature map;
[0065] Specifically, the pixel scattering intensity distribution generated by the 532 nm green laser is extracted from the first registered image to construct the corresponding first intensity matrix. Simultaneously, the pixel scattering intensity excited by the 650 nm red laser is extracted from the second registered image to form the second intensity matrix. These two matrices reflect the reflection characteristics of the paper roll surface under different wavelengths of laser illumination. Since green light wavelengths are more sensitive to surface structures, while red light wavelengths tend to respond more to internal tissue density, the difference in scattering intensity between the two can reveal the edge contours and depth variations of minute ridges. Based on the first and second intensity matrices, a dual-wavelength contrast enhancement operation is performed. A nonlinear operation is applied to each corresponding pixel point between the two intensity matrices according to the normalized difference enhancement formula, amplifying the difference and suppressing background intensity. The generated contrast enhancement coefficient spatially highlights the scattering variations in the ridge region. Using the contrast enhancement coefficient as a weighting factor, the original two registered images are weighted and fused. Local adaptive Gaussian filtering is then used to suppress noise in the fused image, reducing paper texture interference and system noise while preserving edge information, resulting in a pre-enhanced and noise-suppressed enhanced image. By statistically analyzing the pixel intensity distribution of the entire enhanced image, the mean and standard deviation of the entire image are calculated. Z-score normalization is then applied to normalize each pixel, converting the image into a standard normal distribution with zero mean and unit variance. This eliminates intensity shifts and contrast drift caused by variations in paper batches or lighting conditions. The normalized image is then input into a histogram equalization function, performing non-linear mapping within a standard grayscale dynamic range of 0 to 255. This ensures that the grayscale values of the ridge regions in the enhanced image have higher visual saliency within the entire image, resulting in a ridge enhancement feature map.
[0066] Step 400: Perform cross-attention recognition on the ridge enhancement feature map to obtain the ridge location mask and height prediction results.
[0067] Specifically, the enhanced feature map of the ridge is input into a deep feature extraction network built with ResNet-50 as the backbone for layer-by-layer feature extraction. The ResNet-50 network structure contains four main residual modules: res2, res3, res4, and res5. Through multi-scale convolution operations, it extracts semantic information and structural features from different levels of the image. The first feature map output from the res3 layer contains mid-scale texture details at the spatial level, while the second feature map output from the res4 layer incorporates structural features from a larger receptive field. The first and second feature maps are simultaneously input into a dual-wavelength feature cross-attention module. This module, based on a self-attention mechanism, performs a linear transformation on the res3 layer feature map to generate a query matrix, and then generates a key-value matrix on the res4 layer feature map. Matrix multiplication is then used to construct a cross-layer correlation weight map, achieving deep fusion between the two scales of information. The dual-wavelength feature cross-attention module effectively enhances the perception of subtle ridge contours and texture differences, establishes spatial and channel coupling relationships between multi-wavelength features, and outputs a fused feature map. Gradient-aware convolution is applied to the fused feature map, introducing a learnable convolutional kernel with orientation selection capability. Combined with an orientation template within a preset angle range, directional convolution is performed on the fused feature map, simultaneously extracting gradient change patterns in different directions to enhance the contours of the ridges and locate the ridge undulation regions, outputting an orientation-enhanced ridge feature map. This orientation-enhanced ridge feature map is input into a height regression branch, where it undergoes dimensionality reduction through consecutive 1×1 convolutions and outputs a single-channel regression map to predict the actual height values of the ridges at each pixel location. The orientation-enhanced ridge feature map is then input into a U-Net-like binary segmentation branch, where it is restored to the original image size through an encoder-decoder structure and skip connections, combined with deconvolution operations, outputting a mask map annotating the ridge region locations.
[0068] In one specific embodiment, the process of performing step 100 may specifically include the following steps:
[0069] Configure the pixel resolution and frame rate of the CCD image sensor, and install a filter wheel driven by a stepper motor in front of the sensor, which includes a first bandpass filter for the first laser and a second bandpass filter for the second laser;
[0070] A timing controller is established to make the first laser and the second laser alternately project at a preset frequency, while simultaneously driving the filter wheel to switch to the corresponding first bandpass filter or second bandpass filter;
[0071] Based on a timing controller, the CCD image sensor is controlled to capture an image of the paper roll surface filtered by a first bandpass filter as a first wavelength image when the first laser illuminates it, and to capture an image of the paper roll surface filtered by a second bandpass filter as a second wavelength image when the second laser illuminates it.
[0072] Specifically, the CCD image sensor possesses sufficiently high pixel resolution and frame rate to meet the synchronous image acquisition requirements during high-speed alternating laser irradiation. An industrial-grade CCD chip with a pixel resolution of no less than 2048×1536 is selected, equipped with a high-speed acquisition capability of at least 200fps to cover the stable imaging window under the laser's 100Hz alternating frequency. A set of filter wheels driven by stepper motors is installed in front of the image sensor. The filter wheels rotate around a central axis, and each filter channel switch is achieved by subdivision-driven stepper motors. Two high-optical-density bandpass filters are embedded inside the filter wheels. The first bandpass filter has a center wavelength designed of 530 to 535 nanometers to filter the scattered signal from the 532-nanometer green laser, while the second bandpass filter has a center wavelength set of 645 to 655 nanometers, corresponding to the reflection response of the 650-nanometer red laser. Both have an optical density greater than 4.0 to effectively suppress ambient background light interference and ensure that only the scattered information of the target wavelength is retained in the image. The filter wheel structure needs to possess fast response and high repeatability, with its rotation speed and dwell time matching the laser's pulse projection period to prevent filter position drift or channel mismatch within the image acquisition window. A timing controller with high-precision timing coordination capabilities is constructed to coordinate the alternating projection operations between the first and second lasers, maintaining millisecond-level synchronization with the filter wheel's rotation and the CCD image sensor's exposure process. The timing controller drives the two lasers to work alternately at a preset frequency of 100Hz, with each laser's excitation window lasting 5ms. Within 100μs before the laser is activated, the timing controller initiates the filter wheel's rotation via a pulse signal and controls it to switch to the filter channel corresponding to the wavelength of the laser about to be excited. After the filter alignment is complete and stable, the controller sends a trigger signal to the CCD image sensor, causing it to enter the exposure state and acquire an image under the current laser illumination. During the first laser projection cycle, the image sensor acquires the reflected image of the paper roll surface after passing through the first bandpass filter, obtaining a first wavelength image. During the second laser projection cycle, the filter wheel switches to the second bandpass filter channel in response to the control signal, and triggers the image sensor again to capture the reflected image under red laser illumination, generating a second wavelength image. Throughout the entire cycle, the four actions of laser projection, filter wheel switching, CCD image sensor exposure and reading are controlled by the clock of the timing controller, ensuring no conflicts or overlaps on the timeline. Each image acquisition corresponds to the scattering response characteristics at a specific wavelength, avoiding image contamination caused by image aliasing or wavelength mismatch.
[0073] The process includes, based on a timing controller, controlling the CCD image sensor to capture images of the paper roll surface, followed by adaptive laser power adjustment to obtain a power-optimized dual-wavelength image. This involves: analyzing the paper surface reflectivity of the first and second wavelength images; establishing a paper material characteristic model by calculating the average brightness, dynamic range, and signal-to-noise ratio parameters of the images; determining the optimal laser power requirement range based on the paper material characteristic model; and optimizing the dual-wavelength power balance based on the power adjustment benchmark parameters. This is achieved by constructing a power ratio constraint function for 532nm green light and 650nm red light, and using the least squares method to solve for the power configuration that produces a balanced response intensity on the CCD sensor for the two wavelengths, thus obtaining the dual-wavelength power balance coefficient. A signal-to-noise ratio (SNR) maximization algorithm is implemented based on the dual-wavelength power balance coefficient. By adjusting the laser output power, the image signal intensity is maximized while the background noise is minimized. An objective function for SNR optimization is established, and the optimal power value is solved using the gradient descent method, yielding the SNR-optimized power parameters. These optimized power parameters are input into a power closed-loop control system for real-time adjustment. The actual laser output power is monitored by a power feedback sensor, and a PID control algorithm is used to dynamically adjust the power drive current, ensuring that the laser power remains stable within the optimal range, thus obtaining a stable power control signal. Based on the stable power control signal, the power of the first and second lasers is reset, the laser drive parameters are updated synchronously, and the paper roll surface image is re-acquired, resulting in a power-optimized dual-wavelength image.
[0074] In one specific embodiment, the process of performing step 200 may specifically include the following steps:
[0075] Feature points are extracted from the first wavelength image and the second wavelength image respectively to obtain the first wavelength feature point set and the second wavelength feature point set;
[0076] Feature point matching is performed based on the first wavelength feature point set and the second wavelength feature point set to obtain matched feature point pairs. Then, an affine transformation is performed on the matched feature point pairs to obtain the geometric transformation matrix.
[0077] Based on the geometric transformation matrix, the first wavelength image and the second wavelength image are resampled by bicubic interpolation to obtain the first registration image and the second registration image.
[0078] Specifically, image feature point extraction algorithms, such as Harris corner detection, SIFT (Scale Invariant Feature Transform), or ORB, are applied to the first and second wavelength images respectively to automatically extract corner points or scale-invariant keypoints generated in areas with significant local texture changes, maintaining high matching accuracy under different brightness, rotation, and scale conditions. The keypoints extracted from the first wavelength image constitute the first wavelength feature point set, while the keypoints from the second wavelength image constitute the second wavelength feature point set. Each set contains multi-dimensional attribute information such as spatial coordinates, response intensity, orientation information, and local descriptors for each feature point. Corresponding feature point matching processing is performed on the first and second wavelength feature point sets. During the matching operation, a brute-force matching algorithm based on feature descriptor distance or a fast nearest neighbor search algorithm is used. The similarity is determined by calculating the Euclidean distance or Hamming distance between descriptors, initially screening potential matching point pairs. The robustness of candidate matching point pairs is evaluated using the RANSAC (Random Sample Consensus) algorithm. RANSAC fits an affine model by repeatedly randomly sampling a minimum subset and calculates the number of interior points among all matching points to select the optimal set of consistent matching point pairs. Based on the matching point pairs, the six degrees of freedom parameters of the affine transformation model are solved, including geometric transformation factors such as horizontal and vertical scaling, rotation, shearing, and translation. This establishes a two-dimensional spatial mapping relationship from the source image to the target image, forming a geometric transformation matrix. According to the geometric transformation matrix, image resampling is performed on the first wavelength image and the second wavelength image to achieve image registration. Considering the requirements of image data continuity and smooth grayscale distribution, a bicubic interpolation algorithm is used as the image reconstruction method. Bicubic interpolation effectively avoids edge blurring and geometric distortion caused by the interpolation process by weighting the 16 points surrounding each image pixel in two-dimensional space. During the interpolation resampling process, the value of each target pixel is calculated by interpolating the neighboring pixels at the corresponding transformed coordinate position in the source image using a cubic polynomial function, thus preserving detail information to the greatest extent possible during image rotation, translation, or scaling. Through the combined action of the mapping relationship of the geometric transformation matrix and the bicubic interpolation algorithm, the first wavelength image and the second wavelength image are converted into the first registration image and the second registration image, respectively.
[0079] In one specific embodiment, the process of performing bicubic interpolation resampling on the first wavelength image and the second wavelength image according to the geometric transformation matrix to obtain the first registration image and the second registration image can specifically include the following steps:
[0080] An output coordinate system is established and the pixel size of the registered image is determined. Then, the inverse transformation of each pixel position in the output coordinate system is performed using a geometric transformation matrix to obtain the corresponding source coordinates in the first wavelength image and the second wavelength image, respectively.
[0081] Detect whether the source coordinates are non-integer positions. When the source coordinates are non-integer, determine the pixel neighborhood around the source coordinates in the first wavelength image and the second wavelength image, respectively.
[0082] Calculate the coordinate distance from each pixel in the pixel neighborhood to the source coordinates, and use a bicubic convolution kernel function to calculate the weight of the coordinate distance to obtain the interpolation weight coefficients;
[0083] The pixel gray values of the pixel neighborhood in the first wavelength image and the second wavelength image are weighted and summed with the interpolation weight coefficients to obtain the interpolated pixel values of the source coordinates. Based on the interpolated pixel values, resampling is performed to generate the first registration image and the second registration image, respectively.
[0084] Specifically, an output coordinate system is established in the target image space, and the spatial resolution and pixel size of the registered image under the output coordinate system are determined. The output coordinate system maintains the same size and distribution as the original image coordinate system to ensure image spatial consistency and avoid boundary expansion or information clipping introduced by interpolation. Based on the geometric transformation matrix, an inverse transformation operation is performed on the target position of each pixel in the output image, mapping the coordinates of each pixel in the output image back to the original first-wavelength image and second-wavelength image, obtaining the corresponding coordinate position of the output pixel in the source image. Since the geometric transformation matrix includes affine factors such as fractional scaling, rotation, and translation, the source coordinates after the inverse transformation usually do not fall on integer grid points, but rather on non-integer coordinate positions between image pixels. The source coordinates are checked to see if they are non-integer positions. When the source coordinates are non-integer, a pixel neighborhood region centered on the source coordinates is extracted in the first-wavelength image and the second-wavelength image, respectively. The neighborhood range is a 4×4 pixel grid, containing the 16 nearest integer pixels around the source coordinate point, and this is used as the basic dataset for interpolation calculations. In the interpolation process, a bicubic convolution kernel function is used to calculate the weights of the distances from each pixel in the neighborhood to the source coordinates. The bicubic interpolation function is a two-dimensional kernel function based on a piecewise cubic polynomial definition. It acts on the pixel distance in both the horizontal and vertical directions, and the two-dimensional interpolation coefficients are obtained by combining them. Its calculation process considers the non-linear relationship between distance changes and weights, causing the weights of pixels far from the source coordinates to decay rapidly, while the weights of pixels closer to the source coordinates to increase, thereby improving interpolation smoothness and edge restoration capabilities. The weight of each neighboring pixel is calculated by the convolution kernel function based on the horizontal and vertical differences between the neighboring pixel and the source coordinates, forming a weight coefficient matrix corresponding to the neighboring pixels. The gray values of the neighboring pixels extracted from the first wavelength image are weighted and summed with their corresponding interpolation weight coefficients. That is, each pixel value is multiplied by its corresponding weight coefficient and accumulated to obtain the interpolated gray value of the source coordinates in the first wavelength image. The same weighted summation operation is performed on the corresponding neighboring regions in the second wavelength image to obtain the interpolated gray value in the second wavelength image. The resampled gray values in the first wavelength image and the second wavelength image are filled in sequentially according to the size of the output image to generate the first registration image and the second registration image.
[0085] In one specific embodiment, the process of performing step 300 may specifically include the following steps:
[0086] Extract the pixel intensity values of green light scattering from the first registered image to obtain the first intensity matrix, and extract the pixel intensity values of red light scattering from the second registered image to obtain the second intensity matrix;
[0087] Dual-wavelength contrast enhancement calculations are performed based on the first intensity matrix and the second intensity matrix to obtain the contrast enhancement coefficients;
[0088] Based on the contrast enhancement coefficient, noise suppression and fusion are performed on the first and second registered images to obtain the enhanced image after noise suppression;
[0089] The mean and standard deviation of the enhanced image after noise suppression are calculated. Based on the mean and standard deviation of the whole image, the pixel values are converted into a zero-mean unit variance distribution. Then, the histogram equalization is used to map the pixel values to the standard dynamic range to obtain the ridge enhancement feature map.
[0090] Specifically, pixel scattering intensity values formed by 532 nm green laser irradiation are extracted from the first registered image and organized into a two-dimensional grayscale matrix, denoted as the first intensity matrix. Simultaneously, pixel grayscale intensity values under 650 nm red laser irradiation are extracted from the second registered image, constructing a second intensity matrix. These two matrices correspondingly reflect the reflection response characteristics of the same spatial location under two laser wavelengths. The first intensity matrix is more sensitive to microstructural changes on the paper surface, highlighting edge signals caused by minute height variations, while the second intensity matrix has stronger penetration stability for internal paper texture and density features, thus forming a basis for distinctly different dual-channel signals. Based on the first and second intensity matrices, dual-wavelength contrast enhancement operations are performed to improve the response amplitude of small ridge areas in the image and suppress background interference. The operation uses a normalized difference ratio, i.e., calculating the square of the intensity difference between the two wavelengths for each pixel location and dividing it by the square of the sum of the intensities, to obtain the contrast enhancement coefficient. The contrast enhancement coefficient is used as a weighting parameter in the fusion process of the first and second registered images. Before fusion, adaptive noise suppression is performed through local image analysis, using a Gaussian filter as the main smoothing algorithm. The filter kernel size is dynamically adjusted based on the local gradient information of the image: a 5×5 convolution kernel is used in flat areas of the image to enhance noise suppression, while a 3×3 convolution kernel is used in edge areas to preserve boundary information and detail variations. After noise suppression, the first and second registered images are fused by pixel-position weighting. Each fused pixel is formed by multiplying its intensity value in both images by the enhancement coefficient and then adding them together to construct the fused enhanced image. Statistical standardization and intensity normalization are performed on the fused enhanced image. The mean and standard deviation of the grayscale values of all pixels in the entire enhanced image are statistically calculated to obtain the overall brightness distribution parameters of the enhanced image. Z-score normalization is used, subtracting the image mean from the grayscale value of each pixel and dividing by the standard deviation, transforming the pixel distribution of the entire image into a standard normal distribution with a mean of zero and a standard deviation of one. Histogram equalization is performed on the standardized image to redistribute pixel gray-level frequencies, expanding the overall gray-level dynamic range of the image to between 0 and 255. This results in a more visually striking image with enhanced contrast and improved gray-level gradient response in areas of small ridges, thus constructing a ridge enhancement feature map.
[0091] The process involves calculating the mean and standard deviation of the enhanced image after noise suppression to obtain the ridge enhancement feature map. Following this, multi-scale feature pyramid enhancement is performed to obtain a multi-scale enhanced feature map. This includes: multi-resolution decomposition of the ridge enhancement feature map; constructing feature maps at four different scale levels using the Gaussian pyramid algorithm: original scale, 1 / 2 scale, 1 / 4 scale, and 1 / 8 scale; downsampling is performed on each level using a 5×5 Gaussian kernel to obtain a multi-resolution feature pyramid; inter-scale feature fusion is performed based on the multi-resolution feature pyramid; the Laplacian pyramid reconstruction algorithm is used to upsample the feature information from the low-resolution layer to the high-resolution layer; cross-scale feature transfer is achieved through bilinear interpolation and feature alignment operations to obtain a scale-fused feature sequence; and the scale-fused feature sequence is then processed. The algorithm performs feature consistency constraints on columns, establishes a feature similarity measurement function between scales, calculates the cosine similarity of feature vectors at corresponding positions in different scale layers, and uses the consistency loss function to constrain the spatial correspondence of multi-scale features, resulting in a consistency-constrained feature map. This consistency-constrained feature map is then input into a multi-scale attention aggregation module for weight allocation. By calculating the contribution of each scale layer to the ridge detection task, a softmax normalization algorithm is used to assign weight coefficients to different scales, followed by weighted fusion to obtain an attention-weighted feature map. Finally, based on the attention-weighted feature map, the algorithm performs final feature optimization. Residual connections combine the original ridge enhancement feature map with multi-scale enhancement information, and 1×1 convolutions are used to adjust feature dimensions and refine features, resulting in a multi-scale enhancement feature map.
[0092] In one specific embodiment, the process of performing dual-wavelength contrast enhancement calculations based on the first intensity matrix and the second intensity matrix to obtain the contrast enhancement coefficients can specifically include the following steps:
[0093] Spatial alignment verification is performed on the first intensity matrix and the second intensity matrix to ensure that pixels with the same coordinate position in the first intensity matrix and the second intensity matrix correspond to the same paper roll surface area, thus obtaining position-paired intensity data;
[0094] Based on the intensity data of location pairing, the intensity difference between the first intensity matrix and the second intensity matrix is calculated pixel by pixel, and the intensity difference is squared to obtain the intensity difference square matrix.
[0095] The intensity sum between the first intensity matrix and the second intensity matrix is calculated pixel by pixel based on the intensity data of the position pairing, and the intensity sum is squared to obtain the intensity sum square matrix.
[0096] The contrast enhancement coefficient is obtained by dividing each element of the first matrix in the intensity difference square matrix by the corresponding element of the second matrix in the intensity sum square matrix.
[0097] Specifically, spatial alignment verification is performed on the first and second intensity matrices. The spatial positions of each pixel in both matrices are compared one by one to ensure that pixels at the same coordinates in the first and second intensity matrices correspond to the same area on the paper roll surface, resulting in position-paired intensity data. Pixel-by-pixel calculations are then performed on the paired data. For each pixel coordinate, the grayscale intensity difference between the first and second intensity matrices is calculated, reflecting the different responses of the two wavelengths to the same area and highlighting the differences in surface height and internal fiber structure of the micro-ridges. Each intensity difference is squared to form a squared intensity difference matrix. Based on the position-paired intensity data, the sum of the intensities of the first and second intensity matrices is calculated pixel-by-pixel. This sum represents the overall brightness superposition level under the two wavelengths, reflecting the overall optical reflectivity of the paper under two wavelength laser illuminations. The sum of the intensities is squared pixel-by-pixel to generate a squared intensity sum matrix. Each element in the squared intensity difference matrix is divided by the element in the squared intensity sum matrix at the corresponding position, completing the normalized difference ratio calculation and obtaining the contrast enhancement coefficient matrix.
[0098] In one specific embodiment, the process of performing step 400 may specifically include the following steps:
[0099] The ridge enhancement feature map is input into the ResNet-50 backbone network for feature extraction. The ResNet-50 backbone network includes res2, res3, res4 and res5 layers.
[0100] The first feature map output from res3 layer is input into the dual-wavelength feature cross-attention module, and the second feature map output from res4 layer is input into the dual-wavelength feature cross-attention module for matrix multiplication to obtain the fused feature map.
[0101] Gradient-aware convolution and boundary localization are performed on the fused feature map to obtain a ridge feature map with enhanced orientation;
[0102] The directionally enhanced ridge feature map is input into the height regression branch and the binary segmentation branch respectively for parallel processing of dual tasks to obtain the height prediction result and the ridge position mask.
[0103] Specifically, the enhanced feature map of ridges is input into a deep convolutional neural network with ResNet-50 as the backbone to perform multi-layer feature extraction. The ResNet-50 architecture includes four main residual modules: res2, res3, res4, and res5. The res2 layer mainly extracts low-level texture and edge features, capturing subtle texture undulations on the paper surface; the res3 layer gradually increases the receptive field, and the output first feature map contains both local details and mesoscale structural information; the res4 layer models the spatial context over a larger area, extracting global structural distributions across regions, and its output second feature map contains higher-level semantic information and structural patterns; the res5 layer further integrates deep-level abstract features. The first feature map output from the res3 layer and the second feature map output from the res4 layer are input into a dual-wavelength feature cross-attention module. The dual-wavelength feature cross-attention module establishes correlation weight relationships between features of different wavelengths and different levels through an attention mechanism, thereby strengthening the feature combination related to ridge detection. A linear transformation is performed on the res3 layer features to generate a query matrix, while key and value matrices are generated on the res4 layer features. The correlation distribution between the query and key is calculated using matrix multiplication, and a weighted summation is performed on the value matrix to obtain a fused feature map. Gradient-aware convolution is then applied to the fused feature map. This gradient-aware convolution layer adaptively adjusts the response mode of the convolution kernel based on the local gradient direction of the input features, thereby enhancing edge variations in different directions. Gradient-aware convolution considers the spatial distribution of pixel intensity and combines the features of the second derivative operator to obtain local grayscale change trends, thus producing a significant response when encountering highly directional ridge edges. Simultaneously, combined with the boundary localization module, the direction enhancement and boundary-sensitive operator work together to obtain a direction-enhanced ridge feature map that is prominent in different directions and has clear edge contours. The direction-enhanced ridge feature map is input in parallel into two task branches to achieve a dual-task learning framework. The height regression branch adopts a fully convolutional structure. Through layer-by-layer convolution and gradual dimensionality reduction, it transforms the orientation enhancement feature map into a single-channel height prediction map, outputting the height estimate of the ridge corresponding to each pixel position, thereby achieving a quantitative characterization of the minute undulations on the paper roll surface. The binary segmentation branch is based on the encoder-decoder structure of U-Net. Combining upsampling and skip connection strategies, it gradually restores the deep features to the same resolution as the input image, outputting a binary mask map that marks the location and boundary range of the ridge region.
[0104] In one specific embodiment, the process of performing gradient-aware convolution processing and boundary localization on the fused feature map to obtain an oriented enhanced ridge feature map can specifically include the following steps:
[0105] The fused feature map is convolved with each directional convolution kernel in the multi-directional convolution kernel group to obtain gradient response maps in multiple different directions;
[0106] Second-order partial derivatives are calculated for multiple gradient response maps, and boundary change regions are identified in each gradient response map to obtain boundary localization results;
[0107] Based on the boundary localization results, multiple gradient response maps are superimposed and merged to obtain a directionally enhanced ridge feature map.
[0108] Specifically, directional convolution processing is performed on the fused feature map. A convolution kernel group containing multiple directional kernels is constructed, covering several representative directional angles from 0° to 180°, such as 0°, 45°, 90°, and 135°. The fused feature map is then convolved sequentially with each of the multiple directional kernels. The convolution process extracts local variation features in the corresponding direction by calculating the weighted sum of local neighboring pixels and the kernel weights in the spatial domain, generating multiple gradient response maps in different directions. Each gradient response map reflects the local grayscale changes of the fused feature map in a specific direction. When a ridge has obvious edge or contour features in a certain direction, the grayscale value of the corresponding area in the response map will be enhanced, while areas inconsistent with that direction will maintain a weaker response, thus achieving the differentiation of directional features. Second-order partial derivatives are calculated for each of the multiple gradient response maps to enhance boundary detection capabilities and extract clearer ridge boundary information. By calculating the second-order transformations of the image in the x and y directions to characterize the local curvature and intensity variation trends, significant zero-crossing or high-amplitude responses can be formed in boundary regions, thus enabling edge location capture. For each gradient response map, its second-order derivatives in the horizontal and vertical directions are calculated pixel-by-pixel, and combined with the Laplacian operator or other higher-order operators to obtain the overall second-order transformation result. By thresholding the second-order results, regions with drastic changes representing potential boundaries in the gradient response map are effectively identified, obtaining the boundary localization result corresponding to the gradient response map in each direction. Based on the boundary localization in each direction, the detection results in multiple directions are integrated to obtain a directionally enhanced ridge feature map. The gradient response maps in all directions are superimposed and merged according to the boundary localization results. Each direction's response map is assigned a higher weight in the boundary region and a lower or zero weight in the non-boundary region, highlighting boundary features and suppressing background interference. The weighted response maps in all directions are superimposed pixel-by-pixel, that is, the effective responses from convolutional kernels in different directions are accumulated at the same spatial location to obtain the fused comprehensive image.
[0109] Before inputting the directionally enhanced ridge feature map into the height regression branch and the binary segmentation branch for parallel dual-task processing, the process includes dynamic adaptive adjustment of attention weights to obtain a weight-optimized ridge feature map. This includes: evaluating the scene complexity of the directionally enhanced ridge feature map by calculating the gradient variance, texture complexity, and edge density indices of the feature map, establishing a scene complexity quantification model, and determining the attention weight allocation strategy based on the complexity level to obtain the scene complexity evaluation result; and dynamically allocating multi-head attention based on the scene complexity evaluation result, constructing a multi-head attention mechanism including spatial attention heads, channel attention heads, and temporal attention heads, dynamically adjusting the weight ratio of each attention head according to the scene complexity, and allocating computational resources through an attention head competition mechanism to obtain the multi-head attention. Weight distribution: Based on the multi-head attention weight distribution, a weight decay mechanism is implemented. A weight decay function based on importance scoring is established, and attention weights with low contribution are exponentially decayed while the attention response intensity in key regions is enhanced, resulting in attenuated attention weights. The attenuated attention weights are then input into the computational resource optimization allocation module. By analyzing the computational complexity and accuracy contribution of different attention heads, the Pareto optimization algorithm is used to find the optimal balance between computational efficiency and detection accuracy, resulting in a resource optimization allocation scheme. Based on the resource optimization allocation scheme, attention weights are applied to the directional enhancement ridge feature map. The optimized attention weights are multiplied element-wise with the feature map, and normalization is used to ensure the numerical stability of the feature map, resulting in a weight-optimized ridge feature map.
[0110] In one specific embodiment, the paper roll ridge detection method further includes the following steps:
[0111] Optical flow estimation is performed based on the ridge position mask and height prediction results of consecutive frames. The motion vector of each pixel is solved, and the geometric transformation correction is performed on the ridge position mask and height prediction results of the previous frame based on the motion vector to obtain ridge detection data.
[0112] The texture complexity index of the paper roll surface is calculated based on the ridge detection data, and a calibration threshold is obtained by linear interpolation based on the texture complexity index.
[0113] The ridge detection data are analyzed according to the calibration threshold to identify the ridges and obtain the ridge identification results.
[0114] Based on the ridge recognition results, the spatial coordinates, geometric dimensions, height values, and confidence scores of the ridges are standardized and encapsulated in JSON format, and a detection report is output.
[0115] Specifically, a temporal correlation is established based on the detection results of consecutive frames. Based on the ridge position mask and height prediction results of consecutive frames, an optical flow estimation algorithm is used to solve for pixel-level motion between consecutive frames. Optical flow estimation assumes that pixel brightness remains constant and only displacement occurs between adjacent frames; therefore, a two-dimensional motion vector is solved for each pixel by minimizing the sum of squared brightness differences. For example, the Lucas-Kanade method is used to fit pixel motion within a local window, and an image pyramid strategy is combined to refine it layer by layer, obtaining the motion vector distribution of each pixel in the entire image. Based on the motion vectors, the ridge position mask and height prediction map of the previous frame are geometrically transformed and corrected, mapping them to the spatial coordinate system of the current frame, ensuring spatial consistency of the ridge detection data between consecutive frames, forming temporally optimized ridge detection data. Based on the ridge detection data, the texture complexity of the paper roll surface is analyzed to adaptively adjust the detection sensitivity under different material conditions. The gray-level gradient of each pixel is calculated in the detection data, the standard deviation of the gradient distribution is statistically analyzed, and it is divided by the overall gray-level mean to obtain the texture complexity index. Different paper complexities require different detection thresholds to balance sensitivity and false alarm rate. A linear interpolation strategy is used to determine the calibration threshold based on the texture complexity index. When the texture complexity is close to that of smooth paper, the threshold automatically tends to be lower, detecting smaller ridges; conversely, when the texture complexity is higher, the threshold is increased accordingly to suppress noise interference caused by the paper's inherent texture. Ridge detection data is then identified according to the calibration threshold. The height prediction result of each pixel in the detection data is compared with the calibration threshold. When the height exceeds the threshold, the corresponding area is marked as a ridge region. Simultaneously, spatial clustering and boundary tracking are performed using a position mask to identify the complete outline of the ridge. Geometric dimensions of the identified ridge regions are measured, including region area, boundary length, and maximum and average height parameters, to construct the ridge recognition result. A confidence score is calculated, comprehensively considering the detection probability output by the network, the optical flow consistency verification result, and the noise estimate. These factors are weighted using a probabilistic model, assigning each ridge instance a confidence value between 0 and 1. The identified ridge information is encapsulated according to a unified data structure, and a standardized detection report is output. In this encapsulation structure, each ridge object contains several fields, including a location field recording the ridge's spatial coordinates in the image, a size field describing its width and length, a height field providing the predicted height value, a confidence score field providing the confidence score, and a time field indicating the time of detection. All ridge objects are organized sequentially in a result set to form a detection data file.
[0116] The process involves inputting the directionally enhanced ridge feature maps into both the height regression branch and the binary segmentation branch for parallel processing. It also includes multi-frame fusion optimization to obtain optimized ridge detection results. This includes: establishing a multi-frame temporal localization system to estimate the motion of the directionally enhanced ridge feature maps in consecutive frames; constructing a local coordinate system on the paper roll surface by calculating the feature point optical flow vectors and rotation transformation matrices between adjacent frames; establishing inter-frame correspondences using a feature matching algorithm to obtain a multi-frame temporal constraint model; performing system error correction based on the multi-frame temporal constraint model; calculating the laser projection angle deviation and CCD sensor position deviation by analyzing the feature drift of stable background regions in consecutive frames; establishing an error compensation function to geometrically correct the directionally enhanced ridge feature maps to obtain an error-corrected feature map sequence; and then performing the error-corrected feature map sequence... Three-dimensional ridge reconstruction is performed by projecting two-dimensional ridge features from different frames onto a three-dimensional spatial coordinate system using multi-view geometry principles. Triangulation algorithms are then used to calculate the spatial position and true height information of the ridges, yielding three-dimensional ridge point cloud data. A multi-frame temporal constraint model, an error-corrected feature map sequence, and a three-dimensional ridge point cloud data input factor map optimization framework are jointly optimized to construct a probabilistic graphical model containing single-frame detection factors, inter-frame motion factors, and three-dimensional reconstruction factors. Optimal ridge state parameters are solved using maximum a posteriori probability estimation to obtain globally consistent constraint results. Based on these globally consistent constraint results, local constraint information from single-frame detection is fused and corrected. A sliding window edge detection algorithm is used to retain keyframe constraint information and remove redundant historical data, combining local detection accuracy with global temporal consistency to obtain optimized ridge detection results.
[0117] The paper roll ridge stripe detection method in the embodiments of the present invention has been described above. The paper roll ridge stripe detection system in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 2 One embodiment of the paper roll ridge stripe detection system of the present invention includes:
[0118] Irradiation module 021 is used to irradiate the surface of the paper roll with a first laser to obtain a first wavelength image, and to alternately irradiate the surface of the paper roll with a second laser to obtain a second wavelength image;
[0119] Geometric registration module 022 is used to perform geometric registration on the first wavelength image and the second wavelength image to obtain the first registered image and the second registered image;
[0120] The scattering intensity difference operation module 023 is used to perform scattering intensity difference operation on the first registered image and the second registered image to obtain the ridge enhancement feature map;
[0121] The cross-attention recognition module 024 is used to perform cross-attention recognition on the ridge enhancement feature map to obtain the ridge position mask and height prediction results.
[0122] Through the synergistic collaboration of the aforementioned components, a dual-wavelength imaging system employing alternating projections of a 532nm green laser and a 650nm red laser fully leverages the scattering differences generated by different wavelengths on the paper surface. Compared to existing single-wavelength detection technologies, this significantly enhances the contrast of minute ridges, effectively addressing the insufficient sensitivity of traditional methods to minute height variations. Subpixel-level image registration is achieved through Harris corner detection, the RANSAC algorithm, and bicubic interpolation resampling. Combined with the dual-wavelength contrast enhancement formula for scattering intensity difference calculation, the influence of spatial position differences between the two lasers is precisely eliminated, ensuring accurate fusion of dual-wavelength information. The constructed ResNet-50 backbone network, combined with a dual-wavelength feature cross-attention module, automatically learns the correlation between 532nm and 650nm wavelength features. Compared to traditional fixed algorithms, it possesses stronger feature extraction and pattern recognition capabilities, making it particularly suitable for detecting minute ridges against complex paper backgrounds. The use of learnable directional convolutional kernels adaptively adjusts the detection direction to cover the complete angular range from 0° to 360°, effectively addressing the insufficient recognition capability of existing technologies for gradient ridges and significantly improving the detection accuracy of ridges with different orientations. Simultaneously, a dual-task learning mechanism is implemented, combining height regression and location segmentation. The height regression branch provides precise quantification information, while the binary segmentation branch provides accurate location information. These two branches complement and constrain each other, resulting in higher detection accuracy and robustness compared to single-task methods. A spatiotemporal consistency constraint mechanism based on optical flow estimation utilizes temporal information between consecutive frames to eliminate false detections caused by noise or illumination variations, exhibiting better temporal continuity and stability compared to existing static detection methods. An adaptive threshold adjustment mechanism based on paper texture complexity indicators automatically optimizes detection parameters for different paper types, resolving the poor adaptability issue caused by fixed threshold settings in existing technologies.
[0123] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0124] 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 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 an electronic device (which may be a personal computer, server, or network device, etc.) 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 USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0125] The above-described 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A paper roll end detection method characterized by comprising: include: The surface of the paper roll is irradiated with a first laser to obtain a first wavelength image, and the surface of the paper roll is alternately irradiated with a second laser to obtain a second wavelength image; Geometric registration is performed on the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image; Scattering intensity difference operation is performed on the first registered image and the second registered image to obtain the ridge enhancement feature map; The enhanced ridge feature map is subjected to cross-attention recognition to obtain the ridge location mask and height prediction results. Specifically, this includes: inputting the enhanced ridge feature map into a ResNet-50 backbone network for feature extraction, the ResNet-50 backbone network including res2, res3, res4 and res5 layers; inputting the first feature map output from the res3 layer into a dual-wavelength feature cross-attention module, and simultaneously inputting the second feature map output from the res4 layer into the dual-wavelength feature cross-attention module for matrix multiplication to obtain a fused feature map; performing convolution operations on the fused feature map with each directional convolution kernel in the multi-directional convolution kernel group to obtain multiple gradient response maps in different directions; calculating the second-order partial derivatives of the multiple gradient response maps and identifying the boundary change regions in each gradient response map to obtain boundary localization results; superimposing and merging the multiple gradient response maps according to the boundary localization results to obtain a directionally enhanced ridge feature map; inputting the directionally enhanced ridge feature map into a height regression branch and a binary segmentation branch for dual-task parallel processing to obtain the height prediction result and the ridge location mask.
2. The paper roll end detection method according to claim 1, characterized by The process of using a first laser to irradiate the surface of the paper roll to obtain a first wavelength image, and using a second laser to alternately irradiate the surface of the paper roll to obtain a second wavelength image, includes: Configure the pixel resolution and frame rate of the CCD image sensor, and install a filter wheel driven by a stepper motor in front of the sensor, which includes a first bandpass filter for the first laser and a second bandpass filter for the second laser; A timing controller is established to make the first laser and the second laser alternately project at a preset frequency, while driving the filter wheel to switch to the corresponding first bandpass filter or second bandpass filter. Based on the timing controller, the CCD image sensor is controlled to capture a paper roll surface image filtered by the first bandpass filter as a first wavelength image when the first laser illuminates it, and to capture a paper roll surface image filtered by the second bandpass filter as a second wavelength image when the second laser illuminates it.
3. The paper roll end detection method according to claim 1, characterized by, The geometric registration of the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image includes: Feature points are extracted from the first wavelength image and the second wavelength image respectively to obtain the first wavelength feature point set and the second wavelength feature point set; Feature point matching is performed based on the first wavelength feature point set and the second wavelength feature point set to obtain matched feature point pairs, and affine transformation is performed on the matched feature point pairs to obtain geometric transformation matrices; Based on the geometric transformation matrix, the first wavelength image and the second wavelength image are resampled by bicubic interpolation to obtain the first registration image and the second registration image.
4. The paper roll ridge stripe detection method according to claim 3, characterized in that, The step of performing bicubic interpolation resampling on the first wavelength image and the second wavelength image according to the geometric transformation matrix to obtain the first registration image and the second registration image includes: An output coordinate system is established and the pixel size of the registered image is determined. The geometric transformation matrix is used to perform an inverse transformation calculation on each pixel position in the output coordinate system to obtain the corresponding source coordinates in the first wavelength image and the second wavelength image, respectively. Detect whether the source coordinates are non-integer positions. When the source coordinates are non-integer, determine the pixel neighborhood around the source coordinates in the first wavelength image and the second wavelength image, respectively. Calculate the coordinate distance from each pixel in the pixel neighborhood to the source coordinates, and use a bicubic convolution kernel function to calculate the weight of the coordinate distance to obtain the interpolation weight coefficients; The pixel gray values of the pixel neighborhood in the first wavelength image and the second wavelength image are weighted and summed with the interpolation weight coefficients to obtain the interpolated pixel values of the source coordinates. Based on the interpolated pixel values, resampling is performed to generate the first registration image and the second registration image, respectively.
5. The paper roll ridge stripe detection method according to claim 4, characterized in that, The step of performing scattering intensity difference operation on the first registered image and the second registered image to obtain the ridge enhancement feature map includes: Extract the pixel intensity values of green light scattering in the first registered image to obtain a first intensity matrix, and extract the pixel intensity values of red light scattering in the second registered image to obtain a second intensity matrix; A dual-wavelength contrast enhancement operation is performed based on the first intensity matrix and the second intensity matrix to obtain the contrast enhancement coefficient; Based on the contrast enhancement coefficient, noise suppression and fusion are performed on the first registered image and the second registered image to obtain an enhanced image after noise suppression; The mean and standard deviation of the enhanced image after noise suppression are calculated. Based on the mean and standard deviation, the pixel values are converted into a zero-mean unit variance distribution. Then, the pixel values are mapped to the standard dynamic range through histogram equalization to obtain the ridge enhancement feature map.
6. The paper roll ridge stripe detection method according to claim 5, characterized in that, The step of performing dual-wavelength contrast enhancement calculation based on the first intensity matrix and the second intensity matrix to obtain contrast enhancement coefficients includes: Spatial alignment verification is performed on the first intensity matrix and the second intensity matrix to ensure that pixels with the same coordinate position in the first intensity matrix and the second intensity matrix correspond to the same paper roll surface area, thus obtaining position-paired intensity data; Based on the intensity data of the location pairing, the intensity difference between the first intensity matrix and the second intensity matrix is calculated pixel by pixel, and the intensity difference is squared to obtain the intensity difference square matrix. The intensity sum between the first intensity matrix and the second intensity matrix is calculated pixel by pixel based on the intensity data of the location pairing, and the intensity sum is squared to obtain the intensity sum square matrix; Divide each element of the first matrix in the intensity difference square matrix by the corresponding element of the second matrix in the intensity sum square matrix to obtain the contrast enhancement coefficient.
7. The paper roll ridge stripe detection method according to claim 1, characterized in that, The paper roll ridge detection method also includes: Optical flow estimation is performed based on the ridge position mask and height prediction results of consecutive frames to solve the motion vector of each pixel. Then, geometric transformation correction is performed on the ridge position mask and height prediction results of the previous frame based on the motion vector to obtain ridge detection data. The texture complexity index of the paper roll surface is calculated based on the ridge detection data, and a calibration threshold is obtained by linear interpolation based on the texture complexity index. The ridge detection data is subjected to ridge identification according to the calibration threshold to obtain the ridge identification result; Based on the ridge recognition results, the spatial coordinates, geometric dimensions, height values, and confidence scores of the ridges are standardized and encapsulated in JSON format, and a detection report is output.
8. A paper roll ridge stripe detection system, characterized in that, For performing the paper roll ridge detection method as described in any one of claims 1-7, the paper roll ridge detection system comprises: An illumination module is used to illuminate the surface of a paper roll with a first laser to obtain a first wavelength image, and to alternately illuminate the surface of the paper roll with a second laser to obtain a second wavelength image; A geometric registration module is used to perform geometric registration on the first wavelength image and the second wavelength image to obtain a first registered image and a second registered image; The scattering intensity difference operation module is used to perform scattering intensity difference operation on the first registered image and the second registered image to obtain the ridge enhancement feature map; The cross-attention recognition module is used to perform cross-attention recognition on the ridge enhancement feature map to obtain the ridge position mask and height prediction results.
Citation Information
Patent Citations
Dual laser web defect scanner
US6934029B1
