CN115908245A - Method, device, equipment and medium for detecting fine defects on surface of aviation material - Google Patents

Method, device, equipment and medium for detecting fine defects on surface of aviation material Download PDF

Info

Publication number
CN115908245A
CN115908245A CN202211206767.0A CN202211206767A CN115908245A CN 115908245 A CN115908245 A CN 115908245A CN 202211206767 A CN202211206767 A CN 202211206767A CN 115908245 A CN115908245 A CN 115908245A
Authority
CN
China
Prior art keywords
image
illumination compensation
acquiring
weight
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211206767.0A
Other languages
Chinese (zh)
Inventor
刘清华
朱绪胜
陈代鑫
周力
缑建杰
陈俊佑
蔡怀阳
曾静文
陈昌果
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Aircraft Industrial Group Co Ltd
Original Assignee
Chengdu Aircraft Industrial Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Aircraft Industrial Group Co Ltd filed Critical Chengdu Aircraft Industrial Group Co Ltd
Priority to CN202211206767.0A priority Critical patent/CN115908245A/en
Publication of CN115908245A publication Critical patent/CN115908245A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The application discloses a method, a device, equipment and a medium for detecting fine defects on the surface of an aviation material, and solves the technical problem that the existing method for detecting fine defects on the surface of the aviation material is low in detection precision. The method comprises the following steps: acquiring a single-channel gray image according to an initial defect image of an aeronautical material to be detected, wherein the initial defect image is a three-channel color image; according to the background image information of the single-channel gray image, carrying out illumination compensation on the single-channel gray image to obtain an illumination compensation image; according to a Gaussian filtering method, carrying out edge enhancement on the illumination compensation image to obtain an edge enhanced image; and according to an OSTU threshold value calculation method based on valley bottom enhancement weight, carrying out binarization processing on the edge enhancement image to obtain a target defect image, and according to the target defect image, obtaining the surface defect of the aeronautical material to be detected. The method and the device can improve the detection precision of the tiny defects on the surface of the aviation part.

Description

