CN116883401A - Industrial product production quality detection system - Google Patents

Industrial product production quality detection system Download PDF

Info

Publication number
CN116883401A
CN116883401A CN202311146161.7A CN202311146161A CN116883401A CN 116883401 A CN116883401 A CN 116883401A CN 202311146161 A CN202311146161 A CN 202311146161A CN 116883401 A CN116883401 A CN 116883401A
Authority
CN
China
Prior art keywords
edge
image
pixel
industrial product
optimal
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.)
Granted
Application number
CN202311146161.7A
Other languages
Chinese (zh)
Other versions
CN116883401B (en
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.)
Tianjin Shenghua Hood Technology Co ltd
Original Assignee
Tianjin Shenghua Hood Technology 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 Tianjin Shenghua Hood Technology Co ltd filed Critical Tianjin Shenghua Hood Technology Co ltd
Priority to CN202311146161.7A priority Critical patent/CN116883401B/en
Publication of CN116883401A publication Critical patent/CN116883401A/en
Application granted granted Critical
Publication of CN116883401B publication Critical patent/CN116883401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a production quality detection system of industrial products. The system acquires a surface image of a detected industrial product through an image acquisition module; according to the edge images under different thresholds in the image enhancement module, analyzing the information of edge points in the images, obtaining the target degree of edge pixel points in the optimal edge image, further obtaining the optimal size, carrying out image enhancement on sub-blocks of the optimal size, and obtaining an enhanced image of the industrial product to be detected; obtaining the defect degree of the surface image of the industrial product to be detected through an image feature extraction module; and judging the quality of the defect degree of the surface image of the industrial product by a product quality detection module, and finishing the production quality detection. According to the invention, the surface image of the industrial product is locally enhanced, so that unnecessary contrast enhancement or detail loss is avoided, a defect area in the image is more obvious, and the defect detection rate and accuracy are improved.

Description

Industrial product production quality detection system
Technical Field
The invention relates to the technical field of image processing, in particular to a production quality detection system of industrial products.
Background
The quality detection of industrial products is one of important links in industrial production, and aims to discover and remove defects in the products in time and ensure that the quality of the products meets standard requirements. In the detection of defects of industrial products, some defects may have low contrast with surrounding areas, and are difficult to observe or detect, meanwhile, defects of the products often exist in the form of textures, edges or other tiny details, and uneven gray level change may occur on the surfaces of the products, so that accurate judgment of production quality is difficult to perform well, and image enhancement processing is required to be performed on acquired images of industrial products to be detected.
The existing common image enhancement technology mainly adjusts brightness, contrast, tone, saturation and the like of an image, so as to achieve the purpose of image enhancement. In the defect detection of industrial products, the details and the characteristics of the images can be enhanced by adjusting the brightness and the contrast of the images, the defect areas in the products are highlighted, and the defect detection rate and the defect accuracy are improved. However, the current image enhancement technology for adjusting brightness and contrast of an image is often based on the whole image, which may cause unnecessary contrast enhancement or detail loss in some cases, and for complex image scenes, global enhancement may not accurately process the difference between the areas, resulting in detail loss, thereby affecting detection of products.
Disclosure of Invention
In order to solve the technical problems that details are lost due to global enhancement of industrial product images in the prior art and further influence product quality detection, the invention aims to provide an industrial product production quality detection system, and the adopted technical scheme is as follows:
the invention provides an industrial product production quality detection system, which comprises:
the image acquisition module is used for acquiring a surface image of the industrial product to be detected;
the image enhancement module is used for carrying out edge detection on the surface image to obtain edge images under different edge detection thresholds; screening out an optimal edge graph from the edge graphs; obtaining the target degree of each edge pixel point according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps; obtaining the optimal size and the optimal sub-block according to the target degree of the edge pixel point; in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain an enhanced subblock image; obtaining the edge weight of each pixel point according to the position of each pixel point which is repeatedly enhanced in the optimal sub-block; obtaining an enhanced image of the industrial product to be detected according to the pixel value of the pixel point in the enhanced sub-block image, the edge weight and the repeated enhancement times of the pixel point;
the image feature extraction module is used for extracting features of the enhanced image of the industrial product to be detected to obtain a feature image; acquiring the defect degree of the surface image of the industrial product to be detected according to the characteristic image;
and the product quality detection module is used for judging the quality of the defect degree of the surface image of the industrial product to be detected.
Further, the method for acquiring the target degree of each edge pixel point comprises the following steps:
obtaining the retention degree of each edge pixel point according to the pixel values of the edge pixel points in the optimal edge map in different edge maps; obtaining a neighborhood strong edge degree according to the number and the retention degree of edge pixel points in a preset neighborhood range of the edge pixel points in the optimal edge graph; and mapping the retention degree negative correlation of the edge pixel points and multiplying the retention degree negative correlation with the neighborhood strong edge degree to obtain the target degree of the edge pixel points.
Further, the method for acquiring the retention degree of the edge pixel point comprises the following steps:
and marking edge pixel points in the optimal edge map according to the edge maps under different edge detection thresholds, wherein the marking values are divided into a first reserved value and a second reserved value, when the pixel points of the edge pixel points in the optimal edge map at the corresponding positions in the edge map are edge points, the marking values are marked as the first reserved value, otherwise, the marking values are second reserved values, and the corresponding reserved values of the edge pixel points in the optimal edge map in all the edge maps are averaged to obtain the reserved degree.
Further, the method for obtaining the neighborhood strong edge degree comprises the following steps:
in the optimal edge graph, a preset neighborhood is established by taking an edge pixel point as a center, and the proportion of the edge pixel point in the preset neighborhood occupying all the pixel points in the preset neighborhood is taken as an edge rate; taking the average retention degree of non-central edge pixel points in a preset neighborhood as a neighborhood strong edge rate; and normalizing the neighborhood strong edge rate and multiplying the neighborhood strong edge rate to obtain the neighborhood strong edge degree.
Wherein the optimal size is in positive correlation with the target degree.
Further, the method for acquiring the edge weight of the pixel point comprises the following steps:
and taking the actual distance between the pixel point and the center in the optimal sub-block to which the pixel point belongs as a reference distance, and carrying out negative correlation mapping and normalization on the reference distance to obtain the edge weight of the pixel point in the optimal sub-block to which the pixel point belongs.
Further, the method for acquiring the enhanced image of the industrial product to be detected comprises the following steps:
weighting the pixel values of the pixel points in the enhanced sub-block image by the edge weights to obtain weighted pixel values of the pixel points in the enhanced sub-block image; acquiring weighted average pixel values according to the repeated enhancement times of the pixel points and the weighted pixel values of the pixel points in all corresponding enhanced sub-block images; and traversing all the pixel points by taking the weighted average pixel value as the pixel value of the corresponding pixel point in the enhanced image of the industrial product to be detected, and obtaining the enhanced image of the industrial product to be detected.
Further, the method for acquiring the characteristic image comprises the following steps:
and extracting the characteristics of the enhanced image of the industrial product to be detected through threshold segmentation, and obtaining a characteristic image.
Further, the minimum value of the size of the optimal subblock is 9, and the maximum value is 33.
Further, the preset neighborhood is circular, and the radius is 13.
The invention has the following beneficial effects:
the invention takes into consideration that the existing image enhancement algorithm for enhancing the image by adjusting the brightness and contrast of the image is based on the whole image for enhancement, and the problem of unnecessary contrast enhancement or detail loss can occur; further considering that the weak edges of the defect area are generally distributed near the strong edge points, the weak edge points are more likely to be lost in the enhancement process, the intensity of the edge pixel points can be reflected according to the pixel values of the edge pixel points in different edge graphs, the distribution condition of the strong edges near the edge pixel points can be reflected according to the quantity and the intensity of the edge pixel points in the neighborhood, so that the obtained target degree can reflect the protection degree of the edge pixel points, and the protection degree of the edge pixel points is required to be increased when the target degree is increased, so that the loss of the edge pixel points during image enhancement is avoided; therefore, the optimal sub-block can be obtained through the target degree and is locally enhanced, and detail loss caused by enhancement can be avoided; because the overlapped pixel points are arranged in the optimal sub-blocks, the overlapped pixel points are repeatedly enhanced when the image is enhanced, so that the edge weight of the pixel points is required to be obtained according to the positions of the overlapped pixel points in all the sub-blocks, the correction of the pixel values of the overlapped pixel points is realized according to the edge weight and the repeated enhancement times of the pixel points, and further, an enhanced image of an industrial product to be detected is obtained, the enhanced image of the industrial product to be detected is obtained, the problem that the weak edge is easy to lose during image enhancement is fully considered, the optimal sub-blocks determined by utilizing the target degree are enhanced, the local image enhancement is realized, more edge details are protected, the image is clearer, the defect area in the image is more obvious, and the detection rate and the accuracy of the defect are improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of an industrial product quality inspection system according to one embodiment of the present invention;
fig. 2 is a flowchart of an implementation method of an image enhancement module of an industrial product production quality detection system according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purpose, the following detailed description refers to the specific implementation, structure, characteristics and effects of an industrial product production quality detection system according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the industrial product production quality detection system provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a block diagram of an industrial product production quality detection system according to an embodiment of the present invention is shown, where the system includes: an image acquisition module 101, an image enhancement module 102, an image feature extraction module 103 and a product quality detection module 104.
The image acquisition module 101 is configured to acquire a surface image of an industrial product to be detected, and in the embodiment of the present invention, the image acquisition module acquires the surface image of the industrial product to be detected through a camera, performs denoising processing on the acquired image, and then transmits the image to the image enhancement module for subsequent image processing operation. In the embodiment of the invention, the denoising process is as follows: the acquired image is subjected to noise analysis, and statistical analysis can be adopted in the noise analysis, and statistics of the image, such as mean, variance, standard deviation and the like, are calculated and compared with expected ideal conditions. Noise typically results in deviations in statistics. For example, gaussian noise may cause the mean of an image to approach the mean of noise, increasing variance; the salt and pepper noise can cause larger fluctuation of the mean value and the variance, so that the type of the noise is judged, and an implementer can select corresponding filtering and denoising according to the type of the noise.
The details and the definition of the image can be influenced by noise, the accuracy of the subsequent image enhancement processing result can be promoted by denoising the surface image of the industrial product to be detected, the quality of the processing result is improved, and the reliability of the quality detection result is further improved.
The image enhancement module 102 is used for performing edge detection on the surface image to obtain edge graphs under different edge detection thresholds; screening out an optimal edge graph from the edge graphs; obtaining the target degree of each edge pixel point according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps; obtaining the optimal size and the optimal subblocks according to the target degree of the edge pixel points; in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain enhanced subblock images; obtaining the edge weight of each pixel point according to the position of each pixel point which is repeatedly enhanced in the optimal sub-block; and obtaining an enhanced image of the industrial product to be detected according to the pixel value, the edge weight and the repeated enhancing times of the pixel points in the enhanced sub-block image. Referring to fig. 2, the image enhancement steps include:
step S1: edge detection is carried out on the surface image of the industrial product to be detected, which is transmitted from the image acquisition module 101, so as to obtain edge diagrams under different edge detection thresholds; screening out an optimal edge graph from the edge graphs; and obtaining the target degree of each edge pixel point according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps.
When the image is enhanced, various industrial product images are produced, partial products are complex, the global enhancement can not accurately process the difference between all areas, the detail distribution in the image is required to be subjected to local self-adaptive processing, the sub-block size is self-adaptively obtained according to the target degree of the pixel point by obtaining the target degree of the pixel point, so that the detail can be better reserved, and the target degree of the pixel point is required to be obtained.
In some cases, quality problems may lead to abnormal or discontinuous changes in the edges of the product, such as cracks or defects in the surface of the product, which may appear as abnormal edge messages in the image. Therefore, the edge information can be used as one of indexes for preliminary inspection and screening of products, and the embodiment of the invention calculates the target degree of the pixel point by the edge information of the image.
In one embodiment of the present invention, edge maps are obtained by performing different degrees of edge detection on an industrial product image to be detected through a canny edge detection algorithm, which is a technology well known to those skilled in the art and will not be described in detail herein. In one embodiment of the present invention, the difference between the high threshold and the low threshold in the dual-threshold processing in the canny edge detection algorithm is a fixed value, the high threshold is obtained by traversing a preset value, and the corresponding low threshold is obtained by the high threshold. In other embodiments of the invention, the practitioner may select other threshold setting methods and other edge detection algorithms.
Different edge graphs are obtained through edge detection of different thresholds, one of the edge graphs is required to be selected as an optimal edge graph, and the target degree is obtained through the related information of the edge points in the optimal edge graph.
Preferably, in one embodiment of the present invention, an edge map with the most edge pixels in different edge maps is selected as an optimal edge map, and the optimal edge map selected according to the most edge pixels includes the most edge points and the most weak edge points, so that loss of the weak edge points can be reduced in subsequent processing, more edge details can be protected, an image is clearer, a defect area in the image is more obvious, and defect detection rate and accuracy are improved. In other embodiments of the present invention, the practitioner may select an optimal edge map based on factors such as edge length, edge continuity, etc.
In the optimal edge map, if the corresponding edge is a strong edge, the edge is more reserved under different edge detection thresholds, and if the corresponding edge is a weak edge, the edge is less reserved under different edge detection thresholds, so that the reserved condition of the edge pixel point under different edge detection thresholds in the optimal edge map can be used as the basis of the edge strength. The pixel values of the edge pixels in different edge maps can be used as one of the important factors for obtaining the target degree. In the edge map, since weak edge points of the defect area are generally distributed near strong edge points, and the weak edge points are more likely to be lost in the enhancement process, the more strong edge points distributed around the edge points, the greater the degree of the strong edge of the neighborhood of the edge points, so the number of edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map can be used as one of important factors for obtaining the target degree. Therefore, the target degree of each edge pixel point needs to be obtained according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps.
Preferably, in one embodiment of the present invention, the method for acquiring the target degree of each edge pixel includes:
and obtaining the retention degree of each edge pixel point according to the pixel values of the edge pixel points in the optimal edge map in different edge maps. Obtaining a neighborhood strong edge degree according to the number and the retention degree of edge pixel points in a preset neighborhood range of the edge pixel points in the optimal edge graph; calculating the target degree by the retention degree of the edge points, wherein the number and strength of the peripheral edge points are easily ignored, and the obtained target degree is easily too large or too small; calculating the target degree by the strong edge degree of the neighborhood easily ignores the protection of the target edge point in the center of the neighborhood, and the obtained target degree is inaccurate; therefore, the target degree needs to be calculated by combining the two, the retention degree of the edge pixel points is mapped in a negative correlation way and multiplied by the neighborhood strong edge degree, the target degree of the edge pixel points is obtained, the smaller the retention degree is, the weaker the self strong and weak condition of the edge points is, the more easily lost the image enhancement is, and the more the protection is needed, the greater the target degree is; the larger the neighborhood strong and distant degree, the more strong edge points around the edge points, the more easy the strong edge points are lost in image enhancement, and the more protection is needed, the larger the target degree is. The obtained target degree comprehensively considers the intensity of the target edge points and the intensity and quantity of the peripheral edge points, the obtained target degree is more accurate, and the finally obtained quality detection result is more convincing.
In one embodiment of the present invention, the calculation formula of the target degree includes:
wherein, in the formulaRepresenting the coordinate position as +.>Target extent of target edge points, +.>Representing the coordinate position as +.>Edge preservation degree of target edge point, +.>Representing the coordinate position as +.>Is a neighborhood strong edge degree of the target edge point. It should be noted that, because +.>The value range of (2) is 0 to 1, so the value 1 minus +.>In other embodiments of the present invention, the operations such as negative correlation mapping may be performed by other basic mathematical operations, which are not limited and described herein.
The target degree is calculated by the edge retention degree of the target edge points and the neighborhood strong edge degree of the target edge points, so that the situation of the strength of the target edge points is considered, the number of the strong edge points distributed around the target edge points is considered, the calculated target degree is more accurate, the optimal size and the optimal subblock obtained by the target degree are more convincing, and the accuracy of identifying the defect area after image enhancement is improved.
Preferably, in one embodiment of the present invention, the method for obtaining the retention degree of the edge pixel point includes:
and marking the edge pixel points in the optimal edge map according to the edge maps under different edge detection thresholds, wherein the marking values are divided into a first reserved value and a second reserved value, when the pixel points of the edge pixel points in the optimal edge map at the corresponding positions in the edge map are edge points, the marking values are marked as the first reserved value, otherwise, the marking values are second reserved values, and the corresponding reserved values of the edge pixel points in the optimal edge map in all the edge maps are averaged to obtain the reserved degree.
The higher the edge retention of edge pixels in the optimal edge map, the more likely the pixels representing that location in the optimal edge map are strong edge points, and vice versa. Therefore, the retention degree of the edge pixel points and the target degree are in a negative correlation, the weaker the edge pixel points are, the lower the retention degree is, the higher the target degree is, the more the pixel points need to be protected, the loss in image enhancement is avoided, further more edge details are protected, the image is clearer, the defect area in the image is more obvious, and the defect detection rate and accuracy are improved.
Preferably, in one embodiment of the present invention, the method for obtaining the extent of the strong edge of the neighborhood includes: in the optimal edge graph, a preset neighborhood is established by taking an edge pixel point as a center, and the proportion of the edge pixel point in the preset neighborhood occupying all the pixel points in the preset neighborhood is taken as the edge rate; taking the average retention degree of non-central edge pixel points in a preset neighborhood as a neighborhood strong edge rate; and normalizing the neighborhood strong edge rate and multiplying the neighborhood strong edge rate to obtain the neighborhood strong edge degree.
In one embodiment of the invention, the preset neighborhood range is circular, and the radius is established by taking the target edge point as the center of a circleCircles of size, wherein>Is>For radius +.>All edge points within the circle of (c) are marked. In other embodiments of the present invention, an implementer may set a neighborhood range according to an actual situation, and a calculation formula of a neighborhood strong edge degree includes:
wherein the method comprises the steps ofNeighborhood strong edge degree representing target edge point, < +.>Representing +.about.a target edge point as the center and a radius>The number of edge pixels in the range of a circle of size, +.>Representing +.about.a target edge point as the center and a radius>Size and dimensions ofMaximum number of pixels within the circle of (2), a>Representing +.about.a target edge point as the center and a radius>Within the range of circles of size +.>The extent of edge preservation of the individual edge points.
In the calculation formula of the neighborhood strong edge degree, the more edge points in the neighborhood range, the larger the proportion of the edge pixel points to occupy all the pixel points in the preset neighborhood, namely the edge rateThe larger the neighborhood strong edge degree is, the larger the neighborhood strong edge degree is; the larger the edge point retention degree in the neighborhood range is, the larger the average value is, namely, the neighborhood strong edge rate +.>The larger the neighborhood strong edge degree is, the larger the neighborhood strong edge degree is; by natural number 1 and natural logarithm +.>Normalizing the neighborhood strong edge rate to limit the value range to [0,1]]And finally multiplying the edge rate to obtain the neighborhood strong edge degree which fully reflects the number of strong edges around the target edge point, so that the influence on the subsequent calculation of the target degree is more accurate, and the calculated target degree is more convincing.
The neighborhood strong edge degree reflects the number and the intensity degree of edge points distributed around the target edge point, and the larger the neighborhood strong edge degree is, the more the neighborhood strong edge points are around the target edge point, the more the neighborhood strong edge points are easy to lose in the subsequent enhancement process, so that the neighborhood strong edge degree needs to be considered when the target degree is calculated.
Step S2: obtaining the optimal size and the optimal subblocks according to the target degree of the edge pixel points; in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain enhanced subblock images; and obtaining the edge weight of the pixel points according to the position of each pixel point which is repeatedly enhanced in the optimal sub-block.
The self-adaptive sub-block size is obtained according to the target degree of the edge pixel, the target degree of the edge pixel represents the intensity degree of the pixel, the larger the intensity degree is, the more likely the intensity degree is the weak edge region of the defect, so that the smaller sub-block is selected to avoid the loss of details when the enhancement is carried out, the smaller the intensity degree is, the more likely the intensity degree is the strong edge region or the normal region of the defect, and the larger sub-block is selected to reduce unnecessary calculation when the enhancement is carried out.
Preferably, in one embodiment of the present invention, the optimal size is positively correlated with the target degree. In one embodiment of the present invention, the shape of the optimal sub-block is set to be square, that is, the corresponding optimal size is the side length of the square, and the size of the empirical maximum sub-block and the size of the empirical minimum sub-block are preset, so that the calculation formula for obtaining the optimal size of the edge pixel point and the optimal sub-block thereof includes:
represents the optimal size,/->Representing the empirical minimum sub-block size and the empirical maximum sub-block size respectively,representing the coordinate position as +.>Target extent of target edge points of (c). In one embodiment of the invention, the empirical minimum sub-block size is 9 and the empirical maximum sub-block size is 33.
Due to the fact that the coordinate position is guaranteed to beThe target edge point of (2) is in the center of the sub-block, so the sub-block must be odd, so the sub-block size is selected closest +.>Odd numbers of, e.g. calculated +.>The selected sub-block size is an odd number closest to 28.2 and an odd number closest to 28.2 is 29, so the coordinate position is +.>The optimal sub-block size of the target edge point of (2) is 29; when calculated->If even, the smaller odd nearest is selected. In other embodiments of the present invention, the practitioner may formulate optimal size calculation rules that fit the actual situation.
The optimal size calculated according to the target degree fully considers the strong and weak conditions of the target edge points and the number of the strong edge points distributed around the target edge points, the obtained optimal subblock is more reasonable, the calculated amount is reduced, and the image enhancement effect is improved. The accuracy of defect area identification is further improved.
Further, in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain an enhanced subblock image. The image is locally enhanced according to the optimal sub-block, so that detail loss caused by global enhancement is avoided, more edge details are protected, and the defect detection rate and accuracy are improved.
Preferably, in one embodiment of the present invention, the image enhancement algorithm selects gamma transformation, normalizes the pixel values of the original image of each sub-block to have a value range between [0,1], applies gamma transformation to the normalized image pixel values, inversely normalizes the transformed pixel values, and restores them to the original pixel value range. And in the normalization, the pixel value of the pixel point is divided by the maximum pixel value in the sub-block for normalization. Gamma conversion is well known to those skilled in the art and will not be described in detail herein, and in other embodiments of the present invention, the practitioner may choose other normalization methods and image enhancement algorithms.
The image is enhanced by the optimal sub-block, the obtained optimal sub-block enhanced image realizes local image enhancement, the contrast in the image is obviously improved, more edge details are protected, and the loss of details is avoided.
In order to obtain a final enhanced image of the industrial product to be detected, the repeated pixel points are required to be weighted, and because the optimal sub-blocks are different in size and the distances between the repeated pixel points and the center of the optimal sub-block are different, the repeated pixel points are weighted by the edge weights according to the positions of the repeated pixel points in the optimal sub-block.
Preferably, in one embodiment of the present invention, an actual distance between the pixel point and the center in the optimal sub-block is taken as a reference distance, and the reference distance is mapped and normalized in a negative correlation manner to obtain an edge weight of the pixel point in the optimal sub-block. In one embodiment of the invention, the edge weight calculation formula includes:
wherein, the liquid crystal display device comprises a liquid crystal display device,indicating that the pixel is at +.>Edge weights in sub-blocks +.>Representing the maximum distance between pixel points and the center point of an ion block in all sub-blocks to which the pixel points belongDistance (L)>Indicating that the pixel is at +.>Distance +.>The actual distance of the center point of the sub-block, i.e. +.>Is the reference distance. Note that, the pixels in the non-overlapping portion have no edge weight.
In the edge weight calculation formula, the maximum distance is taken as a denominator, and the difference between the reference distance and the maximum distance is taken as a numerator, so that the reference distance is normalized. The larger the reference distance is, the smaller the molecule is, the smaller the calculated edge weight is, and because the optimal size is calculated according to the edge points and the surrounding edge intensity, the optimal sub-blocks are constructed by taking the edge points as the centers and are respectively enhanced, the effect of protecting the detail information of the center edge points is realized, so that the smaller the pixel points are positioned at the edges of the sub-blocks, the smaller the edge weight is, the overlapping pixel points are weighted by the edge weight, and the enhanced image of the optimal sub-blocks can be obtained after further processing.
In other embodiments of the present invention, the practitioner may select pixel value differences between the pixel points and the center edge points to obtain the edge weights in other manners.
Step S3: and obtaining an enhanced image of the industrial product to be detected according to the pixel value, the edge weight and the repeated enhancing times of the pixel points in the enhanced sub-block image.
Step S1 to step S2 are completed to locally enhance the image, the edge weight of the overlapped pixel points is obtained, the enhanced image of the industrial product to be detected can be obtained only by combining the overlapped pixel points in the sub-block with the corresponding pixel values, the edge weight and the repeated enhancement times, the size of the edge weight reflects the distance degree of the pixel points from the center of the ion block, and the importance of the pixel points is represented; the repeated enhancement times show the times of enhancing the pixel points, reflect the density of the pixel points at the peripheral edge of the pixel points, and are more important the more the pixel points are included in the optimal sub-block when the optimal sub-block is established.
Preferably, in one embodiment of the present invention, weighting the pixel values of the pixels in the enhanced sub-block image with edge weights to obtain weighted pixel values of the pixels in the enhanced sub-block image; acquiring weighted average pixel values according to the repeated enhancement times of the pixel points and the weighted pixel values of the pixel points in all corresponding enhanced sub-block images; taking the weighted average pixel value as the pixel value of the corresponding pixel point in the enhanced image of the industrial product to be detected, wherein the calculation formula comprises:
wherein, the liquid crystal display device comprises a liquid crystal display device,weighted average gray value of pixel point representing coordinate position (x, y), +.>Representing the number of repeated enhancement of a pixel point with a coordinate position (x, y), +.>Pixel point with coordinate position (x, y) at +.>Enhanced gray values in the sub-blocks, respectively>Pixel point with coordinate position (x, y) at +.>Edge weights in the sub-blocks. It should be noted that becauseFor repeating the enhancement times, the pixel point with the corresponding coordinate position of (x, y) is the pixel point with the repeated enhancement, i.e. +.>Is an integer greater than 1.
Further, traversing all pixel points, carrying out weighted average on all overlapped pixel points, and combining the pixel points without overlapped parts in the optimal sub-block enhanced image to obtain the enhanced image of the industrial product to be detected.
The enhancement image of the industrial product to be detected obtained in the steps S1 to S3 fully considers the problem that the weak edge is easy to lose during image enhancement, enhances the optimal subblock determined by the target degree, realizes local image enhancement, realizes correction of the pixel value of the overlapped pixel point according to the edge weight and the repeated enhancement times of the pixel point, avoids the weak edge point from losing during enhancement, protects more edge details, provides more accurate and clearer image information, has more obvious defect areas in the image, and improves the detection rate and accuracy of the defect.
The image feature extraction module 103 is used for extracting features of the enhanced image of the industrial product to be detected to obtain a feature image; and obtaining the defect degree of the surface image of the industrial product to be detected according to the characteristic image.
After being processed by the image enhancement module 102, the image quality is obviously enhanced, and the contrast in the image is obviously improved, so that the detection of product defects can be realized by extracting the characteristics of the enhanced image of the industrial product to be detected.
Preferably, in one embodiment of the present invention, the feature extraction is performed on the enhanced image of the industrial product to be detected through threshold segmentation, and the feature image is obtained. Threshold segmentation is well known to those skilled in the art and will not be described in detail herein. In other embodiments of the invention, the practitioner may select other suitable feature extraction algorithms such as directional gradient histograms, convolutional neural networks, and the like.
In one embodiment of the invention, the feature image is compared with a preselected template image of the industrial product, the greater the difference between the feature image and the template image, the greater the degree of defect in the surface image of the industrial product to be detected.
The product quality detection module 104 is used for judging the quality of the defect degree of the surface image of the industrial product to be detected.
Quality judgment is performed by setting quality judgment indexes, quality classification is performed according to the judgment indexes, and the quality judgment indexes are formulated according to actual conditions by practitioners, which are not described in detail herein.
In summary, in the embodiment of the invention, the image acquisition module acquires the surface image of the industrial product to be detected and transmits the surface image to the image enhancement module for image enhancement, the image enhancement module performs different threshold detection on the image of the industrial product to be detected through the canny edge detection algorithm when performing image enhancement, acquires different edge images, selects the optimal edge image according to the different edge images and acquires the target degree, acquires the optimal sub-block according to the target degree and performs image enhancement on the optimal sub-block, further processes the enhanced sub-block image to obtain the enhanced image of the industrial product to be detected, transmits the enhanced sub-block image to the image feature extraction module for feature extraction, and finally transmits the feature image to the image feature extraction module for comparing the feature image with the template image, and performs quality judgment on the defect degree of the detected surface image of the industrial product to complete quality detection. The problem that the weak edge is easy to lose when the image is enhanced is fully considered in the process, the weak edge point is prevented from losing in the enhancement process by the processing of the image enhancement module, more edge details are protected, more accurate and clearer image information is provided, the defect area in the image is more obvious after the processing of the image feature extraction module, and the defect detection rate and accuracy are improved.
An industrial product image enhancement system embodiment:
the existing common image enhancement technology mainly adjusts brightness, contrast, tone, saturation and the like of an image, so as to achieve the purpose of image enhancement. In the defect detection of industrial products, the details and the characteristics of the images can be enhanced by adjusting the brightness and the contrast of the images, the defect areas in the products are highlighted, and the defect detection rate and the defect accuracy are improved. However, current image enhancement techniques for adjusting brightness and contrast of an image tend to be based on the entire image, which may result in unnecessary contrast enhancement or loss of detail in some cases, and global enhancement may not accurately handle differences between regions for complex image scenes.
The invention provides an industrial product image enhancement system, which considers the problems that the prior image enhancement algorithm for enhancing the image by adjusting the brightness and contrast of the image is based on the whole image and unnecessary contrast enhancement or detail loss can occur, and comprises the following steps: an image acquisition module 101 and an image enhancement module 102.
The image acquisition module 101 is used for acquiring a surface image of an industrial product to be detected.
The image enhancement module 102 is configured to perform edge detection on the surface image to obtain edge maps under different edge detection thresholds; screening out an optimal edge graph from the edge graphs; obtaining the target degree of each edge pixel point according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps; obtaining the optimal size and the optimal subblocks according to the target degree of the edge pixel points; in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain enhanced subblock images; obtaining the edge weight of each pixel point according to the position of each pixel point which is repeatedly enhanced in the optimal sub-block; and obtaining an enhanced image of the industrial product to be detected according to the pixel value, the edge weight and the repeated enhancing times of the pixel points in the enhanced sub-block image.
Because the detailed implementation process of the industrial product image enhancement system is already given in the above-mentioned industrial product production quality detection system, the detailed description is omitted.
In summary, the invention screens out the optimal edge map from the edge maps under different edge detection thresholds, and the optimal edge map can provide more accurate and clearer edge information, thereby being beneficial to the subsequent local enhancement of the image and the calculation of the target degree; further considering that the weak edges of the defect area are generally distributed near the strong edge points, the weak edge points are more likely to be lost in the enhancement process, the intensity of the edge pixel points can be reflected according to the pixel values of the edge pixel points in different edge graphs, the distribution condition of the strong edges near the edge pixel points can be reflected according to the quantity and the intensity of the edge pixel points in the neighborhood, so that the obtained target degree can reflect the protection degree of the edge pixel points, and the protection degree of the edge pixel points is required to be increased when the target degree is increased, so that the loss of the edge pixel points during image enhancement is avoided; therefore, the optimal sub-block can be obtained through the target degree and is locally enhanced, and detail loss caused by enhancement can be avoided; because the overlapped pixel points are arranged in the optimal sub-blocks, the overlapped pixel points are repeatedly enhanced when the image is enhanced, so that the edge weight of the pixel points is required to be obtained according to the positions of the overlapped pixel points in all the sub-blocks, the correction of the pixel values of the overlapped pixel points is realized according to the edge weight and the repeated enhancement times of the pixel points, and further, the enhanced image of the industrial product to be detected is obtained, the problem that the weak edge is easy to lose during image enhancement is fully considered, the optimal sub-blocks determined by utilizing the target degree are enhanced, the local image enhancement is realized, more edge details are protected, and the image is clearer and better in image enhancement effect.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1. An industrial product quality inspection system, the system comprising:
the image acquisition module is used for acquiring a surface image of the industrial product to be detected;
the image enhancement module is used for carrying out edge detection on the surface image to obtain edge images under different edge detection thresholds; screening out an optimal edge graph from the edge graphs; obtaining the target degree of each edge pixel point according to the number of the edge pixel points in the preset neighborhood range of the edge pixel points in the optimal edge map and the pixel values in different edge maps; obtaining the optimal size and the optimal sub-block according to the target degree of the edge pixel point; in the surface image, respectively carrying out image enhancement on the optimal subblocks of the edge pixel points to obtain an enhanced subblock image; obtaining the edge weight of each pixel point according to the position of each pixel point which is repeatedly enhanced in the optimal sub-block; obtaining an enhanced image of the industrial product to be detected according to the pixel value of the pixel point in the enhanced sub-block image, the edge weight and the repeated enhancement times of the pixel point;
the image feature extraction module is used for extracting features of the enhanced image of the industrial product to be detected to obtain a feature image; acquiring the defect degree of the surface image of the industrial product to be detected according to the characteristic image;
and the product quality detection module is used for judging the quality of the defect degree of the surface image of the industrial product to be detected.
2. The industrial product production quality detection system according to claim 1, wherein the target degree of each edge pixel comprises an acquisition method comprising:
obtaining the retention degree of each edge pixel point according to the pixel values of the edge pixel points in the optimal edge map in different edge maps; obtaining a neighborhood strong edge degree according to the number and the retention degree of edge pixel points in a preset neighborhood range of the edge pixel points in the optimal edge graph; and mapping the retention degree negative correlation of the edge pixel points and multiplying the retention degree negative correlation with the neighborhood strong edge degree to obtain the target degree of the edge pixel points.
3. The industrial product production quality detection system according to claim 2, wherein the method for obtaining the retention degree of the edge pixel point comprises:
and marking edge pixel points in the optimal edge map according to the edge maps under different edge detection thresholds, wherein the marking values are divided into a first reserved value and a second reserved value, when the pixel points of the edge pixel points in the optimal edge map at the corresponding positions in the edge map are edge points, the marking values are marked as the first reserved value, otherwise, the marking values are second reserved values, and the corresponding reserved values of the edge pixel points in the optimal edge map in all the edge maps are averaged to obtain the reserved degree.
4. The industrial product production quality detection system according to claim 2, wherein the method for obtaining the neighborhood strong edge degree comprises:
in the optimal edge graph, a preset neighborhood is established by taking an edge pixel point as a center, and the proportion of the edge pixel point in the preset neighborhood occupying all the pixel points in the preset neighborhood is taken as an edge rate; taking the average retention degree of non-central edge pixel points in a preset neighborhood as a neighborhood strong edge rate; and normalizing the neighborhood strong edge rate and multiplying the neighborhood strong edge rate to obtain the neighborhood strong edge degree.
5. An industrial product quality inspection system according to claim 1, wherein:
the optimal size is in positive correlation with the target degree.
6. The industrial product production quality detection system according to claim 1, wherein the method for obtaining the edge weight of the pixel point comprises:
and taking the actual distance between the pixel point and the center in the optimal sub-block to which the pixel point belongs as a reference distance, and carrying out negative correlation mapping and normalization on the reference distance to obtain the edge weight of the pixel point in the optimal sub-block to which the pixel point belongs.
7. The industrial product quality inspection system according to claim 1, wherein the method for acquiring the enhanced image of the industrial product to be inspected comprises:
weighting the pixel values of the pixel points in the enhanced sub-block image by the edge weights to obtain weighted pixel values of the pixel points in the enhanced sub-block image; acquiring weighted average pixel values according to the repeated enhancement times of the pixel points and the weighted pixel values of the pixel points in all corresponding enhanced sub-block images; and traversing all the pixel points by taking the weighted average pixel value as the pixel value of the corresponding pixel point in the enhanced image of the industrial product to be detected, and obtaining the enhanced image of the industrial product to be detected.
8. The industrial product production quality detection system according to claim 1, wherein the feature image acquisition method comprises:
and extracting the characteristics of the enhanced image of the industrial product to be detected through threshold segmentation, and obtaining a characteristic image.
9. An industrial product quality inspection system according to claim 1 wherein the optimal sub-block has a minimum size of 9 and a maximum size of 33.
10. The industrial product quality inspection system of claim 4 wherein the predetermined neighborhood is circular and has a radius of 13.
CN202311146161.7A 2023-09-07 2023-09-07 Industrial product production quality detection system Active CN116883401B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311146161.7A CN116883401B (en) 2023-09-07 2023-09-07 Industrial product production quality detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311146161.7A CN116883401B (en) 2023-09-07 2023-09-07 Industrial product production quality detection system

Publications (2)

Publication Number Publication Date
CN116883401A true CN116883401A (en) 2023-10-13
CN116883401B CN116883401B (en) 2023-11-10

Family

ID=88257267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311146161.7A Active CN116883401B (en) 2023-09-07 2023-09-07 Industrial product production quality detection system

Country Status (1)

Country Link
CN (1) CN116883401B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020051746A1 (en) * 2018-09-10 2020-03-19 深圳配天智能技术研究院有限公司 Image edge detection method, image processing device, and computer storage medium
CN112819772A (en) * 2021-01-28 2021-05-18 南京挥戈智能科技有限公司 High-precision rapid pattern detection and identification method
WO2022027949A1 (en) * 2020-08-04 2022-02-10 湖南大学 Machine vision-based detecting method and system for glass bottle bottom defects
CN115272341A (en) * 2022-09-29 2022-11-01 华联机械集团有限公司 Packaging machine defect product detection method based on machine vision
CN115272346A (en) * 2022-09-30 2022-11-01 江苏炜盛光电科技有限公司 PCB production process online detection method based on edge detection
CN116468641A (en) * 2023-05-23 2023-07-21 重庆邮电大学 Infrared blood vessel image enhancement processing method
CN116660286A (en) * 2023-04-24 2023-08-29 上海电机学院 Wire harness head peeling measurement and defect detection method and system based on image segmentation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020051746A1 (en) * 2018-09-10 2020-03-19 深圳配天智能技术研究院有限公司 Image edge detection method, image processing device, and computer storage medium
WO2022027949A1 (en) * 2020-08-04 2022-02-10 湖南大学 Machine vision-based detecting method and system for glass bottle bottom defects
CN112819772A (en) * 2021-01-28 2021-05-18 南京挥戈智能科技有限公司 High-precision rapid pattern detection and identification method
CN115272341A (en) * 2022-09-29 2022-11-01 华联机械集团有限公司 Packaging machine defect product detection method based on machine vision
CN115272346A (en) * 2022-09-30 2022-11-01 江苏炜盛光电科技有限公司 PCB production process online detection method based on edge detection
CN116660286A (en) * 2023-04-24 2023-08-29 上海电机学院 Wire harness head peeling measurement and defect detection method and system based on image segmentation
CN116468641A (en) * 2023-05-23 2023-07-21 重庆邮电大学 Infrared blood vessel image enhancement processing method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANDREY KRYLOV ET AL.: "Edge quality metrics for image enhancement", 《PATTERN RECOGNITION AND IMAGE ANALYSIS》, pages 1 - 15 *
孙宗凯 等: "基于加权引导滤波的水下图像增强算法", 《桂林电子科技大学学报》, vol. 36, no. 2, pages 113 - 117 *
杨楠;王卫星;王峰萍;薛柏玉;WANG KEVIN;: "基于分数阶积分和邻域FCM的道路信息变化检测", 长安大学学报(自然科学版), no. 02 *

