CN115082418B - Precise identification method for automobile parts - Google Patents

Precise identification method for automobile parts Download PDF

Info

Publication number
CN115082418B
CN115082418B CN202210822912.1A CN202210822912A CN115082418B CN 115082418 B CN115082418 B CN 115082418B CN 202210822912 A CN202210822912 A CN 202210822912A CN 115082418 B CN115082418 B CN 115082418B
Authority
CN
China
Prior art keywords
defect
window
run
gray level
frequency
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
CN202210822912.1A
Other languages
Chinese (zh)
Other versions
CN115082418A (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 Liaocheng Fufeng Auto Parts Co ltd
Original Assignee
Shandong Liaocheng Fufeng Auto Parts 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 Liaocheng Fufeng Auto Parts Co ltd filed Critical Shandong Liaocheng Fufeng Auto Parts Co ltd
Priority to CN202210822912.1A priority Critical patent/CN115082418B/en
Publication of CN115082418A publication Critical patent/CN115082418A/en
Application granted granted Critical
Publication of CN115082418B publication Critical patent/CN115082418B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20076Probabilistic image processing
    • 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/30164Workpiece; Machine component

Abstract

The invention relates to the field of image processing, in particular to a precise identification method for automobile parts. Acquiring a gear gray level image for window segmentation; performing edge detection on each window to obtain a defect window; calculating the defect degree of edge pixel points in a defect window to obtain defect pixel points; calculating direction probability according to the number of the defective pixel points in each direction on the neighborhood by taking the defective pixel points as centers; acquiring gray level run matrix of each direction of the defect window, and acquiring final gray level run matrix of each defect window; dividing the final gray level run matrix into a long run area and a short run area; calculating the difference degree of the run frequency; dividing the final gray level run matrix into a high gray level area and a low gray level area; calculating the difference degree of the gray frequency; and calculating the confidence of each defect window to judge the defect type of the window. The method can identify the defect type more accurately by combining the gray frequency difference characteristic and the run length difference characteristic of the pixels in the matrix.

Description

Precise identification method for automobile parts
Technical Field
The invention relates to the field of image processing, in particular to a precise identification method for automobile parts.
Background
The gear is an important part forming an automobile, but production defects such as cracks or scratches on the surface of the gear are caused by forging strength, temperature and the like in the production and processing process of the gear, once the automobile adopts a cracked defective gear, the gear is possibly damaged under the conditions of heavy load and excessive stress, even the whole mechanical equipment is damaged and even scrapped, and personal safety is seriously endangered.
At present mainly detect according to the manual work to gear surface defect, artifical detection inefficiency just is difficult to accurately distinguish crackle and mar, causes easily to miss to examine and the false retrieval, and the subjectivity is too strong, and current mostly is to the degree of wear after the gear uses carries out the analysis, and is less to the surface production quality analysis of gear, and the image processing technique of conventionality simultaneously can't make accurate differentiation to the defect type of gear, exists certain error.
The invention provides a precise identification method of the surface defects of the gear, which combines the characteristics of the defect areas in the gear image to construct a run-length matrix, thereby identifying whether the gear defects are cracks or scratches according to the characteristics of pixel points in each area in the run-length matrix.
Disclosure of Invention
The invention provides a precise identification method of automobile parts, which aims to solve the existing problems and comprises the following steps: acquiring a gear gray level image for window segmentation; performing edge detection on each window to obtain a defect window; calculating the defect degree of edge pixel points in a defect window to obtain defect pixel points; calculating direction probability according to the number of the defective pixel points in each direction on the neighborhood by taking the defective pixel points as centers; obtaining gray level run matrixes of all directions of the defect windows, and obtaining a final gray level run matrix of each defect window; dividing the final gray level run matrix into a long run area and a short run area; calculating the difference degree of the frequency of the run; dividing the final gray level run matrix into a high gray level area and a low gray level area; calculating the difference degree of the gray frequency; and calculating the confidence of each defect window to judge the defect type of the window.
According to the invention, firstly, the pixels in the gear image are preliminarily judged through edge detection, so that the gray level run matrix is established for the obtained suspected defect window, the calculated amount is greatly reduced, meanwhile, when the gray level run matrix is established, the run matrix of each direction of the window is weighted through the distribution of the defect pixels in the window in each direction, the characteristics of the pixels in the defect window can be more completely represented by the obtained final gray level run matrix, and further, the gray level frequency difference characteristic and the run length difference characteristic of the pixels in the matrix are combined, and the dual characteristics are closely combined with texture information, so that the defect type can be more accurately identified.
The invention adopts the following technical scheme that the method for precisely identifying the automobile parts comprises the following steps:
and acquiring a gear gray image, and performing window segmentation on the gray image to obtain a plurality of windows.
And carrying out edge detection on each window, and taking the window with the number ratio of the edge pixel points obtained by detection larger than a threshold value as a defect window.
And calculating the defect degree of the edge pixel points in each defect window, taking the edge pixel points with the defect degrees larger than the threshold value as defect pixel points, and acquiring all the defect pixel points in each defect window.
And counting the number of the defective pixel points in each direction in the neighborhood of each defective pixel point by taking each defective pixel point as a center, and calculating the direction probability of each direction according to the number of the defective pixel points in each direction.
And obtaining the gray level run matrix of each defect window in each direction, and obtaining the final gray level run matrix of each defect window according to the gray level run matrix of each window in each direction and the direction probability of the corresponding direction.
And averagely dividing the final gray level run matrix of each defect window into a long run area and a short run area.
And calculating the frequency difference degree of the run frequency of each defect window according to the frequency of the elements in the long run area and the short run area in the final gray run matrix.
And averagely dividing the final gray level run matrix of each defect window into a high gray level area and a low gray level area.
And calculating the gray frequency difference degree of each defect window according to the frequency of the elements in the high gray level region and the low gray level region in the final gray level run matrix.
And calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, and judging the defect type of each defect window according to the confidence coefficient of each defect window.
Further, a method for precisely identifying the automobile parts comprises the following steps of:
acquiring the number of pixel points in the neighborhood of each edge pixel point, wherein the pixel points are the same as the gray value of the edge pixel point;
sequentially traversing the pixels in the neighborhood of each edge pixel, and acquiring the number of continuous pixels with the same gray value of the edge pixel as the pixel aggregation degree of each edge pixel;
and calculating the defect degree of each edge pixel according to the pixel aggregation degree of each edge pixel and the number of pixels in the neighborhood which are the same as the gray value of the edge pixel.
Further, a method for precisely identifying automobile parts, which is used for acquiring a final gray level run matrix of each defect window, comprises the following steps:
obtaining corresponding direction probability according to the number of pixel points in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees in each defect window;
and obtaining the gray level run matrix of each defect window in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees, and carrying out weighted summation according to the gray level run matrix in each direction and the direction probability of the corresponding direction to obtain the final gray level run matrix of each defect window.
Further, a method for precisely identifying automobile parts, which calculates the difference degree of the run frequency of each defect window, comprises the following steps:
averagely dividing the final gray level run matrix into a long run area and a short run area according to the run length, and respectively counting the frequency of all elements in the long run area and the short run area;
calculating the difference degree of the run frequency of each defect window according to the frequency of all elements in the long run region and the frequency of all elements in the short run region, wherein the expression is as follows:
Figure 100002_DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,
Figure 206369DEST_PATH_IMAGE002
indicating the run-rate disparity of each defective window,
Figure 581986DEST_PATH_IMAGE003
the frequency count indicating the short runs,
Figure 487756DEST_PATH_IMAGE004
indicating the frequency of long runs.
Further, a method for precisely identifying automobile parts, which calculates the difference degree of the gray frequency of each defect window, comprises the following steps:
averagely dividing the final gray level run matrix into a high gray level area and a low gray level area according to the gray level, and respectively counting the frequency of all elements in the high gray level area and the low gray level area;
calculating the difference degree of the gray frequency of each defect window according to the frequency of all elements in the high gray level area and the low gray level area, wherein the expression is as follows:
Figure 632430DEST_PATH_IMAGE005
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE006
representing the degree of difference in the gray frequency of each defect window,
Figure 401672DEST_PATH_IMAGE007
indicating the pixel frequency number of the run length j and the gray level i, m indicating the run length of the final gray run matrix,
Figure 592482DEST_PATH_IMAGE008
representing the gray scale length of the final gray scale run matrix,
Figure 20052DEST_PATH_IMAGE009
representing the first gray level of the final gray run matrix.
Furthermore, the method for precisely identifying the automobile parts comprises the following steps of:
calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, wherein the expression is as follows:
Figure 347128DEST_PATH_IMAGE010
wherein the content of the first and second substances,
Figure 834741DEST_PATH_IMAGE011
the confidence level of each of the defect windows is indicated,
Figure 512847DEST_PATH_IMAGE002
indicating the run-rate disparity of each defective window,
Figure 503630DEST_PATH_IMAGE006
representing the difference of the gray frequency of each defect window.
Further, a method for precisely identifying automobile parts comprises the following steps of:
when the confidence coefficient of the defect window is larger than a threshold value, a crack defect exists in the defect window;
when the confidence of the defect window is less than the threshold, a scratch exists in the defect window.
The invention has the beneficial effects that: according to the invention, firstly, the pixels in the gear image are preliminarily judged through edge detection, so that the gray level run matrix is established for the obtained suspected defect window, the calculated amount is greatly reduced, meanwhile, when the gray level run matrix is established, the run matrix of each direction of the window is weighted through the distribution of the defect pixels in the window in each direction, the characteristics of the pixels in the defect window can be more completely represented by the obtained final gray level run matrix, and further, the gray level frequency difference characteristic and the run length difference characteristic of the pixels in the matrix are combined, and the dual characteristics are closely combined with texture information, so that the defect type can be more accurately identified.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of 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 for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a precision identification method for automobile parts according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing that the final gray level run matrix of each defect window is divided along the vertical direction according to the embodiment of the present invention;
fig. 3 is a schematic diagram illustrating that the final gray level run matrix of each defect window is divided along the horizontal direction according to the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a schematic structural diagram of a precision identification method for automobile parts according to an embodiment of the present invention is provided, which includes:
101. and acquiring a gear gray image, and performing window segmentation on the gray image to obtain a plurality of windows.
And carrying out edge detection on each window, and taking the window with the number ratio of the edge pixel points obtained by detection larger than a threshold value as a defect window.
The specific scenes aimed by the invention are as follows: the defects of cracks or scratches generated in the production and processing process of the gear are difficult to accurately and efficiently distinguish by human eyes, so that the defect image is analyzed by using an image processing technology, and the defect type is identified by a computer.
The cross section of the gear is horizontally placed upwards, the fixed light source is arranged above the gear, an industrial professional collection camera is used in the collection process, the collection is started right above the gear, the collected image is subjected to Gaussian filtering noise reduction processing due to noise interference, the collected image is subjected to semantic segmentation to remove a background area, a gear area is reserved, and the gear area image is converted into a gray level image.
Because a plurality of defects possibly exist in the cross section of the gear, texture characteristics of the defects need to be analyzed for each defect by combining the gray run matrix of the defect, an image needs to be segmented, each defect is segmented into a window as much as possible, the windows with the defects are further screened, and the crack types of the defects are analyzed according to the difference of texture information reflected in the window gray co-occurrence matrix.
The gray scale of the normal defect-free area is uniform and abnormal, the difference exists between the pixel gray scale value of the defect area and the pixel gray scale value of the normal area, the pixel gray scale value of the crack area is lower than the pixel gray scale value of the normal area, and the pixel gray scale value of the scratch area is higher than the pixel gray scale value of the normal area, so that the gray scale co-occurrence matrix of the whole gear is not required to be obtained, and only the window area with the defect is required to be obtained.
And (4) performing edge detection on each window by using a sobel operator, and when more edges are detected in the slider, considering that the slider has a defect, otherwise, considering that the current slider has no defect.
Setting the number of pixels on the detected edge to be more than a threshold value in the total number of window pixels
Figure DEST_PATH_IMAGE012
The subsequent identification processing of the defects is considered to be required,
Figure 639207DEST_PATH_IMAGE013
>0.03, N is the number of pixels on the edge detection line, and N is the number of pixels of the window.
102. And calculating the defect degree of the edge pixel points in each defect window, and taking the edge pixel points with the confidence degrees larger than the threshold value as defect pixel points to obtain all the defect pixel points in each defect window.
Since the crack is cracked along the grain, the statistical direction when the crack gray scale run matrix is counted should be more finely divided into different weights for each direction, and the gray scale co-occurrence matrix of the scratch area does not need to be calculated and weighted and summed towards all directions. In summary, we obtain the self-adaptive gray level co-occurrence matrix statistical direction by analyzing the real-time image texture features of cracks and scratches, so that the frequency information of the subsequent gray level run-length matrix is more real.
Because the gray level quantization is based on the conventional segmentation quantization, the values of pixel points of a non-defect region and pixel points of a defect region may be merged into the same class, and the false defect points just appear in the eight neighborhoods of the defect points, so that the points with the same gray value need to be screened in the eight neighborhoods, the false defect points are isolated and scattered generally, continuous false defect points do not exist around, and one side of the general neighborhood of the real defect points or most regions of the whole neighborhood are the defect points.
Firstly, screening out points with the same gray value as the point A in the neighborhood of the current defect point A:
Figure 32143DEST_PATH_IMAGE014
where H is the pixel point correspondenceAnd (3) marking the points with different gray values in the neighborhood of the defect point A as 0 and marking the points with the same gray value as 1.
Analyzing the distribution characteristics of the pixels in the neighborhood of the point A, namely counting the number of the pixels with the same gray level in the neighborhood and the distribution aggregation of the pixels, thereby calculating the defect degree of the point A as a defect point as follows:
Figure 197545DEST_PATH_IMAGE015
in the formula
Figure 216185DEST_PATH_IMAGE016
The number of pixels with the same gray value in the neighborhood of the point A, and HP is the pixel point
Figure 783433DEST_PATH_IMAGE017
The aggregation degree of pixels with the same gray value in the neighborhood is calculated by the following formula:
Figure 347269DEST_PATH_IMAGE018
HP is pixel aggregation degree, the initial value is 0, statistics is started from the point expansion of the first pixel value of 0 in the pixel neighborhood, when the gray value of the next pixel is the same as the gray value of the previous pixel and is not 0, the aggregation degree of the central pixel is added with 1, when the gray value of the next pixel is different from the gray value of the previous pixel, the aggregation degree is kept unchanged, and finally the defect degree of the current point which is a true defect point is obtained
Figure 999967DEST_PATH_IMAGE019
In the invention, the defect degree of the pixel point is used as
Figure 573031DEST_PATH_IMAGE020
And then, the pixel point is considered as a defective pixel point.
The method for calculating the defect degree of the edge pixel point in each defect window comprises the following steps:
acquiring the number of pixel points in the neighborhood of each edge pixel point, wherein the pixel points are the same as the gray value of the edge pixel point;
sequentially traversing the pixels in the neighborhood of each edge pixel, and acquiring the number of continuous pixels with the same gray value of the edge pixel as the pixel aggregation degree of each edge pixel;
and calculating the defect degree of each edge pixel according to the pixel aggregation degree of each edge pixel and the number of pixels in the neighborhood which are the same as the gray value of the edge pixel.
103. And counting the number of the defective pixel points in each direction in the neighborhood of each defective pixel point by taking each defective pixel point as a center, and calculating the direction probability of each direction according to the number of the defective pixel points in each direction.
And taking the defective pixel point A as a center, acquiring all defective pixel points in the neighborhood of the defective pixel point, and calculating the distribution angles of the true defective points in the neighborhood of the point A:
Figure 729206DEST_PATH_IMAGE021
in the formula
Figure 729523DEST_PATH_IMAGE022
The horizontal and vertical coordinate values of the pixel of the true defect point with the same gray value of the neighborhood are shown, and x and y are the coordinates of the central pixel point A.
Counting the direction angles of pixels with the same gray value in the neighborhood of all the true defect points relative to the central pixel point:
Figure 603938DEST_PATH_IMAGE023
and carrying out sequential probability distribution statistics on the direction angles, and respectively calculating the 0-degree direction probability as follows:
Figure 728496DEST_PATH_IMAGE024
wherein
Figure 4756DEST_PATH_IMAGE025
In the formula
Figure 175974DEST_PATH_IMAGE026
For counting the pixel quantity of 0 degree and 180 degree angles, i is the total quantity of true defect pixel points, and the probability of 45 degrees direction is calculated in the same way as follows:
Figure 537686DEST_PATH_IMAGE027
in which
Figure 452552DEST_PATH_IMAGE028
(ii) a The 90 ° directional probability is:
Figure 583319DEST_PATH_IMAGE029
wherein
Figure 925439DEST_PATH_IMAGE030
(ii) a The 135 ° directional probability is:
Figure 774446DEST_PATH_IMAGE031
wherein
Figure 476692DEST_PATH_IMAGE032
104. And obtaining the gray level run matrix of each defect window in each direction, and obtaining the final gray level run matrix of each defect window according to the gray level run matrix of each window in each direction and the direction probability of the corresponding direction.
The method for acquiring the final gray level run matrix of each defect window comprises the following steps:
acquiring corresponding direction probabilities according to the number of pixel points in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees in each defect window;
and obtaining the gray level run matrix of each defect window in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees, and carrying out weighted summation according to the gray level run matrix in each direction and the direction probability of the corresponding direction to obtain the final gray level run matrix of each defect window.
Taking the probability of each direction as the weight of the gray level run matrix of each direction, and finally counting the gray level run matrix:
Figure 461965DEST_PATH_IMAGE033
where P is the weight in each direction, and P (i, j) is the gray scale run matrix obtained in each direction.
105. And averagely dividing the final gray scale run matrix of each defect window into a long run area and a short run area.
The final gray level run matrix of each defect window is divided into 2 rectangles with the same size along the vertical direction, and the division schematic diagram is shown in fig. 2.
In the figure, the run length of the matrix of the A1 area is short, the run length of the matrix of the A2 area is long, and the longer the run length is, the higher the possibility that the current defect is a scratch is, and conversely, the shorter the run length is, the higher the possibility that the current defect is a crack is.
Counting the frequency difference of long run and short run of pixels in each area of the current window gray level run matrix, and according to the frequency difference, primarily analyzing the type of the current defect, counting the short run frequency of the A1 area by a calculation formula as follows:
Figure 37303DEST_PATH_IMAGE034
in the formula
Figure 311290DEST_PATH_IMAGE003
The frequency number representing a short run, i being the ith grey level, j being the run length, the interval being (1,
Figure 630275DEST_PATH_IMAGE035
) P (i, j) is the frequency of the run with the gray value i and the length j,
Figure 673318DEST_PATH_IMAGE003
the larger the value of (d), the larger the short run frequency.
Counting the frequency calculation formula of the long run of the A2 area:
Figure 311235DEST_PATH_IMAGE036
Figure 72517DEST_PATH_IMAGE004
frequency number representing long run, i is ith gray level, j is run length, interval is (
Figure 195194DEST_PATH_IMAGE037
) P (i, j) is the frequency of the run-length with the gray value i and the length j,
Figure 92743DEST_PATH_IMAGE004
the larger the value of (d), the larger the long run frequency.
And calculating the difference degree of the running frequency of each defect window according to the frequency of the elements in the long-running area and the short-running area in the final gray level running matrix.
The method for calculating the difference degree of the run frequency of each defect window comprises the following steps:
averagely dividing the final gray level run matrix into a long run area and a short run area according to the run length, and respectively counting the frequency of all elements in the long run area and the short run area;
calculating the difference degree of the frequency of the runlength of each defect window according to the frequency of all elements in the long-run area and the frequency of all elements in the short-run area, wherein the expression is as follows:
Figure 744304DEST_PATH_IMAGE001
wherein, the first and the second end of the pipe are connected with each other,
Figure 55200DEST_PATH_IMAGE002
indicating the run-rate disparity of each defective window,
Figure 902939DEST_PATH_IMAGE003
the frequency count indicating the short runs,
Figure 717311DEST_PATH_IMAGE004
frequency number of long run
Figure 8615DEST_PATH_IMAGE002
>A time of 1 indicates a higher frequency of short runs, reflecting a higher probability that the defect in the current window is a crack. On the contrary, when
Figure 541228DEST_PATH_IMAGE002
<A time of 1 indicates a higher frequency of long runs, reflecting a higher probability that the defect in the current window is a scratch.
106. And averagely dividing the final gray level run matrix of each defect window into a high gray level area and a low gray level area.
The gray scale run matrix of the window is divided into two regions with equal size along the horizontal direction, and the division schematic diagram is shown in fig. 3.
In the figure, A3 region is a low gray region, and A4 region is a high gray region. A higher grey value indicates a higher probability that the current defect is a scratch, whereas a lower grey value indicates a higher probability that the current defect is considered to be a crack.
And calculating the gray frequency difference degree of each defect window according to the frequency of the elements in the high gray level region and the low gray level region in the final gray level run matrix.
The method for calculating the gray frequency difference degree of each defect window comprises the following steps:
averagely dividing the final gray level run matrix into a high gray level area and a low gray level area according to the gray level, and respectively counting the frequency of all elements in the high gray level area and the low gray level area;
calculating the gray frequency difference degree of each defect window according to the frequency of all elements in the high gray scale area and the low gray scale area, wherein the expression is as follows:
Figure 943390DEST_PATH_IMAGE005
wherein the content of the first and second substances,
Figure 612269DEST_PATH_IMAGE006
indicating the degree of difference in the gray frequency of each defect window,
Figure 74474DEST_PATH_IMAGE007
indicating the pixel frequency number of the run length j and the gray level i, m indicating the run length of the final gray run matrix,
Figure 94383DEST_PATH_IMAGE008
representing the gray scale length of the final gray scale run matrix,
Figure 782460DEST_PATH_IMAGE009
expressing the first gray level of the final gray run matrix when
Figure 571424DEST_PATH_IMAGE038
The larger the possibility that the current defect is a crack is, and vice versa
Figure 204531DEST_PATH_IMAGE039
Figure 204531DEST_PATH_IMAGE039
1 indicates that the greater the probability that the defect is currently a scratch.
107. And calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, and judging the defect type of each defect window according to the confidence coefficient of each defect window.
The difference between the cracks and the tooth marks cannot be directly identified according to a single element, and the combination of the gray value and the run length is needed, so that the identification accuracy can be improved to a great extent.
The method for calculating the confidence of each defect window comprises the following steps:
calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, wherein the expression is as follows:
Figure 446157DEST_PATH_IMAGE010
wherein the content of the first and second substances,
Figure 190122DEST_PATH_IMAGE011
the confidence level of each of the defect windows is indicated,
Figure 99172DEST_PATH_IMAGE002
indicating the run-rate disparity of each defective window,
Figure 637601DEST_PATH_IMAGE006
indicating the difference of the gray frequency of each defect window when
Figure 632101DEST_PATH_IMAGE011
A larger value of (A) indicates a higher frequency of low-gray short runs in the matrix, reflecting a higher probability that the defect tends to crack, whereas when (B) is larger
Figure 163446DEST_PATH_IMAGE011
The smaller the number of pixels indicating a long run of high gray level in the matrix, the more likely it is to reflect defects tending to scratch.
The characteristics of the pixel low-gray short-run region are matched with the texture characteristics of the crack very much, the pixel of the high-gray short-run region possibly containing a small part of the crack region also possibly containing a small part of the scratch region, the pixel of the pixel low-gray long-run region also possibly containing a small part of the crack region also possibly containing a small part of the scratch region, and the characteristics of the high-gray long-run region are matched with the texture characteristics of the scratch very much, so that the run difference and the gray difference in the window region are reflected according to the confidence coefficient of each window, and the defect type in the defect window is judged.
The method for judging the defect type of each defect window according to the confidence coefficient of the window comprises the following steps:
when the confidence of the defect window is larger than a threshold value, a crack defect exists in the defect window;
when the confidence of the defect window is less than the threshold, a scratch exists in the defect window.
Confidence level
Figure 927002DEST_PATH_IMAGE011
When the defect is close to 1, the possibility that the current defect is a crack is considered to be high, and vice versa
Figure 636332DEST_PATH_IMAGE011
Considering that the probability of the current defect being a scratch is high when the trend is 0, the invention sets an empirical threshold value of 0.5 when
Figure 118129DEST_PATH_IMAGE040
The current defect is considered to be a crack when
Figure 203897DEST_PATH_IMAGE041
The current defect is treated as a scratch.
According to the invention, firstly, the pixels in the gear image are preliminarily judged through edge detection, so that the gray level run matrix is established for the obtained suspected defect window, the calculated amount is greatly reduced, meanwhile, when the gray level run matrix is established, the run matrix of each direction of the window is weighted through the distribution of the defect pixels in the window in each direction, the characteristics of the pixels in the defect window can be more completely represented by the obtained final gray level run matrix, and further, the gray level frequency difference characteristic and the run length difference characteristic of the pixels in the matrix are combined, and the dual characteristics are closely combined with texture information, so that the defect type can be more accurately identified.
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 (7)

1. A precise identification method for automobile parts is characterized by comprising the following steps:
acquiring a gear gray image, and performing window segmentation on the gray image to obtain a plurality of windows;
performing edge detection on each window, and taking the window with the number ratio of the edge pixel points obtained by detection larger than a threshold value as a defect window; setting the number of pixels on the detected edge to be more than a threshold value in the total number of window pixels
Figure DEST_PATH_IMAGE001
Considering that the subsequent identification processing is needed to the defects;
calculating the defect degree of edge pixel points in each defect window, taking the edge pixel points with the defect degree larger than a threshold value as defect pixel points, and acquiring all the defect pixel points in each defect window;
counting the number of defective pixel points in each direction in the neighborhood of each defective pixel point by taking each defective pixel point as a center, and calculating the direction probability of each direction according to the number of the defective pixel points in each direction, wherein the method comprises the following steps:
counting the direction angles of pixels with the same gray value in the neighborhood of all the defect points relative to the central pixel point, carrying out sequential probability distribution statistics on the direction angles, and calculating the 0-degree direction probability according to the ratio of the number of the defect pixel points with the direction angles of 0 degree and 180 degrees to the number of all the defect pixel points;
similarly, calculating the 45-degree direction probability according to the ratio of the number of defective pixel points with the direction angles of 45 degrees and 225 degrees to the number of all defective pixel points; calculating 90-degree direction probability according to the ratio of the number of defective pixel points with direction angles of 90 degrees and 270 degrees to the number of all defective pixel points; calculating 135-degree direction probability according to the ratio of the number of the defective pixel points with the direction angles of 135 degrees and 315 degrees to the number of all the defective pixel points;
acquiring a gray level run matrix of each defect window in each direction, and acquiring a final gray level run matrix of each defect window according to the gray level run matrix of each window in each direction and the directional probability of the corresponding direction;
averagely dividing the final gray level run matrix of each defect window into a long run area and a short run area;
calculating the difference degree of the running frequency of each defect window according to the frequency of the elements in the long-running area and the short-running area in the final gray level running matrix;
averagely dividing the final gray level run matrix of each defect window into a high gray level area and a low gray level area;
calculating the difference degree of the gray frequency of each defect window according to the frequency of elements in the high gray level region and the low gray level region in the final gray level run matrix;
and calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, and judging the defect type of each defect window according to the confidence coefficient of each defect window.
2. The precise identification method of the automobile parts as claimed in claim 1, wherein the method of calculating the defect degree of the edge pixel points in each defect window is:
acquiring the number of pixel points in the neighborhood of each edge pixel point, wherein the pixel points are the same as the gray value of the edge pixel point;
sequentially traversing the pixels in the neighborhood of each edge pixel, and acquiring the number of continuous pixels with the same gray value of the edge pixel as the pixel aggregation degree of each edge pixel;
and calculating the defect degree of each edge pixel according to the pixel aggregation degree of each edge pixel and the number of pixels in the neighborhood which are the same as the gray value of the edge pixel.
3. The method for precisely identifying the automobile parts as claimed in claim 1, wherein the method for obtaining the final gray level run matrix of each defect window comprises:
acquiring corresponding direction probabilities according to the number of pixel points in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees in each defect window;
and obtaining the gray level run matrix of each defect window in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees, and carrying out weighted summation according to the gray level run matrix in each direction and the direction probability of the corresponding direction to obtain the final gray level run matrix of each defect window.
4. The method for precisely identifying the automobile parts as claimed in claim 1, wherein the method for calculating the difference of the run frequency of each defect window comprises:
averagely dividing the final gray level run matrix into a long run area and a short run area according to the run length, and respectively counting the frequency of all elements in the long run area and the short run area;
calculating the difference degree of the frequency of the runlength of each defect window according to the frequency of all elements in the long-run area and the frequency of all elements in the short-run area, wherein the expression is as follows:
Figure DEST_PATH_IMAGE003
wherein the content of the first and second substances,
Figure 799825DEST_PATH_IMAGE004
indicating the run-rate disparity of each defective window,
Figure DEST_PATH_IMAGE005
the frequency count indicating the short runs,
Figure 601559DEST_PATH_IMAGE006
indicating the frequency of long runs.
5. The precise identification method for the automobile parts as claimed in claim 1, wherein the method for calculating the difference degree of the gray frequency of each defect window comprises:
averagely dividing the final gray level run matrix into a high gray level area and a low gray level area according to the gray level, and respectively counting the frequency of all elements in the high gray level area and the low gray level area;
calculating the gray frequency difference degree of each defect window according to the frequency of all elements in the high gray scale area and the low gray scale area, wherein the expression is as follows:
Figure 166664DEST_PATH_IMAGE008
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE009
indicating the degree of difference in the gray frequency of each defect window,
Figure 661230DEST_PATH_IMAGE010
indicating the pixel frequency number of the run length j and the gray level i, m indicating the run length of the final gray run matrix,
Figure DEST_PATH_IMAGE011
representing the gray scale length of the final gray scale run matrix,
Figure 865946DEST_PATH_IMAGE012
representing the first gray level of the final gray run matrix.
6. The method for precisely identifying the automobile parts as claimed in claim 1, wherein the method for calculating the confidence level of each defect window comprises:
calculating the confidence coefficient of each defect window according to the run frequency difference and the gray frequency difference of each defect window, wherein the expression is as follows:
Figure 533688DEST_PATH_IMAGE014
wherein, the first and the second end of the pipe are connected with each other,
Figure DEST_PATH_IMAGE015
the confidence level of each of the defect windows is indicated,
Figure 140250DEST_PATH_IMAGE004
indicating the run-rate disparity of each defective window,
Figure 602455DEST_PATH_IMAGE009
representing the difference of the gray frequency of each defect window.
7. The method for precisely identifying the automobile parts as claimed in claim 1, wherein the method for judging the defect type of each defect window according to the confidence of the window comprises the following steps:
when the confidence coefficient of the defect window is larger than a threshold value, a crack defect exists in the defect window;
when the confidence of the defect window is less than the threshold, a scratch exists in the defect window.
CN202210822912.1A 2022-07-14 2022-07-14 Precise identification method for automobile parts Active CN115082418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210822912.1A CN115082418B (en) 2022-07-14 2022-07-14 Precise identification method for automobile parts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210822912.1A CN115082418B (en) 2022-07-14 2022-07-14 Precise identification method for automobile parts

Publications (2)

Publication Number Publication Date
CN115082418A CN115082418A (en) 2022-09-20
CN115082418B true CN115082418B (en) 2022-11-04

Family

ID=83259462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210822912.1A Active CN115082418B (en) 2022-07-14 2022-07-14 Precise identification method for automobile parts

Country Status (1)

Country Link
CN (1) CN115082418B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115270894B (en) * 2022-09-27 2022-12-27 山东行创科技有限公司 Abnormal vibration signal extraction method for methanol generator
CN115330773B (en) * 2022-10-12 2023-03-28 南通红运金属科技有限公司 Metal grinding pockmark defect detection method
CN115359053B (en) * 2022-10-19 2023-12-19 天津云象科技发展有限公司 Intelligent detection method and system for defects of metal plate
CN115526890B (en) * 2022-11-25 2023-03-24 深圳市腾泰博科技有限公司 Method for identifying fault factors of record player head
CN115731239B (en) * 2023-01-06 2023-04-11 山东建筑大学鉴定检测中心有限公司 Steel quality detection method
CN115953398B (en) * 2023-03-13 2023-05-26 无锡斯达新能源科技股份有限公司 Defect identification method for strip steel surface
CN116229335B (en) * 2023-05-10 2023-07-21 山东大佳机械有限公司 Livestock and poultry farm environment recognition method based on image data
CN116309561B (en) * 2023-05-17 2023-08-04 威海赛宝工业信息技术研究院有限公司 Surface defect identification method based on anti-creeping insulating material
CN116468728B (en) * 2023-06-20 2023-08-29 深圳市锦红兴科技有限公司 Production quality detection method for hardware stamping part die
CN116993722B (en) * 2023-09-26 2023-12-08 山东奥斯登房车有限公司 Visual detection method for defects of trailer body of trailer
CN117173703B (en) * 2023-11-02 2024-01-16 温州华嘉电器有限公司 Isolating switch state identification method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006331163A (en) * 2005-05-27 2006-12-07 Matsushita Electric Ind Co Ltd Image processing device
CN112998649A (en) * 2015-01-06 2021-06-22 大卫·伯顿 Movable wearable monitoring system
CN114049489A (en) * 2022-01-13 2022-02-15 山东鹰联光电科技股份有限公司 Early warning method for breakage of optical fiber cable sheath
CN114202541A (en) * 2022-02-17 2022-03-18 湖北中海电线电缆有限公司 Cable defect detection method based on artificial intelligence
CN114399635A (en) * 2022-03-25 2022-04-26 珞石(北京)科技有限公司 Image two-classification ensemble learning method based on feature definition and deep learning
CN114419025A (en) * 2022-01-27 2022-04-29 江苏泰和木业有限公司 Fiberboard quality evaluation method based on image processing
CN114529549A (en) * 2022-04-25 2022-05-24 南通东德纺织科技有限公司 Cloth defect labeling method and system based on machine vision
CN114708325A (en) * 2022-03-31 2022-07-05 南通华烨塑料工业有限公司 Method for quickly positioning rubber production problem based on rubber blooming defect

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2793164A1 (en) * 2013-04-19 2014-10-22 Stichting Maastricht Radiation Oncology "Maastro Clinic" Method and system for determining a phenotype of a neoplasm in a human or animal body
CN114240888B (en) * 2021-12-17 2022-09-20 沭阳安宏木制品厂 Furniture assembly paint spraying defect repairing method and system based on image processing
CN114445387A (en) * 2022-01-29 2022-05-06 泗阳富艺木业股份有限公司 Fiberboard quality classification method based on machine vision

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006331163A (en) * 2005-05-27 2006-12-07 Matsushita Electric Ind Co Ltd Image processing device
CN112998649A (en) * 2015-01-06 2021-06-22 大卫·伯顿 Movable wearable monitoring system
CN114049489A (en) * 2022-01-13 2022-02-15 山东鹰联光电科技股份有限公司 Early warning method for breakage of optical fiber cable sheath
CN114419025A (en) * 2022-01-27 2022-04-29 江苏泰和木业有限公司 Fiberboard quality evaluation method based on image processing
CN114202541A (en) * 2022-02-17 2022-03-18 湖北中海电线电缆有限公司 Cable defect detection method based on artificial intelligence
CN114399635A (en) * 2022-03-25 2022-04-26 珞石(北京)科技有限公司 Image two-classification ensemble learning method based on feature definition and deep learning
CN114708325A (en) * 2022-03-31 2022-07-05 南通华烨塑料工业有限公司 Method for quickly positioning rubber production problem based on rubber blooming defect
CN114529549A (en) * 2022-04-25 2022-05-24 南通东德纺织科技有限公司 Cloth defect labeling method and system based on machine vision

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Real-time textural defect detection based on label run length co-occurrence matrix;Bi Mingde等;《Proceedings 2011 International Conference on Transportation, Mechanical, and Electrical Engineering (TMEE)》;20120514;第271-274页 *
Texture features based microscopic image classification of liver cellular granuloma using artificial neural networks;Fuqian Shi等;《2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC)》;20190805;第432-439页 *
基于灰度―游程累加的皮革缺陷自动检测;于彩香等;《皮革与化工》;20081225(第06期);第36-38、43页 *
基于纹理分析的皮革可视缺陷检测方法的研究;于彩香;《中古优秀硕士学位论文全文数据库 信息科技辑》;20100315;第2010年卷(第3期);I138-750 *

