CN115690089A - Image enhancement preprocessing method and system for weak defect detection - Google Patents

Image enhancement preprocessing method and system for weak defect detection Download PDF

Info

Publication number
CN115690089A
CN115690089A CN202211452986.7A CN202211452986A CN115690089A CN 115690089 A CN115690089 A CN 115690089A CN 202211452986 A CN202211452986 A CN 202211452986A CN 115690089 A CN115690089 A CN 115690089A
Authority
CN
China
Prior art keywords
area
sub
defect
gray
region
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
CN202211452986.7A
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.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech 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 Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202211452986.7A priority Critical patent/CN115690089A/en
Publication of CN115690089A publication Critical patent/CN115690089A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Processing (AREA)

Abstract

The application relates to the technical field of defect detection, in particular to an image enhancement pretreatment method and system for weak defect detection, which can solve the problem of inaccurate defect detection result caused by image enhancement steps at present to a certain extent. The method comprises the following steps: acquiring a detection area of the acquired image; dividing the detection area into at least two sub-areas, and determining a possible defect area in each sub-area; splicing possible defect areas in all the sub-areas to obtain a defect suspected area, wherein the defect suspected area is used for corresponding to an area to be detected in a detection area image, and the area to be detected is used for determining a real defect in an image enhancement mode; wherein determining the possible defect area in each sub-area comprises: calculating the gray average value in each sub-area, and determining the gray average value and the floating value thereof as the offset interval in the sub-area; and after stretching the gray value gray scale in the offset interval, extracting a possible defect area in each sub-area.

Description

