CN116402808A - Intelligent detection method for manufacturing cable clamp plate die - Google Patents

Intelligent detection method for manufacturing cable clamp plate die Download PDF

Info

Publication number
CN116402808A
CN116402808A CN202310628670.7A CN202310628670A CN116402808A CN 116402808 A CN116402808 A CN 116402808A CN 202310628670 A CN202310628670 A CN 202310628670A CN 116402808 A CN116402808 A CN 116402808A
Authority
CN
China
Prior art keywords
pixel point
suspected
defective
target pixel
target
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
CN202310628670.7A
Other languages
Chinese (zh)
Other versions
CN116402808B (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.)
Shandong Huayuwida Electromechanical Technology Co ltd
Original Assignee
Shandong Huayuwida Electromechanical 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 Shandong Huayuwida Electromechanical Technology Co ltd filed Critical Shandong Huayuwida Electromechanical Technology Co ltd
Priority to CN202310628670.7A priority Critical patent/CN116402808B/en
Publication of CN116402808A publication Critical patent/CN116402808A/en
Application granted granted Critical
Publication of CN116402808B publication Critical patent/CN116402808B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/11Region-based segmentation
    • 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
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/68Analysis of geometric attributes of symmetry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30136Metal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/06Recognition of objects for industrial automation
    • 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)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to the technical field of image data processing, in particular to an intelligent detection method for manufacturing a cable splint die. The method comprises the steps of obtaining a mold cavity image and a suspected defect area of a cable clamp plate mold cavity; determining initial suspected scratch probability of each defective pixel point in the suspected defective area; further correcting the initial suspected scratch probability and determining the target suspected scratch probability of each defective pixel point; determining the self-adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel; and determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point, segmenting a mold cavity image, and determining a quality evaluation value of the cable clamp plate mold cavity. The quality detection accuracy of the cable clamping plate die is improved.

Description

