An aluminum bar surface defect detection method and system based on image recognition

CN123015503APending Publication Date: 2026-10-30SHENZHEN JIAMEI ALUMINUM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611287405.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种基于图像识别的铝棒表面缺陷检测方法及系统,用于现有的检测方法存在暗区虚警和在亮区漏检的情况,导致对铝棒的表面进行缺陷检测的准确率低的问题

Benefits of technology

本发明通过获取铝棒圆柱面的铝棒表面图像和图像采集设备的图像采集参数,并得到反映铝棒圆柱面空间照度分布的亮度分布信息。随后,对亮度分布信息进行亮度分区处理,得到每个亮度分区的图像区域,并对这些区域进行像素优化处理,最终得到铝棒优化图像,用于缺陷检测。通过对图像进行精细化的亮度分区和针对性的像素优化,能够避免暗区虚警和亮区漏检,显著提高铝棒表面缺陷检测的准确性和可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015503A_ABST
    Figure CN123015503A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of surface detection, in particular to an aluminum rod surface defect detection method and system based on image recognition. The method comprises the following steps: acquiring an aluminum rod surface image of an aluminum rod cylindrical surface and image acquisition parameters of an image acquisition device; based on the aluminum rod surface image and the image acquisition parameters, brightness distribution information reflecting the spatial illumination distribution of the aluminum rod cylindrical surface is obtained; the brightness distribution information is subjected to brightness partition processing to obtain an image area of each brightness partition; the image area of each brightness partition is subjected to pixel optimization processing to obtain an aluminum rod optimized image; and the aluminum rod optimized image is used to perform defect detection processing on the surface of the aluminum rod to obtain a defect result of the aluminum rod surface. The application aims to solve the problems of low accuracy of the existing detection method in the dark area false alarm and the bright area missed detection, and the low accuracy of the defect detection on the surface of the aluminum rod.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surface inspection technology, and specifically to a method and system for detecting surface defects in aluminum rods based on image recognition. Background Technology

[0002] In the process of defect detection on the surface of aluminum rods, existing detection methods use image recognition technology for non-destructive testing. The aluminum rod rotates and translates at a stable speed through the camera's field of view at the inspection station. A ring of LED light sources illuminates the surface of the aluminum rod in an approximately diffuse manner, and multiple cameras simultaneously acquire images of the entire circumference of the cylindrical surface. In actual image acquisition, due to the inherent curvature of the aluminum rod's cylindrical surface, even under uniform illumination, the image within the camera's field of view still exhibits an illumination gradient that gradually darkens from the central bright area to the sides, resulting in the simultaneous inclusion of bright areas and dark edges within the same frame. A global histogram equalization method is used to statistically map the pixel distribution of the entire frame image. Because bright area pixels have a statistical advantage, the equalization process forcibly stretches the originally narrow grayscale range of the dark areas while compressing the grayscale range of the bright areas. This causes the minute matrix undulations and sensor noise in the dark areas to be excessively amplified, forming high-contrast pseudo-textures that mask real, subtle defects. Meanwhile, the edge sharpness of defects in the bright areas decreases due to compression, and the details of shallow defects tend to become blurred and blend into the background.

[0003] Meanwhile, existing detection methods struggle to adapt to the significant illumination differences caused by curvature within the same field of view. This results in images fed into the recognition model carrying numerous false features in dark areas and losing crucial details in bright areas. Therefore, in acquiring full-circumference images of the cylindrical surface of an aluminum rod, the illumination gradient within the field of view caused by the cylindrical curvature leads to excessive amplification of noise in dark areas when global histogram equalization is used to uniformly enhance the contrast of the entire frame, resulting in the formation of false defect features in dark areas and the compression and loss of defect details in bright areas. This leads to false alarms in dark areas and missed detections in bright areas, resulting in low accuracy in detecting defects on the surface of the aluminum rod. Summary of the Invention

[0004] The purpose of this invention is to provide an image recognition-based method and system for detecting surface defects in aluminum rods, addressing the problem that existing detection methods suffer from false alarms in dark areas and missed detections in bright areas, resulting in low accuracy in detecting surface defects in aluminum rods.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting surface defects in aluminum rods based on image recognition, comprising the following steps: Acquire images of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device; Based on the surface image of the aluminum rod and the image acquisition parameters, brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod is obtained; The brightness distribution information is subjected to brightness partitioning to obtain the image region of each brightness partition; Pixel optimization processing is performed on the image area of ​​each brightness partition to obtain the aluminum rod optimized image; The aluminum rod is optimized using an image to perform defect detection on its surface, resulting in the defect findings.

[0006] Further, the step of obtaining luminance distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image and image acquisition parameters includes: The surface image of the aluminum rod is denoised to obtain a denoised surface image of the aluminum rod. Based on the image acquisition parameters, determine the image acquisition angle that reflects the image acquisition device's image acquisition of the aluminum rod surface; Based on the denoised aluminum rod surface image and the image acquisition angle, brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod cylindrical surface is obtained.

[0007] Further, the step of obtaining brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the denoised aluminum rod surface image and the image acquisition angle includes: Using the image acquisition angle, the acquisition environment on the surface of the aluminum rod is analyzed to obtain the ambient brightness information at the image acquisition location; Based on the ambient brightness information of the image acquisition location, a brightness distribution matching model is determined; Using the brightness distribution matching model, the brightness distribution matching process is performed on the denoised aluminum rod surface image to obtain brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod cylindrical surface.

