A method and system for adjusting the intensity of a light source for surface defect detection

By setting the intensity of the first and second light sources in petrochemical equipment, calculating the degree of light instability, and using a binary search method or a step adjustment method to determine the optimal light source intensity, the problem of unstable light source intensity in petrochemical equipment under complex lighting conditions is solved, and high-precision defect detection is achieved.

CN119603832BActive Publication Date: 2025-11-07CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311167817.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2025-11-07
Estimated Expiration
2043-09-11

AI Technical Summary

Technical Problem

Existing petrochemical equipment defect detection systems suffer from unstable light source intensity adjustment under complex lighting conditions, leading to inaccurate detection results, especially in environments with alternating light and dark conditions where it is difficult to guarantee the lighting effect.

Method used

By setting the intensity of the first and second light sources, calculating the degree of illumination instability, determining the optimal light source intensity using a binary search method or a step adjustment method, and combining this with a texture projection method to determine the suitability of the light source intensity, the automatic adjustment of the light source intensity is achieved.

Benefits of technology

This improves the imaging quality and stability of the optical inspection system, ensuring the accuracy and precision of defect detection in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603832B_ABST
    Figure CN119603832B_ABST
Patent Text Reader

Abstract

The application discloses a light source intensity adjusting method and system for surface defect detection, comprising: setting a first light source intensity and a second light source intensity, and obtaining a to-be-detected area image under the corresponding light source intensity, wherein the first light source intensity is smaller than the second light source intensity; calculating the corresponding light instability degree according to the to-be-detected area images under the first light source intensity and the second light source intensity; searching the mean value of the light intensity between the first light source intensity and the second light source intensity or adjusting the light intensity in steps to determine the optimal light source intensity, so as to carry out surface defect detection and measurement on the to-be-detected area according to the optimal light source intensity. The application can quickly adjust the optimal lighting light source intensity suitable for the current detection environment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of petrochemical equipment surface defect detection, and in particular to a light source intensity adjustment method and system for surface defect detection in a complex light environment. BACKGROUND

[0002] Surface defect detection is one of the necessary links to ensure equipment quality and evaluate equipment service safety. Optical detection and measurement is the most commonly used means of surface defect detection. In recent years, in order to improve detection quality and production efficiency and reduce labor costs, visual-based automatic detection systems have attracted widespread attention and have achieved good application results in fixed detection. However, mobile defect detection and measurement systems are still lacking, one of the reasons being that optical detection and measurement are greatly affected by environmental light sources. Suitable light sources can greatly reduce the difficulty of image recognition algorithm processing, improve the positioning and measurement accuracy of visual detection systems, and thus ensure the stability and comprehensive performance of the visual system.

[0003] Currently, mobile detection and measurement systems need to cope with bright field, dark field and alternating light field environments. Especially when conducting inspection and detection work in petrochemical plants, the equipment materials are diverse, the reflection of light is not the same, and environmental light is one of the necessary considerations. In addition, in a restricted space working environment, the dark field environmental light intensity is uneven, and the entry and exit of the restricted space brings a large change in bright and dark fields, which requires adjusting the light source intensity according to the changes in the surface characteristics of the inspected object.

[0004] In the existing petrochemical equipment detection technical field, in the case of weak environmental light, the intensity of the illumination light is usually adjusted artificially. Artificial adjustment can cause the irradiated area to be too bright or too dark, resulting in inaccurate defect data, which affects accurate judgment of the number of defects and three-dimensional topography.

[0005] Therefore, the existing technology needs to provide a light source intensity adjustment scheme suitable for petrochemical scenes and a corresponding defect detection scheme. SUMMARY

[0006] The present application aims to provide a scheme that can solve the technical problem of the existing petrochemical equipment defect detection system being greatly affected by the lighting system and / or the lighting system being difficult to ensure stable lighting effect when facing complex bright and dark alternating environmental light.

[0007] To solve the above technical problems, the embodiment of the present application provides a light source intensity adjusting method for surface defect detection, comprising: step one, setting a first light source intensity and a second light source intensity, and obtaining a to-be-measured area image under the corresponding light source intensity, wherein the first light source intensity is less than the second light source intensity; step two, calculating the corresponding light instability degree according to the to-be-measured area images under the first light source intensity and the second light source intensity, searching for the mean value of the light intensity between the first light source intensity and the second light source intensity or adjusting the light intensity in steps, and determining the optimal light source intensity, so as to carry out surface defect detection and measurement on the to-be-measured area according to the optimal light source intensity.

[0008] Preferably, in the process of determining the optimal light source intensity by searching for the mean value of the light intensity between the first light source intensity and the second light source intensity, the process comprises: S101, determining the mean value of the two light source intensities according to the first light source intensity and the second light source intensity, thereby obtaining a to-be-measured area image under the current light source intensity mean value; S102, determining the light instability degree under the corresponding light source intensity according to the to-be-measured area images under the current first light source intensity, the current second light source intensity and the light source intensity mean value; S103, updating the first light source intensity or the second light source intensity according to the light instability degrees under the current first light source intensity, the current second light source intensity and the light source intensity mean value, thereby updating the light source intensity mean value; S104, judging whether the current light source intensity adjustment is ended according to the update adjustment amplitude of the light source intensity mean value in the last two consecutive times, and if so, taking the latest second light source intensity as the optimal light source intensity.