Also Published As

Publication number Publication date
CN116883401B (en) 2023-11-10

Similar Documents

Publication Publication Date Title
CN107507173B (en) No-reference definition evaluation method and system for full-slice image
WO2022110804A1 (en) Image noise measurement method and device based on local statistical information
CN115222733B (en) Metal component surface defect detection method based on image recognition
CN113963042B (en) Metal part defect degree evaluation method based on image processing
CN115829883A (en) Surface image denoising method for dissimilar metal structural member
CN109584240B (en) Landslide trailing edge crack displacement image identification method
CN111080661A (en) Image-based line detection method and device and electronic equipment
CN116110053B (en) Container surface information detection method based on image recognition
CN117351019B (en) Welding defect detection method
CN116245880B (en) Electric vehicle charging pile fire risk detection method based on infrared identification
CN114387273A (en) Environmental dust concentration detection method and system based on computer image recognition
CN115841434A (en) Infrared image enhancement method for gas concentration analysis
CN116823822B (en) Ship sheet metal part welding defect detection method based on visual characteristics
CN115631116B (en) Aircraft power inspection system based on binocular vision
CN116228780B (en) Silicon wafer defect detection method and system based on computer vision
CN116958125B (en) Electronic contest host power supply element defect visual detection method based on image processing
CN110619146A (en) Polycrystalline silicon cell crack defect detection method based on structural similarity measurement
CN116862910B (en) Visual detection method based on automatic cutting production
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN117094975A (en) Method and device for detecting surface defects of steel and electronic equipment
CN113487563B (en) EL image-based self-adaptive detection method for hidden cracks of photovoltaic module
CN116563298B (en) Cross line center sub-pixel detection method based on Gaussian fitting
CN116883401B (en) Industrial product production quality detection system
CN116363097A (en) Defect detection method and system for photovoltaic panel
CN117808799B (en) Chamfering equipment processing quality detection method based on artificial intelligence

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
GR01 Patent grant
GR01 Patent grant