Method, device, equipment and medium for detecting fine defects on surface of aviation material
Technical Field
The application relates to the field of airplane digital manufacturing, in particular to a method, a device, equipment and a medium for detecting fine defects on the surface of an aviation material.
Background
Aircraft manufacturing is the process of assembling a large number of parts, finished products, conduits, etc. into a whole. Dozens of surface defects such as scratches, pits, excess materials and the like are easy to generate in the processes of processing, assembling, transporting and the like of various products. Defects not only damage the aesthetic appearance of the aircraft product, but also may cause serious damage to the performance of the product, and if various surface defects are not discovered and treated in time, the defects further cause greater quality problems of the aircraft parts, and directly influence the delivery of the aircraft.
In the prior art, the surface detection of the aviation material mainly adopts the traditional detection means such as visual or tactile detection, and the problem of low detection precision exists.
The above is only for the purpose of assisting understanding of the technical solutions of the present application, and does not represent an admission that the above is prior art.
Disclosure of Invention
The application mainly aims to provide a method, a device, equipment and a medium for detecting fine defects on the surface of an aviation material, and aims to solve the technical problem that the existing method for detecting fine defects on the surface of the aviation material is low in detection precision.
In order to achieve the purpose, the application provides a method for detecting fine defects on the surface of an aeronautical material, which comprises the following steps:
acquiring a single-channel gray image according to an initial defect image of an aeronautical material to be detected, wherein the initial defect image is a three-channel color image;
according to the background image information of the single-channel gray image, carrying out illumination compensation on the single-channel gray image to obtain an illumination compensation image;
according to a Gaussian filtering method, performing edge enhancement on the illumination compensation image to obtain an edge enhancement image;
carrying out binarization processing on the edge enhancement image to obtain a target defect image;
and acquiring the surface defects of the aeronautical material to be detected according to the target defect image.
As some optional embodiments of the present application, the step of obtaining a single-channel grayscale image according to an initial defect image of the aerospace material to be detected includes:
acquiring a preset color component weight, wherein the preset color score weight comprises a red component weight value, a blue component weight value and a green component weight value, the green component weight value is greater than the red component weight value, and the red component weight value is greater than the blue component weight value;
and performing weighted average operation on the initial defect image according to the preset color component weight to obtain a single-channel gray image.
As some optional embodiments of the present application, the performing illumination compensation on the single-channel grayscale image according to the background image information of the single-channel grayscale image to obtain an illumination compensation image includes:
carrying out color reversal on the single-channel gray image to obtain a reversed image;
according to a first preset range, carrying out median filtering processing on the reverse image to obtain a filtered image;
acquiring a background image of the single-channel gray image according to a second preset range and the filtering image;
and acquiring an illumination compensation image according to the background image, the reverse image and a first preset formula.
As some optional embodiments of the present application, the step of obtaining an illumination compensation image according to the background image, the reverse image and a first preset formula includes:
acquiring the magnification of each pixel point in the reverse image according to the background image;
and amplifying each pixel point of the reverse image according to the amplification factor and the first preset formula to obtain the illumination compensation image.
As some optional embodiments of the present application, the expression of the first preset formula is as follows:
Figure BDA0003873978980000031
in the formula, il (i, j) is a pixel value of the illumination compensation image at a pixel point (i, j), ib (i, j) is a pixel value of the background image at a pixel point (i, j), ir (i, j) is a pixel value of the inversion image at a pixel point (i, j), and k is the magnification.
As some optional embodiments of the present application, the step of performing edge enhancement on the illumination compensation image according to a gaussian filtering method to obtain an edge enhanced image includes:
according to a third preset area, carrying out Gaussian filtering processing on the illumination compensation image to obtain a filtered image;
and according to a first preset weight and a second preset weight, performing weighted difference operation on the illumination compensation image and the filtering image to obtain an edge enhancement image.
As some optional embodiments of the present application, the step of performing binarization processing on the edge-enhanced image according to an OSTU threshold calculation method based on valley bottom enhancement weight to obtain a target defect image includes:
acquiring a target binary threshold according to an OSTU threshold calculation method based on valley bottom enhancement weight;
and carrying out binarization processing on the edge enhanced image according to the target binarization threshold value to obtain a target defect image.
As some optional embodiments of the present application, the step of obtaining the target binarization threshold according to the method for computing the OSTU threshold based on the valley bottom enhancement weight includes:
acquiring an initial binarization threshold value, wherein the range of the initial binarization threshold value is [0,255];
dividing the edge enhancement image into a foreground image and a background image according to the initial binarization threshold value;
acquiring the inter-class variance of the foreground image and the background image according to a second preset formula;
and acquiring an initial binarization threshold corresponding to the maximum value of the inter-class variance as the target binarization threshold.
As some optional embodiments of the present application, the second preset formula is as follows:
Figure BDA0003873978980000041
in the formula (I), the compound is shown in the specification,
Figure BDA0003873978980000042
for said between-class variance, 1-p t For enhancement of weight at valley bottom, p t Probability of occurrence, w, of the initial binarized threshold in the edge-enhanced image 1 (t) and w 2 (t) the ratio of the foreground image and the background image in the edge-enhanced image, μ 1 (t) and μ 2 (t) is the inter-class mean gray scale value of the foreground image and the background image.
In addition, in order to achieve the above object, the present application further provides an apparatus for detecting fine defects on a surface of an aerospace material, the apparatus including:
the graying module is used for acquiring a single-channel grayscale image according to an initial defect image of the aeronautical material to be detected, wherein the initial defect image is a three-channel color image;
the illumination compensation module is used for carrying out illumination compensation on the single-channel gray-scale image according to the background image information of the single-channel gray-scale image to obtain an illumination compensation image;
the edge enhancement module is used for carrying out edge enhancement on the illumination compensation image according to a Gaussian filtering method to obtain an edge enhanced image;
a binarization module, configured to perform binarization processing on the edge enhancement image according to an OSTU threshold calculation method based on valley bottom enhancement weight to obtain a target defect image, where the valley bottom enhancement weight is obtained based on an occurrence probability of a binarization threshold obtained by the OSTU threshold calculation method in the edge enhancement image;
and the defect acquisition module is used for acquiring the surface defects of the to-be-detected aviation material according to the target defect image.
In order to solve the above technical problem, the present application further provides an electronic device, including: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method as described above.
In order to solve the above technical problem, the present application further proposes a storage medium having computer program instructions stored thereon, which when executed by a processor implement the above method.
In conclusion, the beneficial effects of the invention are as follows:
according to the method, the device, the equipment and the medium for detecting the fine defects on the surface of the aviation material, the single-channel gray image is obtained according to the initial defect image of the aviation material to be detected, wherein the initial defect image is a three-channel color image, the three-channel color image is converted into the single-channel gray image through gray processing, the amount of information contained in the image after gray processing is greatly reduced, the image processing calculation amount is correspondingly greatly reduced, and the detection efficiency of the surface defects is improved; according to the background image information of the single-channel gray image, illumination compensation is carried out on the single-channel gray image to obtain an illumination compensation image, the influence of nonuniform illumination on the binarization of a subsequent image can be reduced in the single-channel gray image through the illumination compensation, and the problem of nonuniform illumination of an acquired image caused by the high-reflectivity characteristic is solved through the illumination compensation as the surface of an aviation material mostly has the high-reflectivity characteristic; according to a Gaussian filtering method, edge enhancement is carried out on the illumination compensation image to obtain an edge enhancement image, high-frequency signals belonging to an edge area are removed, and low-frequency signals of the compensation image are reserved, so that the edge enhancement image can more clearly display the surface defects of the aeronautical material to be detected, and the detection precision is improved; the edge enhancement image is subjected to binarization processing to obtain a target defect image, the target defect image is simplified through binarization processing, the data volume is reduced, and the outline of fine defects on the surface of the aviation material can be highlighted, so that the detection precision of the fine defects on the surface of the aviation material is improved; and finally, acquiring the surface defects of the aeronautical material to be detected according to the target defect image.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting fine defects on the surface of an aircraft material according to an embodiment of the present application;
FIG. 2 is a single channel grayscale image according to an embodiment of the present application;
FIG. 3 is an illumination compensation image according to an embodiment of the present application;
FIG. 4 is an edge enhanced image according to an embodiment of the present application;
FIG. 5 is a target defect image according to an embodiment of the present application;
FIG. 6 is a schematic view of a device for detecting fine defects on the surface of an aircraft material according to an embodiment of the present application;
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group of processes, methods, articles, or devices that include the element.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Aircraft manufacturing is the process of assembling a large number of parts, finished products, conduits, etc. into a whole. Dozens of surface defects such as scratches, pits, redundant materials and the like are easy to generate in the processes of processing, assembling, transporting and the like of various products. Defects not only spoil the aesthetic appearance of the aircraft product, but can also cause severe damage to the performance of the product. If various surface defects are not discovered and treated in time, further greater quality problems of the aircraft parts can be caused, and the delivery of the aircraft is directly influenced.
The surface detection of the current components mainly adopts the traditional detection means such as visual or tactile detection. Although the manual detection has the advantages of low cost and simple production, the manual detection mode mainly depends on the operation of personnel and has great subjectivity. Meanwhile, for surface quality detection, due to the problems of poor eye color, fatigue and the like, the detection efficiency and reliability are difficult to guarantee.
Compared with a detection object in a natural scene, the surface of an aviation material mostly has the characteristics of high light reflection, multiple curvatures and the like, and the damage of the upper surface of a skin has the morphological characteristics of slender and tiny shape and the like, so that the fine defects of the surface cannot be accurately detected by the prior art.
In order to solve the above problem, as shown in fig. 1, the present application provides a method for detecting fine defects on the surface of an aerospace material, the method comprising the following steps:
the application provides a method for detecting fine defects on the surface of an aviation material, which comprises the following steps:
s1, acquiring a single-channel gray image according to an initial defect image of an aeronautical material to be detected, wherein the initial defect image is a three-channel color image;
specifically, an initial defect image of an aerospace material to be detected is obtained, the aerospace material to be detected includes, but is not limited to, a skin, a wing panel, an airplane tail fin and the like, the initial defect image can be obtained through an industrial camera or other imaging equipment, the initial defect image is a three-channel color image, the three-channel color image includes data of three color channels, and processing of the data of the three color channels is complex, so that subsequent processing efficiency is reduced.
As some optional embodiments of the present application, the step of obtaining a single-channel grayscale image according to an initial defect image of the aerospace material to be detected includes:
s11, obtaining a preset color component weight, wherein the preset color component weight comprises a red component weight, a blue component weight and a green component weight, the green component weight is greater than the red component weight, and the red component weight is greater than the blue component weight;
specifically, a preset color component weight is obtained, wherein the preset color score weight comprises a red component weight, a blue component weight and a green component weight, the red component weight, the blue component weight and the green component weight are determined according to the importance degree of different color channels, and the sensitivity of human eyes to colors is green > red > blue, so that in the embodiment, the green component weight is greater than the red component weight, and the red component weight is greater than the blue component weight; in an embodiment, the red color component weight is 0.299, the green color component weight is 0.587, and the blue color component weight is 0.144.
And S12, carrying out weighted average operation on the initial defect image according to the preset color component weight to obtain a single-channel gray image.
In this embodiment, after the preset color component weight is obtained, a weighted average operation is performed on the initial defective image to obtain the single-channel gray image, where an expression of the weighted average operation is as follows:
Figure BDA0003873978980000081
wherein the size of the initial defect image is M N, i belongs to {1, 2.. Multidot.M } is the ith row of the image; j belongs to {1, 2.,. N } the jth line of the image; i is g (i, j) is the pixel value of the converted grayscale image at (i, j), w R Is the red component weight, w B Is the blue component weight sum w G Green component weights, R (i, j), G (i, j), B: (i, j) are the red component, the green component and the blue component of the initial defect image at (i, j), respectively, and in a specific embodiment, the single-channel grayscale image obtained after the processing of this step is as shown in fig. 2.
S2, performing illumination compensation on the single-channel gray image according to background image information of the single-channel gray image to obtain an illumination compensation image;
specifically, when an initial defect image is obtained, because the surface of an aviation material mostly has the characteristics of high light reflection, multiple curvatures and the like compared with a detection object in a natural scene, the obtained initial image has the condition of inconsistent brightness and darkness, and further the detection precision is reduced, in this step, in order to reduce the influence of the inconsistent brightness and darkness on the binarization of a subsequent image, the background image information of the single-channel gray scale image is used for carrying out illumination compensation on the single-channel gray scale image in a segmentation manner to obtain a defect image with uniform illumination, and the defect image is marked as an illumination compensation image.
As some optional embodiments of the present application, the performing illumination compensation on the single-channel grayscale image according to the background image information of the single-channel grayscale image to obtain an illumination compensation image includes:
s21, reversing the color of the single-channel gray image to obtain a reversed image;
specifically, if illumination compensation is directly performed on background image information of a single-channel grayscale image, loss of image detail features is easily caused, so in this embodiment, in order to retain the detail features of the image as much as possible to improve the detection accuracy of defects, first, color inversion is performed on the single-channel grayscale image to obtain an inverted image, and specifically, the color inversion can be implemented by the following expression:
I r (i,j)=255-I g (i,j)
in the formula, ir (i, j) is a pixel value of the inverted image at a pixel point (i, j), and Ig (i, j) is a pixel value of the single-channel grayscale image at a pixel point (i, j).
S22, performing median filtering processing on the reverse image according to a first preset range to obtain a filtered image;
in this step, in order to retain the image detail features in the inverted image as much as possible, a median filtering process is used to suppress the noise of the inverted image, where the median filtering process is a nonlinear smoothing technique, and the gray value of each pixel point in the inverted image is set as the median of the gray values of all pixel points in a certain neighborhood window of the point, in this embodiment, according to a first preset range, the median filtering process is performed on the inverted image, that is, the gray value of each pixel point in the inverted image is set as the median of the gray values of all pixel points in the first preset range of the point, so as to obtain a filtered image, and to achieve noise suppression, thereby improving the accuracy of subsequent detection, in this embodiment, the first preset range is a square neighborhood with a side length of k1, and the value of k1 can be set by a user according to the size of the inverted image; in a specific embodiment, the value of k1 is 5.
S23, obtaining a background image of the single-channel gray image according to a second preset range and the filtering image;
in this step, in order to calculate the background image of the filtered image, first, the pixel values of all the pixel points in a second preset range around any point in the filtered image are obtained for any point in the filtered image, and the pixel values of the pixel points in the second preset range are sorted according to the size, so that the pixel point I in the background image b The value of (i, j) is the average value of the pixel values except for the maximum pixel value outer row name of 5 in the sorting, the second preset range is a square area with the side length of k2, the value of k2 can be determined according to the size of the filtered image, and in a specific embodiment, the value of k2 is 7.
S24, acquiring an illumination compensation image according to the background image, the reverse image and a first preset formula, wherein the expression of the first preset formula is as follows:
Figure BDA0003873978980000101
in the formula, il (i, j) is a pixel value of the illumination compensation image at the pixel point (i, j), ib (i, j) is a pixel value of the background image at the pixel point (i, j), ir (i, j) is a pixel value of the reverse image at the pixel point (i, j), and k is the magnification.
Specifically, after acquiring a background image, according to the background image, the reverse image and a first preset formula, an illumination compensation image may be acquired, in this embodiment, the magnification k is a fixed value, and although illumination compensation is implemented to a certain extent, a phenomenon of uneven brightness may still occur, so as to serve as some optional embodiments of the present application, the step of acquiring the illumination compensation image according to the background image, the reverse image and the first preset formula includes:
s241, acquiring the magnification of each pixel point in the reverse image according to the background image;
firstly, according to the pixel value of each pixel point in the background image, acquiring the magnification of each pixel point in the reverse image, so as to perform segmented illumination compensation on the reverse image, and obtain a defect image with uniform illumination, specifically, the magnification of the method can be calculated by the following segmentation functions:
Figure BDA0003873978980000102
in the formula I b And (i, j) is the pixel value of the background image at the point (i, j), and the corresponding magnification ratio of each pixel point can be obtained through the segmentation function, so that the finally obtained illumination compensation image has a better effect by amplifying according to the pixel value of each pixel point, and the accuracy of subsequent defect detection is further improved.
And S242, amplifying each pixel point of the reverse image according to the amplification factor and the first preset formula to obtain the illumination compensation image.
Specifically, after the magnification factor corresponding to each pixel point is obtained, the pixel value of each pixel point of the illumination compensation image can be obtained according to the first preset formula, illumination compensation of the reverse image is achieved, the brightness degree of the obtained illumination compensation image is consistent, and interference of aviation material characteristics on fine defect detection is solved to a certain extent, wherein in one embodiment, the illumination compensation image is as shown in fig. 3.
S3, according to a Gaussian filtering method, performing edge enhancement on the illumination compensation image to obtain an edge enhancement image;
the Gaussian filtering is a linear smooth filtering, is suitable for eliminating Gaussian noise, is widely applied to noise reduction of image processing, namely, a process of weighted average is carried out on a whole image, the value of each pixel point is obtained by carrying out weighted average on the pixel point and other pixel values in a neighborhood, and high-frequency signals belonging to an edge area are filtered by the low-pass Gaussian filtering, so that the edge of the illumination compensation image is enhanced, an edge enhanced image is obtained, and the accuracy of subsequent defect detection is improved conveniently.
As some optional embodiments of the present application, the step of performing edge enhancement on the illumination compensation image according to a gaussian filtering method to obtain an edge enhanced image includes:
s31, according to a third preset area, carrying out Gaussian filtering processing on the illumination compensation image to obtain a filtered image;
specifically, in order to filter high-frequency signals belonging to the edge region by low-pass gaussian filtering, the compensated image I is first collated l (i, j) selecting a third preset region around any point, and determining the weight corresponding to each pixel value in the third preset region by utilizing binary Gaussian normal distribution, wherein the third preset region is a square region with the side length of k3, and the weight corresponding to each pixel value is calculated by the following formula:
Figure BDA0003873978980000111
in the formula, w gauss (i, j) is the weight, σ, of the pixel point (i, j) i And σ j Is 15, followed by adoptingThe weight w of any pixel point in the third preset area is subjected to normalization treatment gauss (i, j) normalized to [0,1 ]]Filtered image I obtained using a Gaussian filter between ranges guass Any point of the guass (I, j) as illumination-compensated image I l (i, j) a weighted sum of all pixel values within a third predetermined area.
And S32, according to the first preset weight and the second preset weight, carrying out weighted difference operation on the illumination compensation image and the filtered image to obtain an edge enhancement image.
After gaussian filtering, the high frequency signals belonging to the edge region are filtered out, I guass Only the illumination compensation image I is kept l The edge-enhanced image can compensate the image I through the original illumination l And a filtered illumination compensation image I guass And performing weighted difference operation to obtain the formula as follows:
I enhance (i,j)=α*I l (i,j)-β*I guass (i,j)
wherein, the values of alpha and beta are respectively 1.2 and 0.4.
S4, carrying out binarization processing on the edge enhancement image to obtain a target defect image;
specifically, the image binarization is to set the gray value of a pixel point on an image to be 0 or 255, that is, to present an obvious black-and-white effect to the whole image, in an embodiment, the binarization processing is implemented by an averaging method, that is, an average value of pixel values of all pixel points in the edge-enhanced image is obtained, the average value is used as a binarization threshold, and the edge-enhanced image is binarized by the binarization threshold to obtain a target defect image.
As some optional embodiments of the present application, the step of performing binarization processing on the edge-enhanced image to obtain a target defect image includes:
s41, acquiring a target binary threshold according to an OSTU threshold calculation method based on valley bottom enhancement weight;
specifically, as the proportion of fine surface defects in an image is small, in order to obtain a better target binarization threshold value, the fine defects of the aviation material can be more obvious by the binarization image obtained by the target binarization threshold value, and the valley bottom enhancement weight is increased in the inter-class variance calculation formula of the existing OSTU threshold value calculation method; the valley bottom enhancement weight is obtained based on the occurrence probability of the binarization threshold obtained by the OSTU threshold calculation method in the edge enhancement image, the lower the occurrence probability is, the larger the valley bottom enhancement weight is, the weight can ensure that the result threshold is always the value at the valley bottom or the bottom edge of the gray distribution, so that the obtained binarization threshold is more suitable for the detection of the tiny defects, and further the detection precision of the tiny defects is improved, and the valley bottom enhancement weight can ensure that the result threshold is always the value at the valley bottom or the bottom edge of the gray distribution, so that the obtained binarization threshold is more suitable for the detection of the tiny defects, and further the detection precision of the tiny defects is improved.
As some optional embodiments of the present application, the step of obtaining the target binarization threshold according to the method for computing the OSTU threshold based on the valley bottom enhancement weight includes:
s411, obtaining an initial binarization threshold value, wherein the range of the initial binarization threshold value is [0,255];
s412, dividing the edge enhancement image into a foreground image and a background image according to the initial binarization threshold value;
specifically, let t be the binarization threshold of the image, the pixel value of the edge-enhanced image can be divided into two types of foreground images and background images according to t, which are respectively marked as C 1 = {0,1,2,. Eta., t } and C 2 ={t,t+ 1,t+2,...,255}。
S413, obtaining a variance between the classes of the foreground image and the background image according to a second preset formula, where the second preset formula is as follows:
Figure BDA0003873978980000131
in the formula (I), the compound is shown in the specification,
Figure BDA0003873978980000132
is the between-class variance, 1-p t Enhancing the weight, p, for said valley bottom t The probability, w, of the occurrence of the initial binarization threshold value in the edge enhanced image 1 (t) and w 2 (t) the ratio of the foreground image and the background image in the edge-enhanced image, μ 1 (t) and μ 2 (t) is the inter-class mean gray scale value of the foreground image and the background image;
in particular, p t Calculated by the following formula:
Figure BDA0003873978980000133
wherein M and N are the length and width of the edge-enhanced image, and N t Is the number of pixel points with pixel values as the initial binarization threshold, p t The smaller the value is, namely the lower the occurrence probability is, the larger the valley bottom enhancement weight is, and the weight can ensure that the result threshold value is always the value at the valley bottom or the bottom edge of the gray distribution, so that the obtained binarization threshold value is more suitable for detecting the fine defects, and the detection precision of the fine defects is further improved.
And S414, acquiring an initial binarization threshold corresponding to the maximum value of the inter-class variance as the target binarization threshold.
The inter-class variance is a measure of the uniformity of the gray distribution, the larger the inter-class variance between the background and the foreground is, the larger the difference between two parts constituting the image is, and when part of the foreground is wrongly divided into the background or part of the background is wrongly divided into the foreground, the difference between the two parts is reduced, so that the segmentation with the largest inter-class variance means that the probability of the wrong division is the smallest, and therefore, after the inter-class variance is obtained, the initial binary threshold corresponding to the largest value of the inter-class variance is obtained as the target binary threshold, and the target binary threshold can be calculated by the following formula:
Figure BDA0003873978980000141
and S42, carrying out binarization processing on the edge enhanced image according to the target binarization threshold value to obtain a target defect image.
Specifically, after a target binarization threshold is determined, binarizing the edge enhanced image to obtain a target defect image, wherein a formula is as follows:
Figure BDA0003873978980000142
in the formula I binary (i, j) is the pixel value of the target defect image at point (i, j), T is the target binarization threshold value,
Figure DA00038739789856266858
for the pixel value of the edge-enhanced image at point (i, j), in one embodiment, the target defect image is shown in FIG. 5.
And S5, acquiring the surface defects of the aeronautical material to be detected according to the target defect image.
And finally, according to the target defect image, obtaining the surface defect of the aeronautical material to be detected in a machine vision or manual identification mode.
According to the method, the device, the equipment and the medium for detecting the fine defects on the surface of the aviation material, the single-channel gray image is obtained according to the initial defect image of the aviation material to be detected, wherein the initial defect image is a three-channel color image, the three-channel color image is converted into the single-channel gray image through gray processing, the amount of information contained in the image after gray processing is greatly reduced, the image processing calculation amount is correspondingly greatly reduced, and the detection efficiency of the surface defects is improved; according to the background image information of the single-channel gray image, illumination compensation is carried out on the single-channel gray image to obtain an illumination compensation image, the influence of nonuniform illumination on the binarization of a subsequent image can be reduced in the single-channel gray image through the illumination compensation, and the problem of nonuniform illumination of an acquired image caused by the high-reflectivity characteristic is solved through the illumination compensation as the surface of an aviation material mostly has the high-reflectivity characteristic; according to a Gaussian filtering method, edge enhancement is carried out on the illumination compensation image to obtain an edge enhancement image, high-frequency signals belonging to an edge area are removed, and low-frequency signals of the compensation image are reserved, so that the edge enhancement image can more clearly display the surface defects of the aeronautical material to be detected, and the detection precision is improved; according to an OSTU threshold value calculation method based on valley bottom enhancement weight, performing binarization processing on the edge enhancement image to obtain a target defect image, wherein the valley bottom enhancement weight is obtained based on the occurrence probability of a binarization threshold value obtained by the OSTU threshold value calculation method in the edge enhancement image, and due to the arrangement of the valley bottom enhancement weight, the binarization threshold value obtained by the OSTU threshold value calculation method is always the value of the valley bottom or the edge of the bottom of gray distribution, so that the detection precision of fine defects on the surface of the aviation material is further improved; and finally, acquiring the surface defects of the aviation material to be detected according to the target defect image.
In addition, in order to achieve the above object, the present application further provides an apparatus for detecting fine defects on a surface of an aircraft material, the apparatus comprising:
the system comprises a graying module, a defect detection module and a defect detection module, wherein the graying module is used for acquiring a single-channel grayscale image according to an initial defect image of the aeronautical material to be detected, and the initial defect image is a three-channel color image;
the illumination compensation module is used for carrying out illumination compensation on the single-channel gray-scale image according to the background image information of the single-channel gray-scale image to obtain an illumination compensation image;
the edge enhancement module is used for carrying out edge enhancement on the illumination compensation image according to a Gaussian filtering method to obtain an edge enhanced image;
a binarization module, configured to perform binarization processing on the edge enhancement image according to an OSTU threshold value calculation method based on valley bottom enhancement weight to obtain a target defect image, where the valley bottom enhancement weight is obtained based on an occurrence probability of a binarization threshold value obtained by the OSTU threshold value calculation method in the edge enhancement image;
and the defect acquisition module is used for acquiring the surface defects of the to-be-detected aviation material according to the target defect image.
It should be noted that, each module in the apparatus for detecting a fine defect on an aircraft material surface of this embodiment corresponds to each step in the method for detecting a fine defect on an aircraft material surface of the foregoing embodiment one by one, and therefore, the specific implementation and the achieved technical effect of this embodiment may refer to the implementation of the method for detecting a fine defect on an aircraft material surface, which is not described herein again.
In addition, the method for detecting the fine defects on the surface of the aviation material, which is described in the embodiment of the invention in connection with fig. 1, can be realized by electronic-based equipment. Fig. 3 is a schematic diagram illustrating a hardware structure of an electronic device according to an embodiment of the present invention.
The electronic device may comprise at least one processor 301, at least one memory 302, and computer program instructions stored in the memory 302 which, when executed by the processor 301, implement the method of the above-described embodiments.
In particular, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present invention.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may include a Hard Disk Drive (HDD), a floppy Disk Drive, flash memory, an optical Disk, a magneto-optical Disk, magnetic tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 302 may include removable or non-removable (or fixed) media, where appropriate. The memory 302 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 302 is non-volatile solid-state memory. In a particular embodiment, the memory 302 includes Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement any one of the above-mentioned methods for detecting fine defects on the surface of an aircraft material.
In one example, the electronic device may also include a communication interface and a bus. As shown in fig. 3, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 to complete communication therebetween. The communication interface is mainly used for realizing communication among modules, devices, units and/or equipment in the embodiment of the invention.
A bus comprises hardware, software, or both that couple the components of the electronic device to each other. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. A bus may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
In addition, in combination with the method for detecting fine defects on the surface of an aircraft material in the foregoing embodiments, embodiments of the present invention may be implemented by providing a computer-readable storage medium. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions can be executed by a processor to realize the method for detecting the fine defects on the surface of the aeronautical material in any one of the above embodiments.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps, after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in a different order from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it is clear to those skilled in the art that, for convenience and simplicity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (12)

