CN114359270B - Computer vision-based automobile engine oil way copper sleeve defect detection method - Google Patents

Computer vision-based automobile engine oil way copper sleeve defect detection method Download PDF

Info

Publication number
CN114359270B
CN114359270B CN202210221735.1A CN202210221735A CN114359270B CN 114359270 B CN114359270 B CN 114359270B CN 202210221735 A CN202210221735 A CN 202210221735A CN 114359270 B CN114359270 B CN 114359270B
Authority
CN
China
Prior art keywords
pixel point
defect
surface image
automobile engine
defect edge
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.)
Active
Application number
CN202210221735.1A
Other languages
Chinese (zh)
Other versions
CN114359270A (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 Huarentong Automobile Service Co ltd
Original Assignee
Shandong Huashuo Auto Parts 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 Huashuo Auto Parts Technology Co ltd filed Critical Shandong Huashuo Auto Parts Technology Co ltd
Priority to CN202210221735.1A priority Critical patent/CN114359270B/en
Publication of CN114359270A publication Critical patent/CN114359270A/en
Application granted granted Critical
Publication of CN114359270B publication Critical patent/CN114359270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The invention relates to the technical field of computer vision, in particular to a computer vision-based method for detecting defects of an oil way copper sleeve of an automobile engine, which comprises the following steps: determining a relevant area of each pixel point in the preprocessed surface image according to the preprocessed surface image of the oil-way copper sleeve of the automobile engine to be detected, and determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant area of each pixel point; determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude of each pixel point and the adjacent pixel points thereof, and further determining each defect edge pixel point; and determining each defect edge communication domain according to each defect edge pixel point and the probability of the defect edge pixel point, and further determining each defect region, thereby determining the defect degree evaluation value of the oil way copper sleeve of the automobile engine to be detected. The method effectively improves the accuracy of detecting the defects of the copper bush of the oil way.

Description

Computer vision-based automobile engine oil way copper bush defect detection method
Technical Field
The invention relates to the technical field of computer vision, in particular to a computer vision-based method for detecting defects of an oil way copper sleeve of an automobile engine.
Background
With the continuous development of science and technology, the prosperous progress of the automobile manufacturing industry is promoted. The automobile engine is used as a power device which determines the dynamic property, the economical efficiency and the stability of an automobile, the oil-way copper sleeve is used as one of important components of the automobile engine, and the quality of the oil-way copper sleeve is one of important factors influencing the performance of the automobile engine. In the production process of the copper bush of the oil circuit of the automobile engine, the defects of different degrees appear on the surface of the product due to the collision among products and the control error of the production process, the performance of the automobile can be seriously influenced by inferior products, and irrecoverable accidents can be more seriously caused, so the defect detection of the copper bush product of the oil circuit of the automobile engine is very important.
The defect detection of the oil way copper sleeve of the automobile engine usually adopts a manual detection method, but the manual detection method has low production efficiency, and the defect detection result is often inaccurate due to visual fatigue of workers and subjective judgment errors. With the development of machine vision technology, the prior art provides a method for detecting the defects of an oil-way copper sleeve of an automobile engine based on machine vision, and the method adopts an edge detection and threshold segmentation method to detect the defects, so that the defect detection efficiency is improved.
Disclosure of Invention
In order to solve the problem that the accuracy of the detection result of the defect of the oil-way copper sleeve of the automobile engine is poor, the invention aims to provide a computer vision-based method for detecting the defect of the oil-way copper sleeve of the automobile engine.
The invention provides a computer vision-based method for detecting defects of a copper bush of an oil way of an automobile engine, which comprises the following steps of:
acquiring a surface image of an oil way copper sleeve of an automobile engine to be detected, and preprocessing the surface image to obtain a preprocessed surface image;
determining a relevant area of each pixel point in the preprocessed surface image according to the preprocessed surface image, and determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant area of each pixel point;
acquiring the gray gradient amplitude of each pixel point in the preprocessed surface image, and determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude of each pixel point and the neighborhood pixel points in the preprocessed surface image;
determining each defect edge pixel point in the preprocessed surface image according to the probability that each pixel point is a defect edge pixel point;
determining each defect edge connected domain in the preprocessed surface image according to each defect edge pixel point in the preprocessed surface image and the probability that the defect edge pixel point is the defect edge pixel point, and further determining each defect area in the preprocessed surface image;
and determining the defect degree evaluation value of the oil way copper sleeve of the automobile engine to be detected according to the area and the number corresponding to each defect region in the preprocessed surface image of the oil way copper sleeve of the automobile engine to be detected.
Further, a formula for calculating the probability that each pixel is a defect edge pixel is as follows:
Figure 343422DEST_PATH_IMAGE002
wherein,
Figure 819402DEST_PATH_IMAGE003
for the probability that each pixel is a defect edge pixel,
Figure 640728DEST_PATH_IMAGE004
for the index value of the degree of abnormality of each pixel point,
Figure 678216DEST_PATH_IMAGE005
for the gray scale gradient magnitude of each pixel point,
Figure 584992DEST_PATH_IMAGE006
the abnormal degree index value of the k-th neighborhood pixel point of each pixel point,
Figure 333505DEST_PATH_IMAGE007
for the k-th neighborhood image of each pixel pointThe gray scale gradient magnitude of the pixel point,
Figure 274917DEST_PATH_IMAGE008
in order to be a hyper-parameter,
Figure 981841DEST_PATH_IMAGE010
as a hyperbolic tangent function.
Further, a calculation formula of the abnormal degree index value of each pixel point is as follows:
Figure 172651DEST_PATH_IMAGE012
wherein,
Figure 865801DEST_PATH_IMAGE004
for the index value of the degree of abnormality of each pixel point,
Figure 520773DEST_PATH_IMAGE013
for the first in the relevant area of each pixeljThe gray value of each pixel point is calculated,
Figure 273965DEST_PATH_IMAGE015
for the mean value of the gray levels of the individual pixels in the relevant area of each pixel,
Figure 781432DEST_PATH_IMAGE016
the number of pixel points in the relevant area for each pixel point.
Further, the step of determining each defect edge connected domain in the preprocessed surface image includes a step of determining and traversing a plurality of defect edge connected domains in sequence, and each step of determining and traversing a defect edge connected domain includes:
judging whether a defect edge pixel point of a defect edge connected domain which is not determined exists in the current surface image;
if the defect edge pixel points of the undetermined defect edge connected domain exist, determining the positions of the growing seed points in the current surface image according to the probability that each defect edge pixel point in the undetermined defect edge connected domain corresponds to the defect edge pixel point;
judging whether defect edge pixel points exist in a preset neighborhood corresponding to the growth seed point, if so, merging the growth seed point and the defect edge pixel points in the preset neighborhood into a defect edge communication domain, further judging whether defect edge pixel points exist in the preset neighborhood corresponding to each defect edge pixel point in the defect edge communication domain, and continuously repeating the steps until no defect edge pixel points exist in the preset neighborhood corresponding to the defect edge pixel points.
Further, a calculation formula of the evaluation value of the defect degree of the copper sleeve of the oil way of the automobile engine to be detected is as follows:
Figure 278273DEST_PATH_IMAGE018
wherein,
Figure 53331DEST_PATH_IMAGE019
the defect degree evaluation value of the copper sleeve of the oil way of the automobile engine to be detected,
Figure 446266DEST_PATH_IMAGE020
for the second in the surface image of the pretreated automobile engine oil way copper sleeve to be detectedxThe area of each defect area, n is the number of the defect areas in the surface image of the oil way copper sleeve of the automobile engine to be detected after pretreatment,
Figure 939564DEST_PATH_IMAGE021
the total area of the surface image of the pre-processed automobile engine oil way copper sleeve to be detected is obtained.
Further, the step of determining each defect edge pixel point in the preprocessed surface image includes:
if the probability that a certain pixel point in the preprocessed surface image is a defect edge pixel point is not less than the preset defect probability value, the pixel point is a defect edge pixel point, otherwise, the pixel point is not a defect edge pixel point.
Further, the step of determining the relevant region of each pixel point in the preprocessed surface image includes:
constructing a sliding window according to the preprocessed surface image, and enabling the sliding window to slide on the preprocessed surface image, so as to obtain a sliding window area of each pixel point in the preprocessed surface image;
and determining the relevant area of each pixel point according to the sliding window area of each pixel point in the preprocessed surface image.
Further, the relevant region of each pixel point refers to a sliding window region that does not contain each pixel point.
Further, the step of determining each defect region in the preprocessed surface image comprises:
and clustering the defect edge connected domains according to the defect edge connected domains in the preprocessed surface image, and taking the minimum external matrix of the defect edge connected domains of the same type as the defect region in the preprocessed surface image.
The invention has the following beneficial effects:
according to the method, the relevant area of each pixel point is determined by acquiring the surface image of the preprocessed automobile engine oil way copper sleeve to be detected. Determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant region of each pixel point, then determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude value of each pixel point and the adjacent pixel points, and further determining each defect edge pixel point in the preprocessed surface image, thereby determining each defect region in the preprocessed surface image. And finally, the defect degree evaluation value of the oil way copper sleeve of the automobile engine to be detected is determined according to the area and the number corresponding to each defect area.
According to the method, the probability that each pixel point in the surface image of the to-be-detected automobile engine oil way copper sleeve is a defect edge pixel point is determined, the defect edge pixel points in the surface image are determined, pixel points with abnormal pixel gray levels caused by illumination influence in the surface image of the to-be-detected automobile engine oil way copper sleeve are eliminated, the accuracy of the area and the number corresponding to each defect area in the pre-processed surface image is ensured, the defect degree evaluation value of the to-be-detected automobile engine oil way copper sleeve is enabled to be more standard, and the accuracy of oil way copper sleeve defect detection is effectively improved. In addition, the invention can enable the automobile engine oil way copper sleeve to be detected to be more suitable for complex illumination environment, enhances the robustness of defect detection and enables the defect detection result to be more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method for detecting defects of an oil way copper bush of an automobile engine based on computer vision.
Detailed Description
To further explain the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the embodiments, structures, features and effects of the technical solutions according to the present invention will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
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 provides a computer vision-based method for detecting defects of an oil way copper bush of an automobile engine, which has the application scenes that: in the production process of the automobile engine oil way copper sleeve, the defect of the automobile engine oil way copper sleeve caused by abnormal process control or transport error needs to be detected, as shown in figure 1, the method comprises the following steps:
(1) the method comprises the steps of obtaining a surface image of an oil way copper sleeve of the automobile engine to be detected, and preprocessing the surface image to obtain a preprocessed surface image.
In this embodiment, the industrial camera is used for collecting the surface image of the copper sleeve of the oil passage of the automobile engine to be detected, and in order to reduce the subsequent calculation amount, the surface image is preprocessed in the implementation, and the preprocessing step includes: inputting the surface image of the oil-way copper sleeve of the automobile engine to be detected into a constructed and trained oil-way copper sleeve recognition network to obtain a binary image of the surface image of the oil-way copper sleeve of the automobile engine to be detected, then processing the binary image of the surface image of the oil-way copper sleeve of the automobile engine to be detected by adopting Gaussian filtering to eliminate the influence of Gaussian noise on the binary image of the surface image of the oil-way copper sleeve of the automobile engine to be detected, carrying out gray processing on the binary image, and finally obtaining the surface image of the oil-way copper sleeve of the automobile engine to be detected after preprocessing. The process of gaussian filtering and denoising is prior art and is not within the scope of the present invention, and will not be elaborated herein.
The process for acquiring the surface image of the oil way copper sleeve of the automobile engine to be detected comprises the following steps: firstly, placing an automobile engine oil way copper sleeve to be detected on a rotatable workbench, then arranging a camera light source, wherein the camera light source adopts an OPT machine vision light source to realize light source compensation on the surface of the automobile engine oil way copper sleeve to be detected, the camera light source is positioned obliquely above the automobile engine oil way copper sleeve to be detected, and finally, acquiring a surface image of the automobile engine oil way copper sleeve to be detected by utilizing an industrial camera through the rotatable workbench, wherein the industrial camera is positioned right above the automobile engine oil way copper sleeve to be detected.
It should be noted that, when the surface image to be detected is preprocessed, a pre-constructed and trained oil circuit copper bush identification network is used, and training the oil circuit copper bush identification network requires a large number of training data sets, the training data sets are surface images of a large number of automobile engine oil circuit copper bushes with various styles, and the process of acquiring the training data sets of the oil circuit copper bush identification network is consistent with the process of acquiring the surface images of the automobile engine oil circuit copper bushes to be detected, so the process of acquiring the surface images of the automobile engine oil circuit copper bushes to be detected can be referred to by the training data sets of the oil circuit copper bush identification network. When the oil way copper sleeve identification network is trained, the label corresponding to the data set is a single-channel semantic label, the background pixel point in the surface image is marked as 0, the pixel point of the automobile engine oil way copper sleeve in the surface image is marked as 1, and the loss function used in the training process is a cross entropy loss function. The process of constructing and training the oil circuit copper bush recognition network is the prior art and is not within the protection scope of the invention, and the detailed description is not provided herein.
(2) And determining a relevant area of each pixel point in the preprocessed surface image according to the preprocessed surface image, and determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant area of each pixel point.
Firstly, it should be noted that, in the production process of the oil-way copper sleeve of the automobile engine, the casting blank is subjected to various stresses, and the stresses cause the casting blank to generate thermal strain, tensile strain, phase change strain and the like. When the casting blank can not bear stress strain, a crack is generated, after the crack is contacted with air, oxidation reaction is generated and cuprous oxide is generated, the cuprous oxide on the surface of the copper sleeve of the oil way of the automobile engine and the copper inside the copper sleeve have color difference, at the moment, various pixel gray level differences can be presented in the collected surface image of the copper sleeve of the oil way of the automobile engine, the gray level differences are caused by cracks or scratches of products in the production process, and the gray level changes of the pixel gray level of a crack area or a scratch area in the surface image of the copper sleeve of the oil way of the automobile engine and the pixel gray level of a normal area are cliff type.
In addition, because the automobile engine oil way copper sleeve in the embodiment is of a tubular smooth metal structure, the automobile engine oil way copper sleeve is easy to reflect light under the influence of illumination, so that a local highlight phenomenon exists in the automobile engine oil way copper sleeve, and the closer the automobile engine oil way copper sleeve is to the industrial camera, the larger the gray value of a partial area in a surface image of the automobile engine oil way copper sleeve is. Although the highlight area in the surface image of the copper sleeve of the oil way of the automobile engine has larger gray scale difference with other areas in the surface image, the gray scale change in the surface image of the copper sleeve of the oil way of the automobile engine caused by illumination is a gradual change process.
In order to determine whether the abnormal change of the pixel gray scale in the surface image of the oil copper sleeve of the automobile engine to be detected after preprocessing is a cliff type or a gradual change type, that is, in order to distinguish a defect caused by a crack in the surface image of the oil copper sleeve of the automobile engine and a pseudo defect caused by illumination, the embodiment needs to calculate the abnormal degree index value of each pixel point in the surface image, and the steps include:
(2-1) determining a relevant area of each pixel point in the preprocessed surface image according to the preprocessed surface image, wherein the method comprises the following steps:
(2-1-1) constructing a sliding window according to the preprocessed surface image, and enabling the sliding window to slide on the preprocessed surface image, so that a sliding window area of each pixel point in the preprocessed surface image is obtained.
In the embodiment, a sliding window is constructed according to the preprocessed surface image of the oil way copper sleeve of the automobile engine to be detected, and the size of the sliding window is n
Figure 974516DEST_PATH_IMAGE022
n, sliding the sliding window on the preprocessed surface image to obtain each corresponding sliding area when the sliding window slides, and taking each pixel point as a central pixelAnd taking the sliding area of the point as the sliding window area of each pixel point in the preprocessed surface image.
(2-1-2) determining a relevant area of each pixel point according to the sliding window area of each pixel point in the preprocessed surface image.
In this embodiment, according to the sliding window region of each pixel point in the preprocessed surface image, the sliding window region that does not include each pixel point itself is used as the relevant region of each pixel point, that is, the sliding window region that does not include the center pixel point is used as the relevant region of the center pixel point.
It should be noted that, in the present embodiment, the central pixel point is not considered to reduce interference caused by calculation of the relevant area when the central pixel point is a noise point, which effectively improves accuracy of subsequently determined abnormal degree index values of each pixel point.
(2-2) determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant area of each pixel point, wherein the calculation formula is as follows:
Figure 869660DEST_PATH_IMAGE012
wherein,
Figure 699076DEST_PATH_IMAGE004
the index value of the abnormal degree of each pixel point,
Figure 181135DEST_PATH_IMAGE013
for the first in the relevant area of each pixeljThe gray value of each pixel point is calculated,
Figure 19778DEST_PATH_IMAGE015
for the mean value of the gray levels of the individual pixels in the relevant area of each pixel,
Figure 503849DEST_PATH_IMAGE016
the number of pixel points in the relevant area for each pixel point.
It should be noted that, if the grayscale fluctuation of each pixel point in the relevant region of a certain pixel point is larger, that is, the grayscale variance of each pixel point in the relevant region of a certain pixel point is larger, the abnormal degree index value of the pixel point is larger, and then the pixel point is more likely to be the pixel point in the defect region caused by the crack.
(3) And obtaining the gray gradient amplitude of each pixel point in the preprocessed surface image, and determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude of each pixel point and the adjacent pixel points in the preprocessed surface image.
Firstly, it should be noted that the distinguishing features of the defect region caused by the crack and the pseudo-defect region caused by the illumination further include the gray gradient change of the edge pixel points, in order to amplify the difference between the defect caused by the crack and the pseudo-defect caused by the illumination, the embodiment further analyzes the relationship between the gray gradient of each pixel point in the surface image of the oil path copper sleeve of the automobile engine and the gray gradient of the pixel points in the neighborhood thereof, thereby determining the probability that each pixel point is the defect edge pixel point, and the steps include:
and (3-1) obtaining the gray gradient amplitude of each pixel point in the surface image of the oil way copper sleeve of the preprocessed automobile engine.
In the embodiment, the sobel operator is used for calculating each pixel point in the surface image of the preprocessed copper sleeve of the oil way of the automobile engine
Figure 769745DEST_PATH_IMAGE023
Direction and
Figure 972056DEST_PATH_IMAGE024
a gradient of gray scale in the direction, i.e.
Figure 411128DEST_PATH_IMAGE025
And
Figure 890651DEST_PATH_IMAGE026
then the gray scale gradient amplitude of each pixel point is
Figure 452082DEST_PATH_IMAGE027
And finally, obtaining the gray gradient amplitude corresponding to the gray gradient of each pixel point in the surface image of the pretreated automobile engine oil way copper sleeve. The sobel operator is prior art and is not within the scope of the present invention, and will not be described in detail herein.
And (3-2) determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude of each pixel point and the neighborhood pixel points in the preprocessed surface image.
In this embodiment, the probability that each pixel point is a defect edge pixel point is determined by combining the abnormal degree index value and the gray gradient amplitude value of each pixel point and the neighborhood pixel points in the surface image of the pretreated automobile engine oil path copper bush determined in the step (2-2) and the step (3-1), and the calculation formula is as follows:
Figure 751477DEST_PATH_IMAGE002
wherein,
Figure 558021DEST_PATH_IMAGE003
for the probability that each pixel is a defect edge pixel,
Figure 892050DEST_PATH_IMAGE004
for the index value of the degree of abnormality of each pixel point,
Figure 624383DEST_PATH_IMAGE005
for the gray scale gradient magnitude of each pixel point,
Figure 676652DEST_PATH_IMAGE006
the abnormal degree index value of the k-th neighborhood pixel point of each pixel point,
Figure 191947DEST_PATH_IMAGE007
for the gray scale gradient amplitude of the k-th neighborhood pixel of each pixel,
Figure 770696DEST_PATH_IMAGE008
in order to be a super-parameter,
Figure 877193DEST_PATH_IMAGE028
Figure 213496DEST_PATH_IMAGE029
is a hyperbolic tangent function.
It should be noted that, for a certain pixel point in the preprocessed surface image of the oil-way copper sleeve of the automobile engine to be detected, if the gray gradient amplitude of the pixel point is larger, the abnormal degree is higher, and the difference between the pixel point and the pixel point in the neighborhood is more obvious, the probability that the pixel point is a defect edge pixel point is higher.
(4) And determining each defect edge pixel point in the preprocessed surface image according to the probability that each pixel point is a defect edge pixel point.
In this embodiment, according to the probability that each pixel in step (3) is a defect edge pixel, each pixel in the surface image of the to-be-detected automobile engine oil way copper sleeve after the pretreatment is screened, and each pixel after the screening is labeled, and the pixel after the labeling is used as a defect edge pixel, the screening step includes:
if the probability P that a certain pixel point in the preprocessed surface image of the automobile engine oil way copper sleeve to be detected is a defect edge pixel point is not smaller than the preset defect probability value, the pixel point is the defect edge pixel point, the preset defect probability value is set to be 0.7 in the embodiment, and if the probability P that a certain pixel point in the preprocessed surface image of the automobile engine oil way copper sleeve to be detected is the defect edge pixel point is smaller than the preset defect probability value, the pixel point is not the defect edge pixel point.
It should be noted that if the probability that a certain pixel point in the preprocessed surface image of the oil-way copper sleeve of the automobile engine to be detected is a defect edge pixel point is higher, the more likely the pixel point is the defect edge pixel point.
(5) And determining each defect edge connected domain in the preprocessed surface image according to each defect edge pixel point in the preprocessed surface image and the probability that the defect edge pixel point is the defect edge pixel point, and further determining each defect area in the preprocessed surface image.
(5-1) determining each defect edge connected domain in the preprocessed surface image according to each defect edge pixel point in the preprocessed surface image and the probability that the defect edge pixel point is the defect edge pixel point, wherein the method comprises the following steps:
and judging whether the current surface image has defect edge pixel points of the undetermined defect edge connected domain, if so, determining the positions of the growing seed points in the current surface image according to the probability that each defect edge pixel point in the undetermined defect edge connected domain corresponds to the defect edge pixel point. Judging whether defect edge pixel points exist in a preset neighborhood corresponding to the growth seed point, if so, merging the growth seed point and the defect edge pixel points in the preset neighborhood into a defect edge communication domain, further judging whether defect edge pixel points exist in the preset neighborhood corresponding to each defect edge pixel point in the defect edge communication domain, and continuously repeating the steps until no defect edge pixel points exist in the preset neighborhood corresponding to the defect edge pixel points.
In this embodiment, the step of determining each defect edge connected domain in the surface image of the oil-way copper sleeve of the pre-processed automobile engine to be detected comprises:
(5-1-1) firstly, judging whether defect edge pixel points of a defect edge communicating region which is not determined exist in a surface image of an oil way copper sleeve of an automobile engine to be detected after current pretreatment, if the defect edge pixel points of the defect edge communicating region which is not determined exist in the current surface image, selecting the defect edge pixel point with the maximum P as a growth seed point, and when a plurality of defect edge pixel points with the maximum P exist in the surface image, randomly selecting any one of the defect edge pixel points as the growth seed point, wherein P is the probability that each pixel point is a defect edge pixel point.
(5-1-2) then, searching in the preset neighborhood range of the growing seed point, setting the preset neighborhood range of the implementation as eight neighborhoods, detecting whether defect edge pixel points exist in the eight neighborhoods of the growing seed point, if so, reserving the defect edge pixel points in the eight neighborhoods of the growing seed point, combining the reserved defect edge pixel points and the growing seed point into a defect edge communication domain, taking each defect edge pixel point in the defect edge communication domain as a new growing seed point, searching again in the eight neighborhoods of each new growing seed point, detecting whether defect edge pixel points exist in the eight neighborhoods of each new growing seed point, if so, reserving the defect edge pixel points in the eight neighborhoods of each new growing seed point, and combining the reserved defect edge pixel points and each new growing seed point into a defect edge pixel point And (4) continuously repeating the steps until defect edge pixel points do not exist in the eight neighborhoods of the growing seed points, and obtaining one defect edge connected domain of the current surface image at the moment.
(5-1-3) after obtaining one of the defect edge connected domains of the current surface image, judging whether defect edge pixels of the undetermined defect edge connected domain exist in the surface image of the to-be-detected automobile engine oil way copper sleeve after current pretreatment, if defect edge pixels of the undetermined defect edge connected domain still exist in the current surface image, repeating the steps (5-1-1) to (5-1-3), and continuously iterating the steps until defect edge pixel points of the undetermined defect edge connected domain do not exist in the surface image of the to-be-detected automobile engine oil way copper sleeve after current pretreatment.
Therefore, the defect edge communication domain in the surface image of the oil way copper sleeve of the automobile engine to be detected after pretreatment is obtained.
And (5-2) determining each defect area in the preprocessed surface image according to each defect edge connected domain in the preprocessed surface image.
Firstly, it should be noted that, since each defect edge connected domain in the step (5-1) may not be a complete defect region, each defect edge connected domain needs to be clustered to obtain each defect region, so that the accuracy of the subsequently determined evaluation value of the defect degree of the oil-way copper sleeve of the automobile engine to be detected is improved, and the accuracy of the defect detection result of the oil-way copper sleeve of the automobile engine is enhanced.
In this embodiment, according to each defect edge connected domain in the preprocessed surface image of the oil copper sleeve of the automobile engine to be detected, and based on the euclidean distance between each defect edge connected domain, each defect edge connected domain is clustered by using a K-M clustering algorithm, and the minimum external matrix of each defect edge connected domain of the same type is used as a defect region in the preprocessed surface image, that is, each defect region includes a plurality of defect edge connected domains of the same type. The K-M clustering algorithm is prior art and is not within the scope of the present invention, and will not be described in detail herein.
(6) Determining the defect degree evaluation value of the automobile engine oil way copper sleeve to be detected according to the area and the number corresponding to each defect region in the preprocessed surface image of the automobile engine oil way copper sleeve to be detected, wherein the calculation formula is as follows:
Figure 735744DEST_PATH_IMAGE030
wherein,
Figure 404885DEST_PATH_IMAGE019
the defect degree evaluation value of the copper sleeve of the oil way of the automobile engine to be detected,
Figure 354387DEST_PATH_IMAGE020
for the second in the surface image of the pretreated automobile engine oil way copper sleeve to be detectedxThe area of each defect area, n is the number of the defect areas in the surface image of the oil way copper sleeve of the automobile engine to be detected after pretreatment,
Figure 912407DEST_PATH_IMAGE021
the total area of the surface image of the pre-processed automobile engine oil way copper sleeve to be detected is obtained.
It should be noted that the larger the area of each defect region in the surface image of the to-be-detected automobile engine oil way copper bush is, the larger the number of each defect region is, the larger the defect degree evaluation value of the to-be-detected automobile engine oil way copper bush is, that is, the worse the quality of the to-be-detected automobile engine oil way copper bush is.
The implementer can carry out quality classification according to the actual detection condition of the automobile engine oil circuit copper bush to be detected, for example:
if the defect degree evaluation value H of the automobile engine oil way copper sleeve to be detected is smaller than or equal to the first defect degree evaluation threshold, the quality of the automobile engine oil way copper sleeve to be detected is good, if the defect degree evaluation value H of the automobile engine oil way copper sleeve to be detected is larger than the first defect degree evaluation threshold and smaller than the second defect degree evaluation threshold, the quality of the automobile engine oil way copper sleeve to be detected is general, and if the defect degree evaluation value H of the automobile engine oil way copper sleeve to be detected is larger than the second defect degree evaluation threshold, the quality of the automobile engine oil way copper sleeve to be detected is poor.
The invention mainly aims to reduce the influence of false defects caused by illumination on the defect detection of the oil-way copper sleeve of the automobile engine to be detected and eliminate interference factors in the defect detection process of the oil-way copper sleeve of the automobile engine as much as possible, thereby effectively improving the accuracy and the detection efficiency of the defect detection of the oil-way copper sleeve of the automobile engine.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A computer vision-based method for detecting defects of a copper bush of an oil way of an automobile engine is characterized by comprising the following steps:
acquiring a surface image of an oil way copper sleeve of an automobile engine to be detected, and preprocessing the surface image to obtain a preprocessed surface image;
determining a relevant area of each pixel point in the preprocessed surface image according to the preprocessed surface image, and determining an abnormal degree index value of each pixel point according to the gray value of each pixel point in the relevant area of each pixel point;
acquiring the gray gradient amplitude of each pixel point in the preprocessed surface image, and determining the probability that each pixel point is a defect edge pixel point according to the abnormal degree index value and the gray gradient amplitude of each pixel point and the neighborhood pixel points in the preprocessed surface image;
determining each defect edge pixel point in the preprocessed surface image according to the probability that each pixel point is a defect edge pixel point;
determining each defect edge connected domain in the preprocessed surface image according to each defect edge pixel point in the preprocessed surface image and the probability that each defect edge pixel point is the defect edge pixel point, and further determining each defect area in the preprocessed surface image;
determining the defect degree evaluation value of the oil way copper sleeve of the automobile engine to be detected according to the area and the number corresponding to each defect region in the preprocessed surface image of the oil way copper sleeve of the automobile engine to be detected; the probability of each pixel point being a defect edge pixel point is calculated by the following formula:
Figure DEST_PATH_IMAGE002
wherein,
Figure DEST_PATH_IMAGE003
for the probability that each pixel is a defect edge pixel,
Figure DEST_PATH_IMAGE004
for the index value of the degree of abnormality of each pixel point,
Figure DEST_PATH_IMAGE005
for the gray scale gradient magnitude of each pixel point,
Figure DEST_PATH_IMAGE006
the abnormal degree index value of the k-th neighborhood pixel point of each pixel point,
Figure DEST_PATH_IMAGE007
for the gray scale gradient amplitude of the k-th neighborhood pixel of each pixel,
Figure DEST_PATH_IMAGE008
in order to be a hyper-parameter,
Figure DEST_PATH_IMAGE010
as a hyperbolic tangent function.
2. The method for detecting the defects of the copper bush of the oil circuit of the automobile engine based on the computer vision of claim 1, wherein the calculation formula of the abnormal degree index value of each pixel point is as follows:
Figure DEST_PATH_IMAGE012
wherein,
Figure 274526DEST_PATH_IMAGE004
the index value of the abnormal degree of each pixel point,
Figure DEST_PATH_IMAGE013
for the first in the relevant area of each pixeljThe gray value of each pixel point is calculated,
Figure DEST_PATH_IMAGE015
for the mean value of the gray levels of the individual pixels in the relevant area of each pixel,
Figure DEST_PATH_IMAGE016
the number of pixel points in the relevant area for each pixel point.
3. The method for detecting the defects of the copper bush of the oil circuit of the automobile engine based on the computer vision as claimed in claim 1, wherein the step of determining each defect edge connected domain in the preprocessed surface image comprises a plurality of defect edge connected domain determination traversal steps which are sequentially performed, and each defect edge connected domain determination traversal step comprises:
judging whether a defect edge pixel point of a defect edge connected domain which is not determined exists in the current surface image;
if the defect edge pixel points of the undetermined defect edge connected domain exist, determining the positions of the growing seed points in the current surface image according to the probability that each defect edge pixel point in the undetermined defect edge connected domain corresponds to the defect edge pixel point;
judging whether defect edge pixel points exist in a preset neighborhood corresponding to the growth seed point, if so, merging the growth seed point and the defect edge pixel points in the preset neighborhood into a defect edge communication domain, further judging whether defect edge pixel points exist in the preset neighborhood corresponding to each defect edge pixel point in the defect edge communication domain, and continuously repeating the steps until no defect edge pixel points exist in the preset neighborhood corresponding to the defect edge pixel points.
4. The method for detecting the defects of the copper bush of the oil way of the automobile engine based on the computer vision as claimed in claim 1, wherein a calculation formula of the evaluation value of the defect degree of the copper bush of the oil way of the automobile engine to be detected is as follows:
Figure DEST_PATH_IMAGE018
wherein,
Figure DEST_PATH_IMAGE019
the defect degree evaluation value of the copper sleeve of the oil way of the automobile engine to be detected,
Figure DEST_PATH_IMAGE020
for the second in the surface image of the pretreated automobile engine oil way copper sleeve to be detectedxThe area of each defect area, n is the number of the defect areas in the surface image of the oil way copper sleeve of the pre-processed automobile engine to be detected,
Figure DEST_PATH_IMAGE021
for pretreated oil circuit of automobile engine to be detectedTotal area of surface image of copper sleeve.
5. The method for detecting the defects of the copper bush of the oil way of the automobile engine based on the computer vision as claimed in claim 1, wherein the step of determining each defect edge pixel point in the preprocessed surface image comprises the following steps:
if the probability that a certain pixel point in the preprocessed surface image is a defect edge pixel point is not less than the preset defect probability value, the pixel point is a defect edge pixel point, otherwise, the pixel point is not a defect edge pixel point.
6. The method for detecting the defects of the copper bush of the oil circuit of the automobile engine based on the computer vision as claimed in claim 1, wherein the step of determining the relevant area of each pixel point in the preprocessed surface image comprises the following steps:
constructing a sliding window according to the preprocessed surface image, and enabling the sliding window to slide on the preprocessed surface image, so as to obtain a sliding window area of each pixel point in the preprocessed surface image;
and determining the relevant area of each pixel point according to the sliding window area of each pixel point in the preprocessed surface image.
7. The method for detecting the defects of the copper bush of the oil circuit of the automobile engine based on the computer vision as claimed in claim 6, wherein the relevant area of each pixel point is a sliding window area which does not contain each pixel point.
8. The computer vision-based automobile engine oil way copper bush defect detection method according to claim 1, wherein the step of determining each defect area in the preprocessed surface image comprises the following steps:
and clustering the defect edge connected domains according to the defect edge connected domains in the preprocessed surface image, and taking the minimum external matrix of the defect edge connected domains of the same type as the defect region in the preprocessed surface image.
CN202210221735.1A 2022-03-09 2022-03-09 Computer vision-based automobile engine oil way copper sleeve defect detection method Active CN114359270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210221735.1A CN114359270B (en) 2022-03-09 2022-03-09 Computer vision-based automobile engine oil way copper sleeve defect detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210221735.1A CN114359270B (en) 2022-03-09 2022-03-09 Computer vision-based automobile engine oil way copper sleeve defect detection method

Publications (2)

Publication Number Publication Date
CN114359270A CN114359270A (en) 2022-04-15
CN114359270B true CN114359270B (en) 2022-06-07

Family

ID=81094412

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210221735.1A Active CN114359270B (en) 2022-03-09 2022-03-09 Computer vision-based automobile engine oil way copper sleeve defect detection method

Country Status (1)

Country Link
CN (1) CN114359270B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114841938A (en) * 2022-04-22 2022-08-02 南通海恒纺织设备有限公司 Fabric snagging defect detection method
CN114937004B (en) * 2022-04-28 2024-01-02 烟台大视工业智能科技有限公司 Method for detecting surface air hole defects of mechanical part based on computer vision
CN114998226A (en) * 2022-05-20 2022-09-02 南通辑兴紧固件科技有限公司 Defect evaluation method for metal fastener pitting area
CN115170476B (en) * 2022-06-08 2023-06-16 重庆宇隆光电科技股份有限公司 Printed circuit board defect detection method based on image processing
CN114820626B (en) * 2022-06-30 2022-09-02 南通浩盛汽车科技有限公司 Intelligent detection method for automobile front face part configuration
CN115082429B (en) * 2022-07-20 2022-11-04 山东马勒铝业科技有限公司 Aluminum bar defect detection method based on image processing
CN114937041B (en) * 2022-07-25 2022-10-25 聊城市博源节能科技有限公司 Method and system for detecting defects of copper bush of oil way of automobile engine
CN114972894A (en) * 2022-07-26 2022-08-30 南通三信塑胶装备科技股份有限公司 CPP film defect classification method based on computer vision
CN115063407B (en) * 2022-07-28 2023-05-09 海门市亚泰精密铜材有限公司 Scratch and crack identification method for annular copper gasket
CN115240193B (en) * 2022-07-29 2023-12-22 山东品正金属制品有限公司 Surface treatment method and system for electric automobile motor spindle
CN114972357B (en) * 2022-08-03 2022-10-21 南通恒立机械设备有限公司 Roller surface defect detection method and system based on image processing
CN115082482B (en) * 2022-08-23 2022-11-22 山东优奭趸泵业科技有限公司 Metal surface defect detection method
CN115861291B (en) * 2023-01-06 2023-05-09 曲阜天博汽车电器有限公司 Chip circuit board production defect detection method based on machine vision
CN117523211A (en) * 2023-10-31 2024-02-06 中国人民解放军火箭军工程大学 Gray image processing method for butanediol propellant
CN117237355B (en) * 2023-11-15 2024-02-02 宁波快马加鞭科技有限公司 Thermos cup surface defect detection method based on image characteristics
CN117689662B (en) * 2024-02-04 2024-04-26 张家港长寿工业设备制造有限公司 Visual detection method and system for welding quality of heat exchanger tube head

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127779A (en) * 2016-06-29 2016-11-16 上海晨兴希姆通电子科技有限公司 The defect inspection method of view-based access control model identification and system
CN113934190A (en) * 2021-12-17 2022-01-14 武汉春田纸品包装有限公司 Corrugated board production quality regulation and control method based on machine vision

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080008375A1 (en) * 2006-07-06 2008-01-10 Petersen Russell H Method for inspecting surface texture direction of workpieces
CN101261234B (en) * 2008-03-26 2010-06-09 广州中国科学院工业技术研究院 Surface flaw detection device
CN107345916B (en) * 2017-07-25 2020-01-10 深圳市杰恩世智能科技有限公司 Plane appearance detection method based on fixed contour
CN108230321A (en) * 2018-01-19 2018-06-29 深圳市亿图视觉自动化技术有限公司 Defect inspection method and device
CN109242852A (en) * 2018-10-30 2019-01-18 长春光华学院 A kind of automobile engine oil circuit copper sheathing defective vision detection method
CN110189290A (en) * 2019-04-08 2019-08-30 广东工业大学 Metal surface fine defects detection method and device based on deep learning
CN114078108B (en) * 2020-08-11 2023-12-22 北京阅影科技有限公司 Method and device for processing abnormal region in image, and method and device for dividing image
CN113793337B (en) * 2021-11-18 2022-02-08 汶上海纬机车配件有限公司 Locomotive accessory surface abnormal degree evaluation method based on artificial intelligence

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127779A (en) * 2016-06-29 2016-11-16 上海晨兴希姆通电子科技有限公司 The defect inspection method of view-based access control model identification and system
CN113934190A (en) * 2021-12-17 2022-01-14 武汉春田纸品包装有限公司 Corrugated board production quality regulation and control method based on machine vision

Also Published As

Publication number Publication date
CN114359270A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN114359270B (en) Computer vision-based automobile engine oil way copper sleeve defect detection method
CN116721106B (en) Profile flaw visual detection method based on image processing
CN109490316B (en) Surface defect detection algorithm based on machine vision
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
CN109377485B (en) Machine vision detection method for instant noodle packaging defects
CN115082419B (en) Blow-molded luggage production defect detection method
CN101996405B (en) Method and device for rapidly detecting and classifying defects of glass image
CN108765402B (en) Non-woven fabric defect detection and classification method
CN109685760B (en) MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method
CN109682839B (en) Online detection method for surface defects of metal arc-shaped workpiece
CN114219805B (en) Intelligent detection method for glass defects
CN115330767A (en) Method for identifying production abnormity of corrosion foil
CN116385450B (en) PS sheet wear resistance detection method based on image processing
CN114742788A (en) Copper bar defect detection method and system based on machine vision
CN110060239B (en) Defect detection method for bottle opening of bottle
CN113177924A (en) Industrial production line product flaw detection method
CN116012291A (en) Industrial part image defect detection method and system, electronic equipment and storage medium
CN114841938A (en) Fabric snagging defect detection method
CN114119603A (en) Image processing-based snack box short shot defect detection method
CN115719332A (en) Welding quality detection method
CN115311289A (en) Method for detecting oil stain defects of plain-color cloth
CN116523922B (en) Bearing surface defect identification method
CN114926441A (en) Defect detection method and system for machining and molding injection molding part
CN110866915A (en) Circular inkstone quality detection method based on metric learning
CN111738931B (en) Shadow removal algorithm for aerial image of photovoltaic array unmanned aerial vehicle

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230407

Address after: 272600 west side of Jiliang highway, quanpu Town, Liangshan County, Jining City, Shandong Province (Geng rural North)

Patentee after: Shandong Huarentong Automobile Service Co.,Ltd.

Address before: 272600 north of Geng Village, west side of Jiliang highway, quanpu Town, Liangshan County, Jining City, Shandong Province (in the courtyard of Shandong Huatong used car information technology company)

Patentee before: Shandong Huashuo Auto Parts Technology Co.,Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Computer vision based defect detection method for automotive engine oil circuit copper sleeve

Granted publication date: 20220607

Pledgee: Shandong Liangshan Rural Commercial Bank Co.,Ltd.

Pledgor: Shandong Huarentong Automobile Service Co.,Ltd.

Registration number: Y2024980023325