A method and system for rapid extraction of rifling surface features using an improved LBP

By improving the LBP algorithm for rifling surface feature extraction, the problems of insufficient accuracy, low efficiency, and weak anti-interference ability in the existing technology are solved, realizing fast, accurate, and non-contact extraction of rifling surface features, which is suitable for field inspection needs.

CN122199554BActive Publication Date: 2026-07-17CHANGCHUN UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGCHUN UNIV OF SCI & TECH
Filing Date
2026-05-18
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing methods for extracting rifling surface features suffer from insufficient accuracy, low efficiency, weak anti-interference capabilities, and poor equipment adaptability and economy, making it difficult to meet the modern, high-precision, high-efficiency, and routine testing requirements.

Method used

An improved LBP algorithm is used for rifling surface feature extraction, including image preprocessing, texture feature extraction, region segmentation and localization. Combined with the Otsu threshold segmentation algorithm and double verification, the rifling surface feature is extracted quickly and accurately.

Benefits of technology

It improves the accuracy and efficiency of rifling surface feature extraction, reduces detection costs, adapts to the needs of rapid on-site detection, and provides reliable data support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122199554B_ABST
    Figure CN122199554B_ABST
Patent Text Reader

Abstract

This invention relates to a rapid extraction method and system for rifling surface features using an improved LBP (Low-Pressure Bearing) method, belonging to the field of rifling inspection technology. It addresses the problems of insufficient accuracy, low efficiency, and weak anti-interference capability in existing technologies for rifling surface feature extraction. The method includes: acquiring rifling images and performing quality verification; performing multi-step image preprocessing on the verified rifling images to obtain a standard grayscale image; extracting texture features using a circular LBP operator and uniform mode LBP, and performing rotation-invariant optimization to obtain an LBP texture image, then constructing an LBP global feature vector; segmenting and locating the rifling and non-rifling regions in the LBP texture image, and distinguishing between masted and oblique rifling; calculating rifling surface feature parameters; and finally outputting the results after double verification. This invention has the advantages of high extraction accuracy, strong anti-interference capability, high detection efficiency, low cost, and no secondary damage, and can be adapted to the needs of rapid on-site detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of rifling inspection technology, specifically relating to a method and system for rapid extraction of rifling surface features using an improved LBP. Background Technology

[0002] In rifling condition monitoring and maintenance, the accuracy, efficiency, and anti-interference capability of rifling surface feature extraction are closely related to core aspects such as rifling condition assessment, wear diagnosis, and maintenance decisions. While existing rifling surface feature extraction methods can achieve basic feature extraction, they still suffer from drawbacks in practical applications, including insufficient extraction accuracy, weak anti-interference capability, low extraction efficiency, and poor equipment compatibility. These shortcomings make it difficult to meet the demands of modern, high-precision, high-efficiency, and routine inspections, and are key factors restricting the upgrading of rifling condition monitoring technology. Currently, most widely used rifling surface feature extraction methods rely on traditional contact or conventional non-contact inspection techniques. Although they can achieve basic feature extraction, the following main problems still exist in actual rifling inspection processes:

[0003] 1. Insufficient feature extraction accuracy: When using existing extraction methods to extract rifling surface features, most methods adopt traditional texture extraction strategies or simple image recognition techniques, which cannot simultaneously take into account the local details and global features of the rifling spiral texture. Furthermore, they are sensitive to changes in lighting and image noise in the detection environment, resulting in incomplete feature representation, deviations in extraction accuracy, and an inability to accurately reflect the actual surface shape of the rifling.

[0004] 2. Low extraction efficiency: Even though some current extraction methods attempt to optimize the detection method, they do not perform efficient preprocessing of image data during feature extraction and do not use lightweight feature extraction algorithms, which significantly increases the complexity of feature calculation, resulting in a sharp drop in extraction efficiency and a longer time consumption, making it difficult to meet the needs of rapid on-site detection and batch detection.

[0005] 3. Weak anti-interference ability: In actual detection scenarios, there are interference factors such as gunpowder residue and surface stains inside the workpiece to be detected. Existing extraction methods have not designed targeted preprocessing and feature screening mechanisms for these interference factors, which can easily lead to interference in the feature extraction process, resulting in misjudgment and omission of features, and cannot adapt to complex detection environments.

[0006] 4. Poor equipment adaptability and economy: Existing non-contact extraction methods (such as laser scanning) are expensive and complex to operate, making them difficult to widely apply in field testing; although contact extraction methods are simple to use, they can cause secondary damage to the rifling and have extremely low detection efficiency, making them unsuitable for routine maintenance and difficult to achieve efficient and economical feature extraction. Summary of the Invention

[0007] To address the problems of insufficient accuracy, low efficiency, weak anti-interference ability, and high equipment compatibility and cost in existing technologies for rifling surface feature extraction, this invention provides a method and system for rapid extraction of rifling surface features using an improved Local Binary Pattern (LBP). This method can achieve efficient and accurate extraction of rifling surface features, providing data support for rifling performance assessment. This method first employs multi-step image preprocessing to perform grayscale conversion, noise reduction, contrast enhancement, and normalization on the quality-verified rifling image, eliminating environmental interference and standardizing image specifications. Then, an improved LBP (Layered Backpropagation) algorithm with rotational invariance optimization is used to extract features of the rifling spiral texture, resulting in an LBP texture image that captures local rifling texture. Simultaneously, an LBP global feature vector is constructed based on the LBP texture image to capture global features. Subsequently, the Otsu threshold segmentation algorithm is used to determine the optimal segmentation threshold, enabling segmentation and precise localization of the rifling region, and distinguishing between male and female rifling. Finally, rifling surface feature parameters such as width, depth, pitch, and wear are calculated, and double verification ensures the reliability of the extraction results. This method achieves rapid and accurate extraction of rifling surface features, reduces inspection costs, adapts to rapid on-site inspection needs, and provides data support for rifling maintenance and repair.

[0008] The technical solution adopted in this invention is as follows:

[0009] A fast extraction method for rifling surface features using an improved LBP is proposed, which includes the following steps:

[0010] Step 1: Acquire rifling images of the workpiece to be inspected using a non-contact image acquisition device, and perform quality verification on all acquired rifling images, simultaneously recording the axial and circumferential coordinates corresponding to the verified rifling images;

[0011] Step 2: Perform grayscale conversion, noise reduction, contrast enhancement, and normalization on the qualified rifling images in sequence to obtain the corresponding standard grayscale images;

[0012] Step 3: Use the circular LBP operator and uniform mode LBP to extract texture features from each of the standard grayscale images, and perform rotation invariance optimization to obtain the corresponding LBP texture image;