[0009] Preferably, in step S104, if the current adjustment is not ended, repeating step S102, step S103 and step S104, wherein it is judged whether the update adjustment amplitude of the light source intensity mean value in the last two consecutive times is less than a preset threshold value, and if so, ending the adjustment, otherwise, continuing the adjustment.

[0010] Preferably, in step S103, if the light instability degree under the current first light source intensity does not exceed the light instability degree under the current second light source intensity, and the light instability degree under the current light source intensity mean value does not exceed the light instability degree under the current second light source intensity, then assigning the current light source intensity mean value to the second light source intensity, and then updating the light source intensity mean value; if the light instability degree under the current second light source intensity does not exceed the light instability degree under the current first light source intensity, and the light instability degree under the current light source intensity mean value does not exceed the light instability degree under the current first light source intensity, then assigning the current light source intensity mean value to the first light source intensity, and then updating the light source intensity mean value.

[0011] Preferably, the preset threshold is K times of the initial second light source intensity value, wherein K is 5% to 10%; or the preset threshold is K times of the difference between the initial second light source intensity and the initial first light source intensity.

[0012] Preferably, in the process of determining the optimal light source intensity by adjusting the light intensity in steps, the process comprises: dividing the range interval between the first light source intensity and the second light source intensity into M intermediate intensity values at equal intervals; calculating the light source instability degree of each intermediate intensity value according to the test area image under each intermediate intensity value; and taking the light source intensity corresponding to the minimum value of the light source instability degree of all intermediate intensity values as the optimal light source intensity.

[0013] Preferably, the optimal light source intensity is obtained by using the following expression:

[0014] S = argmin f(P m )

[0015] Wherein, S represents the optimal light source intensity, m represents the serial number of each intermediate intensity value, P m represents the test area image under the mth intermediate intensity value, and f represents the light source instability degree of the P m image under the light source intensity value m.

[0016] Preferably, in the process of calculating the illumination instability degree of the test area image under the specified light source intensity, the process comprises: detecting the underexposure and overexposure serious area of the test area image, so as to calculate the illumination instability degree by using the following expression:

[0017] f′ = Xx / s′

[0018] Wherein, f′ represents the illumination instability degree, Xx represents the area of the underexposure and overexposure serious area, and s′ represents the area of the current test area image.

[0019] Preferably, in the process of calculating the illumination instability degree of the test area image under the specified light source intensity, the process comprises: building a projection device, projecting a first texture image to the test area by using the projection device, and recording the texture area in the projected first texture image; collecting the projection image when the first texture image is projected to the test area, and pre-processing and texture segmentation processing the projection image to form a second texture image; and calculating the illumination instability degree by using the following expression according to the area of the first texture and the second texture image:

[0020] f″ = (s″-s″ remaining ) / s″

[0021] Wherein, f″ represents the illumination instability degree, s″remaining s" represents the texture area in the second texture image.

[0022] Preferably, the texture in the first texture image is selected from one of a discrete light spot, a bar light and a coded structured light; the preprocessing sequentially carries out grayscale processing, Gaussian blur processing, binaryzation processing and affine transformation processing; and the texture segmentation processing is realized by a semantic segmentation model based on deep learning.

[0023] In another aspect, the embodiments of the present application provide a defect detection method for petrochemical equipment, which carries out surface defect detection and measurement on a to-be-detected region according to the optimal light source intensity obtained by the light source intensity adjustment method as described above.

[0024] In addition, the embodiments of the present application also provide a light source intensity adjustment system for surface defect detection, which is used to realize the light source intensity adjustment method as described above, wherein the light source intensity adjustment system comprises: an adjustable light source for adjusting its light source intensity to a specified light source intensity under the control of a specified light source intensity parameter from a controller; an image sensor for collecting a to-be-detected region image; a controller for setting a first light source intensity and a second light source intensity, the first light source intensity being smaller than the second light source intensity, and calculating corresponding light instability degrees according to the to-be-detected region images under the first light source intensity and the second light source intensity, determining an optimal light source intensity by continuously narrowing the range between the first light source intensity and the second light source intensity, or searching for a light intensity mean value or step-adjusting a light intensity, so that the detection system carries out surface defect detection and measurement on the to-be-detected region according to the optimal light source intensity.

[0025] Compared with the prior art, one or more embodiments in the above solution can have the following advantages or beneficial effects:

[0026] The present application provides a light source intensity adjustment method and system for surface defect detection. The method and system can be widely applied to optical detection and measurement of surface defects of equipment in the fields of petroleum and chemical industry, and the light source intensity adjustment method and system have wide applicability to equipment materials. The present application feeds back the instability degree of an irradiated surface to a light source intensity controller as an input parameter for next step light source intensity by establishing a light source intensity feedback method, so as to automatically adjust the environmental light, scattered light of a measured object surface and an irradiation light source, thereby being able to quickly and adaptively adjust the optimal illumination light source intensity suitable for the current detection environment, and the specific beneficial effects are as follows:

