Steel surface defect detection platform based on local contrast superposition algorithm
Through the local contrast superposition algorithm, the problem of low detection accuracy caused by differences in imaging conditions in steel surface defect detection is solved, and efficient positioning and accurate detection of minor defects are achieved.
Patent Information
- Application Number
- CN202510684006.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-10-17
AI Technical Summary
In steel surface defect detection, it is difficult to determine the optimal imaging conditions for each sample under different imaging conditions, resulting in low accuracy in detecting minor defects.
The local contrast superposition algorithm is adopted to collect and analyze images under multiple light intensity conditions, and the Multiscale patch-based contrast method (MPCM) is used to calculate the local contrast, combined with the segmentation algorithm to locate defects.
It improves the detection accuracy of minor defects, is applicable to different types of defect detection, and simplifies the process of determining the optimal imaging conditions.
Smart Images

Figure CN120807391A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of steel surface defect detection, in particular to a steel surface defect detection platform based on a local contrast superposition algorithm. BACKGROUND
[0002] In the field of defect detection, non-contact detection methods have been widely concerned and applied. In steel surface defect detection, machine vision-based detection is a common method. This method images the sample surface through an image acquisition system, and then identifies, locates and analyzes the defects of the image data. An image with good defect contrast is of great significance to improve the accuracy of defect detection. The imaging system is a key factor affecting the defect contrast. In actual detection, the type of light source, the angle of incidence of light and the intensity of light all have important influences on the steel surface image.
[0003] When imaging the surface of steel, the same defect has different degrees of obviousness under different imaging conditions. Obtaining the defect image under the best condition helps to improve the detection accuracy, especially for slight surface defects that are difficult to detect. It is of great significance to determine the best imaging condition. Since the best imaging conditions for different types of defects are often different, it is difficult to determine the best imaging condition for each sample during detection. Therefore, we propose a steel surface defect detection platform based on a local contrast superposition algorithm. SUMMARY
[0004] The application provides a steel surface defect detection platform based on a local contrast superposition algorithm to solve the above-mentioned problems.
[0005] The application provides a steel surface defect detection platform based on a local contrast superposition algorithm, comprising the following steps:
[0006] Step 1: Select real steel defect samples of the production line, change the light intensity condition during image acquisition, and obtain image data;
[0007] Step 2: Analyze the local contrast of the image using the Multiscale patch-based contrast method (mpcm), and count the local contrast of each pixel point and the background area.
[0008] Step 3: Superimpose the local contrast analysis graph to obtain the local contrast superposition graph of the sample under multiple light intensity conditions. Then, capture the pixel points with high local contrast in the superposition graph using a segmentation algorithm to complete the defect location.
[0009] Preferably, the defect types of the defect samples include indentation, scratch, dirt and oil stain.
[0010] Preferably, the system information of the steel surface defect detection platform based on the local contrast superposition algorithm is as follows: Linux ubun 5.15.0-105-generic#115~20.04.1-Ubuntu SMP Mon Apr 15 17:33:04 UTC 2024 x86_64 x86_64 x86_64 GNU / Linux.
[0011] The algorithm needs the following dependent conditions:
[0012] Tensorflow==1.5.1, the CUDA library of 10.0 and the cuDNN library of version 7.
[0013] Preferably, the image data is specifically a sample in an imaging system, and the light source intensity is adjusted, the sample is imaged under multiple different light intensities, and multiple images of the same sample under different brightness are obtained.
[0014] Preferably, the steel surface defect detection platform based on the local contrast superposition algorithm calls a CSI camera to acquire images.
[0015] Preferably, the CSI camera calling step is as follows:
[0016] Recompile opencv-python to enable Gstreamer;
[0017] The compilation process is as follows: uninstall the original version of opencv-python;
[0018] Install cmake and gcc compilation tools for the package;
[0019] Install dependent items libgtk, libgtk, and libpng;
[0020] Check the version of opencv-python to determine the maximum limit of the frame rate of opencv-python to video stream;
[0021] Configure the opencv-python options: check the parameters of the image acquisition device, and change the upper limit of the frame rate of opencv-python to be greater than or equal to the frame rate acquired by the image device;
[0022] Change the resolution format of the input image of opencv-python to be adaptive to the sample;
[0023] Compile the c++ project and install;
[0024] The enabling Gstreamer step is as follows: cv2.VideoCapture(0) is changed to: cap=
[0025] cv2.VideoCapture("nvarguscamerasrc", cv2.CAP_GSTREAMER).
[0026] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art:
[0027] The overall system provided by the embodiments of the present application is a steel surface defect detection platform based on a local contrast superposition algorithm, which can improve the detection accuracy of slight defects compared with a detection platform based on a single imaging condition. Compared with a method of finding defects one by one to find the best imaging condition, the present application can replace the best condition image with multiple good condition images, which is suitable for different types of defect detection. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate an embodiment consistent with the present application and, together with the description, serve to explain the principles of the application.
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0030] Fig. 1 is the overall schematic diagram of the present application;
[0031] Fig. 2 is the defect defect and local contrast analysis diagram under different light intensities of the present application;
[0032] Fig. 3 is the local contrast superposition diagram of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0034] The various embodiments of the present application can exist in a variety of forms and it should be understood that described forms are merely exemplary and should not be construed as limiting the scope of the present application; therefore, it should be considered that the described range has been specifically disclosed all possible sub-ranges and single values within the range. For example, it should be considered that the range from 1 to 6 has been specifically disclosed sub-ranges, such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., and single values within the range, such as 1, 2, 3, 4, 5 and 6, regardless of the range. In addition, whenever a numerical range is indicated in the present application, it refers to any cited number (fraction or integer) within the indicated range. Unless otherwise specifically stated, the various raw materials, reagents, instruments and equipment used in the present application can be purchased on the market or can be prepared by existing equipment.
[0035] In the present application, the orientation words such as "up" and "down" are specific to the drawing direction in the drawings unless otherwise stated. In addition, in the present application, the terms "include", "contain" and the like mean "include but are not limited to". In the present application, relational terms such as "first" and "second" and the like are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. In the present application, "and / or" describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. Where A and B can be singular or plural. In the present application, "one or more" means one or more, and "multiple" means two or more. "At least one", "at least one of the following" or the like means any combination of the items, including any combination of single or multiple items. For example, "at least one of a, b, or c", or "at least one of a, b, and c" can mean a, b, c, a-b, i.e. a and b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0036] As shown in Figs. 1 to 3 The present application provides a steel surface defect detection platform based on a local contrast superposition algorithm, comprising the following steps:
[0037] Step 1, selecting real steel defect samples of the production line, changing the light intensity condition when collecting images, and obtaining image data;
[0038] Step 2: Analyze the local contrast of the image using the Multiscale patch-based contrast method (mpcm), and count the local contrast of each pixel point with the background area.
[0039] Step 3: Superimpose the local contrast analysis graph to obtain the local contrast superimposition graph of the sample under multiple light intensity conditions, and then use the segmentation algorithm to capture the pixel points with high local contrast in the superimposition graph to complete the positioning of the defects.
[0040] Specifically: the positioning of the defects is as shown in Fig. 3 .
[0041] The defect types of the defect sample include indentation, scratch, dirt, and oil stain.
[0042] The system information of the steel surface defect detection platform based on the local contrast superposition algorithm is as follows: Linux ubun 5.15.0-105-generic #115~20.04.1-Ubuntu SMP Mon Apr 15 17:33:04 UTC 2024 x86_64 x86_64 x86_64 GNU / Linux.
[0043] The algorithm requires the following dependent conditions:
[0044] Tensorflow == 1.5.1, CUDA library version 10.0, and cuDNN library version 7.
[0045] The image data is specifically a sample in an imaging system, and the light source intensity is adjusted, and the sample is imaged under multiple different light intensities to obtain multiple images of the same sample with different brightness.
[0046] Specifically: obtaining multiple images of the same sample with different brightness, the analysis results are as shown in Fig. 2 .
[0047] a to c are the local contrast analysis graphs of the 1st, 6th, and 12th images, respectively, and d to e are the local contrast analysis graphs of the 1st, 6th, and 12th images, respectively.
[0048] The steel surface defect detection platform based on the local contrast superposition algorithm calls the CSI camera for image acquisition.
[0049] The CSI camera calling steps are as follows:
[0050] Recompile opencv-python to enable Gstreamer;
[0051] The compilation process is as follows: uninstall the original version opencv-python;
[0052] Install cmake, gcc compilation tools for package;
[0053] Install dependent libgtk, libgtk, libpng;
[0054] Check the version of opencv-python to determine the maximum limit of opencv-python on the frame rate of video stream;
[0055] Configure opencv-python options: check the parameters of the image acquisition device, and change the upper limit of the frame rate of opencv-python to be greater than or equal to the frame rate of the image device collected;
[0056] Change the resolution format of the input image of opencv-python to adapt to the sample;
[0057] Compile the c++ project and install;
[0058] The Gstreamer step is as follows: cv2.VideoCapture(0) is changed to:
[0059] cv2.VideoCapture(“nvarguscamerasrc”, cv2.CAP_GSTREAMER).
[0060] The above is only a specific embodiment of the present application, which enables those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown in the present application, but will conform to the widest range consistent with the principles and novel features of the present application.
Claims
1. A steel surface defect detection platform based on local contrast superposition algorithm, characterized in that: The steps include: Step 1: Select real steel defect samples from the production line, change the light intensity conditions during image acquisition, and obtain image data; Step 2: Use the Multiscale patch-based contrast method (mpcm) to analyze the local contrast of the image and calculate the local contrast between each pixel and the background area; Step 3: Overlay the local contrast analysis images to obtain the local contrast overlay images of the sample under multiple light intensity conditions. Then, use the segmentation algorithm to capture the pixels with high local contrast in the overlay image to locate the defect.
2. The steel surface defect detection platform based on the local contrast superposition algorithm according to claim 1, characterized in that: The defect types of the defective samples include: indentation, scratch, dirt, and oil stain.
3. The steel surface defect detection platform based on the local contrast superposition algorithm according to claim 1, characterized in that: The system information of the steel surface defect detection platform based on the local contrast superposition algorithm is as follows: Linuxubun 5.15.0-105-generic#115~20.04.1-Ubuntu SMP Mon Apr 1517:33:04UTC2024x86_64x86_64x86_64GNU / Linux; This algorithm requires the following dependencies: Tensorflow == 1.5.1, CUDA library 10.0 and cuDNN library version 7.
4. The steel surface defect detection platform based on the local contrast superposition algorithm according to claim 1, characterized in that: The image data specifically refers to a sample in an imaging system. The light source intensity is adjusted to image the sample under multiple light intensities, thereby obtaining multiple images of the same sample with different brightness.
5. The steel surface defect detection platform based on the local contrast superposition algorithm according to claim 1, characterized in that: The steel surface defect detection platform based on the local contrast superposition algorithm uses a CSI camera to acquire images.
6. The steel surface defect detection platform based on the local contrast superposition algorithm according to claim 1, characterized in that: The steps for calling the CSI camera are as follows: Recompile opencv-python and enable Gstreamer; The compilation process is as follows: Uninstall the original version opencv-python; Install cmake and gcc compilation tools for the package; Install dependencies libgtk, libgtk, libpng; Check the version of opencv-python to determine the maximum limit of opencv-python on the video stream frame rate; Configure opencv-python options: Check the parameters of the image acquisition device and change the upper limit of the frame rate of opencv-python to be greater than or equal to the frame rate acquired by the image device; Change the resolution format of OpenCV-Python input images to be sample-adaptive; Compile the C++ project and install; The steps to enable Gstreamer are as follows: change cv2.VideoCapture(0) to: cap = cv2.VideoCapture("nvarguscamerasrc", cv2.CAP_GSTREAMER).