[0013] Based on the LBP texture image, the corresponding LBP feature histogram is statistically analyzed to construct the LBP global feature vector corresponding to each rifling image.

[0014] Step 4: Based on the LBP global feature vector, the Otsu threshold segmentation algorithm is used to determine the optimal segmentation threshold. The LBP texture image is binarized according to the optimal segmentation threshold to complete the segmentation of the rifling region and the non-rifling region. Contour detection and spatial localization are performed on the segmented rifling region, and the positive rifling and negative rifling in the rifling region are distinguished based on the mean difference of LBP encoding values ​​in the rifling region.

[0015] Step 5: Based on the located and differentiated rifling regions, calculate the rifling surface feature parameters, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear.

[0016] Step 6: Verify the calculated rifling surface feature parameters using both standard samples and manual measurements. Once the verification is successful, output the rifling surface feature parameter results.

[0017] Accordingly, this invention also proposes a rapid extraction system for rifling surface features using an improved LBP, the system comprising:

[0018] The image acquisition module is used to acquire rifling images of the workpiece to be inspected through a non-contact image acquisition device, and to perform quality verification on all acquired rifling images, and simultaneously record the axial and circumferential coordinates corresponding to the rifling images that pass the verification.

[0019] The image preprocessing module is used to perform grayscale conversion, noise reduction, contrast enhancement and normalization on the qualified rifling image in sequence to obtain the corresponding standard grayscale image.

[0020] The texture feature extraction module is used to extract texture features from each of the standard grayscale images using a circular LBP operator and uniform mode LBP, and to perform rotation invariance optimization to obtain the corresponding LBP texture image. Based on the LBP texture image, the module calculates the corresponding LBP feature histogram and constructs the LBP global feature vector corresponding to each rifling image.

[0021] The segmentation and localization module is used to determine the optimal segmentation threshold based on the LBP global feature vector using the Otsu threshold segmentation algorithm, perform binarization processing on the LBP texture image according to the optimal segmentation threshold, complete the segmentation of the rifling region and the non-rifling region, perform contour detection and spatial localization on the segmented rifling region, and distinguish between the positive rifling and the negative rifling in the rifling region based on the mean difference of LBP encoding values ​​in the rifling region.

[0022] The parameter calculation module is used to calculate the rifling surface feature parameters based on the located and differentiated rifling areas, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear.

[0023] The verification output module is used to perform dual verification of the calculated rifling surface feature parameters using standard samples and manual measurements. After the verification is successful, the rifling surface feature parameter results are output.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] (1) The present invention uses an improved LBP algorithm as a texture feature extraction algorithm. By optimizing the parameters of the circular LBP operator, combining uniform mode LBP and rotation invariance optimization, texture features are extracted, the feature dimension is greatly reduced, the extraction time is effectively shortened, and the detection efficiency is greatly improved compared with the traditional method. It can efficiently adapt to the needs of rapid on-site detection.

[0026] (2) This invention combines multi-step image preprocessing with circular LBP operator to eliminate image noise and lighting interference, adapt to the spiral texture characteristics of rifling, and combine Otsu threshold segmentation algorithm to segment the rifling area and non-rifling area, so as to achieve accurate positioning of the rifling area and effective differentiation of the positive and negative rifling. The feature parameter extraction error is controlled within the allowable range, the accuracy is significantly improved, and it can accurately reflect the actual surface shape of the rifling.

[0027] (3) This invention effectively suppresses Gaussian noise, random noise and uneven illumination interference introduced during image acquisition through multi-step image preprocessing; on this basis, uniform mode LBP is used for texture feature extraction. This mode only retains regular texture patterns with no more than two jumps, and classifies the messy and irregular texture patterns caused by gunpowder residue, surface stains, scratches, etc. into non-uniform modes and suppresses them, thereby filtering out interference information of non-rifling structures at the feature level, effectively improving anti-interference ability, and can stably adapt to complex on-site detection conditions;

[0028] (4) The present invention uses a non-contact image acquisition device, which not only does not need to contact the rifling surface, effectively avoiding secondary damage to the rifling caused by contact testing, but can also be used for routine and batch testing of rifling, significantly extending the service life of the rifling. Moreover, the equipment is low in cost and easy to operate, and image acquisition can be completed without professional personnel. It can be adapted to different types of rifling, without the need for complex debugging and optimization, and can be directly applied to field testing.

[0029] (5) The rifling surface feature parameters extracted by the present invention are comprehensive, covering width, depth, pitch and wear amount, which can fully reflect the rifling surface condition and wear status, providing reliable data support for rifling wear assessment, maintenance and repair and performance judgment, and solving the problem that the existing technology does not extract features comprehensively and cannot meet maintenance needs. Attached Figure Description

[0030] Figure 1This is an overall flowchart of the method for rapid extraction of rifling surface features based on improved LBP in an embodiment of the present invention;

[0031] Figure 2 This is a flowchart of rifling image acquisition in an embodiment of the present invention;

[0032] Figure 3 This is a flowchart of the rifling image preprocessing in an embodiment of the present invention;

[0033] Figure 4 This is a flowchart illustrating the extraction of rifling texture features using an improved LBP in an embodiment of the present invention;

[0034] Figure 5 This is a flowchart of the rifling region segmentation and positioning in an embodiment of the present invention;

[0035] Figure 6 This is a flowchart for calculating the rifling surface feature parameters in an embodiment of the present invention. Detailed Implementation

[0036] To more clearly illustrate the technical problems, technical solutions, and advantages of the present invention, a detailed description is provided below in conjunction with the accompanying drawings and specific embodiments.

[0037] This invention addresses the problems encountered in rifling surface feature extraction, such as high image noise interference, insufficient feature extraction accuracy, low extraction efficiency, weak anti-interference ability, high equipment cost, and easy secondary damage to the rifling. These issues lead to unreliable detection results, inability to meet the needs of rapid on-site inspection, and difficulty in supporting rifling maintenance decisions. The invention provides a rapid rifling surface feature extraction method using an improved LBP (Layered Texture Filter). This method achieves rapid, accurate, and non-contact extraction of rifling surface features through image acquisition and quality verification, multi-step image preprocessing, improved LBP texture feature extraction, rifling region segmentation and positioning, rifling surface feature parameter calculation, and dual verification output. This reduces inspection costs, adapts to on-site inspection needs, and provides reliable data support for rifling maintenance and repair.

[0038] like Figure 1 As shown, this embodiment provides a method for rapid extraction of rifling surface features using an improved LBP. This method mainly includes the following steps:

[0039] Step 1, Rifling Image Acquisition and Quality Verification: Acquire rifling images of the workpiece to be inspected using a non-contact image acquisition device, and perform quality verification on all acquired rifling images, simultaneously recording the axial and circumferential coordinates corresponding to the verified rifling images;

[0040] Step 2, Multi-step image preprocessing: The qualified rifling image is sequentially processed by grayscale conversion, noise reduction, contrast enhancement and normalization to obtain the corresponding standard grayscale image;

[0041] Step 3, Texture Feature Extraction: Use the circular LBP operator and uniform mode LBP to extract texture features from each standard grayscale image, and perform rotation invariance optimization to obtain the corresponding LBP texture image;

[0042] Based on LBP texture images, the corresponding LBP feature histograms are statistically analyzed to construct the LBP global feature vector for each rifling image.

[0043] Step 4, Segmentation and Localization: Based on the LBP global feature vector, the Otsu threshold segmentation algorithm is used to determine the optimal segmentation threshold. The LBP texture image is binarized according to the optimal segmentation threshold to complete the segmentation of the rifling region and the non-rifling region. Contour detection and spatial localization are performed on the segmented rifling region, and the positive rifling and negative rifling in the rifling region are distinguished based on the mean difference of LBP encoding values ​​in the rifling region.

[0044] Step 5, Parameter Calculation: Based on the located and differentiated rifling areas, calculate the rifling surface feature parameters, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear.

[0045] Step 6: Verification Output: The calculated rifling surface feature parameters are verified by both standard samples and manual measurements. Once the verification is successful, the rifling surface feature parameter results are output.

[0046] Specifically, such as Figure 2 As shown, the process of acquiring rifling images and performing quality verification in step 1 includes:

[0047] (1.1) Debugging of non-contact image acquisition device:

[0048] A non-contact image acquisition device is constructed by combining an industrial endoscope adapted to the inner diameter of the workpiece to be inspected with an industrial camera. The specific configuration and debugging operation are as follows: First, select an industrial endoscope probe adapted to the inner diameter of the workpiece to be inspected to avoid collision between the probe and the inner wall or rifling of the workpiece; then, pair it with a high-definition industrial camera and set the frame rate and exposure time appropriately, for example, set the frame rate to 20fps~60fps and adjust the exposure time to 5ms~20ms to avoid overexposure or underexposure that would cause image blurring; at the same time, adjust the brightness of the light source of the endoscope probe to a suitable brightness to ensure that the surface texture of the rifling is clearly visible without reflection or shadow interference, thus completing the debugging of the non-contact image acquisition device.

[0049] (1.2) Data Acquisition Path Planning:

[0050] The industrial endoscope probe uses a spiral advance method to plan the acquisition path. The specific process includes: slowly inserting the probe of the industrial endoscope from one end of the workpiece to be inspected at a preset fixed speed (e.g., 5mm / s~15mm / s) to avoid secondary damage caused by the probe colliding with the rifling surface; the acquisition path is along the axis of the workpiece to be inspected, and the industrial camera acquires and stores one frame of rifling image every time the probe advances a preset distance (e.g., 5mm~20mm). The acquisition range covers the entire rifling area of ​​the workpiece to be inspected, ensuring no area is missed, and completing the full-area image acquisition.

[0051] (1.3) Image acquisition and storage:

[0052] The non-contact image acquisition device is activated to simultaneously acquire rifling images. Image clarity is monitored in real-time during acquisition; if blurring, obstruction, or glare occurs, acquisition is immediately paused, and the probe position and angle are adjusted before re-acquiring. Acquired images are stored in JPG format, named in the format "Rifling Model-Date-Axial Coordinate (mm)-Circumferential Coordinate (°)" for easy subsequent traceability and processing. The axial coordinate uses the initial acquisition end face of the workpiece as the origin and represents the linear displacement distance of the industrial endoscope probe along the workpiece's axis. The circumferential coordinate uses the initial circumferential positioning position of the probe as the reference zero point and represents the circumferential rotation angle of the industrial endoscope probe around the workpiece's axis. Simultaneously, the axial and circumferential coordinates corresponding to each frame of the rifling image are recorded to provide a positional basis for subsequent rifling area positioning.

[0053] (1.4) Data Acquisition Quality Verification:

[0054] After acquisition, a comprehensive quality check is first performed on all acquired rifling images, removing unqualified images that are blurry, obscured, abnormally exposed, or severely reflective. The number and percentage of valid images (or qualified images) are then counted. Next, the percentage of valid images is checked to see if it meets a preset requirement, i.e., whether it is greater than or equal to a threshold. If it is, no further acquisition of the corresponding area is required, thus completing image acquisition and quality check. If it is less than the threshold, further acquisition of the corresponding area of ​​the unqualified images is required until the percentage of valid images meets the preset requirement.

[0055] After image acquisition and quality verification, step 1 finally yields a clear, complete, and unobstructed rifling image, providing high-quality data support for feature extraction in subsequent steps.

[0056] like Figure 3 As shown, the multi-step image preprocessing process in step 2 specifically includes:

[0057] (2.1) Image grayscale conversion:

[0058] The color rifling images obtained in step 1, which have passed verification, are converted into grayscale images using a weighted average method to reduce data volume and improve subsequent processing speed. The specific grayscale conversion process includes: using a weighted grayscale method commonly used in digital image processing, the color rifling images are converted into grayscale images. The weighting coefficients follow the characteristics of human vision, with R channel set to 0.299, G channel 0.587, and B channel 0.114. The grayscale calculation formula is: Gray = 0.299 × R + 0.587 × G + 0.114 × B, where Gray is the grayscale value, and R, G, and B are the red, green, and blue channel pixel values ​​of the color rifling image, respectively. The grayscale calculation formula is used to convert each color rifling image to grayscale, resulting in a grayscale image corresponding to each rifling image.

[0059] (2.2) Noise Removal:

[0060] A Gaussian filtering algorithm is used to denoise grayscale images to eliminate Gaussian and random noise. The specific denoising process includes: selecting a 3×3 Gaussian filter with a standard deviation σ=1.0; replacing the grayscale value of each pixel in the grayscale image with the weighted average of the grayscale values ​​of its 3×3 neighborhood pixels, with the weights calculated using a Gaussian function; and performing denoising on each pixel in the grayscale image to obtain a clean grayscale image free from noise interference, i.e., the denoised grayscale image.

[0061] (2.3) Contrast enhancement:

[0062] A histogram equalization algorithm is used to enhance the contrast of rifling texture in an image, highlighting the difference between the rifling and the background. The specific process of contrast enhancement includes: first, calculating the grayscale histogram of the denoised grayscale image and counting the number of pixels corresponding to each grayscale level (0-255); then calculating the cumulative histogram and normalizing it to the range of 0-255; finally, based on the normalized cumulative histogram, mapping and adjusting the grayscale value of each pixel to make the grayscale distribution more uniform and clearly present the concave and convex structures of the bullish rifling (raised part) and concave rifling (recessed part), thus completing the contrast enhancement and obtaining the enhanced grayscale image.

[0063] (2.4) Image normalization:

[0064] Bilinear interpolation is used to normalize the size of the enhanced grayscale image, and the grayscale values ​​are also normalized to unify image specifications. The specific normalization process includes: normalizing the image size of the enhanced grayscale image to ensure all images have uniform sizes and avoid size differences affecting the consistency of subsequent feature extraction; and using the formula: Normalized = (Gray - Gray_min) / (Gray_max - Gray_min), normalizing the image grayscale values ​​to the range of 0~1, where Gray_min is the minimum grayscale value of the enhanced image to be processed, Gray_max is the maximum grayscale value of the enhanced image to be processed, Gray is the original grayscale value of any pixel in the enhanced grayscale image to be processed, and Normalized is the dimensionless grayscale value of that pixel after normalization. This improves the convergence speed and extraction accuracy of subsequent algorithms, resulting in a normalized grayscale image, i.e., a standard grayscale image.

[0065] Step 2 involves multi-step image preprocessing of the rifling image, which eliminates image noise, enhances the contrast of rifling texture, and standardizes image specifications, thereby avoiding interference factors from affecting the accuracy of subsequent feature extraction.

[0066] like Figure 4 As shown, the texture feature extraction process in step 3 specifically includes:

[0067] (3.1) LBP operator parameter settings:

[0068] Considering the fineness of the spiral texture of the rifling, this embodiment employs a circular LBP operator with the following specific parameter configurations: A suitable sampling radius and number of sampling points are set; for example, the preset sampling radius is 2 pixels and the number of sampling points is 16, balancing feature extraction accuracy and processing speed. Uniform LBP is also used, meaning that a valid mode is defined as when the total number of transitions between 0 and 1 and between 1 and 0 in the LBP binary code does not exceed two; otherwise, it is classified as a non-uniform mode. Uniform LBP effectively reduces feature dimensions, ensuring improved extraction speed while preserving the rifling texture features.

[0069] (3.2) Calculation of local texture features:

[0070] For each standard grayscale image obtained in step 2, texture features are extracted using the circular LBP operator and uniform mode LBP. This involves traversing each pixel in the image and performing local texture feature calculations. The specific process includes: taking any pixel P in the standard grayscale image as the center pixel, selecting corresponding sampling points within the neighborhood of the center pixel according to the set sampling radius and number of sampling points; comparing the grayscale value of each sampling point with the grayscale value of the center pixel; marking a point as 1 if the grayscale value of the sampling point is greater than or equal to the grayscale value of the center pixel, and marking a point as 0 if the grayscale value of the sampling point is less than the grayscale value of the center pixel; obtaining the binary code (i.e., the original binary form of the LBP encoding value) corresponding to the center pixel after comparing all sampling points; converting this binary code to a decimal number, which is the LBP encoding value of pixel P; and traversing all pixels in the standard grayscale image for pixel P, calculating the LBP encoding value for all pixels to form the initial LBP texture image.

[0071] (3.3) Rotation invariance optimization:

[0072] Because the rifling is spirally distributed, the acquired rifling images may have rotational deviations. Therefore, this step also employs the LBP rotation-invariant mode (LBPROT) to optimize the rotation invariance of the initial LBP texture image. Specifically, the binary code of each pixel in the initial LBP texture image is cyclically rotated according to the bit width corresponding to the number of sampling points, with a step size of 1 bit. The minimum value among the decimal numbers corresponding to all rotated binary codes is taken as the final LBP code value for that pixel, resulting in the final LBP texture image. Rotation invariance optimization ensures that the extracted texture features are rotationally invariant, avoiding feature extraction deviations caused by image rotation and adapting to the spiral structure characteristics of the rifling.

[0073] (3.4) Constructing the global feature vector of LBP:

[0074] The LBP texture image obtained after rotation invariance optimization is divided into several equidistant sub-blocks. The LBP feature histogram of each sub-block is calculated, and the number of pixels corresponding to each effective LBP mode within the sub-block is counted. The total number of uniform modes is determined according to the Uniform LBP rule, and then non-uniform modes are uniformly classified to obtain a one-dimensional LBP feature vector for each sub-block. The LBP feature vectors of all sub-blocks are concatenated in spatial order to obtain a one-dimensional global LBP feature vector corresponding to the entire rifling image. The global LBP feature vector is used for quantization differentiation between the front and back rifling, and for subsequent comparison and verification of rifling surface feature parameters.

[0075] Step 3 utilizes an improved LBP algorithm for rifling texture feature extraction, which is adapted to the spiral texture characteristics of rifling and accurately captures both local and global rifling textures. Addressing the unique characteristics of the spiral rifling texture, the improved LBP algorithm in this invention optimizes the standard LBP algorithm in three aspects: First, it optimizes the sampling radius and number of sampling points of the circular LBP operator to better suit the fine texture scale of the rifling; second, it introduces a uniform mode LBP, which effectively filters out non-uniform noise textures caused by surface contaminants, gunpowder residue, etc., while reducing feature dimensionality; third, it adds rotation invariance optimization to eliminate image rotation deviations caused by the spiral structure of the rifling, significantly improving the robustness of feature extraction.

[0076] like Figure 5 As shown, the segmentation and localization process in step 4 specifically includes:

[0077] (4.1) Determination of the optimal segmentation threshold:

[0078] The Otsu thresholding algorithm is employed, using the LBP global feature vector as input. All valid LBP encoded values ​​covered by this vector are used as the segmentation threshold to be verified. The inter-class variance is calculated to obtain the optimal segmentation threshold for the rifling and non-rifling regions. This optimal segmentation threshold is then mapped to an LBP texture image corresponding one-to-one with the original image pixels, thereby achieving pixel-level rifling region localization and differentiation between bullish and bearish rifling. This approach avoids local noise interference through global feature constraints while ensuring pixel-level segmentation accuracy. The specific process for determining the optimal segmentation threshold includes: traversing all valid LBP encoded values ​​covered by the LBP global feature vector, using each valid LBP encoded value as the segmentation threshold to be verified, and calculating the inter-class variance corresponding to each segmentation threshold. The formula for calculating the inter-class variance is as follows:

[0079]

[0080] In the formula, The segmentation threshold to be verified; For LBP encoded values ​​less than or equal to the threshold The proportion of background pixels to the total number of pixels in the image; For LBP encoded values ​​greater than a threshold The proportion of pixels in the image to the total number of pixels (i.e., the proportion of foreground pixels), and satisfying the following conditions: + =1; The average LBP encoded value of the background pixels; The average LBP encoding value of the foreground pixels; This represents the global average LBP encoding value for the entire LBP texture image. .

[0081] The segmentation threshold with the largest inter-class variance is selected as the optimal segmentation threshold T, and the LBP texture image is divided into foreground (i.e. rifling region, with high LBP coding value and rich texture) and background (i.e. non-rifling region, with low LBP coding value and simple texture).

[0082] (4.2) Region segmentation:

[0083] The LBP texture image is binarized according to the optimal segmentation threshold T to obtain a binary image. In the binary image, the foreground region (i.e., the rifling region) is white with a pixel value of 255; the background region (i.e., the non-rifling region) is black with a pixel value of 0.

[0084] Next, morphological opening operations using 3×3 all-square structuring elements are used to denoise the binary image. First, an erosion operation is performed, followed by a dilation operation to remove isolated bright noise points in the binary image while avoiding deformation of the main rifling contour, resulting in a clear denoised binary image and completing the segmentation of the rifling region and non-rifling region.

[0085] (4.3) Rifling area positioning:

[0086] The Canny edge detection algorithm is used to perform contour detection on the denoised binary image. By setting reasonable high and low thresholds, the contours of all foreground regions are extracted.

[0087] Based on the spiral structure of the rifling, select profiles with continuous lengths that meet the requirements, eliminate scattered small profiles (or noise profiles), and determine the effective rifling area.

[0088] Simultaneously, by combining the acquisition position coordinates (including axial and circumferential coordinates) of the rifling image recorded in step 1, the axial and circumferential positions of the workpiece to be inspected corresponding to each rifling region are located, thus completing the precise positioning of the rifling region.

[0089] (4.4) Distinguishing between the front and back rifling:

[0090] The positive rifling is the machined, raised surface of the rifling, with a smooth surface, uniform texture, and small grayscale differences in the pixel neighborhood, thus corresponding to a lower LBP code value. The negative rifling is the recessed area of ​​the rifling, with a rougher surface, more complex texture, and larger grayscale differences in the pixel neighborhood, thus corresponding to a higher LBP code value. This step distinguishes between positive and negative rifling within the rifling region based on the distribution differences of LBP code values. The specific process includes: calculating the average LBP code value of each rifling sub-region (i.e., the arithmetic mean of the LBP code values ​​of all pixels in the region), and setting a discrimination threshold. Regions with an average LBP code value less than or equal to the discrimination threshold are identified as positive rifling, and regions with an average LBP code value greater than the discrimination threshold are identified as negative rifling, thereby completing the accurate distinction between positive and negative rifling and obtaining the located and distinguished rifling regions.

[0091] like Figure 6 As shown, the parameter calculation process in step 5 specifically includes:

[0092] (5.1) Pixel scale calibration:

[0093] Based on the calibration parameters of the non-contact image acquisition device in step 1, combined with the distance between the industrial endoscope probe and the inner wall of the workpiece to be inspected, and the camera focal length, a pixel scale is calibrated as the basis for converting pixel distance to actual distance, ensuring the accuracy of parameter calculation.

[0094] (5.2) Calculation of rifling width:

[0095] The actual widths of the bullish and worm grooves are calculated using a pixel distance conversion method. The specific process includes: selecting multiple evenly distributed measurement points in the area where the bullish rifling is located along a helical direction perpendicular to the rifling; measuring the pixel width of the bullish rifling at each measurement point and calculating the average value; and converting the pixel width using a pixel scale to obtain the actual width of the bullish rifling. Using the same method, corresponding measurement points are selected in the area where the worm groove is located, and the actual width of the worm groove is measured and converted to obtain the actual width, ensuring that the measurement error meets the preset accuracy requirements.

[0096] (5.3) Calculation of rifling depth:

[0097] The depth of the rifling groove (i.e., the vertical distance between the top of the rifling groove and the bottom of the rifling groove) is calculated using the gray value mapping method. The specific process includes: collecting the average gray value of the corresponding depth region using multiple sets of standard rifling samples with different standard depths; establishing a linear mapping relationship between the gray value difference and the actual depth using the least squares method, with a goodness of fit ≥ 0.99; calculating the average gray value of the bottom of the rifling groove and the top of the rifling groove respectively, obtaining the gray value difference, and substituting it into the mapping relationship to obtain the depth of the rifling groove, while ensuring that the measurement error meets the preset accuracy requirements.

[0098] (5.4) Calculation of rifling pitch:

[0099] By combining the coordinates of the acquisition position with the rifling profile, the rifling pitch (i.e., the axial distance of the workpiece to be tested corresponding to each revolution of the rifling helix) is calculated. The specific process includes: selecting several feature points on the male rifling profile, measuring the actual axial distance and circumferential rotation angle between the feature points, and calculating a single set of results according to the pitch definition; selecting multiple sets of different feature points to repeat the calculation, taking the average value of multiple sets as the final rifling pitch, and ensuring that the measurement error meets the preset accuracy requirements.

[0100] (5.5) Calculation of rifling wear:

[0101] A standard sample of unworn rifling is selected, and its surface feature parameters are extracted using the method of this invention as standard parameters. The surface feature parameters of the rifling extracted from the workpiece to be tested are compared with the standard parameters, and the difference is calculated as the rifling wear amount. The wear amount of the male rifling is equal to the standard male rifling width minus the calculated male rifling width, and the wear amount of the female rifling is equal to the standard female rifling depth minus the calculated female rifling depth. The calculation accuracy is ensured to meet the preset requirements.

[0102] This step, through precise calculation of core parameters such as the width of the rifling bore, the width of the rifling groove, the depth of the rifling groove, the rifling pitch, and the amount of rifling wear, can fully reflect the state and wear of the rifling surface.

[0103] To ensure the accuracy and reliability of the extracted rifling surface feature parameters and to provide intuitive and usable data support for rifling maintenance and repair, step 6 verifies the calculated rifling surface feature parameters using both standard samples and manual measurements. The specific process includes:

[0104] (6.1) Double verification:

[0105] The calculated rifling surface feature parameters are verified using a "double verification method," specifically including:

[0106] First verification: Compare the calculated rifling surface feature parameters with the parameters of the standard sample item by item;