[0027] 1. The preset light source intensity is used for illumination, and an image is collected for analysis, and the light source intensity is adjusted according to the analysis result, thereby ensuring the stability of illumination;

[0028] 2. Based on the proportion of the underexposed and overexposed serious area in the obtained image of the to-be-tested area accounts for the entire collected image area, a bisection search method is proposed to adjust whether the current light source intensity is suitable for the current ambient light intensity, which is beneficial to the detection scene with high alternating frequency of bright and dark fields of ambient light;

[0029] 3. In view of the problem of unstable image clarity under complex ambient light, a texture projection method is proposed to judge the applicability of the light source intensity used for image acquisition, and for the problem of surface defect missing detection caused by overexposure or high reflectivity, the method can be used to quickly judge the influence degree of the ambient light on the to-be-tested plane, so as to quickly adjust the intensity of the illumination light source, so as to ensure the imaging quality of the to-be-tested plane, and ensure the imaging quality and stability of the mobile optical detection system.

[0030] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the structure particularly pointed out in the specification, claims and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0031] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, which together with the embodiments of the present application, serve to explain the present application, and do not constitute a limitation on the present application. In the drawings:

[0032] Figure 1 The step schematic diagram of the light source intensity adjustment method for surface defect detection of the embodiment of the present application.

[0033] Figure 2 The principle schematic diagram of the second example of the light instability degree calculation process in the light source intensity adjustment method for surface defect detection of the embodiment of the present application.

[0034] Figure 3 The structure schematic diagram of the light source intensity adjustment system for surface defect detection of the embodiment of the present application. DETAILED DESCRIPTION

[0035] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and embodiments, so that how the present application applies technical means to solve technical problems and achieves technical effects can be fully understood and implemented. It should be noted that, as long as there is no conflict, each embodiment in the present application and each feature in each embodiment can be combined with each other, and the formed technical solutions are all within the protection scope of the present application.

[0036] Additionally, the steps shown in the flowcharts of the drawings can be performed in a computer system such as a set of computer-executable instructions. Also, while a logical sequence of steps is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order other than that shown.

[0037] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0038] Surface defect detection is one of the necessary links to ensure equipment quality and evaluate the safety of equipment in service. Optical detection and measurement is the most commonly used means of surface defect detection. In recent years, in order to improve the detection quality and production efficiency, and reduce labor costs, visual-based automatic detection systems have attracted widespread attention, and good application results have been achieved in fixed detection. However, mobile defect detection and measurement systems are still not satisfactory, one of the reasons is that optical detection and measurement are greatly affected by environmental light sources. Suitable light sources can greatly reduce the difficulty of image recognition algorithm processing, improve the positioning and measurement accuracy of the visual detection system, and thus ensure the stability and comprehensive performance of the visual system.

[0039] Currently, mobile detection and measurement systems need to cope with bright field, dark field and alternating light field environments. Especially when conducting inspection and detection work in petrochemical plant areas, the equipment materials are diverse, and the reflection of light is not the same. Environmental light is one of the necessary considerations. In addition, in a restricted space operating environment, the dark field environment light intensity is uneven, and the bright and dark fields change greatly when entering and leaving the restricted space, which requires adjusting the light source intensity according to the changes in the surface characteristics of the inspected object.

[0040] In the existing petrochemical equipment detection technology field, in the case of weak environmental light, the intensity of the illumination light is usually adjusted artificially. Artificial adjustment can cause the irradiated area to be too bright or too dark, resulting in inaccurate defect data, thereby affecting the accurate judgment of the number of defects and three-dimensional topography.

[0041] Therefore, the prior art needs to provide a light source intensity adjustment scheme suitable for a petrochemical scene and a corresponding defect detection scheme.

[0042] To solve the technical problems in the background art, the embodiment of the present application proposes a light source intensity adjustment method and system for surface defect detection. The method and system use an image sensor to obtain light source intensity information in the current environment, and a controller adjusts the light source intensity according to a preset rule to search for the optimal light source intensity. The present application obtains light source intensity information and adjusts the light source intensity accordingly by interacting with the environment, so that the light source has adaptability relative to the environment, thereby improving the accuracy, stability and comprehensive performance of the visual detection system. At the same time, the present application analyzes the collected image itself without the need to set a reference object, and has better practicability.

[0043] Example One

[0044] Figure 1 The steps of the light source intensity adjustment method for surface defect detection according to the embodiment of the present application are shown in the following schematic diagram. Figure 1 The specific step flow of the light source intensity adjustment method for surface defect detection according to the embodiment of the present application is described below.

[0045] Step S110 sets a first light source intensity L and a second light source intensity R, and obtains a measured area image under the first light source intensity and a measured area image under the second light source intensity. In the embodiment of the present application, the first light source intensity value L is less than the second light source intensity R.

[0046] It should be noted that the measured area image according to the embodiment of the present application is an image collected by an image sensor under a specific light source intensity condition, which contains an area in a petrochemical equipment that currently needs to carry out surface defect detection and measurement tasks.