Image enhancement preprocessing method and system for weak defect detection
Technical Field
The application relates to the technical field of defect detection, in particular to an image enhancement preprocessing method and system for weak defect detection.
Background
Because uncertain factors of quality control exist in the production process of industrial products, various defects are often generated on the surfaces of the products, so that the defects of the products are generally detected before the products leave a factory so as to remove unqualified products.
In the implementation process of detecting product defects, gray scales in an image containing defects are generally compared in a visual image processing mode at present, and then the positions of the defects and relevant parameters of the defects are determined in a threshold segmentation mode.
However, in the weak defect image, the difference between the gray value of the defect itself and the background gray value is very small, the defect boundary is fuzzy, and the segmentation of the defect is also influenced by the inherent texture features on the surface of the detected product and the noise interference of similar gray values, so that a large batch of over-detection is easily caused when the image enhancement step is performed at present, and finally the detection result of the whole product is inaccurate.
Disclosure of Invention
In order to solve the problem that the defect detection result is inaccurate when the image enhancement step is carried out at present, the application provides an image enhancement pretreatment method and system for weak defect detection.
The embodiment of the application is realized as follows:
a first aspect of the embodiments of the present application provides an image enhancement preprocessing method for weak defect detection, including:
acquiring a detection area of the acquired image, wherein the detection area comprises a defect area;
dividing the detection area into at least two sub-areas, and determining a possible defect area in each sub-area;
splicing the possible defect areas in all the sub-areas to obtain a defect suspected area, wherein the defect suspected area is used for corresponding to an area to be detected in a detection area image, and the area to be detected is used for determining a real defect through an image enhancement mode;
wherein determining the possible defect area in each sub-area comprises:
calculating the gray average value in each sub-area, and determining the gray average value and the floating value thereof as the offset interval in the sub-area;
and after carrying out gray stretching on the gray value in the offset interval, extracting a possible defect area in each sub-area.
In some embodiments, in the step of dividing the detection region into at least two sub-regions, further comprising: the adjacent subregions are mutually overlapped.
In some embodiments, in the step of determining the mean value of the gray levels and the floating value thereof as the offset interval in the sub-region, the method further includes:
determining an upper offset and a lower offset of the gray level mean value;
and calculating an offset interval of the gray level mean value in each sub-area, wherein the lower limit value of the offset interval is the difference value of the gray level mean value and the lower offset, and the lower limit value of the offset interval is the sum of the gray level mean value and the upper offset.
In some embodiments, before the step of determining the possible defect area in each of the sub-areas, the method further comprises: and when the condition of uneven illumination exists in the image of the detection area, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area.
In some embodiments, in the step of calculating the mean value of the gray levels in each of the sub-regions, the method further includes:
acquiring gray distribution data on an original acquired image corresponding to the sub-region, wherein the distribution data comprises the number of pixels contained in each gray level;
and after eliminating the gray values smaller than the first number, calculating the average gray value after eliminating the interference.
In some embodiments, when the region to be detected is used for determining a real defect through an image enhancement mode, the method further includes: and cutting a region in a corresponding range on the image of the detection region as the region to be detected, and then performing image enhancement on the region to be detected.
A second aspect of the embodiments of the present application provides an image enhancement preprocessing system for weak defect detection, including:
the image acquisition module is used for acquiring a detection area of the acquired image, and the detection area comprises a defect area;
a sub-region determining module, configured to divide the detection region into at least two sub-regions to determine a possible defect region in each of the sub-regions; in the process of determining the possible defect area in each sub-area, the sub-area determining module is used for calculating the gray average value in each sub-area and determining the gray average value and the floating value thereof as the offset interval in the sub-area; after carrying out gray stretching on the gray value in the offset interval, extracting a possible defect area in each sub-area;
and the defect suspected area determining module is used for splicing the possible defect areas in all the sub-areas to obtain a defect suspected area, wherein the defect suspected area is used for corresponding to an area to be detected in the image of the detection area, and the area to be detected is used for determining a real defect in an image enhancement mode.
In some embodiments, in the step of dividing the detection region into at least two sub-regions, adjacent sub-regions overlap with each other.
In some embodiments, in the step of determining the mean value of the gray scale and the floating value thereof as the offset interval in the sub-region, the sub-region determining module is further configured to:
determining an upper offset and a lower offset of the gray level mean value;
and calculating an offset interval of the gray level mean value in each sub-area, wherein the lower limit value of the offset interval is the difference value of the gray level mean value and the lower offset, and the lower limit value of the offset interval is the sum of the gray level mean value and the upper offset.
In some embodiments, before the step of determining the possible defect region in each of the sub-regions, the sub-region determining module is further configured to: and when the condition of uneven illumination exists in the image of the detection area, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area.
In some embodiments, in the step of calculating the mean value of the gray scale in each of the sub-regions, the sub-region determining module is further configured to obtain gray scale distribution data on the original acquired image corresponding to the sub-region, where the distribution data includes the number of pixels included in each gray scale; and after eliminating the gray values smaller than the first number, calculating the average gray value after eliminating the interference.
The beneficial effect of this application: the detection method comprises the steps of firstly dividing a detection area into sub-areas, then amplifying defect positions in the sub-areas in a gray scale stretching mode, so that possible defect areas in the sub-areas are accurately positioned, the possible defect areas in all the sub-areas are combined to obtain a suspected defect area, and subsequent enhancement processing and other operations are carried out on the basis of the area to be detected corresponding to the suspected defect area.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flow diagram of a method of image enhancement preprocessing for weak defect detection according to one or more embodiments of the present application;
fig. 2 is a schematic diagram of sub-regions formed after segmenting a detection region in a working process according to an image enhancement pre-processing method for weak defect detection in one or more embodiments of the present application;
fig. 3 is a flowchart illustrating a process of determining a possible defect region in each sub-region in an image enhancement preprocessing method for weak defect detection according to one or more embodiments of the present disclosure;
fig. 4 is a flowchart of interference point elimination before calculating a sub-region gray-scale mean value in an image enhancement preprocessing method for weak defect detection according to one or more embodiments of the present application;
fig. 5 is a schematic structural diagram of an image enhancement preprocessing system for weak defect detection according to one or more embodiments of the present application;
fig. 6 is a schematic structural diagram of an image enhancement preprocessing device for weak defect detection according to one or more embodiments of the present application.
Detailed Description
To make the objects, embodiments and advantages of the present application clearer, the following description of exemplary embodiments of the present application will clearly and completely describe the exemplary embodiments of the present application with reference to the accompanying drawings in the exemplary embodiments of the present application, and it is to be understood that the described exemplary embodiments are only a part of the embodiments of the present application, and not all of the embodiments.
It should be noted that the brief descriptions of the terms in the present application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present application. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
The terms "first," "second," "third," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between similar or analogous objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements expressly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
Fig. 1 is a flowchart of an image enhancement preprocessing method for weak defect detection. As shown in fig. 1, in a first aspect, the present application discloses an image enhancement preprocessing method for weak defect detection, specifically, the preprocessing method includes the following steps:
in step 100, an inspection area of the captured image is acquired, the inspection area including a defect area.
The method comprises the steps of collecting a visible light dim image through a global shutter CMOS image sensor, realizing a large pixel through a 4 x 4BIN algorithm by adopting an FPGA (field programmable gate array), improving the sensitivity, obtaining a low-noise visible dim image under the target illumination of 10 < -2 > Lux to 10 < -3 > Lux by assisting with the steps of defect correction, dark field correction, flat field correction, lens shadow correction and the like, and realizing automatic control and image optimization of the system through an ISP (internet service provider) at the rear end to obtain a high-quality image corresponding to an object to be detected. In some embodiments, the acquired images can also be obtained by averaging a plurality of images continuously captured in time, so that the interference of random noise on the detection result can be effectively reduced. Next, the detection region in the acquired image may be acquired in the following manner.
And acquiring the detection area of the current product according to the modeling outline and the rough positioning information. In some embodiments, after the collected image is converted into a gray image, pixel points in the collected image are obtained, the Blob algorithm is utilized to perform blocking processing on the pixels in the collected image to obtain a plurality of groups of pixel points, and the outermost pixel points in each group of pixel points are used as pixel points corresponding to at least one contour of the object to be detected; then, gray values of 8 adjacent pixel points of each pixel point corresponding to at least one contour of the object to be detected are obtained, and the gradient direction corresponding to each pixel point is calculated according to the gray values of the 8 adjacent pixel points of each pixel point; then, along the gradient direction obtained by calculating each pixel point, obtaining the pixel point of at least one pixel unit; and finally, combining each pixel point with at least one pixel point obtained along the gradient direction obtained by calculating each pixel point to form a pixel point combination area, wherein the pixel point combination area is a detection area containing weak defects in the acquired image.
In step 200, to facilitate accurate location of weak defects in the inspection area, the inspection area is divided into at least two sub-areas, and possible defect areas in each sub-area are determined.
It can be understood that, when the detection area is segmented, the detection area may be segmented in equal proportion to the whole area of the detection area, and the detection area may be segmented into at least two areas, but in some embodiments, when the weak defect is located at the boundary of the sub-areas, and when the detection area is segmented, the weak defect is also segmented, which easily causes that the sub-areas cannot realize complete splicing of possible defect areas after the post-processing step, so that in the segmented sub-areas, adjacent sub-areas overlap with each other, as shown in fig. 2, the areas surrounded by 4 different line shapes respectively represent the sub-areas, and the possibility of final defect missing detection caused by the segmented defect can be reduced by overlapping the adjacent sub-areas.
In addition, the detection area can be divided into three sub-areas, five sub-areas or six sub-areas, the number of the sub-areas is determined by the actual size of the detection area, and the suitable number of the sub-areas can meet the requirement of fine processing and identification of defects without excessively increasing the calculation and processing time.
As shown in fig. 3, the process of determining the possible defect area in each sub-area specifically includes the following steps:
and step 210, calculating the gray average value in each sub-area, and determining the gray average value and the floating value thereof as the offset interval in the sub-area.
It should be noted that, the sum of the gray values of all pixels in each sub-region is calculated, and then the obtained sum of the gray values is divided by the number of pixels to obtain the image gray average. Because the gray value of the weak defect is located in the range of several gray values with the gray mean value floating up and down in the region, in order to avoid missing the weak defect in the sub-region, the upper offset and the lower offset of the gray mean value need to be determined, then the offset interval of the gray mean value in each sub-region is calculated, the lower limit of the offset interval is the difference between the gray mean value and the lower offset, the lower limit of the offset interval is the sum of the gray mean value and the upper offset, and the gray mean value region in the offset interval formed by the gray value upper offset and the gray value lower offset range covers the possible defect region in the sub-region.
It should be noted that the gray level up shift amount and the gray level down shift amount are set according to actual conditions and are mainly determined according to the requirements for defect detection in the corresponding product production specifications.
And step 220, performing gray stretching on the gray values in the offset interval, and extracting possible defect areas in each sub-area.
Because the gray values of the possible defect regions are all small, the gray values in the offset interval can be subjected to gray stretching to expand the gray intervals of the images with small gray intervals, and the gray values in the offset interval are stretched to the whole gray range [0, 255], at the moment, the gray values in the whole detection region which are lower than the middle-lower limit value of the offset interval are all assigned to be 0, the gray values which are higher than the middle-upper limit value of the offset interval are all assigned to be 255, and the gray values in the offset interval are stretched, so that the gray value difference can be observed more visually, and the purpose of determining the possible defect regions in the sub-regions is achieved.
It should be noted that when some non-linear function is used as the mapping function of the image, the non-linear transformation of the image gray scale can be realized, such as using a logarithmic function, an exponential function, etc., so as to realize a logarithmic transformation and an exponential transformation, where the logarithmic transformation is mainly used to expand the low gray scale value portion of the image and compress the high gray scale value portion thereof, so as to achieve the purpose of emphasizing the low gray scale portion of the image.
In some embodiments, after the gray stretching is performed on the region in the offset interval, the gray stretched region is output as a localized region, and the defect region is extracted from the localized region by a dynamic threshold method, so as to obtain a possible defect region in the sub-region.
In step 300, the possible defect regions in all the sub-regions are spliced to obtain a defect suspected region, and the region to be detected is used for determining the real defect through an image enhancement mode.
And merging the possible defect areas in all the sub-areas, namely merging the defects segmented in the sub-area segmentation process, and further obtaining a complete defect suspected area. At this time, the suspected defect area is relatively complete and the boundary is relatively clear. According to the position coordinates of the suspected defect area, cutting an area in a corresponding range on an original image of the acquired image to be used as a new detection area, namely the area to be detected, then performing image enhancement on the local image of the area to be detected, sequentially searching the boundary position of the defect or constructing a background on the enhanced image, and obtaining the real defect by utilizing a small-scale threshold segmentation step. Because the operation object of the subsequent image enhancement step is the to-be-detected area determined based on the suspected defect area, the weak defect in the to-be-detected area is processed and accurately positioned by the preprocessing method in the application in the image enhancement process, so that the weak defect is not easily interfered, the weak defect in the to-be-detected area is accurately detected, and the possibility of defect over-detection is reduced.
According to the image enhancement pretreatment method for weak defect detection, the detection area is divided into the sub-areas, the possible defect areas in the sub-areas are positioned, the possible defect areas in all the sub-areas are combined to obtain the suspected defect area, and the subsequent enhancement treatment and other operations are carried out on the basis of the area to be detected corresponding to the suspected defect area.
In some embodiments, because there is a case of insufficient illumination when an image is acquired, which causes a case of uneven illumination of the acquired image, and at this time, processing based on a gray value is performed on the acquired image, which easily causes an inaccurate processing result, after a detection region is obtained, before a step of determining a possible defect region in each sub-region, regions may be selected by framing at four corners in the detection region image, or regions may be selected by framing at four corners and a center in the detection region image, an area of each framed region may be set manually, and areas of the framed regions may be equal or unequal. If the gray values of the regions are the same, the condition that the illumination is not uniform in the image of the detection region is indicated; when the gray values of the regions have obvious difference, the detection region image has the phenomenon of uneven illumination.
It is understood that, the step of determining whether the detection area image has uneven illumination may also be performed when the detection area is divided into a plurality of sub-areas in step 200, and in this case, when there is a significant difference in the gray-level values of the respective areas, it indicates that the detection area image has uneven illumination.
And when the image of the detection area has the condition of uneven illumination, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area. The preprocessing mode can be used for illumination compensation in an optical hardware mode by moving a light source or adding a light source and the like, and an image is acquired again; and the illumination compensation can be directly carried out on the image of the detection area by a gray fitting algorithm mode.
When the illumination compensation is directly carried out on the detection area image through the gray value fitting algorithm mode, a first-order curved surface gray fitting mode can be selected, a second-order curved surface gray fitting mode can also be selected, when gray difference exists between different vertical areas and different horizontal areas in the detection area image, the second-order curved surface gray fitting mode is adopted for illumination compensation, and if gray difference exists between the vertical areas or the horizontal areas, the first-order curved surface gray fitting mode is adopted for illumination compensation.
In some embodiments, when gray value fitting of a second-order surface is performed on an image of a detection area, a gray value moment and a gray value fitting parameter are calculated according to the distance between a point to be measured in the area to be fitted and a minimum gray value, the minimum gray value is equivalent to a standard pixel point, the point to be measured is all pixel points in the area to be fitted, and the distance between the point to be measured and the pixel points is calculated through coordinates; and then, performing second-order surface fitting based on the gray value moment and the gray value fitting parameters, wherein the whole process can be regarded as a process of converting gray value information into height information, then smoothing and converting the height information into fitted gray value information, and the fitted image is the detection area image compensated for uneven illumination. And performing segmentation processing on the fitted detection area image, and further performing subsequent local image processing.
In the actual production operation process, due to the influence of external factors such as dust or fine scratches and other interference, an excessively bright or excessively dark region exists in the sub-region, so that the amount of deviation between the gray level mean value and the actual gray level mean value in the sub-region exceeds the difference between the weak defect itself and the region gray level mean value, and further the defect is directly missed, in some embodiments, an interference point removing processing step is further performed before the calculation of the sub-region gray level mean value, that is, the step shown in fig. 4 is performed in the process of calculating the gray level mean value in each sub-region in step 210, and the specific flow is as follows:
step 410: and acquiring gray distribution data on the original acquired image corresponding to the sub-region, wherein the distribution data comprises the number of pixels contained in each gray level.
It should be noted that, a gray level histogram of the sub-region is obtained first, and gray level distribution data on the original acquired image corresponding to each sub-region is obtained based on the gray level histogram.
Step 420: and after eliminating the gray values smaller than the first number, calculating the average gray value after eliminating the interference.
It can be understood that the first number generally needs to be set according to actual conditions, and the gray level average value obtained by calculation after interference in each sub-region is removed is the real gray level average value.
By the method, the process of obtaining the gray level mean value in each sub-area is more accurate, the possible defect area is more accurately obtained in the later period, and the final accurate detection of the weak defect is facilitated.
It should be understood that although the various steps in the flowcharts of fig. 1 and 3-4 are shown in sequence, the steps are not necessarily performed in the order indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
In some embodiments, an image enhancement preprocessing system for weak defect detection is provided, as shown in fig. 5, the image enhancement preprocessing system for weak defect detection specifically includes:
the image acquisition module is used for acquiring a detection area of the acquired image, and the detection area comprises a defect area;
the sub-region determining module is used for dividing the detection region into at least two sub-regions so as to determine a possible defect region in each sub-region; in the process of determining the possible defect area in each sub-area, the sub-area determining module is used for calculating the gray average value in each sub-area and determining the gray average value and the floating value thereof as the offset interval in the sub-area; after gray stretching is carried out on the gray value in the offset interval, a possible defect area in each sub-area is extracted;
and the defect suspected region determining module is used for splicing possible defect regions in all the sub-regions to obtain a defect suspected region, wherein the defect suspected region is used for corresponding to a region to be detected in the image of the detection region, and the region to be detected is used for determining a real defect in an image enhancement mode.
In some embodiments, in the step of dividing the detection area into at least two sub-areas, adjacent sub-areas overlap each other.
In some embodiments, in the step of determining the gray mean value and the floating value thereof as the offset interval in the sub-region, the sub-region determination module is further configured to determine an upper offset and a lower offset of the gray mean value; and calculating an offset interval of the gray level mean value in each sub-area, wherein the lower limit value of the offset interval is the difference value of the gray level mean value and the lower offset, and the lower limit value of the offset interval is the sum of the gray level mean value and the upper offset.
In some embodiments, before the step of determining the possible defect region in each sub-region, the sub-region determining module is further configured to: and when the condition of uneven illumination exists in the image of the detection area, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area.
In some embodiments, in the step of calculating the gray-scale average value in each sub-region, the sub-region determining module is further configured to obtain gray-scale distribution data on the original acquired image corresponding to the sub-region, where the distribution data includes the number of pixels included in each gray-scale level; and after eliminating the gray values smaller than the first number, calculating the average gray value after eliminating the interference.
In some embodiments, when the region to be detected is used for determining a real defect through an image enhancement mode, the system further includes an image enhancement module, and the image enhancement module is configured to cut out a region of a corresponding range on the image of the detection region as the region to be detected, and then perform image enhancement on the region to be detected.
For specific limitations of the image enhancement preprocessing system for weak defect detection, reference may be made to the above limitations of the image enhancement preprocessing method for weak defect detection, and details are not repeated here. All or part of the modules in the image enhancement preprocessing system for weak defect detection can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein, the processor of the computer equipment is used for providing calculation and control capability and running an image enhancement preprocessing program for weak defect detection. The memory of the computer device is used for storing an image enhancement preprocessing program for weak defect detection, and comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement any one of the above-mentioned image enhancement preprocessing methods for weak defect detection. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where an image enhancement preprocessing program for weak defect detection is stored in the computer-readable storage medium, and when being executed by a processor, the image enhancement preprocessing program for weak defect detection implements the image enhancement preprocessing method for weak defect detection in the first aspect.
The method has the advantages that the detection area is divided into the sub-areas, then the defect positions in the sub-areas are amplified in a gray scale stretching mode, possible defect areas in the sub-areas are accurately positioned, the possible defect areas in all the sub-areas are combined to obtain the suspected defect areas, subsequent enhancement processing and other operations are carried out on the basis of the to-be-detected area corresponding to the suspected defect area, and due to the fact that the suspected defect areas are complete and the boundaries are relatively clear, the method is beneficial to accurately screening out the weak defects meeting the requirements, and the possibility of defect over-detection is reduced.
Further, the adjacent sub-areas are mutually overlapped, so that the possible defects of the missing part can be reduced, and the condition that the final weak defect detection is inaccurate is caused. Further, the preprocessing is helpful for carrying out optical compensation on the detection area, so that the condition of uneven illumination does not exist in the image of the detection area, and an accurate calculation result can be obtained in the process of calculating the mean value in the later period.
Further, the gray average value after interference is eliminated through calculation is beneficial to enabling the process of obtaining the gray average value in each sub-area to be more accurate, and further beneficial to accurately determining the defect area in the later period.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An image enhancement preprocessing method for weak defect detection is characterized by comprising the following steps:
acquiring a detection area of the acquired image, wherein the detection area comprises a defect area;
dividing the detection area into at least two sub-areas, and determining a possible defect area in each sub-area;
splicing the possible defect areas in all the sub-areas to obtain a defect suspected area, wherein the defect suspected area is used for corresponding to an area to be detected in a detection area image, and the area to be detected is used for determining a real defect through an image enhancement mode;
wherein determining the possible defect area in each sub-area comprises:
calculating the gray average value in each sub-area, and determining the gray average value and the floating value thereof as the offset interval in the sub-area;
and after carrying out gray stretching on the gray value in the offset interval, extracting a possible defect area in each sub-area.
2. The image enhancement preprocessing method for weak defect detection according to claim 1, wherein in the step of dividing the detection area into at least two sub-areas, the method further comprises: the adjacent subregions are mutually overlapped.
3. The method for image enhancement preprocessing for weak defect detection according to claim 2, wherein the step of determining the gray-scale mean value and the floating value thereof as the offset section in the sub-region further comprises:
determining an upper offset and a lower offset of the gray level mean value;
and calculating an offset interval of the gray level mean value in each sub-area, wherein the lower limit value of the offset interval is the difference value of the gray level mean value and the lower offset, and the lower limit value of the offset interval is the sum of the gray level mean value and the upper offset.
4. The method of image enhancement preprocessing for weak defect detection as set forth in claim 1, further comprising, before the step of determining a possible defect region in each of said sub-regions: and when the condition of uneven illumination exists in the image of the detection area, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area.
5. The method for image enhancement preprocessing for weak defect detection according to any one of claims 1 to 4, wherein in the step of calculating the gray-scale mean value in each of the sub-regions, further comprising:
acquiring gray distribution data on an original acquired image corresponding to the sub-region, wherein the distribution data comprises the number of pixels contained in each gray level;
and after eliminating the gray values smaller than the first number, calculating the average gray value after eliminating the interference.
6. The image enhancement preprocessing method for weak defect detection according to claim 5, wherein when the region to be detected is used for determining real defects through an image enhancement mode, the method further comprises: and cutting a region in a corresponding range on the image of the detection region as the region to be detected, and then performing image enhancement on the region to be detected.
7. An image enhancement preprocessing system for weak defect detection, comprising:
the image acquisition module is used for acquiring a detection area of the acquired image, and the detection area comprises a defect area;
a sub-region determining module, configured to divide the detection region into at least two sub-regions to determine a possible defect region in each of the sub-regions; in the process of determining the possible defect area in each sub-area, the sub-area determining module is used for calculating the gray average value in each sub-area and determining the gray average value and the floating value thereof as the offset interval in the sub-area; after carrying out gray stretching on the gray value in the offset interval, extracting a possible defect area in each sub-area;
and the defect suspected region determining module is used for splicing the possible defect regions in all the sub-regions to obtain a defect suspected region, wherein the defect suspected region is used for corresponding to a region to be detected in the detection region image, and the region to be detected is used for determining a real defect through an image enhancement mode.
8. The pre-image-enhancement processing system for weak defect detection according to claim 7, wherein the step of dividing the detection area into at least two sub-areas further comprises: the adjacent subregions are mutually overlapped.
9. The system of claim 7, wherein the sub-region determining module is further configured to: and when the condition of uneven illumination exists in the image of the detection area, preprocessing the detection area to perform optical compensation on the detection area to obtain the preprocessed detection area.
10. The system of any one of claims 7 to 9, wherein in the step of calculating the mean gray level value in each of the sub-regions, the sub-region determining module is further configured to:
acquiring gray distribution data on an original acquired image corresponding to the sub-region, wherein the distribution data comprises the number of pixels contained in each gray level;
and after the gray values smaller than the first number are removed, calculating the average gray value after interference removal.
CN202211452986.7A 2022-11-21 2022-11-21 Image enhancement preprocessing method and system for weak defect detection Pending CN115690089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211452986.7A CN115690089A (en) 2022-11-21 2022-11-21 Image enhancement preprocessing method and system for weak defect detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211452986.7A CN115690089A (en) 2022-11-21 2022-11-21 Image enhancement preprocessing method and system for weak defect detection