[0008] Furthermore, the step of determining the brightness distribution matching model based on the ambient brightness information of the image acquisition location includes: The ambient brightness information of the image acquisition location is matched with a preset matching model library to obtain all candidate matching models; All candidate matching models are filtered to obtain the brightness distribution matching model.

[0009] Further, the step of performing brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition includes: Based on the brightness distribution information, the brightness partition type is determined; wherein the brightness partition type includes bright area, transition area and dark area; Using the brightness partitioning type, the brightness distribution information is processed to obtain the initial region of the image partition; The initial region of the image partition is subjected to region correction processing to obtain the image region of each brightness partition.

[0010] Furthermore, the step of determining the brightness partition type based on the brightness distribution information includes: The brightness distribution information is processed by image brightness extraction to obtain image brightness information reflecting the brightness range of the aluminum rod surface; The image brightness information is subjected to brightness classification processing to obtain the brightness partition type.

[0011] Furthermore, the step of performing brightness partitioning processing on the brightness distribution information using the brightness partitioning type to obtain the initial region of the image partitions includes: The brightness distribution information is subjected to pixel grayscale extraction processing to obtain pixel grayscale information; Using the brightness partitioning type, the pixel grayscale information is subjected to brightness partitioning processing to obtain the initial region of image partitioning.

[0012] Further, the step of performing pixel optimization processing on the image region of each brightness partition to obtain the optimized image of the aluminum rod includes: Based on the image region of each brightness partition, an optimization model for the image region is determined; Using the optimization model of the image region, pixel optimization processing is performed on the image region of each brightness partition to obtain the optimized image of the aluminum rod.

[0013] Furthermore, the step of determining an optimized model for the image region based on the image region of each brightness partition includes: Based on the image region of each brightness partition, determine the region area and average brightness of the image region; Using the area and average brightness of the image region, a model matching process is performed from a preset image optimization model library to obtain an optimized model for the image region.

[0014] The present invention also provides an image recognition-based aluminum rod surface defect detection system, the system comprising: The image acquisition module is used to acquire images of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device. The information determination module is used to obtain brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image of the aluminum rod and the image acquisition parameters. The region partitioning module is used to perform brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition. The image optimization module is used to perform pixel optimization processing on the image area of ​​each brightness partition to obtain an optimized image of the aluminum rod. The defect detection module is used to perform defect detection processing on the surface of the aluminum rod using the optimized image of the aluminum rod, and obtain the defect results on the surface of the aluminum rod.

[0015] Compared with existing technologies, the image recognition-based aluminum rod surface defect detection method and system of the present invention have the following advantages: This invention acquires an image of the cylindrical surface of an aluminum rod and the image acquisition parameters of an image acquisition device to obtain brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod. Subsequently, the brightness distribution information is processed into brightness partitions to obtain image regions for each brightness partition. These regions are then subjected to pixel optimization processing to obtain an optimized image of the aluminum rod for defect detection. By performing refined brightness partitioning and targeted pixel optimization on the image, false alarms in dark areas and missed detections in bright areas can be avoided, significantly improving the accuracy and reliability of aluminum rod surface defect detection. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention, the accompanying drawings used in the specific embodiments will be briefly described below. In all the drawings, the elements or parts are not necessarily drawn to scale.

[0017] Figure 1 This is a flowchart of an image recognition-based method for detecting surface defects in aluminum rods according to the present invention.

[0018] Figure 2 This is a flowchart of step S200 in the image recognition-based aluminum rod surface defect detection method of the present invention.

[0019] Figure 3 This is a flowchart of step S300 in the image recognition-based aluminum rod surface defect detection method of the present invention.

[0020] Figure 4 This is a structural block diagram of an aluminum rod surface defect detection system based on image recognition according to the present invention.

[0021] In the diagram: 410, Image Acquisition Module; 420, Information Determination Module; 430, Region Partitioning Module; 440, Image Optimization Module; 450, Defect Detection Module.

[0022] The implementation and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] The following drawings disclose several embodiments of the present invention. For clarity, many practical details will be described in the following description. However, it should be understood that these practical details are not intended to limit the invention. That is, in some embodiments of the invention, these practical details are not essential. Furthermore, for the sake of simplicity, some conventional structures and components will be shown in the drawings in a simple schematic manner.

[0024] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0025] Furthermore, in this invention, the use of terms such as "first" and "second" is for descriptive purposes only and does not specifically refer to any order or sequence, nor is it intended to limit the invention. They are merely used to distinguish components or operations described using the same technical terms, and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but only if they are feasible for those skilled in the art. If a combination of technical solutions is contradictory or impossible to implement, such a combination should be considered nonexistent and not within the scope of protection claimed by this invention.

[0026] To further understand the content, features, and effects of this invention, the following embodiments are provided, and detailed descriptions are given below in conjunction with the accompanying drawings: Please see Figure 1 This invention provides a method for detecting surface defects in aluminum rods based on image recognition, comprising the following steps: S100. Acquire an image of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device. The aluminum rod surface image refers to a digital image reflecting the appearance of the cylindrical surface of the aluminum rod, acquired by the image acquisition device, which includes visual information such as texture, color, and brightness of the aluminum rod surface. Image acquisition parameters refer to the various settings used by the image acquisition device when acquiring the aluminum rod surface image, such as exposure time, gain, white balance, focal length, and aperture. These parameters directly affect the image quality and characteristics. Specifically, the image acquisition device can be an industrial camera, a line scan camera, or an area scan camera, etc. Image acquisition parameters can be set manually; for example, the operator adjusts the camera's exposure time, gain, and other parameters based on experience to obtain a preliminarily usable image. Alternatively, image acquisition parameters can be automatically loaded from a preset configuration file; for example, the camera parameters stored in the configuration file are read at startup and applied to the image acquisition device.