[0047] Specifically, in step S110, the light source intensity value L is first set by the controller, the controller adjusts the light source intensity value of the adjustable light source to L, so that the adjustable light source illuminates according to the L value, and the image sensor collects the current measured area image, denoted as PL; then, the light source intensity value R is set, the controller adjusts the light source intensity value of the adjustable light source to R, so that the adjustable light source illuminates according to the R value, and the image sensor collects the current measured area image, denoted as PR.

[0048] In the embodiment of the present application, the first light source intensity L is the minimum value of the light source intensity suitable for the current detection environment; the second light source intensity R is the maximum value of the light source intensity suitable for the current detection environment.

[0049] After obtaining the measured area images under the first light source intensity and the second light source intensity, step S120 is entered.

[0050] Step S120 calculates the light instability degree under the first light source intensity and the second light source intensity respectively according to the images of the region to be measured under the first light source intensity and the second light source intensity, and determines the optimal light source intensity by searching the mean value of the first light source intensity and the second light source intensity (i.e. the mean value of the first light source intensity and the second light source intensity) or by step adjusting the light intensity in a manner of continuously narrowing the range between the first light source intensity and the second light source intensity. In this way, the defect detection system can carry out surface defect detection and measurement on the region to be measured under the optimal light source intensity.

[0051] In step S120, the light instability degree under the first light source intensity and the light instability degree under the second light source intensity need to be calculated respectively according to the image of the region to be measured under the first light source intensity and the image of the region to be measured under the second light source intensity.

[0052] In the first embodiment, the embodiment of the present application can calculate the light instability degree under the corresponding light source intensity according to the detected underexposure and overexposure serious regions in the image of the region to be measured (the image of the region to be measured under the first light source intensity or the image of the region to be measured under the second light source intensity). The light instability degree is calculated by using the following expression:

[0053] f' = Xx / s'

[0054] Wherein, f' represents the light instability degree, Xx represents the area of the underexposure and overexposure serious regions in the current image of the region to be measured, s ′ represents the area of the current image of the region to be measured. It should be noted that in the embodiment of the present application, the underexposure and overexposure serious regions represent the sum of the underexposure serious regions and the overexposure serious regions in the image. In the process of calculating the area of the underexposure and overexposure serious regions, the current obtained color RGB image of the region to be measured is first converted into a gray image, at this time, the gray value of each position in the gray image ranges between 0-255; the area of the region with the gray value in the range of 0-23 in the current gray image is calculated to obtain the area of the underexposure serious regions, and the area of the region with the gray value in the range of 232-255 in the current gray image is calculated to obtain the area of the overexposure serious regions, thereby obtaining the area of the underexposure and overexposure serious regions in the current image of the region to be measured.

[0055] In the second embodiment, the embodiment of the present application can also measure the light instability degree of the image of the region to be measured under different light source intensities by additionally adding a projection device.

[0056] Specifically, in the first step, a projection device is built, the first texture image is projected to the to-be-measured region by using the projection device, and the texture area in the first texture image projected by the projection device is recorded by the controller. It should be noted that the first texture in the embodiment of the present application is the original texture image projected by the projection device (not the image when the original texture image is projected on the to-be-measured region).

[0057] In the second step, the image sensor collects the projection image containing the completely projected state of the first texture when the first texture image is projected to the to-be-measured region, and the controller performs preprocessing and texture segmentation processing on the projection image to form a second texture image. Figure 2 The principle diagram of the second example of the light source intensity adjustment method for the light instability degree calculation process in the surface defect detection method of the embodiment of the present application is shown in FIG. 2. Figure 2 As shown in FIG. 2, when the first texture image (i.e., the image containing the preset texture) is projected to the to-be-measured region, the collected projection image contains not only the first texture image, but also the completely projected state of the first texture image in the to-be-measured region (containing the texture actually projected to the to-be-measured region and the part not effectively projected to the to-be-measured region due to inappropriate light source intensity and other factors).

[0058] In one embodiment, the texture in the first texture image is selected from one of a discrete light spot, a bar light, and a coded structured light.

[0059] Then, the controller performs preprocessing on the projection image, and then performs texture segmentation processing, thereby forming a second texture image.

[0060] In one embodiment, in the preprocessing process of the projection image, a series of image processing tasks such as grayscale processing, Gaussian blur processing, binaryzation processing, and affine transformation processing are sequentially performed.

[0061] In one embodiment, in the texture segmentation processing, the preprocessed projection image is subjected to semantic segmentation by using a semantic segmentation model based on deep learning, so as to remove the area in the current image that does not belong to the micro-projection texture and is not effectively projected into a stripe (i.e., the missing part), thereby achieving texture segmentation processing of the projection image, forming an image containing only the effectively projected stripe area, which is denoted as a second texture image.

[0062] In the third step, the light instability degree is calculated according to the area of the first texture and the second texture image by using the following expression:

[0063] f″=(s″-s″ remaining ) / s″

[0064] Wherein, f″ represents the light instability degree, s″ remainings" represents the texture area in the second texture image.

[0065] Thus, after obtaining the illumination instability degree of the region under test under the first light source intensity and the second light source intensity, the step S120 further determines the optimal light source intensity according to the calculated illumination instability degrees of the first light source intensity and the second light source intensity by a preset rule.