[0107] Second verification: Randomly select some valid rifling images, extract their rifling surface feature parameters by manual measurement, and compare them with the parameters calculated by the method of the present invention;

[0108] When all deviations in the first verification result are within the preset allowable range, and the comparison accuracy of the second verification result meets the preset accuracy requirement, the verification is deemed qualified, and the process proceeds to the next result output step.

[0109] (6.2) Output of rifling surface feature parameters:

[0110] The verified rifling surface feature parameters are compiled and a feature extraction report is generated in the format of "rifling type-collection location-feature parameter". Simultaneously, LBP texture images, rifling region segmentation images, and feature parameter comparison tables are output and stored in a local database for easy subsequent querying, comparison, and analysis. Furthermore, the rifling surface feature parameter results can be transmitted to the rifling maintenance terminal in real time, providing maintenance personnel with intuitive rifling status data to support maintenance decisions.

[0111] The proposed method for rapid extraction of rifling surface features using an improved LBP algorithm first acquires rifling images using a non-contact image acquisition device, ensuring image quality through quality verification. Then, multi-step image preprocessing is used to eliminate interference and standardize specifications. Next, the improved LBP algorithm is employed to extract rifling texture features, adapting to spiral texture characteristics. Then, threshold segmentation and contour detection are used to locate the rifling region and distinguish between masted and oblique rifling. Subsequently, rifling surface feature parameters are accurately calculated, and double verification ensures the reliability of the results. Finally, a feature report and related images are output. This method effectively solves the problems of low accuracy, low efficiency, easy damage to rifling, and high cost associated with traditional extraction methods. It achieves rapid, accurate, and non-contact extraction of rifling surface features, with detection efficiency and accuracy meeting on-site inspection requirements, providing reliable data support for rifling maintenance and repair.

[0112] The invention will now be further explained with reference to specific examples.

[0113] When verifying the invention through examples, an image acquisition platform can be built using an industrial endoscope and an industrial camera, and an image processing and feature extraction program can be developed using the Python programming language to verify the method for rapid extraction of rifling surface features using the improved LBP.

[0114] Based on the established image acquisition and processing platform, the verification process proceeds as follows: First, a non-contact image acquisition device is set up, using a Yateks BIE series industrial endoscope (paired with an 8mm diameter direct-view probe, depth of field range 3mm~120mm) and a Hikvision MV-CA050-10GC. A 5-megapixel industrial area array camera was installed and debugged. The acquisition frame rate was set to 25fps, exposure time to 10ms, light source brightness to 800 lux, and probe insertion speed to 10mm / s. One frame of rifling image was acquired every 15mm of probe insertion, and the axial and circumferential coordinates of each frame were recorded simultaneously. After acquisition, the rifling images were quality checked, and blurry or reflective invalid images were removed, retaining only valid images. Next, the acquired valid images underwent grayscale conversion, Gaussian denoising, histogram equalization, and normalization preprocessing to obtain standard grayscale images. Then, an improved LBP algorithm was used to extract rifling texture features and construct an LBP global feature vector. Subsequently, Otsu threshold segmentation, morphological processing, and contour detection were used to locate the rifling region and distinguish between positive and negative rifling. Then, core parameters such as rifling width, depth, pitch, and wear were calculated. Finally, double verification was used to ensure the reliability of the extraction results, and a feature report and related images were output to verify the feasibility and effectiveness of the method.

[0115] The following analysis uses different types of rifling as examples to verify the adaptability and generalization ability of the present invention.

[0116] First, a complete non-contact image acquisition device was built, and the installation and debugging of industrial endoscopes and industrial cameras were completed. The probe specifications were adjusted according to the inner diameter of different workpieces to be inspected, and the appropriate acquisition parameters were set. Images of the rifling of three different diameters and different winding angles of the workpieces to be inspected were acquired, and a test sample set containing 480 sets of effective images was constructed. At the same time, traditional manual contact measurement and conventional Sobel operator edge detection methods were set as control groups.

[0117] Second, strictly follow the extraction method steps of this invention to complete image acquisition and quality verification, image preprocessing, improved LBP feature extraction, rifling region segmentation and positioning, parameter calculation, dual verification and output in sequence. For different types of workpieces to be tested, flexibly adjust the acquisition parameters and LBP operator parameters to ensure that the extraction process is adapted to the actual testing requirements.

[0118] Third, the experimental comparison results show that for all specifications of rifling samples, the deviations of the rifling surface feature parameter extraction results of the method of the present invention from the standard sample parameters and the manual measurement results are all within the preset allowable range. Among them, the maximum deviation of width is ≤0.01mm, the maximum deviation of depth is ≤0.005mm, the maximum deviation of pitch is ≤±0.03mm, the feature extraction accuracy is ≥99.2%, and the processing time of a single frame image is ≤150ms. Compared with the control group, the detection accuracy of the method of the present invention is improved by more than 40%, the detection efficiency is improved by more than 80%, and there is no risk of workpiece surface damage.

[0119] The control group used traditional manual contact measurement (accuracy 0.02mm, single workpiece inspection time 30min) and conventional Sobel operator edge detection method (feature extraction accuracy 92%, single frame image processing time 500ms); the detection accuracy improvement ratio of the present invention is calculated by the reduction rate of the maximum allowable deviation, and the detection efficiency improvement ratio is calculated by the reduction rate of the single workpiece inspection time.

[0120] Fourth, verification conclusion: The method of the present invention can be adapted to the rifling inspection requirements of different specifications and models, and has excellent adaptability and generalization ability. It solves the problems of low inspection efficiency, easy damage to workpieces and poor adaptability of traditional methods, and can meet the engineering application requirements of rapid, accurate and non-contact rifling inspection on site.

[0121] This invention provides a rapid extraction method for rifling surface features using an improved LBP (Low-Pressure Processing) technique, which is characterized by high accuracy, efficiency, strong anti-interference capabilities, and good equipment adaptability. On one hand, this method achieves accurate capture of local details and global features of rifling textures through optimized image preprocessing and improved LBP texture feature extraction, solving problems such as incomplete feature representation, insufficient extraction accuracy, and weak anti-interference, thus improving extraction accuracy and efficiency. On the other hand, it employs a low-cost, non-contact image acquisition device combining an industrial endoscope and an industrial camera, along with a lightweight feature calculation process, reducing detection costs and improving equipment adaptability. Simultaneously, it optimizes feature screening and verification mechanisms to ensure reliable extraction results, overcoming the technical bottleneck of rifling surface feature extraction and meeting the high-precision, high-efficiency, and routine detection requirements.