Publications (1)

Publication Number Publication Date
CN115690089A true CN115690089A (en) 2023-02-03

Family

ID=85053502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211452986.7A Pending CN115690089A (en) 2022-11-21 2022-11-21 Image enhancement preprocessing method and system for weak defect detection

Country Status (1)

Country Link
CN (1) CN115690089A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116503397A (en) * 2023-06-26 2023-07-28 山东天通汽车科技股份有限公司 In-vehicle transmission belt defect detection method based on image data
CN118196080A (en) * 2024-05-13 2024-06-14 宝鸡拓普达钛业有限公司 Intelligent defect identification method and system for titanium alloy product

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116503397A (en) * 2023-06-26 2023-07-28 山东天通汽车科技股份有限公司 In-vehicle transmission belt defect detection method based on image data
CN116503397B (en) * 2023-06-26 2023-09-01 山东天通汽车科技股份有限公司 In-vehicle transmission belt defect detection method based on image data
CN118196080A (en) * 2024-05-13 2024-06-14 宝鸡拓普达钛业有限公司 Intelligent defect identification method and system for titanium alloy product

Similar Documents

Publication Publication Date Title
CN108460757B (en) Mobile phone TFT-LCD screen Mura defect online automatic detection method
CN110766736B (en) Defect detection method, defect detection device, electronic equipment and storage medium
CN110349145B (en) Defect detection method, defect detection device, electronic equipment and storage medium
JP4657869B2 (en) Defect detection apparatus, image sensor device, image sensor module, image processing apparatus, digital image quality tester, defect detection method, defect detection program, and computer-readable recording medium
CN115690089A (en) Image enhancement preprocessing method and system for weak defect detection
CN110163219B (en) Target detection method based on image edge recognition
JP6620477B2 (en) Method and program for detecting cracks in concrete
Oliveira et al. Road surface crack detection: Improved segmentation with pixel-based refinement
CN107490582B (en) Assembly line workpiece detection system
EP3855389A1 (en) Training data collection device, training data collection method, and program
CN109087286A (en) A kind of detection method and application based on Computer Image Processing and pattern-recognition
CN114549441B (en) Straw defect detection method based on image processing
CN111046862B (en) Character segmentation method, device and computer readable storage medium
JP6811217B2 (en) Crack identification method, crack identification device, crack identification system and program on concrete surface
CN110706224B (en) Optical element weak scratch detection method, system and device based on dark field image
CN118037722B (en) Copper pipe production defect detection method and system
Jing et al. Pavement crack distress detection based on image analysis
CN114519714B (en) Method and system for judging smudgy defect of display screen
KR20190023374A (en) Method for testing display pannel
CN115908415A (en) Defect detection method, device and equipment based on edge and storage medium
CN114723728A (en) Method and system for detecting CD line defects of silk screen of glass cover plate of mobile phone camera
CN113888503A (en) Product appearance detection method and device and storage medium
CN112396618B (en) Grain boundary extraction and grain size measurement method based on image processing
JP2021064215A (en) Surface property inspection device and surface property inspection method
Khalifa et al. A new image model for predicting cracks in sewer pipes based on time

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