[0066] In the first embodiment, the embodiment of the present application determines the optimal light source intensity by searching the mean value of the first light source intensity and the second light source intensity in a manner of continuously narrowing the range between the first light source intensity and the second light source intensity.

[0067] Specifically, the step S101 determines the mean value of the first light source intensity and the second light source intensity according to the current first light source intensity and the current second light source intensity, so as to acquire the region under test image under the current light source intensity mean value by the image sensor and obtain the region under test image under the current light source intensity mean value by the controller, which is recorded as PM. Then, the step S102 determines the illumination instability degree under the corresponding light source intensity according to the current first light source intensity, the current second light source intensity and the region under test image under the current light source intensity mean value. The illumination instability degree can be calculated by the first embodiment of the illumination instability degree calculation process or the second embodiment of the illumination instability degree calculation process.

[0068] The step S103 updates the first light source intensity or the second light source intensity by using the binary search method according to the current first light source intensity, the current second light source intensity and the illumination instability degree under the light source intensity mean value obtained by the step S102, so as to update the light source intensity mean value.

[0069] In an embodiment, if the illumination instability degree under the current first light source intensity does not exceed the illumination instability degree under the current second light source intensity, and the illumination instability degree under the current light source intensity mean value does not exceed the illumination instability degree under the current second light source intensity, the current light source intensity mean value is assigned to the second light source intensity, and then the current light source intensity mean value is updated.

[0070] Specifically, if f(P L )≤f(P R ), and f(P M )≤f(P R ), let R=M, and M=(L+R) / 2.

[0071] In another embodiment, if the instability degree of the illumination under the current second light source intensity does not exceed the instability degree of the illumination under the current first light source intensity, and the instability degree of the illumination under the current light source intensity average does not exceed the instability degree of the illumination under the current first light source intensity, the current light source intensity average is assigned to the first light source intensity, and then the current light source intensity average is updated.

[0072] Specifically, if f(P R )≤f(P L ), and f(P M )≤f(P L ), L=M, and M=(L+R) / 2.

[0073] Next, step S104, according to the update adjustment range of the latest two consecutive light source intensity averages, judges whether the current light source intensity adjustment is ended. If the light source intensity adjustment is ended, the latest second light source intensity is taken as the optimal light source intensity. If the current adjustment is not ended, steps S102, S103 and S104 are repeatedly executed.

[0074] In the process of judging whether the current light source intensity adjustment is ended, it includes judging whether the update adjustment range of the latest two consecutive light source intensity averages is less than a preset threshold. If yes, the adjustment is ended; otherwise, the feedback step S102 is continued to re-adjust the updated light intensity average and judge whether the adjustment is ended (i.e. the adjustment is not ended) by re-executing steps S102-S104.

[0075] It should be noted that the preset threshold is not specifically limited in the embodiment of the present application, and the person skilled in the art can set it according to the light source intensity adjustment accuracy. In one embodiment, the preset threshold can be K times of the initial second light source intensity value (i.e. the second light source intensity value set in step S110). In another embodiment, the preset threshold can also be K times of the difference between the initial second light source intensity and the initial first light source intensity. Wherein, K is 5%-10%.

[0076] In the second embodiment, the optimal light source intensity can also be determined by the step-by-step adjustment of the light intensity.

[0077] Specifically, step T101, the range interval between the first light source intensity and the second light source intensity set in step S110 is equally divided into M intermediate intensity values according to a preset interval, thereby forming an intermediate intensity value sequence. The total number of elements in the intermediate intensity value sequence is M, and the difference between adjacent elements is the preset interval.

[0078] Step T102, collect the image of the to-be-tested region under each intermediate intensity value, and calculate the light source instability degree of each intermediate intensity value according to the image of the to-be-tested region under each intermediate intensity value. The light source instability degree of each intermediate intensity value can be calculated by selecting the first embodiment of the light instability degree calculation process or the second embodiment of the light instability degree calculation process.

[0079] Step T103, take the light source intensity corresponding to the minimum value of the light source instability degrees of all intermediate intensity values as the final optimal light source intensity.

[0080] In an embodiment, the optimal light source intensity is obtained by using the following expression:

[0081] S = argmin f(P m )

[0082] Wherein, S represents the optimal light source intensity, m represents the serial number of each intermediate intensity value, P m represents the image of the to-be-tested region under the mth intermediate intensity value, and f represents the light source instability degree of the image under the light source intensity value m. m

[0083] Therefore, the present application searches for the optimal light source intensity suitable for the current defect detection environment through steps S110 and S120. At this time, the detection system can carry out surface defect detection and measurement work on the to-be-tested region under the action of the optimal light source intensity, so as to obtain more accurate defect detection results.

[0084] Example Two

[0085] Based on the above embodiment one, the specific process of a light source intensity adjustment method for surface defect detection is described as follows:

[0086] S1: preset a light source intensity value L, and perform illumination; an image sensor collects a current to-be-tested region image, denoted as P L ; adjust the light source intensity value to R and M respectively; an image sensor collects the to-be-tested region images under the above light source intensities respectively, denoted as P R and P M ;

[0087] Wherein, the light source intensity L≤M≤R.

[0088] S2: analyze the images obtained in S1 according to a preset judgment rule, and adjust the light source intensity value.

