Bathroom towel rack pipe hole detection method based on image processing

By using an image processing-based method, combined with an industrial area array camera and adaptive threshold segmentation, the problems of low efficiency and poor accuracy in detecting tube holes in bathroom towel racks were solved, achieving high-precision multi-dimensional defect detection and report output.

CN120953218APending Publication Date: 2025-11-14JIANGXI AVONFLOW HVAC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511075558.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies for detecting the tube holes in bathroom towel racks are inefficient and inaccurate. Manual inspection is easily affected by subjective experience, and machine vision solutions have failed to effectively solve the problems of reflection interference and multi-dimensional defect detection.

Method used

An image processing-based approach is employed, including target image acquisition, preprocessing, borehole region localization and feature extraction, defect detection and classification. It utilizes an industrial area array camera and adaptive threshold segmentation, filtering and noise reduction, combined with ring light source and coaxial light source illumination, to achieve high-precision multi-dimensional defect detection.

Benefits of technology

It achieves efficient and accurate inspection of the tube holes of bathroom towel racks, eliminates light spot interference, comprehensively covers defects in size, shape and integrity, and outputs quantitative inspection reports to facilitate production optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953218A_ABST
    Figure CN120953218A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection, and discloses a bathroom towel rack pipe hole detection method based on image processing, and the method comprises the steps: 1, collecting a target image; step 2, preprocessing the target image; step 3, performing pipe hole area positioning and feature extraction on the bathroom towel rack; step 4, performing defect detection and classification on the pipe holes based on the step 3; step 5, outputting a defect detection report, superposing a marking frame on the original target image, and marking the position of a defect pipe hole and the defect category; through the step 3 and the step 4, self-adaptive threshold segmentation and feature extraction are facilitated, the light reflection characteristic of the bathroom towel rack is fully considered, light spot interference is effectively eliminated through filtering and denoising, meanwhile, edge details of a pipe hole area are reserved, the phenomenon that the edge of a pipe hole is fuzzy is prevented, and through multi-dimensional detection, the detection accuracy is improved. The three aspects of size, shape and integrity are integrated, and the comprehensive degree of pipe hole detection coverage is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, and more specifically to a method for detecting the tube holes of a bathroom towel rack based on image processing. Background Technology

[0002] As a common bathroom hardware component, towel racks, especially those with storage functions (such as those with mesh baskets or tiered designs), often include inlet and outlet valves for heating and drying. The machining precision of these pipe holes directly affects the sealing performance and usability of the product after welding and assembly. Traditional inspection methods rely on manual visual inspection or simple measuring tools, which have several drawbacks. For example, they are inefficient, requiring each pipe hole to be checked individually, which cannot meet the needs of large-scale production. They also have poor accuracy, as human judgment is influenced by subjective experience and is insufficient in identifying minor defects or dimensional deviations.

[0003] While there are machine vision-based inspection solutions in the existing technology, there are still some shortcomings in the existing technology due to the special characteristics of the tube holes of bathroom towel racks, such as small size, regular shape, and susceptibility to reflection interference: 1. The reflective characteristics of the surface material of bathroom towel racks are not considered, and light spot interference is prone to occur during the image acquisition stage, resulting in blurred edges of the tube holes; 2. There is a lack of comprehensive judgment on multi-dimensional defects of tube holes, resulting in insufficient detection coverage. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method for detecting the tube holes of a bathroom towel rack based on image processing, so as to solve the problems existing in the background art.

[0005] This invention provides the following technical solution: a method for detecting the pipe holes of a bathroom towel rack based on image processing, comprising the following steps: Step 1: Target Image Acquisition; Acquire the target image using an acquisition device; Step 2: Preprocess the target image; Step 3: Based on the preprocessed target image, locate and extract features of the pipe hole area of ​​the bathroom towel rack; Step 4: Based on Step 3, perform defect detection and classification on the pipe holes; Step 5: Output the defect detection report and overlay annotation boxes on the original target image to mark the location of the defective pipe hole and the defect category.

[0006] Preferably, the target image is the image of the bathroom towel rack tube that needs to be inspected for pipe holes; the acquisition device is an industrial area array camera, and the acquisition device is calibrated during the acquisition of the target image.