[0122] In another embodiment, a rapid extraction system for rifling surface features utilizing an improved LBP is provided, the system comprising:

[0123] The image acquisition module is used to acquire rifling images of the workpiece to be inspected through a non-contact image acquisition device, and to perform quality verification on all acquired rifling images, and simultaneously record the axial and circumferential coordinates corresponding to the rifling images that pass the verification.

[0124] The image preprocessing module is used to perform grayscale conversion, noise reduction, contrast enhancement and normalization on the qualified rifling image in sequence to obtain the corresponding standard grayscale image.

[0125] The texture feature extraction module is used to extract texture features from each standard grayscale image using a circular LBP operator and uniform mode LBP, and to perform rotation invariance optimization to obtain the corresponding LBP texture image. Based on the LBP texture image, the module calculates the corresponding LBP feature histogram and constructs the LBP global feature vector corresponding to each rifling image.

[0126] The segmentation and localization module is used to determine the optimal segmentation threshold based on the LBP global feature vector using the Otsu threshold segmentation algorithm, perform binarization processing on the LBP texture image according to the optimal segmentation threshold, complete the segmentation of the rifling region and the non-rifling region, perform contour detection and spatial localization on the segmented rifling region, and distinguish between the masculine rifling and the oblique rifling in the rifling region based on the mean difference of LBP encoding values ​​in the rifling region.

[0127] The parameter calculation module is used to calculate the rifling surface feature parameters based on the located and differentiated rifling areas, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear.

[0128] The verification output module is used to perform dual verification of the calculated rifling surface feature parameters using standard samples and manual measurements. Once the verification is successful, the rifling surface feature parameter results are output.

[0129] Specifically, the image acquisition module uses a non-contact image acquisition device, combining an industrial endoscope and an industrial camera, to acquire images of the rifling. The non-contact image acquisition device is adjusted and adapted to the inner diameter of the workpiece under inspection, and the camera resolution, frame rate, exposure time, and light source brightness are adjusted to ensure clear rifling texture. The industrial endoscope probe uses a spiral advance path to acquire images, controlling the insertion speed and acquiring images at fixed intervals to cover the entire rifling area. The acquired rifling images are stored and named according to specifications, and the acquisition coordinates (axial and circumferential coordinates) are recorded. After acquisition, the image acquisition module performs quality verification on the acquired rifling images, discarding blurry, obstructed, or abnormally exposed images to ensure a high proportion of valid images. Defective areas are supplemented with additional images to provide high-quality image data for subsequent feature extraction.

[0130] The image preprocessing module uses a weighted average method to convert the verified color rifling images into grayscale images to reduce data volume and improve processing efficiency. A 3×3 kernel Gaussian filtering algorithm is used to eliminate Gaussian and random noise in the image, and the standard deviation is adaptively adjusted according to the noise level. A histogram equalization algorithm is used to enhance the contrast of the rifling texture, highlighting the difference between the raised and recessed rifling. Finally, bilinear interpolation is used to normalize the image to a fixed size, while simultaneously normalizing the grayscale values ​​to the 0-1 range, unifying image specifications and avoiding the impact of size and grayscale differences on feature extraction consistency.

[0131] The texture feature extraction module, taking into account the spiral texture characteristics of rifling, selects a circular LBP operator, sets an appropriate sampling radius and number of sampling points, and employs a Uniform LBP mode to reduce feature dimensionality. It iterates through each pixel of the standard grayscale image, calculates the local LBP encoding value, and forms an initial LBP texture image. An LBP rotation-invariant mode is introduced for optimization to avoid feature deviations caused by image rotation. The optimized LBP texture image is divided into sub-blocks, and the feature histograms of each sub-block are calculated and concatenated to form a global LBP feature vector, comprehensively capturing both local details and global statistical features of the rifling texture.

[0132] The segmentation and localization module is used to accurately identify the effective rifling region. Based on the LBP global feature vector, the module automatically determines the optimal segmentation threshold using the Otsu thresholding algorithm, binarizes the LBP texture image, and distinguishes between rifling and non-rifling regions. Morphological opening operations are used to remove isolated bright noise points from the binary image while avoiding deformation of the main rifling contour. The Canny edge detection algorithm is used to extract the contour, and effective contours are selected based on the spiral structure of the rifling. The axial and circumferential positions of the rifling region are located using acquired coordinates. Finally, based on the difference in the mean LBP encoded values ​​and a set discrimination threshold, the module distinguishes between positive and negative rifling within the rifling region, achieving accurate classification of the two types of rifling.

[0133] The parameter calculation module calculates the width of the positive and negative rifling based on the pixel scale calibration results and uses the pixel distance conversion method; it establishes a linear mapping relationship between the grayscale difference and the actual depth through standard sample calibration to calculate the depth of the negative rifling; it calculates the rifling pitch and takes the average value by combining the collected position coordinates and the rifling profile to improve accuracy; and it calculates the rifling wear by comparing the parameters of the standard sample.

[0134] The verification output module employs a dual verification method to verify parameter accuracy. This dual verification method includes two stages: First, the calculated rifling surface feature parameters are compared item by item with those of a standard sample. Second, a subset of valid rifling images are randomly selected, and their rifling surface feature parameters are extracted manually and compared with those calculated by the parameter calculation module. When all deviations in the first verification result are within the preset allowable range, and the accuracy rate of the second verification result meets the preset accuracy requirements, the verification output module determines that the verification is successful. It then compiles and outputs the rifling surface feature parameter results, including the rifling surface feature parameters, a report, and related images, stores them, and transmits them to the maintenance terminal, thereby providing maintenance personnel with decision support for rifling maintenance.

[0135] It should be noted that the specific implementation methods of each module in the rapid extraction system for rifling surface features using the improved LBP provided in this embodiment correspond to the steps in the above method embodiments. Specifically, the image acquisition module performs step 1, the image preprocessing module performs step 2, the texture feature extraction module performs step 3, the segmentation and localization module performs step 4, the parameter calculation module performs step 5, and the verification output module performs step 6. The specific working principles, parameter settings, and preferred implementation methods of each module have been described in detail in the above method embodiments and will not be repeated here.