[0089] Optionally, the judgment rule is: after obtaining the images, detect the underexposed and overexposed serious regions in the images, and adjust the light source intensity according to the light instability degree; ​

[0090] wherein the calculation of the degree of illumination instability is as follows:

[0091] f' = s' loss / s'

[0092] wherein: f' is the degree of illumination instability, s' loss is the total area of the detection image and the overexposed area, and s' is the total area of the obtained image.

[0093] S3: repeat the process of image acquisition, analysis and intensity adjustment until the adjustment amplitude of the intensity value is less than a preset threshold value for two consecutive times;

[0094] The intensity adjustment process is to adjust the light source intensity by using a binary search method, wherein the binary search method is as follows:

[0095] If f(P L )≤f(P R ) and f(P M )≤f(P R ), let R=M, and M=(L+R) / 2;

[0096] If f(P R )≤f(P L ) and f(P M )≤f(P L ), let L=M, and M=(L+R) / 2;

[0097] wherein f is the evaluation of the degree of illumination instability under the current light intensity;

[0098] Preferably, the ratio K of the maximum intensity value is 5%.

[0099] S4: according to the result of S3, set the final intensity value, and perform surface defect detection and measurement work.

[0100] Example Three

[0101] Based on the above embodiment two, the light source intensity is adjusted by using a method similar to that of embodiment two, except that in embodiment three:

[0102] The preset light source intensity value L is the minimum value of the light source intensity; the adjusted light source intensity value R is the maximum value of the light source intensity; and the light source intensity value M is the average value of the light source intensity value L and the light source intensity value R.

[0103] In the process of light source intensity analysis:

[0104] As Figure 3As shown, a projection device is added in the detection system, and the projection device is used to project a specific texture to the region to be detected, and the preset texture is regarded as a first texture;

[0105] The specific texture is a strip light.

[0106] After the corresponding image is obtained, the texture projected in the region is segmented through image preprocessing and other operations, and is regarded as a second texture;

[0107] The image preprocessing includes steps such as graying, Gaussian blurring, binarization, affine transformation, etc.

[0108] The first texture is compared with the second texture, and the light source intensity is adjusted according to the light instability degree;

[0109] The calculation method of the light instability degree is as follows:

[0110] f″=(s″-s″ remaining ) / s″

[0111] In the formula, f″ is the light instability degree, s″ remaining is the obtained second texture area, and s″ is the set first texture area.

[0112] The remaining processes are similar to those of Embodiment Two.

[0113] Example Four

[0114] Based on Embodiment Two, the light source intensity is adjusted by using a method similar to that of Embodiment Two, and the difference is that, in Embodiment Four:

[0115] The intensity adjustment process is to adjust the light source intensity by using a step adjustment method;

[0116] The step adjustment method is to set M groups of intensity values at equal intervals from the minimum intensity to the maximum intensity of the light source, calculate the light instability degree under each group of intensity values, and the value of the optimal intensity S is:

[0117] S=argmin f(P m )

[0118] In the formula, S represents the optimal light source intensity, m represents the serial number of each intermediate intensity value, P m represents the image of the region to be detected under the mth intermediate intensity value, and f represents the light instability degree of the image P m under the light source intensity value m.

[0119] The remaining processes are similar to those of Embodiment Two.

[0120] Example Five

[0121] Based on the above embodiment two, the light source intensity adjustment is carried out by using the similar method of embodiment two, and the difference is that, in embodiment five:

[0122] In the process of light source intensity analysis:

[0123] As shown in the detection system, the projection device is added, and the projection device is used to project the specific texture to the to-be-measured area, and the preset texture is regarded as the first texture. Figure 3

[0124] Among them, the special texture is a coded structured light.

[0125] The intensity adjustment process is: the step adjustment method is used to adjust the light source intensity.

[0126] Among them, the step adjustment method is: M groups of intensity values are set at equal intervals from the minimum intensity to the maximum intensity of the light source, the light instability degree under each group of intensity values is calculated, and the value of the optimal intensity S is:

[0127] S = argmin f(P m )

[0128] In the formula: S represents the optimal light source intensity, m represents the serial number of each intermediate intensity value, P m represents the to-be-measured area image under the mth intermediate intensity value, and f represents the light source instability degree of the P m image under the light source intensity value m.

[0129] The remaining processes are similar to embodiment two.

[0130] Example Six

[0131] Based on the light source intensity adjustment method described in the above embodiments one to five, the present embodiment further provides a defect detection method for petrochemical equipment. The defect detection method carries out surface defect detection and measurement work on the to-be-measured area according to the optimal light source intensity obtained by the light source intensity adjustment method described in the above embodiments one to five.

[0132] In this way, the present application provides detection of imaging quality and improves the accuracy of defect detection results.

[0133] Example Seven

[0134] Based on the light source intensity adjustment method described in the above embodiments one to five, the present application further provides a light source intensity adjustment system for surface defect detection. The light source intensity adjustment system is used to realize the light source intensity adjustment method described in the above embodiments one to five.

[0135] Figure 3 ​It is a structural schematic diagram of the light source intensity adjusting system for surface defect detection of the embodiment of the present application. Figure 3 As shown in the figure, the light source intensity adjusting system of the embodiment of the present application comprises an adjustable light source 31, an image sensor 32 and a controller 33.