[0007] Preferably, the preprocessing includes grayscale conversion, filtering and denoising, and binarization segmentation; the defect detection includes size defect detection, shape defect detection, and integrity defect detection.

[0008] Preferably, the grayscale conversion specifically involves: The formula for converting the RGB image of the target image to a grayscale image is as follows: ; in, I represents the grayscale value of pixel (X, Y) in the target image I. R I represents the pixel value of the R channel in the RGB three-channel representation of the target image I. G I represents the pixel value of the G channel in the RGB three-channel representation of the target image I. B This represents the pixel value of the B channel in the RGB three-channel representation of the target image I.

[0009] Preferably, the filtering and denoising specifically includes: The pixels within the window are sorted in ascending order and represented as follows: If it exists make: and Then replace the center pixel with Otherwise, retain the original center pixel, where, ; This indicates a preset threshold.

[0010] Preferably, the binarization segmentation employs an adaptive thresholding method to convert the grayscale image into a binary image, i.e., the orifice region is white and the background region is black, specifically: Set the grayscale range of the target image to Obtain the inter-class variance: ; in, This represents the inter-class variance between the background region and the orifice region. This represents the probability of being a background region. This represents the probability of the orifice region. The average gray level of the background area. To determine the average gray level of the perforated area, select the appropriate value. The largest threshold T is used as the segmentation threshold, and a binary image is output. ; .

[0011] Preferably, the specific steps in step three for locating the pipe hole area of ​​the bathroom towel rack are as follows: For the output binary image Mark connected components and filter by area within the interval. The connected regions are marked as pipe regions; This represents the theoretical minimum area of ​​the pipe hole for a bathroom towel rack. This represents the theoretical maximum area of ​​the tubing in a bathroom towel rack.

[0012] Preferably, the feature extraction in step three specifically includes: Contour fitting optimization: Extract the contours of the marked connected regions and simplify the contour points; Geometric features are extracted from the simplified contour, including the diameter of the bore region, roundness, position coordinates of the contour points, and the average gray value inside the bore region.

[0013] Preferably, the diameter of the orifice region is expressed as: ; Where D represents the diameter of the orifice region, The minimum circumcircle radius of the profile; The circularity is expressed as: ; Where C represents the roundness, B represents the area of ​​the region formed by the simplified outline, and P represents the perimeter of the region formed by the simplified outline.

[0014] Preferably, the specific method of classification in step four is as follows: Different levels are set for the categories of defects in pipe holes, including Class I defects, Class II defects, and Class III defects; Based on the results of the borehole defect detection, the various results of the defect detection are correlated with the borehole defect categories; The defect detection report in step five includes the coordinates of the borehole location, the diameter and roundness of the borehole area, the defect judgment result, and the defect category. The location of the defective pipe hole can be marked using different colored annotation boxes.

[0015] The technical effects and advantages of this invention are as follows: This invention, through steps three and four, facilitates adaptive threshold segmentation and feature extraction, fully considering the reflective characteristics of bathroom towel racks. It also employs filtering and noise reduction to effectively eliminate light spot interference while preserving edge details in the pipe hole area, preventing blurring of the pipe hole edges. This allows for high-precision and high-efficiency acquisition of the target image. Furthermore, through multi-dimensional detection, it integrates size, shape, and integrity, covering all key quality indicators of bathroom towel rack pipe holes. This comprehensive assessment of multi-dimensional defects in the pipe holes improves the overall coverage of pipe hole detection. Finally, the output results are quantified into a detection report for quality analysis and process optimization during production. Attached Figure Description

[0016] Figure 1 This is a flowchart of the image processing-based method for detecting the pipe holes in a bathroom towel rack according to the present invention. Detailed Implementation

[0017] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. The image processing-based method for detecting the tube holes of a bathroom towel rack involved in the present invention is not limited to the structures described in the following embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] like Figure 1 As shown, the present invention provides a method for detecting the tube holes of a bathroom towel rack based on image processing, comprising the following steps: Step 1: Target Image Acquisition; Acquire the target image using an acquisition device; the target image is the image of the bathroom towel rack tubes to be inspected for pipe holes; the acquisition device is an industrial area array camera, which can be equipped with a telecentric lens. The industrial area array camera has a resolution greater than 20 million pixels and a pixel size greater than 3.5μm. The telecentric lens has a distortion rate of less than 0.05% to ensure that the pipe hole imaging is free of perspective distortion; During the target image acquisition process, a combination of ring light source and coaxial light source can be used for illumination. The ring light source is used to eliminate reflections at the edges of the pipe holes, and side lighting can be used to make the reflected light from the metal surface uniform. The coaxial light source is used to enhance the shadows inside the pipe holes and can distinguish between blocked and normal holes; During the target image acquisition process, the acquisition device can be calibrated; the purpose is to obtain a high-resolution, low-noise image containing all the pipe holes on the surface of the bathroom towel rack, providing clear input for subsequent processing; Step 2: Preprocess the target image; the preprocessing includes, but is not limited to, grayscale conversion, filtering and denoising, and binarization segmentation; the purpose is to eliminate image noise and enhance the contrast between the pore area and the background by preprocessing the target image, thus laying the foundation for feature extraction. Step 3: Based on the preprocessed target image, locate and extract the pipe hole area of ​​the bathroom towel rack; the purpose is to segment all pipe hole areas from the background area and extract their geometric features for subsequent defect judgment, laying the foundation for it. Step 4: Based on Step 3, perform defect detection and classification on the pipe holes; the defect detection includes, but is not limited to, dimensional defect detection, shape defect detection, and integrity defect detection; Step 5: Output the defect detection report and overlay annotation boxes on the original target image to mark the location of the defective pipe hole and the defect category.

[0019] In this embodiment, it should be specifically explained that the calibration of the acquisition device specifically involves: The camera's intrinsic and extrinsic parameters are calibrated using standard gauge blocks to establish a mapping relationship between pixel coordinates and actual physical coordinates. The formula is expressed as: ; in, This represents the focal length in the x-direction. This represents the focal length in the y-direction. This represents the coordinates of the principal point of the target image in the x-direction. The coordinates of the principal point in the y-direction of the target image can be obtained using the Zhang Zhengyou calibration method.

[0020] In this embodiment, it should be specifically explained that the grayscale conversion specifically refers to: The formula for converting the RGB image of the target image to a grayscale image is as follows: ; in, I represents the grayscale value of pixel (X, Y) in the target image I. R I represents the pixel value of the R channel in the RGB three-channel representation of the target image I. G I represents the pixel value of the G channel in the RGB three-channel representation of the target image I. B This represents the pixel value of the B channel in the RGB three-channel representation of the target image I; The filtering and denoising employs adaptive median filtering, dynamically adjusting the window size based on local noise density. Specifically: The pixels within the window are sorted in ascending order and represented as follows: If it exists make: and Then replace the center pixel with Otherwise, retain the original center pixel, where, ; This represents a preset threshold; in this embodiment, it is selected as... Its purpose is to effectively remove salt and pepper noise, such as reflected light spots caused by bathroom towel rack debris during the production process, through filtering and noise reduction, while preserving the details of the pipe hole edges. The binarization segmentation uses the Otsu adaptive thresholding method to convert the grayscale image into a binary image, where the pipe hole area is white and the background area is black. Specifically: Set the grayscale range of the target image to Obtain the inter-class variance: ; in, This represents the inter-class variance between the background region and the orifice region. This represents the probability of being a background region. This represents the probability of the orifice region. The average gray level of the background area. To determine the average gray level of the perforated area, select the appropriate value. The largest threshold T is used as the segmentation threshold, and a binary image is output. ; .