Intelligent detection method for manufacturing cable clamp plate die
Technical Field
The invention relates to the technical field of image data processing, in particular to an intelligent detection method for manufacturing a cable splint die.
Background
The cable clamp plate is formed by one-step injection molding, and has the excellent characteristics of heat resistance, freezing resistance and corrosion resistance. The primary influencing factor of the injection molding quality of the cable clamp plate is the surface quality of a cavity of an injection molding metal mold, when the surface of the cavity of the metal mold has defects, the cable clamp plate can directly react on an injection molding product, for example, when the surface of the cavity of the metal mold has scratch defects, the cable clamp plate with the defects has the scratch defects, and the cable clamp plate with the defects can reduce the satisfaction of customers to a certain extent, so that the detection of the cavity of the metal mold is of great importance.
In the injection mold industry, machine vision is generally utilized to detect a metal mold cavity, but due to the change of external illumination and the reflection effect of a metal surface, the collected cavity image is easily affected by the phenomenon of uneven illumination, so that the defect detection precision is affected. At present, a common algorithm for performing defect segmentation on a cavity image under uneven illumination is to perform local threshold segmentation by using a NiBlack algorithm so as to obtain a defect region in the cavity image. The NiBlack algorithm is a relatively common local dynamic threshold algorithm, and the threshold is changed in an image according to a local average value and a local standard deviation so as to achieve the effect of threshold segmentation, but the correction coefficient in the NiBlack algorithm is selected according to prior experience setting or is acquired according to big data, and cannot be adaptively adjusted according to a specific use scene, so that the segmentation accuracy is reduced to a certain extent, defect segmentation cannot be accurately realized, the situation that the segmentation error is large is easily caused, and the quality detection result of a die cavity is affected.
Disclosure of Invention
In order to solve the technical problem of lower accuracy of a metal mold cavity quality detection result, the invention aims to provide an intelligent detection method for manufacturing a cable clamping plate mold, which adopts the following technical scheme:
Acquiring a mold cavity image of a cable clamp plate mold cavity, and dividing the mold cavity image to obtain a suspected defect area;
constructing gray scale descending vectors of all the defect pixel points according to descending change characteristics of gray scale values of all the defect pixel points in the suspected defect area and the pixel points in the corresponding neighborhood;
based on the direction of the gray level descending vector of each defective pixel point, the homodromous pixel points corresponding to each defective pixel point are screened out from the pixel points in the neighborhood of each defective pixel point; determining initial suspected scratch probability of each defective pixel point according to the difference of gray scale descending vectors of each defective pixel point and the corresponding homodromous pixel points and the fluctuation characteristics of gray scale values;
determining symmetry points of each defective pixel point based on the opposite direction of the gray level falling vector of each defective pixel point; determining target suspected scratch probability of each defective pixel according to the distance between each defective pixel and the symmetrical point, the frequency of occurrence of the distance between each defective pixel and the symmetrical point, the gray level decline vector of each defective pixel and the symmetrical point and the initial suspected scratch probability of each defective pixel;
determining the self-adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel; determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point;
And dividing the die cavity image based on the defect dividing threshold value of each defective pixel point, and determining the quality evaluation value of the cable clamp plate die cavity.
Preferably, the constructing the gray scale decreasing vector of each defective pixel according to the decreasing variation characteristics of the gray scale values of each defective pixel in the suspected defective area and the pixels in the corresponding neighborhood includes:
selecting any defective pixel point in the suspected defective area as a target pixel point; taking the pixel point, corresponding to the target pixel point, of which the gray value in the neighborhood is smaller than that of the target pixel point as a matched pixel point corresponding to the target pixel point; taking the direction from the target pixel point to each corresponding matched pixel point as the direction of the gray scale descending vector of the target pixel point and each corresponding matched pixel point, and taking the gray scale difference value of the target pixel point and each corresponding matched pixel point as the modulus of the gray scale descending vector of the target pixel point and each corresponding matched pixel point;
and taking the sum vector of the gray-scale reduction component vectors of the target pixel point and all the corresponding matched pixel points as the gray-scale reduction vector of the target pixel point.
Preferably, the step of selecting the same-direction pixel point corresponding to each defective pixel point from the pixels in the neighborhood of each defective pixel point based on the direction of the gray-level descent vector of each defective pixel point includes:
Selecting any defective pixel point in the suspected defective area as a target pixel point; acquiring the vertical direction of the gray-scale descent vector corresponding to the target pixel point, and taking the vertical direction as the vertical direction of the target pixel point; and passing through the target pixel point, making a straight line along the vertical direction corresponding to the target pixel point to obtain a vertical line corresponding to the target pixel point, and taking the pixel point positioned on the vertical line of the target pixel point in the neighborhood of the target pixel point as the same-direction pixel point of the target pixel point.
Preferably, the determining the initial suspected scratch probability of each defective pixel according to the difference of the gray scale decreasing vectors of each defective pixel and the corresponding homodromous pixel and the fluctuation characteristic of the gray scale value includes:
selecting any defective pixel point in the suspected defective area as a target pixel point; acquiring an included angle value between the direction of the gray scale falling vector of the target pixel point and the direction of the gray scale falling vector of the corresponding homodromous pixel point; taking the average value of the included angle values of the directions of the gray scale falling vectors of the target pixel point and all corresponding homodromous pixel points as the average value of the included angles of the target pixel point; taking the ratio of the average value of the included angles of the target pixel points to the preset included angle value as the included angle duty ratio of the target pixel points; carrying out negative correlation normalization on the included angle duty ratio of the target pixel point to obtain a first suspected scratch probability of the target pixel point;
Calculating the variance of gray values of the target pixel point and all corresponding homodromous pixel points to be used as the gray variance of the target pixel point; taking the product of the gray variance of the target pixel point and a preset adjustment coefficient as the adjustment variance of the target pixel point; carrying out negative correlation normalization on the adjustment variance of the target pixel point to obtain a second suspected scratch probability of the target pixel point;
determining initial suspected scratch probability of the target pixel point according to the first suspected scratch probability and the second suspected scratch probability of the target pixel point; the first suspected scratch probability and the second suspected scratch probability are in positive correlation with the initial suspected scratch probability.
Preferably, the determining the target suspected scratch probability of each defective pixel point according to the distance between each defective pixel point and the symmetric point, the frequency of occurrence of the distance between each defective pixel point and the symmetric point, the gray-level decrease vector of each defective pixel point and the symmetric point, and the initial suspected scratch probability of each defective pixel point includes:
selecting any defective pixel point in the suspected defective area as a target pixel point;
taking the distance between the target pixel point and the corresponding symmetrical point as the symmetrical distance of the target pixel point; taking the frequency of the symmetric distance of the target pixel point in the symmetric distances of all the defect pixel points in the suspected defect area as the frequency of occurrence of the target pixel point, and taking the normalized value of the product of the symmetric distance and the frequency of occurrence as the distance normalization value of the target pixel point;
Obtaining a vector sum module of the gray-scale descent vector of the target pixel point and the gray-scale descent vector of the corresponding symmetrical point, and taking the vector sum module as a symmetrical module of the target pixel point; inversely proportional normalizing the product of the distance normalization value of the target pixel point and the symmetry mode to obtain a third suspected scratch probability of the target pixel point;
and determining the target suspected scratch probability of the target pixel point according to the third suspected scratch probability and the initial suspected scratch probability of the target pixel point, wherein the third suspected scratch probability and the initial suspected scratch probability are in positive correlation with the target suspected scratch probability.
Preferably, the determining the adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel includes:
and carrying out negative correlation mapping on the normalized target suspected scratch probability of the preset multiple of the defect pixel point to obtain the self-adaptive correction coefficient of the defect pixel point.
Preferably, the determining, by using the NiBlack algorithm, the defect segmentation threshold value of each defective pixel based on the adaptive correction coefficient of each defective pixel includes:
and taking the self-adaptive correction coefficient corresponding to the defective pixel as the correction coefficient in the NiBlack algorithm to obtain a threshold corresponding to the defective pixel, and marking the threshold as a defect segmentation threshold of the defective pixel.
Preferably, the dividing the mold cavity image based on the defect dividing threshold value of each defective pixel point, determining the quality evaluation value of the cable clamp plate mold cavity, includes:
taking a defect pixel point with the gray value larger than the corresponding defect segmentation threshold value in the suspected defect area as a scratch pixel point in the mold cavity image; and forming a defect area in the mold cavity image by using the scratch pixel points, and taking a negative correlation mapping value of the area ratio of the defect area in the mold cavity image as a quality evaluation value of the cable clamp plate mold cavity.
Preferably, the determining the symmetry point of each defective pixel point based on the opposite direction of the gray-scale descent vector of each defective pixel point includes:
selecting any defective pixel point in the suspected defective area as a target pixel point; taking a target pixel point as an endpoint, taking a ray along the opposite direction of the gray level descending vector of the target pixel point, and connecting the target pixel point with an edge point, closest to the target pixel point, on the corresponding ray to obtain an opposite direction line of the target pixel point, wherein the edge point is an edge point of a suspected defect area;
and respectively calculating the gray-scale descending vector of the target pixel point and the sum vector module of the gray-scale descending vector of each pixel point on the corresponding opposite direction line, and taking the pixel point corresponding to the minimum sum vector module as the symmetrical point of the target pixel point.
Preferably, the segmenting the mold cavity image to obtain the suspected defect area includes:
obtaining an optimal segmentation threshold value of a mold cavity image by using an Ojin algorithm; and taking the pixel point with the pixel value larger than the optimal segmentation threshold value as a defect pixel point, and forming a suspected defect area by the defect pixel point.
The embodiment of the invention has at least the following beneficial effects:
firstly, acquiring a mold cavity image of a cable clamp plate mold cavity and a corresponding suspected defect area; and constructing a gray level descending vector of each defective pixel point according to the descending change characteristics of gray level values of each defective pixel point in the suspected defective area and the corresponding pixel points in the neighborhood, wherein the gray level descending vector reflects the change trend of the defective pixel point and the pixel points in the neighborhood. Screening out the same-direction pixel points corresponding to the defect pixel points from the pixel points in the neighborhood of each defect pixel point, determining the initial suspected scratch probability of each defect pixel point according to the difference of the gray-scale descending vectors of the defect pixel points and the corresponding same-direction pixel points and the fluctuation characteristic of the gray values, and carrying out initial judgment on whether the defect pixel point is the pixel point of the scratch area according to the difference of the gray-scale descending vectors and the fluctuation of the gray values of the defect pixel points because if the defect pixel point is the pixel point on the scratch area, the scratch area has a certain length, and the pixel point similar to the characteristic of the defect pixel point exists in the neighborhood of the defect pixel point in a large probability; since a certain radian may exist in a part of scratches, the scratch direction is not completely linear, and thus, an error may exist in the initial suspected scratch probability calculated according to the similarity of the gray-level drop vectors of the pixels. Therefore, the initial suspected scratch probability needs to be further corrected according to the scratch characteristics to obtain a more accurate target suspected scratch probability, and particularly a symmetric point of the defective pixel is obtained, and the similarity between the defective pixel and the symmetric point is analyzed because the scratch defect has a certain width, so that the target suspected scratch probability of the defective pixel is determined. According to the target suspected scratch probability of each defective pixel point, the self-adaptive correction coefficient of each defective pixel point is determined, the purpose of self-adaptive adjustment of the correction coefficient in the traditional NiBlack algorithm is achieved, the smaller self-adaptive correction coefficient is endowed to the pixel point in the scratch area, so that the corresponding defect segmentation threshold value is lower, accurate segmentation of the scratch pixel point is ensured, and the accuracy of local threshold segmentation is improved; based on the self-adaptive correction coefficient of each defective pixel point, a defect segmentation threshold value of each defective pixel point is determined by using a NiBlack algorithm, a mold cavity image is segmented, and a quality evaluation value of a cable clamp plate mold cavity is determined, so that accuracy of segmentation of a defect area is improved, and accuracy of detection of the metal cable clamp plate mold cavity is further 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 flowchart of a method for manufacturing an intelligent detection method for a cable clamp plate die according to an embodiment of the invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects of the intelligent detection method for manufacturing the cable splint die according to the invention in combination with the accompanying drawings and the preferred embodiment. 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 embodiment of the invention provides a specific implementation method of an intelligent detection method for manufacturing a cable clamp plate die, which is suitable for a scene of cable clamp plate die detection. And in the scene, a mold cavity image of the cable clamp plate mold cavity is acquired through an industrial camera. The method aims to solve the technical problem that the accuracy of the quality detection result of the metal mold cavity is low because the correction coefficient in the traditional NiBlack algorithm cannot be adaptively adjusted according to a specific use scene. The method comprises the steps of obtaining a mold cavity image and a suspected defect area of a cable clamp plate mold cavity; determining initial suspected scratch probability of each defective pixel point in the suspected defective area; further correcting the initial suspected scratch probability and determining the target suspected scratch probability of each defective pixel point; determining the self-adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel; and determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point, segmenting a mold cavity image, and determining a quality evaluation value of the cable clamp plate mold cavity. According to the invention, the traditional NiBlack algorithm is optimized, so that the correction coefficient in the traditional NiBlack algorithm can be adaptively adjusted according to specific use situations, the accuracy of dividing the defect area is improved, and the accuracy of judging the quality of the cable clamp plate die cavity is further improved.
The invention provides a specific scheme of an intelligent detection method for manufacturing a cable clamp plate die, which is specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of a method for manufacturing an intelligent detection method for a cable clamp plate mold according to an embodiment of the invention is shown, the method includes the following steps:
and S100, acquiring a mold cavity image of a cable clamp plate mold cavity, and dividing the mold cavity image to obtain a suspected defect area.
Firstly, acquiring a mold cavity image of a cable clamp plate metal mold by using image acquisition equipment, and performing preliminary segmentation by using an Ojin algorithm to obtain a suspected defect area in the mold cavity image. And then according to the similarity of the gray scale descent vector direction of the scratch pixel points along the scratch direction, acquiring the possibility that each pixel point is a suspected scratch, calculating a correction coefficient according to the symmetry of the scratch, acquiring the more accurate suspected scratch possibility of each pixel point, further acquiring the self-adaptive correction coefficient required by each pixel point, and accurately dividing the scratch defect area in the target area by using a NiBlack algorithm.
In the embodiment of the invention, the image acquisition equipment is an industrial camera, acquires the cavity surface image through the industrial camera, and then carries out gray processing on the cavity surface image to obtain the corresponding mold cavity image. The invention analyzes a rectangular cable clamp plate, so that the surface of a metal mold cavity of the cable clamp plate is a smooth plane.
Thin and shallow scratches are the most common defects on the metal surface and are also the most difficult defects to automatically identify, and the identification of the scratches is mainly realized. Because the oxide film exists on the surface of the metal, the scratch is equivalent to removing the oxide film, and the original metallic luster is exposed, so that the scratch is brighter.
After a mold cavity image of a cable clamp plate mold cavity is obtained, the mold cavity image is segmented to obtain a suspected defect area, namely the mold cavity image is segmented to obtain the suspected defect area, and the method is specific: obtaining an optimal segmentation threshold value of a mold cavity image by using an Ojin algorithm; and taking the pixel point with the pixel value larger than the optimal segmentation threshold value as a defect pixel point, and forming a suspected defect area by the defect pixel point. The primary segmentation of the die cavity image is realized through an Ojin algorithm. Due to the change of external illumination and the reflection effect of the metal surface, a highlight reflection area exists in the die cavity image, so that scratch defects and high reflection areas exist in the suspected defect areas obtained by primary segmentation.
Step S200, constructing gray scale descending vectors of all the defect pixel points according to descending change characteristics of gray scale values of all the defect pixel points in the suspected defect area and the pixel points in the corresponding neighborhood.
In the traditional NiBlack algorithm in the cable clamp plate die defect detection scene, when the correction coefficient in the NiBlack algorithm is selected to be smaller, the obtained local segmentation threshold value is lower, so that the non-scratch pixel points are easily divided into scratch pixel points by mistake, and when the correction coefficient in the NiBlack algorithm is selected to be larger, the obtained local segmentation threshold value is higher, so that the scratch pixel points are easily divided into the non-scratch pixel points by mistake. Therefore, the invention identifies suspected defect points according to gray features in the local neighborhood of the image, thereby self-adapting correction coefficients to achieve the purpose of accurately dividing defect areas.
According to gray features in local adjacent areas of the mold cavity image, the self-adaptive correction coefficient is realized, so that defect points in the mold cavity image are identified.
Firstly, constructing gray scale descending vectors of all defective pixel points according to descending change characteristics of gray scale values of all defective pixel points in a suspected defective area and pixel points in a corresponding neighborhood, and specifically: selecting any defective pixel point in the suspected defective area as a target pixel point; taking the pixel point, corresponding to the target pixel point, of which the gray value in the neighborhood is smaller than that of the target pixel point as a matched pixel point corresponding to the target pixel point; taking the direction from the target pixel point to each corresponding matched pixel point as the direction of the gray level descending component vector of the target pixel point and each corresponding matched pixel point; and taking the gray level difference value of the target pixel point and the corresponding matched pixel points as the mode of the gray level descending component vector of the target pixel point and the corresponding matched pixel points. It should be noted that, the target pixel point and each corresponding matching pixel point have corresponding gray-scale decreasing component, for example, the target pixel point is a, the matching pixel points corresponding to the target pixel point have b and c, and the target pixel point a and the matching pixel point b have corresponding gray-scale decreasing component
Figure SMS_1
The target pixel point a and the matched pixel point c have corresponding gray-scale reduction component
Figure SMS_2
And taking the sum vector of the gray-scale reduction component vectors of the target pixel point and all the corresponding matched pixel points as the gray-scale reduction vector of the target pixel point. Obtaining gray-scale descending vectors of all defect pixel points in suspected defect areas in a mold cavity image of a cable clamp plate mold cavity, and obtaining a gray-scale descending vector set
Figure SMS_3
Wherein, the method comprises the steps of, wherein,
Figure SMS_4
a gray-scale decreasing vector which is a first defective pixel point in the suspected defective area;
Figure SMS_5
a gray-scale decreasing vector which is the second defective pixel point in the suspected defective area;
Figure SMS_6
the gray level decreasing vector of the nth defective pixel point in the suspected defective area is n, and n is the number of defective pixel points in the suspected defective area in the die cavity image.
Step S300, based on the direction of the gray level descending vector of each defective pixel, the same-direction pixel corresponding to each defective pixel is selected from the pixels in the neighborhood of each defective pixel; and determining the initial suspected scratch probability of each defective pixel point according to the difference of the gray scale descending vectors of each defective pixel point and the corresponding homodromous pixel point and the fluctuation characteristic of the gray scale value.
Since the scratch is equivalent to removing the oxide film on the metal surface, the original metal luster is exposed, namely, the deeper and more obvious the scratch is, the pixel gray values on the two sides in the vertical direction of the central line of the scratch area in the target area gradually decrease. And the gray values of pixels in the high light reflection area in the target area gradually decrease from the illumination position to the periphery. The scratches are generally nearly linear, so that the gray scale falling vector directions of the pixel points in the scratch areas are the same along the scratch directions, the gray scale falling vector directions of the pixel points are perpendicular to the scratch directions, and the gray scale values are the same.
And based on the direction of the gray level descending vector of each defective pixel point, the homodromous pixel points corresponding to each defective pixel point are screened out from the pixel points in the neighborhood of each defective pixel point. The greater the probability that the co-directional pixel is a pixel belonging to the scratch area.
Taking any defective pixel point in a suspected defective area of a mold cavity image as a target pixel point as an example, a method for obtaining a homodromous pixel point corresponding to the target pixel point is specifically: the vertical direction of the gray-scale descent vector corresponding to the target pixel point is obtained and is taken as the vertical direction of the target pixel point, namely, the two directions of the direction of the gray-scale descent vector of the target pixel point and the vertical direction of the target pixel point are vertical on a two-dimensional plane. And passing through the target pixel point, making a straight line along the vertical direction corresponding to the target pixel point to obtain a vertical line corresponding to the target pixel point, and taking the pixel point positioned on the vertical line of the target pixel point in the neighborhood of the target pixel point as the same-direction pixel point of the target pixel point. In the embodiment of the invention, the neighborhood of the defective pixel point is set to be eight neighborhood, namely, the pixel point which is positioned on the vertical line of the target pixel point in the eight neighborhood of the target pixel point is used as the homodromous pixel point of the target pixel point, and the target pixel point is also positioned on the vertical line because the vertical line passes through the target pixel point; in addition to the target pixel, in the eight adjacent regions of the target pixel, the number of the same-direction pixels corresponding to the target pixel should be 2, and when the adjacent region of the pixel changes, the number of the same-direction pixels corresponding to the defect pixel also changes, so that the size of the adjacent region corresponding to the pixel can be adjusted by an implementer according to actual conditions.
After the homodromous pixel points are obtained, determining initial suspected scratch probability of each defective pixel point according to the difference of gray scale descending vectors of each defective pixel point and the corresponding homodromous pixel points and the fluctuation characteristics of gray scale values, and specifically:
taking any defective pixel point in the suspected defective area of the mold cavity image as a target pixel point as an example; and acquiring an included angle value between the direction of the gray scale falling vector of the target pixel point and the direction of the gray scale falling vector of the corresponding homodromous pixel point. And taking the average value of the included angle values of the directions of the gray scale falling vectors of the target pixel point and all the corresponding same-direction pixel points as the average value of the included angles of the target pixel point. Taking the ratio of the average value of the included angles of the target pixel points to the preset included angle value as the included angle duty ratio of the target pixel points; and carrying out negative correlation normalization on the included angle duty ratio of the target pixel point to obtain a first suspected scratch probability of the target pixel point.
And calculating the variance of the gray values of the target pixel point and all corresponding homodromous pixel points to be used as the gray variance of the target pixel point. Taking the product of the gray variance of the target pixel point and a preset adjustment coefficient as the adjustment variance of the target pixel point; and carrying out negative correlation normalization on the adjustment variance of the target pixel point to obtain a second suspected scratch probability of the target pixel point.
Determining initial suspected scratch probability of the target pixel point according to the first suspected scratch probability and the second suspected scratch probability of the target pixel point, wherein the first suspected scratch probability and the second suspected scratch probability are in positive correlation with the initial suspected scratch probability. In the embodiment of the present invention, the preset included angle value is 90, the preset adjustment coefficient is 0.1, and in other embodiments, the value can be adjusted by an operator according to the actual situation.
Taking the ith defective pixel point in the suspected defective area as a target pixel point as an example, the calculation formula of the initial suspected scratch probability of the target pixel point is as follows:
Figure SMS_7
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_8
the initial suspected defect probability of the target pixel point is obtained;
Figure SMS_9
the average value of the included angles of the target pixel points;
Figure SMS_10
is a normalization function; e is a natural constant; u is a preset adjustment coefficient; 90 is a preset included angle value;
Figure SMS_11
the gray variance corresponding to the target pixel point is obtained;
Figure SMS_12
the first suspected scratch probability is the target pixel point;
Figure SMS_13
and the second suspected scratch probability of the target pixel point.
In the calculation formula of the initial suspected scratch probability, the method comprises the following steps of
Figure SMS_14
And negative correlation normalization of the included angle duty ratio of the target pixel point is realized.Negative correlation normalization of the adjustment variance is achieved by an exponential function with the natural constant e as a base and the negative adjustment variance as an exponent. The purpose of multiplying the gray variance of the target pixel by the preset adjustment coefficient is to avoid the situation that when the adjustment variance is normalized by the exponential function taking the natural constant e as a base and taking the negative adjustment variance as an index, the exponential function tends to zero too early, so the preset adjustment coefficient is taken as the weight of the gray variance, and the gray variance is reduced.
The direction of the gray scale falling vector of the pixel point in the scratch area along the scratch direction is the same, the direction of the gray scale falling vector of the pixel point is perpendicular to the scratch direction, and the gray scale value is the same. The gray scale decreasing vector direction of the pixel points in the high light area is the same along the illumination direction, but the gray scale decreasing vector direction of the pixel points is parallel to the illumination direction. Thus when the included angle is the average
Figure SMS_15
The closer to 0, the more likely the pixel is the pixel at the scratch, and the scratch pixel has similar gray value along the scratch direction, i.e. the gray variance V is smaller, normalized by negative correlation
Figure SMS_16
Normalized as a negative correlation
Figure SMS_17
The product of the two represents the possibility that the defective pixel point is a suspected scratch; namely, when the included angle value of the gray scale decline vector of the defect pixel point and the corresponding homodromous pixel point is smaller, the included angle ratio of the defect pixel point is smaller, the first suspected scratch probability of the corresponding defect pixel point is larger, and the initial suspected scratch probability of the defect pixel point belonging to the scratch area is larger; when the gray value fluctuation of the defect pixel point and the corresponding homodromous pixel point is smaller, the gray variance of the defect pixel point is larger, the second suspected scratch probability of the corresponding defect pixel point is larger, and the initial suspected scratch probability of the defect pixel point belonging to the scratch area is larger.
Obtaining each defective pixel in the suspected defective areaThe initial suspected scratch probability of the point forms an initial suspected scratch probability set
Figure SMS_18
Wherein, the method comprises the steps of, wherein,
Figure SMS_19
the initial suspected scratch probability of the 1 st defective pixel point in the suspected defective area;
Figure SMS_20
the initial suspected scratch probability of the 2 nd defective pixel point in the suspected defective area;
Figure SMS_21
the initial suspected scratch probability of the nth defective pixel point in the suspected defective area is determined; n is the number of defective pixels in the suspected defective region in the mold cavity image.
Step S400, determining symmetry points of each defective pixel point based on the opposite direction of the gray scale falling vector of each defective pixel point; and determining the target suspected scratch probability of each defective pixel point according to the distance between each defective pixel point and the symmetrical point, the frequency of occurrence of the distance between each defective pixel point and the symmetrical point, the gray level decline vector of each defective pixel point and the symmetrical point and the initial suspected scratch probability of each defective pixel point.
Since a certain radian may exist in the partial scratch, and the scratch direction is not completely linear, an error may exist in the initial suspected scratch probability calculated in step S300 according to the directional similarity of the gray-scale descent vectors of the pixels. Therefore, the initial probability of suspected scratches needs to be further corrected according to the characteristics of the scratches so as to obtain more accurate probability of suspected scratches.
The pixel points in the scratch area have the characteristic of symmetry along the center line of the scratch direction, namely, a certain scratch pixel point h traverses along the opposite direction of the gray-scale descending vector of the scratch pixel point h to the pixel point which is opposite to the direction of the gray-scale descending vector of the scratch pixel point h and has the same modulus with the gray-scale descending vector of the pixel point h, and the pixel point which is opposite to the direction of the gray-scale descending vector of the pixel point h and has the same modulus with the gray-scale descending vector of the pixel point h is taken as the symmetry point of the pixel point h. And in the scene detected by the cable clamp plate die, the high light reflection area of the metal die is close to a sector smaller than a semicircle, so that the high light reflection pixel point cannot traverse to a symmetrical point which is opposite to the direction of the gray level falling vector of the high light reflection pixel point and is the same as the mode of the gray level falling vector of the high light reflection pixel point in the opposite direction of the gray level falling vector direction of the high light reflection pixel point.
The method comprises the steps of determining symmetry points of each defective pixel point based on the opposite direction of a gray level falling vector of each defective pixel point, and specifically: taking any defective pixel point in the suspected defective area of the mold cavity image as an example of a target pixel point, taking the target pixel point as an endpoint, taking a ray along the opposite direction of the gray level descending vector of the target pixel point, and connecting the target pixel point with the edge point closest to the target pixel point on the corresponding ray to obtain an opposite direction line of the target pixel point, wherein the edge point is the edge point of the suspected defective area.
And respectively calculating the gray-scale descending vector of the target pixel point and the sum vector module of the gray-scale descending vector of each pixel point on the corresponding opposite direction line, and taking the pixel point corresponding to the minimum sum vector module as the symmetrical point of the target pixel point. For example, there are three pixel points w1, w2 and w3 on the opposite direction line corresponding to the target pixel point r, respectively calculating the mode q1 of the sum vector of the gray-scale falling vectors of the target pixel point r and the corresponding pixel point w1 on the opposite direction line, calculating the mode q2 of the sum vector of the gray-scale falling vectors of the target pixel point r and the corresponding pixel point w2 on the opposite direction line, calculating the mode q3 of the sum vector of the gray-scale falling vectors of the target pixel point r and the corresponding pixel point w3 on the opposite direction line, comparing the sizes of the modes q1, q2 and q3 of the three sum vectors, and if q2 is the minimum value of the three modes q1, q2 and q3, taking the pixel point corresponding to q2 as the symmetry point of the target pixel point r of w 2. If the target pixel point has a plurality of corresponding symmetry points, the symmetry point with the smallest euclidean distance with the target pixel point is used as the final symmetry point of the target pixel point, that is, when the number of the corresponding symmetry points of the target pixel point is more than one in the analysis of the subsequent step, only the symmetry point with the smallest euclidean distance with the target pixel point is used as the final symmetry point of the target pixel point, and the subsequent analysis is only performed on the final symmetry point.
Because the cavity surface of the cable clamp plate die is a plane, the position and the size of the uneven illumination area are random, and the scratch defect is symmetrical along the central line of the scratch direction. Because the distance values corresponding to the pixel points along the scratch direction in the scratch defect are the same, and the distance values corresponding to the pixel points of random uneven illumination are random in size. After the symmetrical points of the defect pixel points in the suspected defect area are obtained, determining target suspected scratch probability of the defect pixel points according to the distance between the defect pixel points and the symmetrical points, the gray level decline vector of the defect pixel points and the symmetrical points and the initial suspected scratch probability of the defect pixel points, and specifically:
taking any defective pixel point in the suspected defective area of the mold cavity image as a target pixel point as an example, and taking the distance between the target pixel point and the corresponding symmetrical point as the symmetrical distance of the target pixel point; and taking the frequency of the symmetric distance of the target pixel point in the symmetric distances of all the defect pixel points in the suspected defect area as the occurrence frequency of the target pixel point, and taking the normalized value of the product of the symmetric distance and the occurrence frequency as the distance normalization value of the target pixel point. In the embodiment of the invention, the normalization of the distance G is realized by calculating the ratio of the distance G between the target pixel point and the corresponding symmetrical point to the length of the diagonal line of the die cavity image, namely, the ratio of the distance G to the length of the diagonal line of the die cavity image is a normalized value of the distance G, namely, a distance normalization value. The length of the diagonal line of the mold cavity image is determined by the size of the acquired mold cavity image. The distance between the target pixel point and the corresponding symmetric point is the Euclidean distance.
Further, a sum vector module of the gray level falling vector of the target pixel point and the gray level falling vector of the corresponding symmetrical point is obtained and is used as a symmetrical module of the target pixel point, and the product of the distance normalization value of the target pixel point and the symmetrical module of the target pixel point is subjected to inverse proportion normalization to obtain a third suspected scratch probability of the target pixel point;
determining the target suspected defect probability of the target pixel point according to the third suspected scratch probability and the initial suspected scratch probability of the target pixel point; the third suspected scratch probability and the initial suspected scratch probability are in positive correlation with the target suspected scratch probability.
Taking the ith defective pixel point in the suspected defective area as a target pixel point as an example, the calculation formula of the target suspected scratch probability of the target pixel point is as follows:
Figure SMS_22
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_24
the probability of the target suspected scratch is the target pixel point;
Figure SMS_28
is a natural constant;
Figure SMS_32
the initial suspected scratch probability of the target pixel point;
Figure SMS_25
the distance between the target pixel point and the corresponding symmetrical point is the symmetrical distance of the target pixel point;
Figure SMS_29
the length of the diagonal line of the die cavity image;
Figure SMS_33
the distance between the target pixel point and the corresponding symmetrical point is normalized;
Figure SMS_35
a symmetry mode of the target pixel point;
Figure SMS_23
The third suspected scratch probability is the target pixel point;
Figure SMS_27
is the symmetric distance of the target pixel point
Figure SMS_31
The number of occurrences; n is the number of defective pixel points in the suspected defective area;
Figure SMS_34
is the symmetric distance of the target pixel point
Figure SMS_26
The frequency of occurrence of the target pixel, i.e. the symmetric distance of the target pixel
Figure SMS_30
And the frequency of occurrence in the symmetrical distance corresponding to all the defective pixel points in the suspected defective area.
Since the pixel points in the scratch area are symmetrical along the central line of the scratch direction, that is, the directions of the gray scale falling vectors of the pixel points in the scratch area and the corresponding symmetrical points are opposite and the modes of the vectors are the same, the symmetrical mode of the pixel points is close to 0, and the probability that the pixel points belong to the scratch area is larger. Since the scratches are elongated, the distance G between the defective pixel point and the corresponding symmetric point should be smaller, so that the smaller the distance G, the smaller the corresponding distance normalization value, and the greater the target suspected scratch probability of the corresponding defective pixel point. The probability of occurrence of the symmetric distance corresponding to the pixel point of the scratch is larger, because the symmetric distance belonging to the same defect is generally similar, and the reflective area generated by illumination is generally wider in central area and narrower in two side areas, so that the frequency of occurrence of the symmetric distance of the pixel point is smaller, the larger the frequency of occurrence corresponding to the pixel point is, the more reliable the symmetric distance corresponding to the pixel point is, therefore, the frequency of occurrence of the pixel point is used as an adjustment value of the symmetric distance of the pixel point, and the width characteristic of the scratch defect is represented by the product of the two. The mode of the gray-scale falling vector of the defective pixel is the gray-scale difference value of the defective pixel and the corresponding matching pixel, because under normal conditions, when the defective pixel and the corresponding matching pixel are the pixels of the scratch area, the directions of the two corresponding gray-scale falling vectors are opposite, and the two corresponding gray-scale falling vectors So that the closer the gray difference between the defective pixel and the corresponding matched pixel, the more the gray difference between the symmetrical point corresponding to the defective pixel and the corresponding matched pixel, the smaller the modulus of the sum vector of the gray-scale falling vectors of the defective pixel and the corresponding matched pixel, and the greater the probability that the corresponding defective pixel is the pixel of the scratch area. Normalizing values by normalized distance
Figure SMS_36
As the adjustment value of the symmetry mode D of the defect pixel point, the product of the distance normalization value between the defect pixel point and the corresponding symmetry point and the symmetry mode of the defect pixel point is used for reflecting the scratch characteristic,
Figure SMS_37
the smaller the value, the more the corresponding defective pixel point accords with the scratch characteristic. Therefore, the third suspected scratch probability normalized by the inverse proportion
Figure SMS_38
Initial suspected scratch probability as defective pixel
Figure SMS_39
The correction coefficient of the defect pixel point is used for realizing the optimal adjustment of the initial suspected scratch probability of the defect pixel point, and whether the defect pixel point is suspected scratch or not is judged according to the target suspected scratch probability obtained after the optimal adjustment, so that the probability is more accurate.
Obtaining more accurate target suspected scratch probability of each defect pixel point in the suspected defect area to obtain a target suspected scratch probability set
Figure SMS_41
Figure SMS_44
The target suspected scratch probability of the 1 st defective pixel point in the suspected defective area;
Figure SMS_46
the target suspected scratch probability of the 2 nd defective pixel point in the suspected defective area;
Figure SMS_42
the target suspected scratch probability of the nth defective pixel point in the suspected defective area; wherein n is the number of defective pixels in the suspected defective region in the mold cavity image. Then the probability set of the suspected scratch of the target
Figure SMS_45
The target suspected defect probability is normalized, and a target suspected scratch probability set is calculated in the embodiment of the invention
Figure SMS_48
Each of the target suspected scratch probability and the target suspected scratch probability set
Figure SMS_50
The ratio of the maximum target suspected scratch probability in the (a) is used as a normalization value of each target suspected scratch probability so as to normalize the target suspected scratch probability. Obtaining a normalized target suspected scratch probability set
Figure SMS_40
The method comprises the steps of carrying out a first treatment on the surface of the Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_43
the normalized value of the target suspected scratch probability of the 1 st defective pixel point in the suspected defective area is the normalized target suspected scratch probability of the 1 st defective pixel point in the suspected defective area;
Figure SMS_47
the normalized value of the target suspected scratch probability of the 2 nd defect pixel point in the suspected defect area;
Figure SMS_49
The normalized value of the target suspected scratch probability of the nth defective pixel point in the suspected defective area.
Step S500, determining self-adaptive correction coefficients of the defective pixel points according to the target suspected scratch probability of the defective pixel points; and determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point.
The value range of the correction coefficient in the NiBlack algorithm is [ -1,1], and the larger the correction coefficient is, the more likely the pixel is misclassified, so that the more accurate the pixel is, the more likely the suspected scratch is, and the smaller the correction coefficient is needed.
After obtaining the target suspected scratch probability of each defective pixel, determining an adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel, specifically: and carrying out negative correlation mapping on the normalized target suspected scratch probability of the preset multiple of the defect pixel point to obtain the self-adaptive correction coefficient of the defect pixel point. In the embodiment of the present invention, the preset multiple has a value of 2, and in other embodiments, the practitioner can adjust the value according to the actual situation.
Taking the ith defective pixel point in the suspected defective area as a target pixel point as an example, the calculation formula of the adaptive correction coefficient of the target pixel point is as follows:
Figure SMS_51
Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_52
the adaptive correction coefficient of the target pixel point;
Figure SMS_53
the probability of the target suspected scratch after normalization; 2 is a preset multiple.
In the calculation formula of the self-adaptive correction coefficient, the method comprises the following steps of
Figure SMS_54
The negative correlation mapping of the target suspected scratch probability after normalization of the preset multiple is realized. When the normalized target suspected scratch probability corresponding to the defective pixel is larger, the probability that the defective pixel is a pixel in the scratch defect is larger, and at the moment, a smaller correction coefficient is needed to accurately divide the defective pixelThe smaller the corresponding adaptive correction coefficient should be.
Further, based on the adaptive correction coefficient of each defective pixel, a defect segmentation threshold of each defective pixel is determined by using a NiBlack algorithm. The purpose of optimizing the NiBlack algorithm is achieved by adjusting the correction coefficient in the NiBlack algorithm. And taking the self-adaptive correction coefficient corresponding to the defective pixel as the correction coefficient in the NiBlack algorithm to obtain a threshold corresponding to the defective pixel, and marking the threshold as a defect segmentation threshold of the defective pixel. In the embodiment of the invention, the neighborhood window of the NiBlack algorithm is set to be 7 multiplied by 7, and in other embodiments, an implementer can set the size of the neighborhood window of the NiBlack algorithm according to actual requirements.
Taking the ith defective pixel point in the suspected defective area as a target pixel point as an example, the calculation formula of the defect segmentation threshold value of the target pixel point is as follows:
Figure SMS_55
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_56
a defect segmentation threshold value for the target pixel point;
Figure SMS_57
the adaptive correction coefficient of the target pixel point;
Figure SMS_58
standard deviation of gray values in a neighborhood window of a target pixel point;
Figure SMS_59
the average value of gray values in a neighborhood window of the target pixel point. It should be noted that, the calculation formula of the defect segmentation threshold is a calculation formula of a threshold in the NiBlack algorithm, which is a well-known technique of those skilled in the art, and will not be described herein.
When the correction coefficient of the traditional NiBlack algorithm is selected to be smaller, namely closer to-1, the obtained local segmentation threshold value is lower due to the larger gray variance, and the pixel points with larger gray values in the high light reflection area are easily divided into scratch pixel points by mistake. When the correction coefficient is selected to be larger, namely, the correction coefficient is closer to 1, the acquired local segmentation threshold value is higher due to larger gray variance, and pixel points with smaller gray values in a scratch area are easily divided into non-scratch pixel points by mistake. According to the method, the initial suspected scratch probability that each defective pixel point is a pixel point on suspected scratches is obtained according to the similarity of the gray scale descending vector direction of the pixel point along the scratch direction, then the initial suspected scratch probability is corrected according to the symmetry of scratches, the more accurate target suspected scratch probability of each defective pixel point is obtained, and further the self-adaptive correction coefficient required by each defective pixel point is obtained, namely, a small correction coefficient is given to the pixel point of a scratch area, a lower defect segmentation threshold value is obtained, accurate segmentation of the pixel point of the scratch is ensured, a larger correction coefficient is given to the pixel point of a high reflection area, a higher defect segmentation threshold value is obtained, and error segmentation is prevented, so that the accuracy of local threshold value segmentation is improved.
And S600, dividing the mold cavity image based on the defect dividing threshold value of each defective pixel point, and determining the quality evaluation value of the cable clamp plate mold cavity.
After obtaining the defect segmentation threshold value of each defect pixel point in the suspected defect area, segmenting the mold cavity image based on the defect segmentation threshold value of each defect pixel point to obtain the defect area in the mold cavity image. Specific: and taking the defective pixel point with the gray value larger than the corresponding defect segmentation threshold value in the suspected defective area as a scratch pixel point in the mold cavity image, and forming the defective area in the mold cavity image by the scratch pixel point. Due to the change of external illumination and the reflection effect of the metal surface, the acquired image of the die cavity of the metal is easy to generate uneven illumination, and the accuracy of identifying scratch defects is affected. According to the invention, the scratch defect area in the image is accurately segmented through an improved NiBlack algorithm with the self-adaptive correction coefficient, so that the accurate segmentation of the scratch defect in the surface of the die cavity of the metal die is realized.
Further, the negative correlation mapping value of the area ratio of the defective area in the mold cavity image is used as the quality evaluation value of the cable clamp plate mold cavity.
The calculation formula of the quality evaluation value is as follows:
Figure SMS_60
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_61
quality evaluation value;
Figure SMS_62
is the area of the defect area;
Figure SMS_63
is the area of the mold cavity image;
Figure SMS_64
is the area ratio.
The larger the area ratio is, the smaller the corresponding negative correlation mapping value of the area ratio is, the worse the quality of the cable clamp plate mould is reflected, the quality evaluation value reflects the quality of the cable clamp plate mould, when the quality evaluation value is larger, the better the quality of the corresponding cable clamp plate mould is, and when the quality evaluation value is smaller, the worse the quality of the corresponding cable clamp plate mould is. In the embodiment of the invention by
Figure SMS_65
Realizing the area ratio
Figure SMS_66
Is a negative correlation mapping of (1). In the embodiment of the invention, the area is the number of pixels, namely the area of the defect area is the number of pixels in the defect area, and the area of the mold cavity image is the number of pixels in the mold cavity image.
In summary, the present invention relates to the technical field of image data processing. Firstly, acquiring a mold cavity image and a suspected defect area of a cable clamp plate mold cavity; determining initial suspected scratch probability of each defective pixel point in the suspected defective area; further correcting the initial suspected scratch probability and determining the target suspected scratch probability of each defective pixel point; determining the self-adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel; determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point; and dividing the die cavity image based on the defect dividing threshold value of each defective pixel point, and determining the quality evaluation value of the cable clamp plate die cavity. According to the invention, the traditional NiBlack algorithm is optimized, so that the correction coefficient in the traditional NiBlack algorithm can be adaptively adjusted according to specific use situations, the accuracy of dividing the defect area is improved, and the accuracy of judging the quality of the cable clamp plate die cavity is further improved.
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. The intelligent detection method for manufacturing the cable clamp plate die is characterized by comprising the following steps of:
acquiring a mold cavity image of a cable clamp plate mold cavity, and dividing the mold cavity image to obtain a suspected defect area;
constructing gray scale descending vectors of all the defect pixel points according to descending change characteristics of gray scale values of all the defect pixel points in the suspected defect area and the pixel points in the corresponding neighborhood;
based on the direction of the gray level descending vector of each defective pixel point, the homodromous pixel points corresponding to each defective pixel point are screened out from the pixel points in the neighborhood of each defective pixel point; determining initial suspected scratch probability of each defective pixel point according to the difference of gray scale descending vectors of each defective pixel point and the corresponding homodromous pixel points and the fluctuation characteristics of gray scale values;
Determining symmetry points of each defective pixel point based on the opposite direction of the gray level falling vector of each defective pixel point; determining target suspected scratch probability of each defective pixel according to the distance between each defective pixel and the symmetrical point, the frequency of occurrence of the distance between each defective pixel and the symmetrical point, the gray level decline vector of each defective pixel and the symmetrical point and the initial suspected scratch probability of each defective pixel;
determining the self-adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel; determining a defect segmentation threshold value of each defective pixel point by using a NiBlack algorithm based on the self-adaptive correction coefficient of each defective pixel point;
and dividing the die cavity image based on the defect dividing threshold value of each defective pixel point, and determining the quality evaluation value of the cable clamp plate die cavity.
2. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the constructing the gray-scale descent vector of each defective pixel according to the descending variation characteristics of gray-scale values of each defective pixel in the suspected defective region and the pixels in the corresponding neighborhood comprises:
selecting any defective pixel point in the suspected defective area as a target pixel point; taking the pixel point, corresponding to the target pixel point, of which the gray value in the neighborhood is smaller than that of the target pixel point as a matched pixel point corresponding to the target pixel point; taking the direction from the target pixel point to each corresponding matched pixel point as the direction of the gray scale descending vector of the target pixel point and each corresponding matched pixel point, and taking the gray scale difference value of the target pixel point and each corresponding matched pixel point as the modulus of the gray scale descending vector of the target pixel point and each corresponding matched pixel point;
And taking the sum vector of the gray-scale reduction component vectors of the target pixel point and all the corresponding matched pixel points as the gray-scale reduction vector of the target pixel point.
3. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the step of selecting the same-direction pixel point corresponding to each defective pixel point from the pixel points in the neighborhood of each defective pixel point based on the direction of the gray-scale descent vector of each defective pixel point comprises the steps of:
selecting any defective pixel point in the suspected defective area as a target pixel point; acquiring the vertical direction of the gray-scale descent vector corresponding to the target pixel point, and taking the vertical direction as the vertical direction of the target pixel point; and passing through the target pixel point, making a straight line along the vertical direction corresponding to the target pixel point to obtain a vertical line corresponding to the target pixel point, and taking the pixel point positioned on the vertical line of the target pixel point in the neighborhood of the target pixel point as the same-direction pixel point of the target pixel point.
4. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the determining the initial suspected scratch probability of each defective pixel according to the difference of gray-scale descent vectors and the fluctuation characteristics of gray values of each defective pixel and the corresponding homodromous pixel comprises the following steps:
Selecting any defective pixel point in the suspected defective area as a target pixel point; acquiring an included angle value between the direction of the gray scale falling vector of the target pixel point and the direction of the gray scale falling vector of the corresponding homodromous pixel point; taking the average value of the included angle values of the directions of the gray scale falling vectors of the target pixel point and all corresponding homodromous pixel points as the average value of the included angles of the target pixel point; taking the ratio of the average value of the included angles of the target pixel points to the preset included angle value as the included angle duty ratio of the target pixel points; carrying out negative correlation normalization on the included angle duty ratio of the target pixel point to obtain a first suspected scratch probability of the target pixel point;
calculating the variance of gray values of the target pixel point and all corresponding homodromous pixel points to be used as the gray variance of the target pixel point; taking the product of the gray variance of the target pixel point and a preset adjustment coefficient as the adjustment variance of the target pixel point; carrying out negative correlation normalization on the adjustment variance of the target pixel point to obtain a second suspected scratch probability of the target pixel point;
determining initial suspected scratch probability of the target pixel point according to the first suspected scratch probability and the second suspected scratch probability of the target pixel point; the first suspected scratch probability and the second suspected scratch probability are in positive correlation with the initial suspected scratch probability.
5. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the determining the target suspected scratch probability of each defective pixel point according to the distance between each defective pixel point and the symmetric point, the frequency of occurrence of the distance between each defective pixel point and the symmetric point, the gray-scale decrease vector of each defective pixel point and the symmetric point, the initial suspected scratch probability of each defective pixel point, comprises:
selecting any defective pixel point in the suspected defective area as a target pixel point;
taking the distance between the target pixel point and the corresponding symmetrical point as the symmetrical distance of the target pixel point; taking the frequency of the symmetric distance of the target pixel point in the symmetric distances of all the defect pixel points in the suspected defect area as the frequency of occurrence of the target pixel point, and taking the normalized value of the product of the symmetric distance and the frequency of occurrence as the distance normalization value of the target pixel point;
obtaining a vector sum module of the gray-scale descent vector of the target pixel point and the gray-scale descent vector of the corresponding symmetrical point, and taking the vector sum module as a symmetrical module of the target pixel point; inversely proportional normalizing the product of the distance normalization value of the target pixel point and the symmetry mode to obtain a third suspected scratch probability of the target pixel point;
And determining the target suspected scratch probability of the target pixel point according to the third suspected scratch probability and the initial suspected scratch probability of the target pixel point, wherein the third suspected scratch probability and the initial suspected scratch probability are in positive correlation with the target suspected scratch probability.
6. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the determining the adaptive correction coefficient of each defective pixel according to the target suspected scratch probability of each defective pixel comprises:
and carrying out negative correlation mapping on the normalized target suspected scratch probability of the preset multiple of the defect pixel point to obtain the self-adaptive correction coefficient of the defect pixel point.
7. The method for intelligently detecting the manufacturing of the cable clamp plate die according to claim 1, wherein the determining the defect segmentation threshold value of each defective pixel point by using the NiBlack algorithm based on the adaptive correction coefficient of each defective pixel point comprises:
and taking the self-adaptive correction coefficient corresponding to the defective pixel as the correction coefficient in the NiBlack algorithm to obtain a threshold corresponding to the defective pixel, and marking the threshold as a defect segmentation threshold of the defective pixel.
8. The method for intelligently detecting the manufacturing of the cable clamp plate mold according to claim 1, wherein the step of dividing the mold cavity image based on the defect dividing threshold value of each defective pixel point to determine the quality evaluation value of the cable clamp plate mold cavity comprises the steps of:
Taking a defect pixel point with the gray value larger than the corresponding defect segmentation threshold value in the suspected defect area as a scratch pixel point in the mold cavity image; and forming a defect area in the mold cavity image by using the scratch pixel points, and taking a negative correlation mapping value of the area ratio of the defect area in the mold cavity image as a quality evaluation value of the cable clamp plate mold cavity.
9. The method for intelligently detecting the manufacture of the cable clamp plate die according to claim 1, wherein the determining the symmetry point of each defective pixel point based on the opposite direction of the gray-scale descent vector of each defective pixel point comprises:
selecting any defective pixel point in the suspected defective area as a target pixel point; taking a target pixel point as an endpoint, taking a ray along the opposite direction of the gray level descending vector of the target pixel point, and connecting the target pixel point with an edge point, closest to the target pixel point, on the corresponding ray to obtain an opposite direction line of the target pixel point, wherein the edge point is an edge point of a suspected defect area;
and respectively calculating the gray-scale descending vector of the target pixel point and the sum vector module of the gray-scale descending vector of each pixel point on the corresponding opposite direction line, and taking the pixel point corresponding to the minimum sum vector module as the symmetrical point of the target pixel point.
10. The intelligent detection method for manufacturing a cable clamp plate mold according to claim 1, wherein the step of dividing the mold cavity image to obtain a suspected defect area comprises the steps of:
obtaining an optimal segmentation threshold value of a mold cavity image by using an Ojin algorithm; and taking the pixel point with the pixel value larger than the optimal segmentation threshold value as a defect pixel point, and forming a suspected defect area by the defect pixel point.
CN202310628670.7A 2023-05-31 2023-05-31 Intelligent detection method for manufacturing cable clamp plate die Active CN116402808B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310628670.7A CN116402808B (en) 2023-05-31 2023-05-31 Intelligent detection method for manufacturing cable clamp plate die

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310628670.7A CN116402808B (en) 2023-05-31 2023-05-31 Intelligent detection method for manufacturing cable clamp plate die

Publications (2)

Publication Number Publication Date
CN116402808A true CN116402808A (en) 2023-07-07
CN116402808B CN116402808B (en) 2023-08-25

Family

ID=87014505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310628670.7A Active CN116402808B (en) 2023-05-31 2023-05-31 Intelligent detection method for manufacturing cable clamp plate die

Country Status (1)

Country Link
CN (1) CN116402808B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630815A (en) * 2023-07-25 2023-08-22 济南玖通志恒信息技术有限公司 Intelligent agricultural pest detection method
CN116703931A (en) * 2023-08-09 2023-09-05 山东津庭名企建材有限公司 Surface silver vein detection method for building high polymer material
CN117173184A (en) * 2023-11-03 2023-12-05 济宁市市政园林养护中心 Road construction quality detection method and system based on artificial intelligence

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040081347A1 (en) * 2001-01-19 2004-04-29 Christian Bernatek Method for determining and evaluating defects in a sample surface
CN115020267A (en) * 2022-08-05 2022-09-06 启东旺晟电子科技有限公司 Semiconductor surface defect detection method
CN115082683A (en) * 2022-08-22 2022-09-20 南通三信塑胶装备科技股份有限公司 Injection molding defect detection method based on image processing
CN115457035A (en) * 2022-11-10 2022-12-09 山东鲁旺机械设备有限公司 Machine vision-based construction hanging basket welding quality detection method
CN115861317A (en) * 2023-02-27 2023-03-28 深圳市伟利达精密塑胶模具有限公司 Plastic mold production defect detection method based on machine vision
CN116030061A (en) * 2023-03-29 2023-04-28 深圳市捷超行模具有限公司 Silica gel molding effect detection method based on vision

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040081347A1 (en) * 2001-01-19 2004-04-29 Christian Bernatek Method for determining and evaluating defects in a sample surface
CN115020267A (en) * 2022-08-05 2022-09-06 启东旺晟电子科技有限公司 Semiconductor surface defect detection method
CN115082683A (en) * 2022-08-22 2022-09-20 南通三信塑胶装备科技股份有限公司 Injection molding defect detection method based on image processing
CN115457035A (en) * 2022-11-10 2022-12-09 山东鲁旺机械设备有限公司 Machine vision-based construction hanging basket welding quality detection method
CN115861317A (en) * 2023-02-27 2023-03-28 深圳市伟利达精密塑胶模具有限公司 Plastic mold production defect detection method based on machine vision
CN116030061A (en) * 2023-03-29 2023-04-28 深圳市捷超行模具有限公司 Silica gel molding effect detection method based on vision

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHAO -CHING HO ET AL: "Machine Vision and Deep Learning Based Rubber Gasket Defect Detection", 《ADVANCES IN TECHNOLOGY INNOVATION》, vol. 5, no. 2, pages 76 - 83 *
陈硕等: "基于机器视觉的注塑齿轮缺陷检测系统研究", 《机电工程》, vol. 39, no. 9, pages 1243 - 1249 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116630815A (en) * 2023-07-25 2023-08-22 济南玖通志恒信息技术有限公司 Intelligent agricultural pest detection method
CN116630815B (en) * 2023-07-25 2023-09-22 济南玖通志恒信息技术有限公司 Intelligent agricultural pest detection method
CN116703931A (en) * 2023-08-09 2023-09-05 山东津庭名企建材有限公司 Surface silver vein detection method for building high polymer material
CN116703931B (en) * 2023-08-09 2023-10-24 山东津庭名企建材有限公司 Surface silver vein detection method for building high polymer material
CN117173184A (en) * 2023-11-03 2023-12-05 济宁市市政园林养护中心 Road construction quality detection method and system based on artificial intelligence
CN117173184B (en) * 2023-11-03 2024-01-26 济宁市市政园林养护中心 Road construction quality detection method and system based on artificial intelligence