[0136] The adjustable light source 31 is used to adjust its light source intensity to a specified light source intensity under the control of the specified light source intensity parameter from the controller. The image sensor 32 is used to collect the image of the to-be-detected area after obtaining the image collection instruction from the controller 33. The controller 33 is first used to set a first light source intensity and a second light source intensity. The first light source intensity is less than the second light source intensity. Then, the controller 33 is further used to calculate the corresponding light instability degree according to the images of the to-be-detected area under the first light source intensity and the second light source intensity, and determine the optimal light source intensity by searching the mean value of the light intensity between the first light source intensity and the second light source intensity or adjusting the light intensity step by step, so that the detection system carries out surface defect detection and measurement work on the to-be-detected area according to the optimal light source intensity.

[0137] The present application discloses a light source intensity adjusting method and system for surface defect detection. The method and system can be widely applied to optical detection and measurement of surface defects of equipment in the fields of petroleum and chemical industry, and the light source intensity adjusting method and system have wide applicability to equipment materials. The present application feeds back the instability degree of the irradiated surface to the light source intensity controller as the input parameter of the next step light source intensity by establishing a light source intensity feedback method, so as to automatically adjust the environmental light, the scattered light of the measured object surface and the irradiation light source, and the beneficial effects are as follows:

[0138] 1. The preset light source intensity is used for illumination, and the image is collected for analysis. The light source intensity is adjusted according to the analysis result, so as to ensure the stability of illumination.

[0139] 2. Based on the proportion of the area of underexposed and overexposed serious area in the whole collected image area in the obtained image of the to-be-detected area, the dichotomy search method is proposed to adjust whether the current light source intensity is suitable for the current environmental light intensity, which is beneficial to the detection scene with high alternating frequency of bright and dark environmental light.

[0140] 3. In view of the problem of unstable clarity of the collected image under complex environmental light, the texture projection method is proposed to judge the applicability of the light source intensity used for the current image collection. In view of the problem of surface defect omission caused by overexposure or high reflectivity, the method can be used to quickly judge the influence degree of the environmental light on the detected plane, so as to quickly adjust the illumination light source intensity, so as to ensure the imaging quality of the to-be-detected plane, and ensure the imaging quality and stability of the mobile optical detection system.

[0141] The above merely provides the preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0142] In the description of the present application, unless otherwise specified and limited, the meaning of "a plurality of" is two or more; the orientation or positional relationship indicated by the terms "upper", "lower", "left", "right", "inner", "outer", "front end", "rear end", "head", "tail" and the like is based on the orientation or positional relationship shown in the drawings, which is merely for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third" and the like are only for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0143] In the description of the present application, it should be noted that, unless otherwise specified and limited, the terms "connected", "connected" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0144] It should be understood that the embodiments disclosed herein are not limited to the specific structure, processing steps or materials disclosed herein, but extend to equivalent alternatives of these features understood by those skilled in the relevant art. It should also be understood that the terms used herein are for the purpose of describing specific embodiments only and are not meant to be limiting.

[0145] The phrase "one embodiment" or "an embodiment" appearing in the specification means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Therefore, the phrase "one embodiment" or "an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment.

[0146] The embodiments of the present application are given for the purpose of illustration and description, and are not exhaustive or limit the present application to the disclosed form. Many modifications and variations will be apparent to those skilled in the art. The embodiments are chosen and described in order to better illustrate the principles and practical application of the present application, and to enable those skilled in the art to understand the present application in order to design various embodiments with various modifications suitable for specific purposes.

[0147] Although the present application has been described with reference to the above embodiments, the contents described are only the embodiments adopted for facilitating the understanding of the present application, and are not intended to limit the present application. Any modification and change in the form and details of the present application can be made by any person skilled in the art without departing from the spirit and scope of the present application, and the patent protection scope of the present application shall be subject to the scope defined by the appended claims.

Claims

1. A method for adjusting the intensity of a light source for surface defect detection, characterized in that, The method comprises the following steps: Step 1: setting a first light source intensity and a second light source intensity, and obtaining images of a to-be-measured region under the corresponding light source intensities, wherein the first light source intensity is less than the second light source intensity; Step 2: calculating the corresponding light instability degrees under the images of the to-be-measured region under the first light source intensity and the second light source intensity, searching for the mean value of the light intensities between the first light source intensity and the second light source intensity or adjusting the light intensity step by step to determine the optimal light source intensity, and performing surface defect detection and measurement on the to-be-measured region according to the optimal light source intensity, wherein the optimal light source intensity is determined based on the searching for the mean value of the light intensities by the following steps: S101: determining the mean value of the two light source intensities according to the first light source intensity and the second light source intensity, thereby obtaining the image of the to-be-measured region under the current light source intensity mean value; S102: determining the light instability degree under the corresponding light source intensity according to the current first light source intensity, the current second light source intensity, and the image of the to-be-measured region under the light source intensity mean value; S103: assigning the light source intensity mean value to the light source intensity with the greatest light instability degree between the first light source intensity and the second light source intensity by using the light instability degrees under the current first light source intensity, the current second light source intensity, and the light source intensity mean value, thereby updating the light source intensity mean value; S104: judging whether the current light source intensity adjustment is ended according to the adjustment range of the latest two consecutive updates of the light source intensity mean value, and if so, taking the latest second light source intensity as the optimal light source intensity, wherein The light instability degree refers to the area ratio of the regions with serious underexposure and overexposure or the regions not effectively projected onto the to-be-measured region due to inappropriate light source intensity.