[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0137] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for rapid extraction of rifling surface features using an improved LBP (Low Pressure Plate) rifling, characterized in that... Includes the following steps: Step 1: Acquire rifling images of the workpiece to be inspected using a non-contact image acquisition device, and perform quality verification on all acquired rifling images, simultaneously recording the axial and circumferential coordinates corresponding to the verified rifling images; Step 2: Perform grayscale conversion, noise reduction, contrast enhancement, and normalization on the qualified rifling images in sequence to obtain the corresponding standard grayscale images; Step 3: Use the circular LBP operator and uniform mode LBP to extract texture features from each of the standard grayscale images, and perform rotation invariance optimization to obtain the corresponding LBP texture image; Based on the LBP texture image, the corresponding LBP feature histogram is statistically analyzed to construct the LBP global feature vector corresponding to each rifling image. Step 4: Based on the LBP global feature vector, the Otsu threshold segmentation algorithm is used to determine the optimal segmentation threshold. The LBP texture image is binarized according to the optimal segmentation threshold to complete the segmentation of the rifling region and the non-rifling region. Contour detection and spatial localization are performed on the segmented rifling region, and the positive rifling and negative rifling in the rifling region are distinguished based on the mean difference of LBP encoding values ​​in the rifling region. Step 5: Based on the located and differentiated rifling regions, calculate the rifling surface feature parameters, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear. Step 6: Verify the calculated rifling surface feature parameters using both standard samples and manual measurements. Once the verification is successful, output the rifling surface feature parameter results.

2. The method for rapid extraction of rifling surface features using an improved LBP according to claim 1, characterized in that, The process of quality verification for all acquired rifling images includes the following steps: Remove all unqualified images from the rifling images, including those that are blurry, obscured, abnormally exposed, or severely reflective, and then count the number and percentage of valid images. Determine if the proportion of valid images is greater than or equal to the threshold. If so, complete image acquisition and quality verification. Otherwise, supplement the acquisition of the corresponding areas of unqualified images until the proportion of valid images in all acquired rifling images is greater than or equal to the threshold.

3. The method for rapid extraction of rifling surface features using an improved LBP according to claim 1 or 2, characterized in that, The specific process of extracting texture features from each of the standard grayscale images using the circular LBP operator and uniform mode LBP includes: Using any pixel in the standard grayscale image as the center pixel, select the corresponding sampling points in its neighborhood according to the preset sampling radius and number of sampling points; The gray values ​​of all sampling points are compared one by one with the gray value of the center pixel. If the gray value of a sampling point is greater than or equal to the gray value of the center pixel, it is marked as 1; otherwise, it is marked as 0, and the corresponding binary code is obtained. Convert the binary code to a decimal number to obtain the LBP encoding value of the pixel; Traverse all pixels in the standard grayscale image, calculate the LBP encoding value of all pixels in the standard grayscale image, and form an initial LBP texture image.

4. The method for rapid extraction of rifling surface features using an improved LBP according to claim 3, characterized in that, The preset sampling radius of the circular LBP operator is 2 pixels, and the number of sampling points is 16.

5. The method for rapid extraction of rifling surface features using an improved LBP according to claim 1 or 2, characterized in that, The specific process of performing rotation-invariant optimization on the initial LBP texture image to obtain the LBP texture image includes: The binary code corresponding to each pixel in the initial LBP texture image is rotated cyclically with a step size of 1 bit according to the bit width corresponding to the number of sampling points. The minimum value of the decimal number corresponding to all the rotated binary codes is taken as the final LBP code value of the pixel, and the LBP texture image is finally obtained.

6. The method for rapid extraction of rifling surface features using an improved LBP according to claim 1 or 2, characterized in that, The process of binarizing the LBP texture image according to the optimal segmentation threshold to complete the segmentation of the rifling region and the non-rifling region includes: The LBP texture image is binarized according to the optimal segmentation threshold to obtain a binary image. In this binary image, the foreground region is the rifling region with a pixel value of 255, and the background region is the non-rifling region with a pixel value of 0. Morphological opening operations are used to denoise the binary image, removing noise points to obtain a denoised binary image, thus completing the segmentation of the rifling region and the non-rifling region.

7. The method for rapid extraction of rifling surface features using an improved LBP according to claim 6, characterized in that, The process of locating the rifling area includes: The Canny edge detection algorithm is used to perform contour detection on the denoised binary image and extract the contours of all foreground regions. Based on the spiral structure of the rifling, profiles with continuous lengths that meet the requirements are selected, scattered noise profiles are eliminated, and the effective rifling area is determined. By combining the axial and circumferential coordinates of the rifling image, the axial and circumferential positions of the workpiece to be inspected corresponding to each rifling region are located, thus completing the precise positioning of the rifling region.

8. The method for rapid extraction of rifling surface features using an improved LBP according to claim 1 or 2, characterized in that, The non-contact image acquisition device includes an industrial endoscope adapted to the inner diameter of the workpiece to be inspected and an industrial camera connected to the industrial endoscope. The probe of the industrial endoscope is inserted into the workpiece from one end in a spiral manner at a preset fixed speed. The acquisition path is along the axis of the workpiece. For every preset distance the probe advances, the industrial camera acquires and stores one frame of rifling image.

9. The method for rapid extraction of rifling surface features using an improved LBP according to claim 8, characterized in that, The fixed speed is 5mm / s to 15mm / s; the preset distance is 5mm to 20mm.

10. A rapid extraction system for rifling surface features using an improved LBP, characterized in that, include: The image acquisition module is used to acquire rifling images of the workpiece to be inspected through a non-contact image acquisition device, and to perform quality verification on all acquired rifling images, and simultaneously record the axial and circumferential coordinates corresponding to the rifling images that pass the verification. The image preprocessing module is used to perform grayscale conversion, noise reduction, contrast enhancement and normalization on the qualified rifling image in sequence to obtain the corresponding standard grayscale image. The texture feature extraction module is used to extract texture features from each of the standard grayscale images using a circular LBP operator and uniform mode LBP, and to perform rotation invariance optimization to obtain the corresponding LBP texture image. Based on the LBP texture image, the module calculates the corresponding LBP feature histogram and constructs the LBP global feature vector corresponding to each rifling image. The segmentation and localization module is used to determine the optimal segmentation threshold based on the LBP global feature vector using the Otsu threshold segmentation algorithm, perform binarization processing on the LBP texture image according to the optimal segmentation threshold, complete the segmentation of the rifling region and the non-rifling region, perform contour detection and spatial localization on the segmented rifling region, and distinguish between the positive rifling and the negative rifling in the rifling region based on the mean difference of LBP encoding values ​​in the rifling region. The parameter calculation module is used to calculate the rifling surface feature parameters based on the located and differentiated rifling areas, including the width of the male rifling, the width of the female rifling, the depth of the female rifling, the rifling pitch, and the amount of rifling wear. The verification output module is used to perform dual verification of the calculated rifling surface feature parameters using standard samples and manual measurements. After the verification is successful, the rifling surface feature parameter results are output.