Also Published As

Publication number Publication date
CN116402808B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN116402808B (en) Intelligent detection method for manufacturing cable clamp plate die
CN115311292B (en) Strip steel surface defect detection method and system based on image processing
CN117173189B (en) Visual inspection system for polishing effect of aluminum alloy surface
CN116758083B (en) Quick detection method for metal wash basin defects based on computer vision
CN116740070B (en) Plastic pipeline appearance defect detection method based on machine vision
CN115018834B (en) Semiconductor wafer image alignment method
CN116228758B (en) Internal bubble detection method for polarizer production
CN116758061A (en) Casting surface defect detection method based on computer vision
CN116309537A (en) Defect detection method for oil stain on surface of tab die
CN116452598B (en) Axle production quality rapid detection method and system based on computer vision
CN115797342B (en) Industrial control capacitive touch LCD display assembly defect detection method
CN117095008B (en) Intelligent detection method for defects of steel bar pipe of clock
CN115063407B (en) Scratch and crack identification method for annular copper gasket
CN116503397B (en) In-vehicle transmission belt defect detection method based on image data
CN116188468B (en) HDMI cable transmission letter sorting intelligent control system
CN116071363B (en) Automatic change shaped steel intelligent production monitoring system
CN115953409B (en) Injection molding surface defect detection method based on image processing
CN115274486B (en) Semiconductor surface defect identification method
CN117557820B (en) Quantum dot optical film damage detection method and system based on machine vision
CN115049651B (en) Metal plate stamping abnormity detection method
CN116703889B (en) Flexible circuit board patch abnormality detection method
CN115359047A (en) Abnormal defect detection method for intelligent welding of PCB (printed circuit board)
CN115511907A (en) Scratch detection method for LED screen
CN115115603A (en) Automobile accessory flywheel surface detection method based on artificial intelligence
CN117237350B (en) Real-time detection method for quality of steel castings

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