Also Published As

Publication number Publication date
CN115082418A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN115082418B (en) Precise identification method for automobile parts
CN114842017B (en) HDMI cable surface quality detection method and system
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
CN114862862B (en) Pump body cold shut defect identification method and system based on image processing
CN115239704B (en) Accurate detection and repair method for wood surface defects
CN114549522B (en) Textile quality detection method based on target detection
CN114529549B (en) Cloth defect labeling method and system based on machine vision
CN115345885B (en) Appearance quality detection method for metal fitness equipment
CN115082467A (en) Building material welding surface defect detection method based on computer vision
CN115018838B (en) Method for identifying pitting defects on surface of oxidized steel pipe material
CN116758061A (en) Casting surface defect detection method based on computer vision
CN114170208A (en) Paper product defect detection method based on artificial intelligence
CN115953398B (en) Defect identification method for strip steel surface
CN115100221A (en) Glass defect segmentation method
CN114943739A (en) Aluminum pipe quality detection method
CN114820625B (en) Automobile top block defect detection method
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN114782330B (en) Grate abnormity detection method and system based on artificial intelligence
CN114972892B (en) Automobile brake pad defect classification method based on computer vision
CN109239073A (en) A kind of detection method of surface flaw for body of a motor car
CN115330645A (en) Welding image enhancement method
CN115266732A (en) Carbon fiber tow defect detection method based on machine vision
CN114155226A (en) Micro defect edge calculation method
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN117152161B (en) Shaving board quality detection method and system based on image recognition

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