2. The light source intensity adjustment method according to claim 1, wherein In step S104, if the current adjustment is not ended, steps S102, S103, and S104 are repeated, wherein It is judged whether the adjustment range of the latest two consecutive updates of the light source intensity mean value is less than a preset threshold, and if so, the adjustment is ended, otherwise the adjustment is continued.

3. The light source intensity adjustment method according to claim 1, wherein In step S103, If the light instability degree under the current first light source intensity does not exceed the light instability degree under the current second light source intensity, and the light instability degree under the current light source intensity mean value does not exceed the light instability degree under the current second light source intensity, the current light source intensity mean value is assigned to the second light source intensity, and then the light source intensity mean value is updated; If the light instability degree under the current second light source intensity does not exceed the light instability degree under the current first light source intensity, and the light instability degree under the current light source intensity mean value does not exceed the light instability degree under the current first light source intensity, the current light source intensity mean value is assigned to the first light source intensity, and then the light source intensity mean value is updated.

4. The light source intensity adjusting method according to claim 2, wherein The preset threshold is K times of the initial second light source intensity value, wherein K is 5% to 10%; or The preset threshold is K times of the difference between the initial second light source intensity and the initial first light source intensity.

5. The light source intensity adjustment method according to any one of claims 1 to 4, characterized by, In the process of determining the optimal light source intensity by adjusting the light intensity in steps, comprising: dividing the range interval between the first light source intensity and the second light source intensity into M intermediate intensity values at equal intervals; calculating the light source instability degree of each intermediate intensity value according to the image of the to-be-tested area under each intermediate intensity value; taking the light source intensity corresponding to the minimum value of the light source instability degree of all intermediate intensity values as the optimal light source intensity.

6. The light source intensity adjustment method according to claim 5, wherein, The optimal light source intensity is obtained using the following expression: wherein S represents the optimal light source intensity, m represents the serial number of each intermediate intensity value, P m represents the image of the region to be measured at the mth intermediate intensity value, f represents the light source instability degree of the image at the light source intensity value m m represents the image of the region to be measured at the mth intermediate intensity value, f represents the light source instability degree of the image at the light source intensity value m 7. The light source intensity adjustment method according to any one of claims 1 to 4, characterized by, In the process of calculating the illumination instability degree of the image of the to-be-tested area under a specified light source intensity, comprising: detecting the underexposed and overexposed severe areas of the image of the to-be-tested area, and calculating the illumination instability degree using the following expression: wherein, represents the degree of light instability, represents the area of the underexposed and overexposed severe regions, represents the area of the current image of the region to be measured.

8. The light source intensity adjustment method according to any one of claims 1 to 4, characterized by, In the process of calculating the illumination instability degree of the image of the to-be-tested area under a specified light source intensity, comprising: building a projection device, projecting a first texture image onto the to-be-tested area using the projection device, and recording the texture area in the projected first texture image; collecting the projection image when the first texture image is projected onto the to-be-tested area, and pre-processing and texture segmentation processing the projection image to form a second texture image; calculating the illumination instability degree using the following expression according to the area of the first texture and the second texture image: wherein, represents the degree of light instability, represents the texture area in the second texture image, represents the texture area in the first texture image.

9. The light source intensity adjustment method of claim 8, wherein the texture in the first texture image is selected from one of discrete light spots, bar lights, and coded structured light; the pre-processing sequentially performs grayscale processing, Gaussian blur processing, binarization processing, and affine transformation processing; the texture segmentation processing is realized by a semantic segmentation model based on deep learning.

10. A method for defect detection of a petrochemical plant, characterized in that, The defect detection method carries out surface defect detection and measurement work on the to-be-tested area according to the optimal light source intensity obtained by the light source intensity adjustment method of any one of claims 1-9.

11. A light source intensity adjustment system for surface defect detection, characterized by, The light source intensity adjustment system is used to implement the light source intensity adjustment method of any one of claims 1-9, wherein the light source intensity adjustment system comprises: an adjustable light source for adjusting its light source intensity to a specified light source intensity under the control of a specified light source intensity parameter from a controller; an image sensor for collecting images of the to-be-tested area; a controller for setting a first light source intensity and a second light source intensity, the first light source intensity being less than the second light source intensity, and calculating the corresponding illumination instability degree according to the images of the to-be-tested area under the first light source intensity and the second light source intensity, determining the optimal light source intensity by continuously narrowing the range between the first light source intensity and the second light source intensity or adjusting the light intensity in steps to search for the average light intensity of the two, so that the detection system carries out surface defect detection and measurement work on the to-be-tested area according to the optimal light source intensity.

Citation Information

Patent Citations

  • Visual inspection device and illumination condition setting method of visual inspection device

    CN110186926A