1. A method for detecting fine defects on the surface of an aviation material is characterized by comprising the following steps:
acquiring a single-channel gray image according to an initial defect image of an aeronautical material to be detected, wherein the initial defect image is a three-channel color image;
according to the background image information of the single-channel gray image, carrying out illumination compensation on the single-channel gray image to obtain an illumination compensation image;
according to a Gaussian filtering method, performing edge enhancement on the illumination compensation image to obtain an edge enhancement image;
carrying out binarization processing on the edge enhancement image to obtain a target defect image;
and acquiring the surface defects of the aviation material to be detected according to the target defect image.
2. The method for detecting fine defects on the surface of an aircraft material according to claim 1, wherein the step of obtaining a single-channel gray image based on an initial defect image of the aircraft material to be detected comprises:
acquiring a preset color component weight, wherein the preset color score weight comprises a red component weight, a blue component weight and a green component weight, the green component weight is greater than the red component weight, and the red component weight is greater than the blue component weight;
and performing weighted average operation on the initial defect image according to the preset color component weight to obtain a single-channel gray image.
3. The method for detecting the fine defects on the surface of the aircraft material according to claim 1, wherein the step of performing illumination compensation on the single-channel gray-scale image according to the background image information of the single-channel gray-scale image to obtain an illumination compensation image comprises the following steps:
carrying out color reversal on the single-channel gray image to obtain a reversed image;
according to a first preset range, carrying out median filtering processing on the reverse image to obtain a filtered image;
acquiring a background image of the single-channel gray image according to a second preset range and the filtering image;
and acquiring an illumination compensation image according to the background image, the reverse image and a first preset formula.
4. The method for detecting fine defects on the surface of an aircraft material according to claim 3, wherein the step of obtaining an illumination compensation image according to the background image, the reverse image and a first preset formula comprises:
acquiring the magnification of each pixel point in the reverse image according to the background image;
and amplifying each pixel point of the reverse image according to the amplification factor and the first preset formula to obtain the illumination compensation image.
5. The method for detecting fine defects on the surface of an aircraft material as claimed in claim 3, wherein the expression of the first preset formula is as follows:
Figure FDA0003873978970000021
in the formula, il (i, j) is a pixel value of the illumination compensation image at a pixel point (i, j), ib (i, j) is a pixel value of the background image at a pixel point (i, j), ir (i, j) is a pixel value of the inversion image at a pixel point (i, j), and k is a magnification.
6. The method for detecting the fine defects on the surface of the aviation material as claimed in claim 1, wherein the step of performing edge enhancement on the illumination compensation image according to a gaussian filtering method to obtain an edge enhanced image comprises:
according to a third preset area, carrying out Gaussian filtering processing on the illumination compensation image to obtain a filtered image;
and according to a first preset weight and a second preset weight, performing weighted difference operation on the illumination compensation image and the filtering image to obtain an edge enhancement image.
7. The method for detecting the fine defects on the surface of the aviation material as claimed in claim 1, wherein the step of performing binarization processing on the edge enhancement image to obtain a target defect image comprises the following steps:
acquiring a target binary threshold according to an OSTU threshold calculation method based on valley bottom enhancement weight;
and carrying out binarization processing on the edge enhanced image according to the target binarization threshold value to obtain a target defect image.
8. The method for detecting the fine defects on the surface of the aircraft material as claimed in claim 7, wherein the step of obtaining the target binarization threshold value according to the OSTU threshold value calculation method based on the valley bottom enhancement weight comprises the following steps:
acquiring an initial binarization threshold value, wherein the range of the initial binarization threshold value is [0,255];
dividing the edge enhancement image into a foreground image and a background image according to the initial binarization threshold value;
acquiring the inter-class variance of the foreground image and the background image according to a second preset formula;
and acquiring an initial binarization threshold corresponding to the maximum value of the inter-class variance as the target binarization threshold.
9. The method for detecting fine defects on the surface of an aircraft material according to claim 8, wherein the second preset formula is as follows:
Figure FDA0003873978970000031
in the formula (I), the compound is shown in the specification,
Figure FDA0003873978970000032
for said between-class variance, 1-p t For enhancement of weight at valley bottom, p t The probability, w, of the occurrence of the initial binarization threshold value in the edge enhanced image 1 (t) and w 2 (t) the ratio of the foreground image and the background image in the edge-enhanced image, μ 1 (t) and μ 2 (t) is the inter-class mean gray scale value of the foreground image and the background image.
10. An apparatus for detecting fine defects on the surface of an aircraft material, the apparatus comprising:
the graying module is used for acquiring a single-channel grayscale image according to an initial defect image of the aeronautical material to be detected, wherein the initial defect image is a three-channel color image;
the illumination compensation module is used for carrying out illumination compensation on the single-channel gray-scale image according to the background image information of the single-channel gray-scale image to obtain an illumination compensation image;
the edge enhancement module is used for carrying out edge enhancement on the illumination compensation image according to a Gaussian filtering method to obtain an edge enhancement image;
a binarization module, configured to perform binarization processing on the edge enhancement image according to an OSTU threshold calculation method based on valley bottom enhancement weight to obtain a target defect image, where the valley bottom enhancement weight is obtained based on an occurrence probability of a binarization threshold obtained by the OSTU threshold calculation method in the edge enhancement image;
and the defect acquisition module is used for acquiring the surface defects of the to-be-detected aviation material according to the target defect image.
11. An electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of any one of claims 1-9.
12. A storage medium having a computer-readable program stored thereon, the computer program instructions when executed by a processor implementing the method of any one of claims 1-9.
CN202211206767.0A 2022-09-30 2022-09-30 Method, device, equipment and medium for detecting fine defects on surface of aviation material Pending CN115908245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211206767.0A CN115908245A (en) 2022-09-30 2022-09-30 Method, device, equipment and medium for detecting fine defects on surface of aviation material

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211206767.0A CN115908245A (en) 2022-09-30 2022-09-30 Method, device, equipment and medium for detecting fine defects on surface of aviation material