[0027] S200. Based on the image of the aluminum rod surface and the image acquisition parameters, obtain brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod's cylindrical surface. The brightness distribution information refers to data reflecting the distribution of illuminance intensity at different locations on the aluminum rod's cylindrical surface in space, enabling the quantification of the brightness levels in different areas of the aluminum rod surface. Specifically, the aluminum rod surface image can be converted to grayscale, and the distribution of grayscale values ​​can be statistically analyzed to obtain the brightness distribution information. Alternatively, theoretical brightness distribution information can be derived by analyzing the image acquisition parameters and combining them with a known lighting model and the aluminum rod's geometric model.

[0028] S300. Perform brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition. Brightness partitioning processing refers to dividing the aluminum rod surface image into regions with different brightness characteristics, such as bright areas, transition areas, and dark areas, based on the brightness distribution information. Specifically, multiple brightness thresholds can be set to divide the brightness distribution information into several brightness intervals, each interval corresponding to a brightness partition. For example, a high brightness threshold and a low brightness threshold can be set to divide the image into bright areas (above the high brightness threshold), dark areas (below the low brightness threshold), and transition areas (between the high and low thresholds). Alternatively, a clustering algorithm, such as the K-means algorithm, can be used to cluster the brightness distribution information, automatically dividing the pixels into different brightness partitions.

[0029] S400. Perform pixel optimization processing on the image region of each brightness zone to obtain an optimized image of the aluminum rod. Pixel optimization processing refers to targeted adjustment and enhancement of image pixels within the brightness zone to eliminate noise, improve contrast, or restore details, thereby obtaining an optimized image of the aluminum rod more suitable for defect detection. Specifically, for bright areas, a local contrast suppression algorithm can be used to avoid over-enhancement leading to loss of detail; for dark areas, methods such as local histogram equalization or adaptive gamma correction can be used to improve contrast and suppress noise. Alternatively, different filtering algorithms can be applied to different brightness zones; for example, Gaussian blur can be used in bright areas to smooth noise, while bilateral filtering can be used in dark areas to preserve edge details while smoothing noise.

[0030] S500. Using the optimized image of the aluminum rod, perform defect detection processing on the surface of the aluminum rod to obtain the defect results of the aluminum rod surface. Defect detection processing refers to using image processing and pattern recognition techniques to identify, locate, and classify various surface defects in the optimized image of the aluminum rod, and output the defect results. Specifically, a deep learning-based image recognition model, such as a convolutional neural network (CNN), can be used to train and infer on the optimized image of the aluminum rod to identify defects such as cracks, scratches, and dents. Alternatively, traditional image processing algorithms, such as edge detection, morphological operations, and threshold segmentation, can be used in combination with feature extraction and a classifier to detect defects in the optimized image of the aluminum rod.

[0031] In this embodiment, by acquiring an image of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device, brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod can be obtained based on these original images and parameters; thus, the brightness and darkness of each region on the surface of the aluminum rod can be quantified. Subsequently, brightness distribution information is processed by brightness partitioning, dividing the image into different image regions such as bright areas, transition areas, and dark areas. This avoids the drawbacks of global processing, allowing subsequent optimization to be targeted. After obtaining the image region of each brightness partition, pixel optimization processing is performed on these regions. Different optimization strategies are adopted according to the brightness characteristics of each partition, such as contrast suppression for bright areas and contrast enhancement and noise suppression for dark areas, thereby obtaining an optimized image of the aluminum rod. This effectively eliminates the problems of pseudo-texture in dark areas and blurred details in bright areas. Finally, using the optimized image of the aluminum rod, defect detection processing is performed on the surface of the aluminum rod to obtain accurate and reliable defect results. By changing the image preprocessing from global uniform adjustment to local adaptive optimization, clear and realistic defect features can be obtained in different illuminance areas, thereby significantly improving the accuracy and reliability of defect detection.

[0032] For some of the embodiments described above in this application, please refer to Figure 2Step S200: The step of obtaining brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image and image acquisition parameters includes: S210. Denoising the surface image of the aluminum rod to obtain a denoised surface image of the aluminum rod. Specifically, denoising the surface image of the aluminum rod refers to eliminating or reducing random noise in the image by applying image processing algorithms to improve image quality and the accuracy of subsequent processing. Various techniques can be used for denoising, such as mean filtering, median filtering, Gaussian filtering, or wavelet denoising, with the aim of removing various interferences introduced during image acquisition, making the image content clearer and providing high-quality input for subsequent brightness analysis.

[0033] S220. Based on the image acquisition parameters, determine the image acquisition angle reflecting the image acquisition device's image acquisition of the aluminum rod surface. This step refers to calculating or deriving the spatial position and attitude information of the image acquisition device relative to the aluminum rod surface based on the parameters recorded by the image acquisition device when acquiring images of the aluminum rod surface. Image acquisition parameters may include, but are not limited to, camera intrinsic parameters, extrinsic parameters, focal length, sensor size, and the relative distance and angle between the camera and the aluminum rod. These parameters allow for the precise determination of the image acquisition angle when the image acquisition device acquires images of the aluminum rod surface, which is crucial for understanding and modeling the spatial illumination distribution on the cylindrical surface of the aluminum rod.

[0034] S230. Based on the denoised image of the aluminum rod surface and the image acquisition angle, brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod's cylindrical surface is obtained. This step refers to modeling and calculating the light intensity distribution on the aluminum rod's cylindrical surface after the image has been denoised, combined with the determined image acquisition angle. The image acquisition angle reflects the geometric relationship of light incident on the aluminum rod surface, thus affecting the brightness performance at various points on the surface. By considering the denoised image data and precise acquisition angle information, the actual illuminance of the aluminum rod's cylindrical surface at different positions and directions can be more accurately inferred, thereby obtaining more realistic brightness distribution information.

[0035] Specifically, after acquiring an image of the cylindrical surface of the aluminum rod, the image contains salt-and-pepper noise caused by ambient light fluctuations or sensor characteristics. In this case, a median filtering algorithm can be applied to denoise the image. Median filtering effectively suppresses salt-and-pepper noise by replacing the gray value of each pixel with the median of the gray values ​​of its neighbors, resulting in a denoised image of the aluminum rod surface with smoother and more realistic brightness information. Simultaneously, when the image acquisition device acquires an image, its image acquisition parameters include the camera's intrinsic and extrinsic parameter matrices. By analyzing these parameters, the angle between the camera's optical axis and the normal to the cylindrical surface of the aluminum rod can be determined, i.e., the image acquisition angle. For example, if the camera is tilted at a 45-degree angle when photographing the aluminum rod, then this 45-degree angle is the image acquisition angle. Subsequently, using the denoised image of the aluminum rod surface and the determined 45-degree image acquisition angle, combined with a preset illumination model (such as the Lambertian reflection model or the Von Techelohan reflection model), brightness distribution matching processing is performed on each pixel on the cylindrical surface of the aluminum rod, thereby obtaining brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod. By combining denoising and angle information processing, it is ensured that the obtained brightness distribution information not only eliminates noise interference but also considers actual geometric illumination conditions, making the information more accurate and reliable.

[0036] This invention effectively avoids noise interference in the original image and the influence of the acquisition angle on the spatial illumination distribution by introducing denoising processing and determining the image acquisition angle. Denoising processing eliminates random noise in the image, making the brightness information purer and more reliable, and avoiding noise interference in the extraction of brightness distribution information. Simultaneously, by determining the image acquisition angle, the geometric relationship between the image acquisition device and the aluminum rod surface can be accurately understood. Because the image is preprocessed to remove noise and combined with precise geometric information (image acquisition angle), the subsequently obtained brightness distribution information can more realistically and accurately reflect the spatial illumination distribution on the cylindrical surface of the aluminum rod, providing high-quality basic data for subsequent defect detection.

[0037] In some embodiments of this application described above, the step of obtaining luminance distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the denoised aluminum rod surface image and the image acquisition angle includes: Using the image acquisition angle, the acquisition environment on the aluminum rod surface is analyzed to obtain the ambient brightness information at the image acquisition location. This step involves evaluating and modeling the lighting conditions, reflection, and potential shadow areas around the image acquisition point based on the position and orientation of the image acquisition device relative to the aluminum rod surface, combined with data from on-site environmental sensors (such as light sensors), thereby obtaining the actual ambient brightness information at that image acquisition location. Ambient brightness information may include parameters such as ambient light intensity, color temperature, and the direction of the main light source, with the aim of comprehensively understanding the external lighting conditions during image acquisition.

[0038] Based on the ambient brightness information of the image acquisition location, a brightness distribution matching model is determined. This step involves selecting the brightness distribution model that best matches the current environmental conditions from a pre-established model library based on the acquired ambient brightness information, or constructing a mathematical model that reflects the influence of the current ambient brightness on the illuminance of the aluminum rod surface. The brightness distribution matching model can be a function, a lookup table, or a machine learning model. Its function is to establish a mapping relationship between ambient brightness and the expected brightness distribution on the aluminum rod surface, in order to correct or compensate for the influence of ambient light on image brightness.

[0039] Using the aforementioned brightness distribution matching model, the denoised aluminum rod surface image is subjected to brightness distribution matching processing to obtain brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod's cylindrical surface. This step refers to applying the determined brightness distribution matching model to the pixel data of the denoised aluminum rod surface image. This processing may include adjusting, normalizing, or transforming the brightness values ​​of the image pixels to make them consistent with the spatial illuminance distribution that the aluminum rod's cylindrical surface should have under the current ambient brightness, as predicted by the brightness distribution matching model. Its purpose is to eliminate or reduce the interference caused by uneven ambient lighting, so that the image's brightness distribution can more realistically and accurately reflect the inherent characteristics of the aluminum rod surface.

[0040] Specifically, on the aluminum rod production line, image acquisition equipment captures images of the high-speed moving aluminum rods at a specific angle. To obtain ambient brightness information at the image acquisition location, multiple light sensors are deployed near the image acquisition equipment. These sensors can monitor the intensity, direction, and color temperature of ambient light in real time. Simultaneously, combined with the known acquisition angle of the image acquisition equipment, the intensity and reflection of ambient light on different areas of the cylindrical surface of the aluminum rod can be analyzed at the current angle. For example, if the ambient light mainly comes from above, the top area of ​​the aluminum rod may be brighter, and the bottom area may be darker. Based on this real-time ambient brightness information, a brightness distribution matching model that best matches the current lighting conditions can be selected from a pre-set matching model library. This model library can be pre-established by performing image acquisition and brightness distribution analysis on standard defect-free aluminum rods under different lighting environments. For example, when a high and uniform ambient light intensity is detected, a uniform brightness distribution model is selected; when a distinct directional light source is detected, a brightness distribution model with gradient changes is selected. Subsequently, the selected brightness distribution matching model is used to perform brightness distribution matching processing on the denoised aluminum rod surface image. For example, if the model indicates that a certain area of ​​the image should exhibit a specific brightness value under the current environment, but the brightness of that area deviates in the actual image, the model adjusts the pixel brightness of that area to match the model's prediction. This matching process can employ pixel-level brightness correction algorithms, such as histogram matching or gamma correction, to ensure that the brightness distribution of the image accurately reflects the spatial illuminance distribution of the aluminum rod's cylindrical surface under ideal conditions, thereby providing high-quality image data for subsequent defect detection.

[0041] This invention analyzes the ambient brightness information at the image acquisition location and determines a brightness distribution matching model based on this information. This allows for brightness distribution matching processing of the denoised aluminum rod surface image, avoiding potential deviations when directly obtaining brightness distribution information from the image and acquisition angle under complex and variable ambient lighting conditions. Specifically, by analyzing the ambient brightness information at the image acquisition angle, the influence of actual lighting conditions on the illuminance of the aluminum rod surface can be accurately captured. Subsequently, a suitable brightness distribution matching model is determined based on the ambient brightness information. This model can effectively simulate or compensate for the influence of ambient lighting on image brightness. Finally, this matching model is used to perform brightness distribution matching processing on the denoised image, allowing the image's brightness distribution to be corrected to more closely approximate the true spatial illuminance distribution of the aluminum rod's cylindrical surface, thereby improving the accuracy and reliability of the brightness distribution information.

[0042] In some embodiments of this application described above, the step of determining a brightness distribution matching model based on the ambient brightness information of the image acquisition location includes: The ambient brightness information of the image acquisition location is matched against a pre-defined matching model library to obtain all candidate matching models. The pre-defined matching model library is a collection of pre-stored brightness distribution models covering various typical or common brightness distribution patterns under image acquisition environments on aluminum rod surfaces, such as uniform illumination, gradient illumination, and localized strong light. Each model contains its corresponding brightness distribution feature parameters. Matching the ambient brightness information of the image acquisition location against the pre-defined matching model library involves calculating the similarity, correlation, or error between the current ambient brightness information and each pre-defined model in the library to evaluate which pre-defined model is closest to the current ambient brightness information. Thus, all candidate matching models are obtained; these candidate matching models are a set of models that, after matching, have a certain degree of similarity to the current ambient brightness information.

[0043] The candidate matching models are then filtered to obtain the brightness distribution matching model. This step involves selecting one or more models from the candidate matching models that best match the brightness characteristics of the current image acquisition environment as the final brightness distribution matching model, based on preset filtering rules or algorithms. The filtering rules can be based on similarity thresholds, minimum error principles, maximum correlation principles, etc.

[0044] Specifically, the pre-set matching model library contains three typical brightness distribution models: Model A (uniform illumination), Model B (left-side strong light gradient illumination), and Model C (center-focused illumination). After acquiring the ambient brightness information of the image acquisition location, for example, analysis reveals that the current ambient brightness gradually decreases from left to right. This ambient brightness information is then matched with Model A, Model B, and Model C. The matching results may show that the current ambient brightness information has the highest similarity to Model B (e.g., a correlation coefficient of 0.95), and lower similarity to Models A and C (e.g., correlation coefficients of 0.6 and 0.7, respectively). Based on this, Models A, B, and C are all considered as candidate matching models. Subsequently, a screening process is performed, and since Model B has the highest similarity to the current ambient brightness information, it is selected as the final brightness distribution matching model. In this way, the most suitable brightness distribution matching model can be intelligently selected from the pre-set model library based on the actual acquisition environment, thereby ensuring the accuracy of subsequent brightness distribution matching processing.

[0045] This invention avoids the potential accuracy and robustness issues of directly determining a brightness distribution matching model by introducing a pre-defined matching model library and a filtering mechanism. Specifically, after acquiring the ambient brightness information of the image acquisition location, instead of directly generating a model, it compares it with a matching model library containing various typical brightness distribution patterns. This matching process fully utilizes existing experience and data, avoiding the complexity and uncertainty of building a model from scratch. Through matching, a series of candidate matching models with a certain similarity to the current ambient brightness information are obtained, providing a foundation for selecting the optimal model. Subsequently, these candidate models are filtered, for example, based on criteria such as matching degree and error magnitude, to select the brightness distribution matching model that most accurately reflects the current spatial illuminance distribution of the aluminum rod's cylindrical surface. Based on the matching and filtering strategy, the determined brightness distribution matching model is more targeted and accurate, thus better adapting to brightness changes under different acquisition environments.

[0046] For some of the embodiments described above in this application, please refer to Figure 3 Step S300: The step of performing brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition includes: S310. Based on the brightness distribution information, determine the brightness partitioning type; wherein the brightness partitioning type includes bright areas, transition areas, and dark areas. This step refers to dividing the entire image area into regions with different brightness characteristics according to the brightness performance of the aluminum rod's cylindrical surface under different spatial illuminance levels. Specifically, the brightness partitioning type can include bright areas, transition areas, and dark areas. Bright areas typically correspond to the areas on the aluminum rod surface that receive the strongest illumination, with higher pixel brightness values; dark areas correspond to the areas that receive the weakest illumination or have shadows, with lower pixel brightness values; transition areas are between bright and dark areas, representing regions where brightness gradually changes. Determining these partitioning types aims to provide a clear basis for subsequent brightness partitioning processing.

[0047] S320. Using the brightness partitioning type, perform brightness partitioning processing on the brightness distribution information to obtain the initial image partitioning region. The purpose of this step is to assign each pixel in the brightness distribution information to the corresponding brightness partition according to the predetermined partitioning types such as bright area, transition area, and dark area, thereby forming a preliminary image partition. For example, by setting different brightness thresholds, areas with pixel brightness values ​​higher than one threshold are classified as bright areas, areas lower than another threshold are classified as dark areas, and areas in between are classified as transition areas.

[0048] S330. Perform region correction processing on the initial region of the image partition to obtain the image region of each brightness partition. The initial region of the image partition may contain some irregular or noisy small areas, which may affect the accuracy of subsequent defect detection. Therefore, these initial regions need to be corrected, for example, by using morphological operations (such as opening and closing operations), connected component analysis, or region merging, to eliminate isolated noise points, smooth region boundaries, and merge adjacent regions of the same type, thereby obtaining a more regular and accurate image region for each brightness partition. The purpose is to ensure that each brightness partition has good continuity and representativeness, laying the foundation for subsequent pixel optimization processing.

[0049] This invention effectively addresses the problem of uneven brightness on the cylindrical surface of an aluminum rod under varying spatial illumination by dividing the brightness distribution information of the image into different partition types, such as bright areas, transition areas, and dark areas, and then performing fine-grained brightness partitioning and region correction. By differentiating between different brightness regions, subsequent pixel optimization processing can be targeted to each region, avoiding under-optimization or over-optimization problems that may occur when using a single processing method for the entire image. This region-based processing strategy enables subsequent defect detection to more accurately identify defect features under different brightness backgrounds.

[0050] In some embodiments of this application described above, the step of determining the brightness partition type based on the brightness distribution information includes: Image brightness extraction processing is performed on the brightness distribution information to obtain image brightness information reflecting the brightness range of the aluminum rod surface. Specifically, image brightness extraction processing refers to identifying and quantifying the numerical values ​​or features related to the brightness range of the aluminum rod surface from the brightness distribution information. Specifically, methods such as statistical analysis, threshold segmentation, or histogram analysis can be used to separate pixel values ​​or regions representing different brightness levels from the overall brightness distribution data, thereby obtaining image brightness information. The aim is to simplify the complex brightness distribution information into brightness features that can be used for classification.

[0051] The image brightness information is subjected to brightness classification processing to obtain brightness partition types. Specifically, brightness classification processing refers to dividing the extracted image brightness information into preset brightness partition types. For example, the image brightness information can be divided into bright areas, transition areas, and dark areas based on the range of brightness values. Specifically, multiple brightness thresholds can be set, classifying areas with brightness values ​​above a certain threshold as bright areas, areas below another threshold as dark areas, and areas in between as transition areas. The purpose is to provide clear classification criteria for subsequent brightness partitioning processing.

[0052] This invention extracts key information related to the brightness characteristics of an aluminum rod surface from raw brightness data by processing image brightness distribution information. This avoids errors and efficiency problems that may result from directly classifying the raw, complex data. Subsequently, by performing brightness classification processing on the extracted image brightness information, brightness features can be accurately categorized into different brightness partition types according to preset rules or models. This provides clear and accurate guidance for subsequent brightness partitioning processing, ensuring the reliability of the brightness partitioning results.

[0053] In some embodiments of this application described above, the step of performing brightness partitioning processing on the brightness distribution information using the brightness partitioning type to obtain the initial region of the image partition includes: The brightness distribution information is processed by pixel grayscale extraction to obtain pixel grayscale information. This step involves converting the original brightness distribution information into grayscale values ​​that directly reflect the pixel brightness intensity. This grayscale information is typically represented by a value range of 0-255, where 0 represents the darkest, 255 represents the brightest, and intermediate values ​​represent different levels of brightness. The purpose is to simplify the complex brightness distribution information into easily quantifiable pixel-level brightness data, providing a foundation for subsequent precise partitioning.

[0054] Using the brightness partitioning type, the pixel grayscale information is subjected to brightness partitioning processing to obtain the initial region of image partitioning.

[0055] This step involves comparing the grayscale value of each pixel with a brightness threshold for each pre-defined partition type, such as bright areas, transition areas, and dark areas. For example, a pixel with a grayscale value higher than a certain threshold is classified as a bright area; a grayscale value between two thresholds is classified as a transition area; and a grayscale value lower than a certain threshold is classified as a dark area. Thus, each pixel is assigned a specific brightness partition attribute, forming the initial image partitioning region.

[0056] This invention extracts pixel grayscale values ​​from brightness distribution information, transforming the abstract brightness distribution into specific pixel grayscale values, thus precisely quantifying the brightness intensity of each pixel. This precise quantization allows for more accurate identification and division of bright, transitional, and dark areas when subsequent brightness partitioning is performed using different partition types. This step-by-step processing avoids making fuzzy judgments directly on complex brightness distribution information, thereby ensuring the accuracy and reliability of the initial image partitioning area.

[0057] In some embodiments of this application described above, the step of performing pixel optimization processing on the image region of each brightness partition to obtain an optimized image of the aluminum rod includes: Based on the image region of each brightness partition, an optimization model for the image region is determined. Specifically, determining the optimization model for the image region means selecting or generating the most suitable pixel optimization algorithm or parameter set for that region according to its characteristics. For example, for bright areas, it may be necessary to suppress overexposure and highlight reflection; for dark areas, it may be necessary to enhance contrast and suppress noise; for transition areas, it may be necessary to balance brightness and contrast. The optimization model for the image region can be a predefined algorithm (such as histogram equalization, gamma correction, local contrast enhancement, etc.) or a model that dynamically adjusts parameters based on region characteristics.

[0058] Using the optimization model of the image region, pixel optimization processing is performed on the image region of each brightness partition to obtain an optimized image of the aluminum rod. This step refers to applying the optimization model determined for a specific brightness partition to the pixel data within that partition to improve image quality and make it easier to identify defects. This process aims to eliminate or reduce the interference caused by factors such as uneven illumination, noise, and reflection on defect features, while highlighting the visual appearance of the defects.

[0059] Specifically, after brightness partitioning the image of the aluminum rod surface, three image regions—bright, transition, and dark—are obtained. For the bright region, due to potential overexposure and high-light reflection, an optimization model based on local histogram equalization or gamma correction is chosen to reduce brightness and enhance contrast. For the dark region, due to insufficient illumination, an optimization model based on adaptive thresholding or the multi-scale Retinex algorithm is chosen to improve brightness, suppress noise, and enhance details. For the transition region, a hybrid model combining bright and dark region optimization strategies, or an image enhancement algorithm based on wavelet transform, is chosen. After determining the optimization model, the corresponding model is applied to the respective image region; for example, gamma correction is applied to the bright region, and the Retinex algorithm is applied to the dark region, resulting in an overall optimized image of the aluminum rod with more prominent defect features, providing high-quality input for subsequent defect detection.

[0060] This invention determines a dedicated optimization model for each brightness zone of the image, fully considering the unique optical characteristics and image degradation patterns of different brightness areas. For example, in bright areas, defect features may be masked due to high reflectivity and excessive saturation; in dark areas, defects may be difficult to identify due to insufficient illumination and noise. By tailoring an optimization model for each region, over-processing or under-processing that may occur with general optimization methods can be avoided, thereby more accurately improving the image quality of each region. This allows subsequent defect detection to be performed on a more uniform and clearer image basis, significantly improving the accuracy and reliability of detection.

[0061] In some embodiments of this application described above, the step of determining an optimized model for an image region based on the image region of each brightness partition includes: Based on the image region of each brightness partition, the area and average brightness of the image region are determined. The area of ​​the image region refers to the number of pixels or physical size occupied by that brightness partition, reflecting the size of the region; the average brightness refers to the average grayscale or brightness value of all pixels within that brightness partition, reflecting the overall brightness level of the region.

[0062] Using the area and average brightness of the image region, a model matching process is performed from a pre-set image optimization model library to obtain an optimized model for the image region. The pre-set image optimization model library is a pre-stored set of optimization algorithms or parameters designed and trained for different image region characteristics (such as area size, brightness range, etc.). This model library can contain various types of optimization models, such as different enhancement, denoising, or contrast adjustment models designed for bright areas, dark areas, or transition areas. Model matching processing refers to comparing the area and average brightness of the current image region as input with the applicable conditions or feature parameters of each optimization model in the model library, thereby selecting the optimization model that best matches the characteristics of the current image region. For example, rule-based matching, machine learning-based classification matching, or similarity-based matching can be used.

[0063] Specifically, after performing brightness partitioning on the aluminum rod surface image, a brightness partition with an area of ​​5000 pixels and an average brightness of 50 (grayscale value range 0-255) is obtained. First, the area and average brightness of this region are calculated. Then, these two parameters are input into a preset image optimization model library for matching. This model library may contain multiple optimization models, such as: Model A (suitable for dark areas with an area greater than 3000 pixels and an average brightness of less than 80, using gamma correction to enhance brightness), Model B (suitable for bright areas with an area less than 2000 pixels and an average brightness of greater than 150, using local contrast enhancement), and Model C (suitable for transition areas, using adaptive histogram equalization). Through matching, it is found that the characteristics of the current region best match the applicable conditions of Model A; therefore, Model A is selected as the optimization model for this brightness partition. Next, Model A is used to perform pixel optimization processing on the image region of this brightness partition, thereby obtaining the optimized image region, which is finally aggregated into an optimized image of the aluminum rod.

[0064] This invention provides an objective and quantitative basis for selecting optimization models by quantitatively analyzing the area and average brightness of image regions in each brightness zone. Since different brightness zones have different area and average brightness, these parameters effectively reflect the local characteristics of image regions. For example, large dark areas may require stronger brightness enhancement models, while small bright areas may require more refined contrast adjustment models. By matching these features with a pre-defined image optimization model library, the most suitable optimization model can be selected for each specific image region. This feature-matching-based model selection mechanism avoids blind or empirical selection of optimization models, making pixel optimization processing more targeted and effective.

[0065] For an image recognition-based aluminum rod surface defect detection method based on any of the above embodiments, please refer to [link to relevant documentation]. Figure 4 The present invention also provides an image recognition-based aluminum rod surface defect detection system, which includes an image acquisition module 410, an information determination module 420, a region partitioning module 430, an image optimization module 440, and a defect detection module 450.

[0066] The image acquisition module 410 is used to acquire images of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device.

[0067] The information determination module 420 is used to obtain brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image of the aluminum rod and the image acquisition parameters.

[0068] The region partitioning module 430 is used to perform brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition.

[0069] The image optimization module 440 is used to perform pixel optimization processing on the image area of ​​each brightness partition to obtain an optimized image of the aluminum rod.

[0070] The defect detection module 450 is used to perform defect detection processing on the surface of the aluminum rod using the optimized image of the aluminum rod, and obtain the defect results on the surface of the aluminum rod.

[0071] In this embodiment, the image acquisition module 410 is responsible for acquiring raw image data, and the information determination module 420 analyzes and quantifies the brightness distribution characteristics of the image. The region partitioning module 430 performs fine segmentation of the image based on the brightness distribution information, distinguishing different brightness regions. Subsequently, the image optimization module 440 performs adaptive pixel optimization on these partitions to eliminate noise and restore details. Finally, the defect detection module 450 uses the optimized image to accurately identify defects. This optimizes the process from raw image acquisition to final defect determination, significantly improving the defect detection model's anti-false alarm capability in dark areas and its false negative rate in bright areas, thus significantly improving the accuracy and reliability of defect detection.

[0072] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the present invention specification.

Claims

1. A method for detecting surface defects in aluminum rods based on image recognition, characterized in that, Includes the following steps: Acquire images of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device; Based on the surface image of the aluminum rod and the image acquisition parameters, brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod is obtained; The brightness distribution information is subjected to brightness partitioning to obtain the image region of each brightness partition; Pixel optimization processing is performed on the image area of ​​each brightness partition to obtain the aluminum rod optimized image; The aluminum rod is optimized using an image to perform defect detection on its surface, resulting in the defect findings.

2. The method for detecting surface defects of aluminum rods based on image recognition according to claim 1, characterized in that, The steps for obtaining luminance distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image and image acquisition parameters include: The surface image of the aluminum rod is denoised to obtain a denoised surface image of the aluminum rod. Based on the image acquisition parameters, determine the image acquisition angle that reflects the image acquisition device's image acquisition of the aluminum rod surface; Based on the denoised aluminum rod surface image and the image acquisition angle, brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod cylindrical surface is obtained.

3. The method for detecting surface defects of aluminum rods based on image recognition according to claim 2, characterized in that, The steps for obtaining brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the denoised aluminum rod surface image and the image acquisition angle include: Using the image acquisition angle, the acquisition environment on the surface of the aluminum rod is analyzed to obtain the ambient brightness information at the image acquisition location; Based on the ambient brightness information of the image acquisition location, a brightness distribution matching model is determined; Using the brightness distribution matching model, the brightness distribution matching process is performed on the denoised aluminum rod surface image to obtain brightness distribution information reflecting the spatial illuminance distribution of the aluminum rod cylindrical surface.

4. The method for detecting surface defects of aluminum rods based on image recognition according to claim 3, characterized in that, The steps for determining the brightness distribution matching model based on the ambient brightness information of the image acquisition location include: The ambient brightness information of the image acquisition location is matched with a preset matching model library to obtain all candidate matching models; All candidate matching models are filtered to obtain the brightness distribution matching model.

5. The method for detecting surface defects of aluminum rods based on image recognition according to claim 1, characterized in that, The steps of performing brightness partitioning on the brightness distribution information to obtain the image region of each brightness partition include: Based on the brightness distribution information, the brightness partition type is determined; wherein the brightness partition type includes bright area, transition area and dark area; Using the brightness partitioning type, the brightness distribution information is processed to obtain the initial region of the image partition; The initial region of the image partition is subjected to region correction processing to obtain the image region of each brightness partition.

6. The method for detecting surface defects of aluminum rods based on image recognition according to claim 5, characterized in that, Based on the brightness distribution information, the steps for determining the brightness partition type include: The brightness distribution information is processed by image brightness extraction to obtain image brightness information reflecting the brightness range of the aluminum rod surface; The image brightness information is subjected to brightness classification processing to obtain the brightness partition type.

7. The method for detecting surface defects of aluminum rods based on image recognition according to claim 5, characterized in that, The steps of performing brightness partitioning processing on the brightness distribution information using the brightness partitioning type to obtain the initial region of the image partitions include: The brightness distribution information is subjected to pixel grayscale extraction processing to obtain pixel grayscale information; Using the brightness partitioning type, the pixel grayscale information is subjected to brightness partitioning processing to obtain the initial region of image partitioning.

8. The method for detecting surface defects of aluminum rods based on image recognition according to claim 1, characterized in that, The steps of performing pixel optimization processing on the image region of each brightness partition to obtain the optimized image of the aluminum rod include: Based on the image region of each brightness partition, an optimization model for the image region is determined; Using the optimization model of the image region, pixel optimization processing is performed on the image region of each brightness partition to obtain the optimized image of the aluminum rod.

9. The method for detecting surface defects of aluminum rods based on image recognition according to claim 8, characterized in that, The steps for determining the optimized model of the image region based on the image region of each brightness partition include: Based on the image region of each brightness partition, determine the region area and average brightness of the image region; Using the area and average brightness of the image region, a model matching process is performed from a preset image optimization model library to obtain an optimized model for the image region.

10. A surface defect detection system for aluminum rods based on image recognition, characterized in that, The system includes: The image acquisition module is used to acquire images of the cylindrical surface of the aluminum rod and the image acquisition parameters of the image acquisition device. The information determination module is used to obtain brightness distribution information reflecting the spatial illuminance distribution of the cylindrical surface of the aluminum rod based on the surface image of the aluminum rod and the image acquisition parameters. The region partitioning module is used to perform brightness partitioning processing on the brightness distribution information to obtain the image region of each brightness partition. The image optimization module is used to perform pixel optimization processing on the image area of ​​each brightness partition to obtain an optimized image of the aluminum rod. The defect detection module is used to perform defect detection processing on the surface of the aluminum rod using the optimized image of the aluminum rod, and obtain the defect results on the surface of the aluminum rod.