[0021] In this embodiment, it should be specifically explained that the positioning of the pipe hole area of ​​the bathroom towel rack in step three is as follows: For the output binary image Connected component labeling can be performed using a two-pass scanning method, filtering components whose areas lie within the interval. The connected areas are marked as pipe hole areas to facilitate the elimination of small noise areas such as dust and scratches; and Based on the pipe hole design specifications of the bathroom towel rack, This represents the theoretical minimum area of ​​the pipe hole for a bathroom towel rack. This refers to the theoretical maximum area of ​​the tube hole in a bathroom towel rack; the theoretical minimum area is the minimum area that can normally perform functions such as drying. If it is too small, it cannot meet the functional requirements and may be a small noise area such as dust or scratches, rather than a normal tube hole area. The theoretical maximum area is the maximum tube hole area that a bathroom towel rack can have. That is, the theoretical maximum area cannot exceed the area that the bathroom towel rack itself can be perforated, and it will not affect the normal drying function of the bathroom towel rack. The feature extraction specifically involves: Contour fitting optimization: Extract the contours of the marked connected regions and simplify the contour points. The contour point retention rate can be set to 95% to reduce the amount of computation. The OpenCV findContours function can be used for contour extraction, and the Douglas-Peucker algorithm is used to simplify the contour points, thereby achieving the purpose of optimizing the contour points. Geometric features are obtained: Features are extracted from the simplified contour, including the diameter of the bore region, the roundness, the position coordinates of the contour points, and the average gray value inside the bore region; the simplified contour is the contour composed of the simplified contour points, the diameter of the bore region is represented by the minimum circumscribed circle diameter of the contour points in the bore region, and the roundness is used to measure how close the simplified contour is to an ideal circle.

[0022] In this embodiment, it should be specifically noted that the diameter of the orifice region is expressed as: ; Where D represents the diameter of the orifice region, The minimum circumcircle radius of the profile; The circularity is expressed as: ; Where C represents the roundness, B represents the area of ​​the region formed by the simplified outline, and P represents the perimeter of the region formed by the simplified outline; The average gray value inside the orifice region is used to determine whether the orifice is blocked. When the orifice is blocked, the average gray value inside the orifice region is significantly higher than the average gray value of the background region.

[0023] In this embodiment, it should be specifically explained that the dimensional defect detection specifically refers to: Compare the diameter of the orifice region with the standard dimensional value; if If the value is 0, it is determined that "a dimensional defect exists"; otherwise, it is determined that "a dimensional defect does not exist". This indicates the maximum allowable error value. This indicates the standard dimensional value; in this case, it means that the difference between the diameter of the pipe hole area and the standard dimensional value exceeds the maximum allowable error value, i.e., it does not meet the production specifications. The shape defect detection specifically involves: Comparing roundness C with the standard shape value The standard values ​​were compared. For the perfect circle, the degree of roundness is... If the shape defect is found to be present, it is determined that a shape defect exists; otherwise, it is determined that a shape defect does not exist. This is expressed as shape error. satisfy In this embodiment, we select This indicates that the difference between the roundness of the tube hole area and the standard shape value exceeds the shape error, and there is a large degree of shape distortion. The integrity defect detection specifically refers to: If the mean gray value inside the pipe area satisfies If so, it is judged as "blockage", that is, there is an integrity defect; if If the condition is met, it is determined that "a gap exists," meaning there is an integrity defect; otherwise, it is determined that "no integrity defect exists." This represents the average gray value within the orifice region. This indicates the grayscale value corresponding to the material of the bathroom towel rack. This represents the theoretical perimeter of the region corresponding to P, which is determined by the diameter of the corresponding region.

[0024] In this embodiment, it should be specifically explained that the classification method in step four is as follows: Different levels are set for pipe hole defects, including Class I, Class II and Class III defects. Class I defects are negligible defects. If a Class I defect exists, the bathroom towel rack can be downgraded and used without rework or scrapping. Class II defects are defects that require rework. If a Class II defect exists, the bathroom towel rack needs to be reworked to improve the pipe hole area. Class III defects are defects that require scrapping, that is, the pipe hole area of ​​the bathroom towel rack affects the assembly and use performance of the bathroom towel rack and cannot be repaired by rework. Based on the results of the pipe hole defect detection, the various results of the defect detection are correlated with the pipe hole defect categories. Due to differences in assembly methods and performance, different bathroom towel racks will produce different corresponding results. Therefore, this embodiment does not limit the various results of defect detection and the corresponding pipe hole defect categories one by one. Those skilled in the art can make specific settings according to the actual assembly and performance of the bathroom towel rack.

[0025] In this embodiment, it should be specifically noted that the content of the defect detection report includes, but is not limited to, the coordinates of the pipe hole location, the diameter of the pipe hole area, the roundness, the defect judgment result, and the defect category; its purpose is to present the detection results in an intuitive way to facilitate production traceability. The location of the defective pipe hole can be marked using different colored boxes. For example, a red box can be used to mark the area of ​​the pipe hole with dimensional defects, and a yellow box can be used to mark the area of ​​the pipe hole with shape defects, so that the defects in the pipe hole area can be seen more intuitively.

[0026] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

[0027] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting the pipe holes of a bathroom towel rack based on image processing, characterized in that: Includes the following steps: Step 1: Target image acquisition; Acquire target images using acquisition devices; Step 2: Preprocess the target image; Step 3: Based on the preprocessed target image, locate and extract features of the pipe hole area of ​​the bathroom towel rack; Step 4: Based on Step 3, perform defect detection and classification on the pipe holes; Step 5: Output the defect detection report and overlay annotation boxes on the original target image to mark the location of the defective pipe hole and the defect category.

2. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 1, characterized in that: The target image is the image of the bathroom towel rack tube that needs to be inspected for pipe holes; the acquisition device is an industrial area array camera, and the acquisition device is calibrated during the acquisition of the target image.

3. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 2, characterized in that: The preprocessing includes grayscale conversion, filtering and denoising, and binarization segmentation; the defect detection includes size defect detection, shape defect detection, and integrity defect detection.

4. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 3, characterized in that: The grayscale conversion specifically refers to: The formula for converting the RGB image of the target image to a grayscale image is as follows: ; in, I represents the grayscale value of pixel (X, Y) in the target image I. R I represents the pixel value of the R channel in the RGB three-channel representation of the target image I. G I represents the pixel value of the G channel in the RGB three-channel representation of the target image I. B This represents the pixel value of the B channel in the RGB three-channel representation of the target image I.

5. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 4, characterized in that: The filtering and denoising specifically involves: The pixels within the window are sorted in ascending order and represented as follows: If it exists make: and Then replace the center pixel with Otherwise, retain the original center pixel, where, ; This indicates a preset threshold.

6. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 5, characterized in that: The binarization segmentation employs an adaptive thresholding method to convert the grayscale image into a binary image, where the orifice region is white and the background region is black. Specifically: Set the grayscale range of the target image to Obtain the inter-class variance: ; in, This represents the inter-class variance between the background region and the orifice region. This represents the probability of being a background region. This represents the probability of the orifice region. The average gray level of the background area. To determine the average gray level of the pipe area, select the appropriate value. The largest threshold T is used as the segmentation threshold, and a binary image is output. ; .

7. The method for detecting the pipe holes of a bathroom towel rack based on image processing according to claim 6, characterized in that: The specific steps for locating the pipe hole area of ​​the bathroom towel rack in step three are as follows: For the output binary image Mark connected components and filter by area within the interval. The connected regions are marked as pipe regions; This represents the theoretical minimum area of ​​the pipe hole for a bathroom towel rack. This represents the theoretical maximum area of ​​the tubing in a bathroom towel rack.

8. The method for detecting the pipe hole of a bathroom towel rack based on image processing according to claim 7, characterized in that: The feature extraction in step three specifically involves: Contour fitting optimization: Extract the contours of the marked connected regions and simplify the contour points; Geometric features are extracted from the simplified contour, including the diameter of the bore region, roundness, position coordinates of the contour points, and the average gray value inside the bore region.

9. The method for detecting the pipe hole of a bathroom towel rack based on image processing according to claim 8, characterized in that: The diameter of the orifice region is expressed as: ; Where D represents the diameter of the orifice region, The minimum circumcircle radius of the profile; The circularity is expressed as: ; Where C represents the roundness, B represents the area of ​​the region formed by the simplified outline, and P represents the perimeter of the region formed by the simplified outline.

10. The method for detecting the tube hole of a bathroom towel rack based on image processing according to claim 9, characterized in that: The specific classification method in step four is as follows: Different levels are set for the categories of defects in pipe holes, including Class I defects, Class II defects, and Class III defects; Based on the results of the borehole defect detection, the various results of the defect detection are correlated with the borehole defect categories; The defect detection report in step five includes the coordinates of the borehole location, the diameter and roundness of the borehole area, the defect judgment result, and the defect category. The location of the defective pipe hole can be marked using different colored annotation boxes.