Publications (1)

Publication Number Publication Date
CN115908245A true CN115908245A (en) 2023-04-04

Family

ID=86473404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211206767.0A Pending CN115908245A (en) 2022-09-30 2022-09-30 Method, device, equipment and medium for detecting fine defects on surface of aviation material

Country Status (1)

Country Link
CN (1) CN115908245A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117809138A (en) * 2024-02-23 2024-04-02 中国电子科技集团公司第二十九研究所 Method and system for enhancing redundant detection image data set
CN117809138B (en) * 2024-02-23 2024-05-14 中国电子科技集团公司第二十九研究所 Method and system for enhancing redundant detection image data set

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117809138A (en) * 2024-02-23 2024-04-02 中国电子科技集团公司第二十九研究所 Method and system for enhancing redundant detection image data set
CN117809138B (en) * 2024-02-23 2024-05-14 中国电子科技集团公司第二十九研究所 Method and system for enhancing redundant detection image data set

Similar Documents

Publication Publication Date Title
CN116721106B (en) Profile flaw visual detection method based on image processing
CN107507173B (en) No-reference definition evaluation method and system for full-slice image
CN102043950B (en) Vehicle outline recognition method based on canny operator and marginal point statistic
CN109242853B (en) PCB defect intelligent detection method based on image processing
CN110288584B (en) Ceramic hot dip aluminizing surface defect detection method and device based on machine vision
CN114219805B (en) Intelligent detection method for glass defects
CN101984346A (en) Method of detecting fruit surface defect based on low pass filter
CN107315990B (en) Pedestrian detection algorithm based on XCS-LBP characteristics
Krishnan et al. A survey on different edge detection techniques for image segmentation
CN115082466B (en) PCB surface welding spot defect detection method and system
CN114972325B (en) Automobile hub defect detection method based on image processing
CN112734691A (en) Industrial product defect detection method and device, terminal equipment and storage medium
CN116777907A (en) Sheet metal part quality detection method
CN112258569B (en) Pupil center positioning method, pupil center positioning device, pupil center positioning equipment and computer storage medium
CN108932449B (en) Bar code binarization method and system based on clustering
CN105320970A (en) Potato disease diagnostic device, diagnostic system and diagnostic method
CN105844337A (en) Intelligent garbage classification device
CN109738448A (en) A kind of industrial products intelligent detection device and method
CN116109637A (en) System and method for detecting appearance defects of turbocharger impeller based on vision
CN115439456A (en) Method and device for detecting and identifying object in pathological image
CN114820626A (en) Intelligent detection method for automobile front part configuration
CN206897873U (en) A kind of image procossing and detecting system based on detection product performance
CN115908245A (en) Method, device, equipment and medium for detecting fine defects on surface of aviation material
CN104102911A (en) Image processing for AOI (automated optical inspection)-based bullet appearance defect detection system
CN111311610A (en) Image segmentation method and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination