CN107967690B - Self-adaptive ferrographic abrasive particle image binarization processing method - Google Patents

Self-adaptive ferrographic abrasive particle image binarization processing method Download PDF

Info

Publication number
CN107967690B
CN107967690B CN201610913176.5A CN201610913176A CN107967690B CN 107967690 B CN107967690 B CN 107967690B CN 201610913176 A CN201610913176 A CN 201610913176A CN 107967690 B CN107967690 B CN 107967690B
Authority
CN
China
Prior art keywords
gray
image
ferrographic
order difference
difference quotient
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
CN201610913176.5A
Other languages
Chinese (zh)
Other versions
CN107967690A (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.)
Petrochina Co Ltd
Original Assignee
Petrochina 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 Petrochina Co Ltd filed Critical Petrochina Co Ltd
Priority to CN201610913176.5A priority Critical patent/CN107967690B/en
Publication of CN107967690A publication Critical patent/CN107967690A/en
Application granted granted Critical
Publication of CN107967690B publication Critical patent/CN107967690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a self-adaptive ferrographic abrasive particle image binarization processing method which integrates abrasive particle gray frequency information and three-dimensional gray histogram information by utilizing the characteristics that a ferrographic abrasive particle image has a single background and the gray value difference between the background and abrasive particles is large, performs slice analysis on the basis of the abrasive particle gray frequency information and the three-dimensional gray histogram information, obtains a slice gray frequency curve, introduces a first order difference quotient and a second order difference quotient and selects a proper segmentation gray value according to the first order difference quotient and the second order difference quotient. The method solves the problem of blind threshold selection trial and error when the ferrographic abrasive grain image is processed in the prior art, and realizes self-adaption obtaining of the optimal binary threshold. The invention can obtain more accurate binarization processing result for the large-abrasive-particle ferrographic image, and can avoid introducing excessive noise when processing the small-abrasive-particle ferrographic image.

Description

Self-adaptive ferrographic abrasive particle image binarization processing method
Technical Field
The invention belongs to the field of fault diagnosis of mechanical equipment, and particularly relates to a self-adaptive ferrographic abrasive particle image binarization processing method.
Background
In recent years, with the development of science and technology, mechanical equipment is developed towards the direction of precision and complexity, and in order to achieve the maximum service life of the mechanical equipment and reduce the loss caused by shutdown maintenance, the wear monitoring of the mechanical equipment by using an oil monitoring technology is becoming more and more common. The abrasive particles are a direct product of the wear process and are closely related to the degradation of the mechanical equipment. Therefore, it has become a research focus of technologists in recent years to acquire ferrographic abrasive grain images from oil monitoring systems and further analyze the ferrographic abrasive grain images by using image processing technology.
Before processing the ferrographic abrasive grain image, the color abrasive grain image is generally required to be converted into a binary image, so that further processing and analysis can be conveniently carried out. The traditional method is to select an Otsu algorithm to process a color image. The Otsu algorithm is also called a maximum inter-class variance method, is an adaptive threshold segmentation algorithm based on the principle of probability statistics, proposed by the great body of japanese scholars in 1979, and has the core idea that: and determining an optimal threshold value, and after the image is subjected to binarization processing, maximizing the inter-class variance of the background pixel class and the foreground pixel class, thereby achieving the purpose of distinguishing the background pixel class from the foreground pixel class. The Otsu algorithm is considered to be the most classical algorithm in the field of image segmentation. However, repeated tests show that the algorithm segmentation performance is close to the optimum only when the area of the foreground target is greater than 20% of the whole image, and when the foreground target is smaller, the algorithm performance rapidly drops, so that the smaller the target is, the larger the threshold deviation value is. Therefore, the segmentation effect is not good for the ferrographic image with small target abrasive grain area. Meanwhile, the Otsu algorithm uses an exhaustive method to obtain the optimal threshold value, so that the method has the defect of large calculation amount. In actual ferrographic abrasive grain image processing, a trial and error method is usually adopted to obtain a better binarization segmentation effect, the method is time-consuming and labor-consuming, the segmentation efficiency is low, and the segmentation result varies from person to person, so that a ferrographic abrasive grain image segmentation method capable of adaptively selecting a threshold value is urgently needed.
Disclosure of Invention
The invention aims to overcome the defects of blindness and low segmentation efficiency in the traditional trial-and-error threshold segmentation process of a ferrographic abrasive particle image, improve the segmentation result of the binarization processing of the ferrographic abrasive particle image, and provide a self-adaptive ferrographic abrasive particle image binarization processing method.
In order to achieve the purpose, the invention converts a two-dimensional ferrographic image into a three-dimensional gray level histogram, and simultaneously introduces the concepts of first order difference quotient and second order difference quotient, and the adopted technical scheme comprises the following steps:
s1, carrying out graying processing on the color image of the ferrographic abrasive grain image, and drawing a frequency change curve of each gray value of the gray image;
s2, using the gray frequency curve obtained in step S1 to judge whether the gray image needs to be gray-scale inverted, and when the sum of the gray peak front frequency is SFront sideGreater than the sum of the frequency values after the peak value of the gray scaleRear endCarrying out image gray scale turnover on the gray scale image, otherwise, carrying out image gray scale turnover on the gray scale image is not needed;
s3, making a three-dimensional gray histogram for the gray image obtained in the step S2, and simultaneously drawing a slice gray frequency curve graph of the three-dimensional gray histogram;
s4, solving a first order difference quotient and a second order difference quotient of the slice gray frequency curve in the slice gray frequency curve graph obtained in the step S3, and drawing a curve graph of two times of the first order difference quotient and the second order difference quotient changing along with the gray value;
s5, determining an optimal binarization threshold value according to the first order difference quotient and the curve graph of the second order difference quotient obtained in the step S4, wherein the curve graph is changed along with the change of the gray value, so that a binary image is obtained;
s6, if the image gray scale is not turned in the step S2, the binary image obtained in the step S5 is a final binary image; if the image grayscale inversion is performed in step S2, the binary image obtained in step S5 is subjected to image grayscale inversion again to obtain a final binary image.
In the adaptive ferrographic abrasive grain image binarization processing method of the present invention, in step S5, the step of determining the optimal binarization threshold preferably includes:
(1) taking the gray value corresponding to the minimum value of the first-order difference quotient as a search starting point, and putting all gray values meeting the condition that the first-order difference quotient is larger than e1 into a matrix; wherein e1 is a set threshold;
(2) sequentially checking second-order difference quotients corresponding to elements in the matrix, and if two times of the second-order difference quotients are smaller than e2, terminating the search; where e2 is the set threshold.
In the adaptive iron spectrum abrasive particle image binarization processing method of the present invention, preferably, in the step (1) of determining the optimal binarization threshold value, e1 is-0.5% m n, where m and n are the total number of rows and the total number of columns of the abrasive particle image pixels, respectively. Since the first order difference quotients are all less than 0, their threshold should be negative.
In the adaptive iron spectrum abrasive particle image binarization processing method of the present invention, preferably, in the step (2) of determining the optimal binarization threshold value, e2 is 0.05% m n, where m and n are the total number of rows and the total number of columns of the abrasive particle image pixels, respectively.
In the adaptive ferrographic abrasive particle image binarization processing method, in step S1, the ferrographic abrasive particle image is preferably acquired from an online or offline oil monitoring system.
In the step S1, preferably, when drawing the change curve of each corresponding gray-value frequency according to the gray-scale image, the method calculates the gray-value frequency corresponding to each gray-value, determines the coordinate position of each gray-value frequency, and connects the gray-value frequency point by point.
In the step S3, preferably, when drawing the corresponding slice gray frequency curve according to the three-dimensional gray histogram, the three-dimensional gray histogram is sliced at each gray value, then the gray frequency of the factor for each slice is calculated, and finally the coordinate position of the slice is determined and the line is connected point by point.
In the adaptive ferrographic abrasive grain image binarization processing method of the present invention, in step S5, the first order difference quotient is preferably according to a formula defined by the first order difference quotient
Figure BDA0001134085770000031
And (6) performing calculation.
In the adaptive ferrographic abrasive grain image binarization processing method of the present invention, in step S5, the second order difference quotient is preferably according to a definition formula of the second order difference quotient
Figure BDA0001134085770000032
And (6) performing calculation.
Compared with other prior art, the invention has the following beneficial effects:
the self-adaptive ferrographic abrasive particle image binarization processing method solves the problem that threshold value selection is blindly tried when a ferrographic abrasive particle image is processed in the prior art, can self-adaptively select a proper threshold value to carry out binarization processing on the image, keeps the advantage of accuracy of processing a large abrasive particle ferrographic image by an Otsu algorithm in a processing result, and overcomes the defect of introducing excessive noise when a small abrasive particle ferrographic image is processed by the Otsu algorithm. Meanwhile, compared with the Otsu algorithm, the search range and the calculation amount are greatly reduced.
Drawings
FIG. 1 is a flow chart of a binarization processing method for an adaptive ferrographic abrasive grain image according to the invention;
fig. 2 is a grayscale image of four typical ferrographic abrasive grain image samples used in the example of the present invention after graying, where fig. 2(a) is a grayscale image of a light-colored large abrasive grain, fig. 2(b) is a grayscale image of a dark-colored large abrasive grain, fig. 2(c) is a grayscale image of a small abrasive grain with more bubbles, and fig. 2(d) is a grayscale image of a small abrasive grain with blurred edges;
FIG. 3 is a graph of the gray scale frequency obtained by the processing of FIG. 2(a) according to embodiment 1 of the present invention;
fig. 4 is a three-dimensional gray surface graph obtained by dividing a mesh by using a tool function mesgrid in MATLAB according to embodiment 1 of the present invention in fig. 2 (a);
fig. 5 is a three-dimensional gray level histogram obtained based on fig. 4 in embodiment 1 of the present invention;
fig. 6 is a slice gray frequency curve of a three-dimensional gray histogram obtained after the slice processing is performed on fig. 5 in embodiment 1 of the present invention;
fig. 7(a), 7(B), and 7(C) are binary images obtained by randomly selecting a1, B1, and C1 as segmentation thresholds from fig. 2(a) according to embodiment 1 of the present invention, respectively;
fig. 8(a) is an exemplary region M selected from the slice gray frequency curve of fig. 6 according to embodiment 1 of the present invention, and fig. 8(b) is a partially enlarged view of the exemplary region M;
fig. 9 is a diagram of a first difference quotient and a slice gray frequency curve obtained by calculating the slice gray frequency curve in fig. 6 according to embodiment 1 of the present invention;
fig. 10 is a variation curve obtained by calculating the first order difference quotient and twice the second order difference quotient for the gray scale frequency curve of the slice in fig. 6 according to embodiment 1 of the present invention;
FIGS. 11(a) and (b) are comparative graphs of the binarization processing results obtained by processing FIG. 2(a) according to Otsu algorithm and the algorithm proposed by the present invention in example 1 of the present invention, respectively;
FIG. 12 is a graph of the gray scale frequency obtained by the processing of FIG. 2(b) according to embodiment 2 of the present invention;
fig. 13 is a three-dimensional gray level curved surface diagram obtained by dividing a mesh by using a tool function mesgrid in MATLAB in embodiment 2 to fig. 2(b) of the present invention;
fig. 14 is a three-dimensional grayscale histogram obtained by performing grayscale inversion processing on the basis of fig. 13 in embodiment 2 of the present invention;
fig. 15 is a slice gray frequency curve of a three-dimensional gray image obtained after the slice processing is performed on fig. 14 in embodiment 2 of the present invention;
fig. 16 is a variation curve obtained by calculating the first order difference quotient and twice the second order difference quotient for the gray scale frequency curve of the slice in fig. 15 according to embodiment 2 of the present invention;
fig. 17 is a binarized image obtained after an appropriate threshold value is automatically selected in embodiment 2 of the present invention;
FIGS. 18(a) and (b) are respectively a comparison graph of the final binarization processing result obtained by processing FIG. 2(b) in embodiment 2 of the present invention by using Otsu algorithm and the algorithm proposed by the present invention;
FIGS. 19(a) and (b) are graphs comparing the results of binarization processing obtained by processing FIG. 2(c) using Otsu algorithm and the algorithm proposed by the present invention, respectively;
fig. 20(a) and (b) are comparative graphs of the binarization processing results obtained by processing fig. 2(d) by using Otsu algorithm and the algorithm proposed by the present invention, respectively.
Detailed Description
The following examples are intended to further illustrate the process of the present invention but should not be construed as limiting thereof.
The method comprises the steps of firstly obtaining a colorful ferrographic abrasive grain image (an original abrasive grain image) from an online or offline oil monitoring system, and then carrying out gray processing on the image to obtain an abrasive grain gray image, wherein fig. 2(a) is a gray image of light-color large abrasive grains, fig. 2(b) is a gray image of dark-color large abrasive grains, fig. 2(c) is a gray image of small abrasive grains with more bubbles, and fig. 2(d) is a gray image of small abrasive grains with blurred edges.
The ferrographic abrasive grain images have the same size and resolution, and the abrasive grains in the images are obviously different from the background color, but the background colors of different abrasive grain images are different.
Drawing a gray frequency curve of each gray image, judging whether gray inversion needs to be carried out on the gray image or not through the gray frequency curve, drawing a three-dimensional gray histogram of the gray image on the basis, drawing a slice gray frequency curve graph of the three-dimensional gray histogram, solving a first order difference quotient and a second order difference quotient of the slice gray frequency curve, determining a gray value as a segmentation threshold value through an allowable received error, and finally obtaining a final binarization processing result of the ferrograph abrasive particle image. The method not only overcomes the blindness of the traditional trial and error threshold, but also overcomes the defect that the Otsu algorithm is inaccurate in segmentation of the small-abrasive-particle ferrographic image, and greatly improves the efficiency and accuracy of the ferrographic abrasive-particle image binarization processing.
To illustrate the superiority of the algorithm proposed in the present invention, two ferrographic images, fig. 2(a) and fig. 2(b), in which the gray level of the abrasive grain is different from the gray level of the background, are selected for illustration. As can be seen in FIG. 2, the abrasive grain pixel grayscale values in FIG. 2(a) are lower than the background, while the abrasive grain pixel grayscale values in FIG. 2(b) are higher than the background. Example 1 takes fig. 2(a) as a processing object, and the processing procedure and the result are shown in fig. 3 to 11; in embodiment 2, fig. 2(b) is used as a processing target, and the processing procedure and the result are shown in fig. 12 to 18.
Example 1
Referring to fig. 1, the specific steps of this embodiment are as follows:
1. graying the light-color large abrasive particle image in the ferrographic abrasive particle image to obtain a graph (a) in fig. 2, and drawing a frequency variation curve (i.e., a gray frequency curve) of each gray value of the gray image, as shown in fig. 3, wherein the gray value corresponding to the peak value of the curve is a background gray value;
2. using the gray frequency curve in fig. 3 to determine whether to perform gray inversion processing on the gray image, taking the gray value corresponding to the peak value of the curve in fig. 3 as the dividing line, and making the sum of the frequency numbers corresponding to the gray values smaller than the dividing line be SFront sideMaking the sum of frequency numbers corresponding to the gray values larger than the dividing line be SRear endCalculated as S in FIG. 3Front side<SRear endTherefore, the gray scale inversion processing is not carried out on the gray scale inversion processing;
3. for fig. 2(a), a three-dimensional gray curved surface graph is obtained by dividing a grid by using a tool function mesgrid in MATLAB, referring to fig. 4, the gray value corresponding to the gray plane with the largest area in fig. 4 is the gray value corresponding to the peak value of the curve in fig. 3, and the sum of pixel points in the area below the gray plane is S in fig. 3Front sideThe sum of the pixel points in the area above the plane is S in FIG. 3Rear end. This is similar to S calculated in fig. 3Front side<SRear endThe conclusion is consistent;
4. the three-dimensional gray level histogram obtained on the basis of fig. 4, as shown in fig. 5, comparing fig. 4 and fig. 5, it can be seen that the regions D1 and D2 in fig. 4 correspond to the regions D1 and D2 of fig. 5 respectively,
namely, the gray scale turning operation is not carried out on the glass substrate; meanwhile, based on the three-dimensional gray-scale image obtained after the slicing processing is performed on fig. 5, a slice gray-scale frequency curve is drawn, as shown in fig. 6. In order to comparatively illustrate the influence of correct selection of the binarization threshold on the binarization result, three gray values A1, B1 and C1 are randomly selected to be respectively made into a slice, wherein A1, B1 and C1 in FIG. 5 are in one-to-one correspondence with A1, B1 and C1 in FIG. 6.
5. Three slices with segmentation thresholds of a1, B1 and C1 are selected to perform binarization processing on the image in fig. 2(a) to obtain a binary image, which is shown in fig. 7(a), 7(B) and 7 (C). Comparing the above 3 images, it is important for the image binarization processing to select an appropriate segmentation threshold.
6. In order to select an optimal segmentation threshold, a region M is selected on the slice gray frequency curve in fig. 6, see fig. 8(a), and first and second order difference quotients are obtained for three consecutive points a, b, and c in the region M, and an enlarged view of the region M is shown in fig. 8 (b);
coordinates { x ] of each point on the slice gray-scale frequency curve in FIG. 8(a)i,yiSince the function of the slice gray frequency curve is very complex, the original function can be replaced by an approximate function which is relatively accurate and easy to calculate. In the present invention, a Newton interpolation polynomial is used, and the nth-order interpolation polynomial of the slice gray frequency curve can be represented as:
Nn(x)=α01(x-x0)+α2(x-x0)(x-x1)+…+αn(x-x0)(x-x1)…(x-xn-1) Wherein, when xi≠xj(i ≠ j), the following results are obtained:
Figure BDA0001134085770000071
in formula (1), f [ x ]0]Called the zero order difference quotient, f [ x ]0,x1]Called first order difference quotient, f [ x ]0,x1,x2,…,xn]Referred to as the n-th order difference quotient. Function f (x) at two points x which are mutually differenti,xjFirst order difference ofThe quotient is defined as:
Figure BDA0001134085770000072
function f (x) at a point x of mutual differencei,xj,xkThe second order difference quotient at (a) is defined as:
Figure BDA0001134085770000073
in general, the function f (x) is at n +1 points x of mutual dissimilarity0,x1,x2,…,xnThe difference quotient of order n above is the difference quotient of order n-1 of the function f (x).
As can be seen from fig. 8 (b): the difference between the abscissas of a and b is Δ x1Difference of ordinate is Δ h1(ii) a The difference between the abscissa of b and c is Δ x2Difference of ordinate is Δ h2. Therefore, according to the definition of the difference quotient, the first difference quotient of the slice frequency curve at a, b and b, c is:
Figure BDA0001134085770000074
Figure BDA0001134085770000075
the second order difference quotient of the slice frequency curve at a, b, c is:
Figure BDA0001134085770000076
the number of gray frequencies corresponding to adjacent gray values for each of the bins a, b, and c
∴Δx1=Δx2=1
∴f[xa,xb]=-Δh1,f[xb,xc]=-Δh2
Figure BDA0001134085770000077
Has a dose of < delta > h1And Δ h2The corresponding ordinate is frequency
∴f[xa,xb]=-Δh1The physical meaning expressed in the present invention is: the number of pixels of abrasive grains in a binary image obtained when the division threshold value is b is smaller by Δ h than the number of pixels of abrasive grains obtained when the division threshold value is a1And (4) respectively. For the same reason f [ x ]b,xc]=-Δh2The physical meaning expressed in the present invention is: the number of pixels of abrasive grains in the binary image obtained when the division threshold value is c is smaller by Δ h than the number of pixels of abrasive grains obtained when the division threshold value is b2And (4) respectively.
As can be seen from fig. 8, when the segmentation threshold varies between a and b, and the segmentation threshold varies between b and c, the fluctuation of the two changes of the pixel points of the abrasive grains is derived as follows:
2f[xa,xb,xc]=Δh2-Δh1(7)
therefore, in the present invention, the physical meaning represented by twice the second order difference quotient is the fluctuation size of the adjacent two first order difference quotients.
Specifically, in order to find the optimum division threshold, a first order difference quotient curve is obtained on the basis of the slice gray frequency curve shown in fig. 6, as shown in fig. 9. Since the curve of the slice gray frequency in fig. 6 is a monotonically decreasing curve, the first order difference quotients thereof are all located below the x coordinate axis. With reference to the x-axis, it can be seen that the first-order difference quotient decreases sequentially until it reaches a minimum value, and then increases sequentially to and fluctuates around the x-axis. To find the best gray value as the segmentation threshold, the first order difference quotient can be used as the judgment criterion: setting an acceptable threshold e1, when the first-order difference quotient is greater than the acceptable threshold e1, it indicates that the difference between the total number of the abrasive grain pixels obtained by dividing at the gray value and the total number of the abrasive grain pixels obtained by dividing at the previous gray value is less than | e1|, and it belongs to an acceptable error range, and this point can be considered as a more ideal dividing threshold. However, in order to ensure the reasonableness of the gray scale value as the dividing threshold, the second order difference quotient should be obtained, and the second order difference quotient is ensured to be twice smaller than the given threshold e2, which indicates that the fluctuation range of the first order difference quotient at two consecutive points is smaller than the given threshold e 2. According to the knowledge related to the abrasive grain image binarization processing, e1 is-0.5% m n, and e2 is 0.05% m n, where m and n are the total number of rows and the total number of columns of the iron spectrum abrasive grain image pixel points, respectively.
In summary, the method of the present invention selects a suitable segmentation gray value, i.e. an optimal binarization threshold, as follows:
(1) taking the gray value corresponding to the minimum value of the first-order difference quotient as a search starting point, and putting all gray values meeting the condition that the first-order difference quotient is larger than e1 into a matrix;
(2) and sequentially checking the second-order difference quotient corresponding to each element in the matrix, and terminating the search if two times of the second-order difference quotient is less than e 2.
7. Then, curves of the first order difference quotient and the second order difference quotient of the whole curve shown in fig. 6, which are two times of the change with the gray value, are respectively drawn, as shown in fig. 10; and determining the optimal binarization threshold value according to the first order difference quotient and the second order difference quotient obtained in the step S6 to obtain the final binary image.
Fig. 11(a) and (b) are graphs comparing the results of binarization processing obtained by processing fig. 2(b) using Otsu algorithm and the algorithm proposed by the present invention, respectively. Because the processing results of the two algorithms are very similar and the qualitative comparison is not obvious, quantitative analysis comparison is needed. The Otsu algorithm calculated an abrasive coverage percentage of 36.803%, while the algorithm of the present invention calculated an abrasive coverage percentage of 36.335%, i.e., 0.468% error. The Otsu algorithm has ideal segmentation results when processing ferrographic images with larger abrasive particles, and the results obtained when processing large abrasive particle images by the algorithm provided by the invention are very close to those obtained by the Otsu algorithm, which shows that the segmentation effect is better when processing ferrographic images with larger light colors.
Example 2
Referring to fig. 1, the present embodiment obtains a binary image by the same method as in embodiment 1, except that:
1. graying the dark large abrasive particle image in the color image of the ferrographic abrasive particle image to obtain fig. 2(b), and drawing a frequency variation curve (gray frequency curve) of each gray value of the gray image, as shown in fig. 12, wherein the gray value corresponding to the peak value of the curve is the background gray value;
2. using the slice gray frequency curve in fig. 12 to determine whether the gray image needs to be subjected to gray inversion processing, and taking the gray value corresponding to the peak value of the curve as the dividing line to obtain SFront sideAnd SRear endCalculated as S in FIG. 12Front side>SRear endTherefore, the gradation reversal processing is required for fig. 2 (b). The grayscale flipping process operates according to equation (I):
V1=255-V0(I)
wherein, V1And V0Respectively representing the gray values before and after gray inversion;
3. for fig. 2(b), a three-dimensional gray curved surface graph is obtained by dividing a grid by using a tool function mesgrid in MATLAB, as shown in fig. 13, a gray value corresponding to a gray plane with the largest area in fig. 13 is a gray value corresponding to a peak of a curve in fig. 12, and the sum of pixel points in a region below the plane is S in fig. 12Front sideThe sum of the pixel points in the area above the plane is S in FIG. 12Rear end. This is similar to S calculated in fig. 12Front side>SRear endThe conclusion is consistent;
fig. 14 is a three-dimensional gray histogram obtained by performing gray inversion on the basis of fig. 13, and comparing fig. 13 with fig. 14, it can be seen that the region E in fig. 13 is consistent with the corresponding region F in fig. 14, that is, it is ensured that when S is performedFront side>SRear endAnd performing gray scale inversion processing on the image.
4. Fig. 15 is a graph of the frequency of the slice gray scale frequency of the three-dimensional gray scale image obtained by performing the slice processing on the basis of fig. 14. Slices a2, B2, and C2 in fig. 15 correspond one-to-one to a2, B2, and C2 in fig. 14. Fig. 16 is a variation curve obtained by calculating the first order difference quotient and twice the second order difference quotient for the slice gray scale frequency curve of fig. 15. On the basis of the second-order difference quotient, a proper threshold value is automatically selected through calculation similar to that in embodiment 1, and a binary image after threshold value segmentation is obtained, which is shown in fig. 17.
5. Since fig. 2(b) is subjected to the gray-scale inversion process (i.e., converted from fig. 13 to fig. 14) before the three-dimensional gray-scale histogram is acquired, in order to obtain an accurate and reasonable binary image, fig. 18(b) is obtained by performing the binary inversion process on fig. 17.
Fig. 18(a) and (b) are graphs comparing the final result of the binarization process obtained by processing fig. 2(b) using Otsu algorithm and the algorithm proposed by the present invention, respectively. Through calculation, the percentage of the coverage area of the abrasive particles obtained by the Otsu algorithm is 20.457%, while the percentage of the coverage area of the abrasive particles obtained by the algorithm provided by the invention is 21.032%, namely the error of the percentage of the coverage area of the abrasive particles and the coverage area of the abrasive particles is 0.575%, which shows that the segmentation effect is good when the algorithm is used for processing the iron spectrum image of the abrasive particles with large dark colors.
Through reading documents and repeated tests, the Otsu algorithm segmentation performance is close to the optimum only when the area of the foreground target is larger than 20% of the whole image, and when the foreground target is smaller, the algorithm performance rapidly drops, so that the smaller the target is, the larger the threshold deviation value is. Therefore, the segmentation effect is not good for the ferrographic image with small target abrasive grain area. To verify the insufficiency of the Otsu algorithm, fig. 2(c) and 2(d) were selected as processing targets. Fig. 19(a) and (b) are comparative graphs of the binarization processing results obtained by processing fig. 2(c) by using Otsu algorithm and the algorithm proposed by the present invention, respectively. Fig. 20(a) and (b) are comparative graphs of the binarization processing results obtained by processing fig. 2(d) by using Otsu algorithm and the algorithm proposed by the present invention, respectively.
As is obvious from comparing fig. 19(a) and (b), the Otsu algorithm wrongly segments a large number of bubbles on the background into the abrasive grains, which results in a serious deviation of the segmented binarization result and makes the next processing impossible. The following results were obtained by statistical calculation: the number of the abrasive particles in the binary image obtained by adopting the Otsu algorithm is 811, and the percentage of the coverage area of the abrasive particles is 10.813%; the number of the abrasive particles in the binary image obtained by the algorithm provided by the invention is 122, and the percentage of the coverage area of the abrasive particles is 2.225%. Compared with the Otsu algorithm, the algorithm provided by the invention only divides a small amount of bubbles into the abrasive particles, maintains the morphological information of the original abrasive particles to a greater extent, and shows the superiority of the algorithm provided by the invention.
As is obvious from comparison between fig. 20(a) and (b), since the original ferrographic abrasive grain edge is blurred, when the Otsu algorithm is used, the blurred region of the abrasive grain edge is erroneously divided into abrasive grains, so that the shape of the abrasive grain is changed by the divided binarization result, and the next processing cannot be performed. The following results were obtained by statistical calculation: the number of the abrasive particles in the binary image obtained by adopting the Otsu algorithm is 131, and the percentage of the coverage area of the abrasive particles is 6.965%; the number of the abrasive particles in the binary image obtained by the algorithm provided by the invention is 23, and the percentage of the coverage area of the abrasive particles is 4.751%. Compared with an Otsu algorithm, the algorithm provided by the invention better maintains the shape of the original abrasive particles, meanwhile, bubbles in the binary image are less, and further morphological feature extraction can be carried out.
Because the Otsu algorithm obtains the optimal threshold value by using an exhaustive method, the calculated amount is large, but the algorithm provided by the invention only needs to search from the minimum value of the first-order difference quotient, so that the search range is greatly reduced. Table 1 lists the run times for processing the four graphs in fig. 2 using the Otsu algorithm and the proposed algorithm, respectively. By comparison, the algorithm provided by the invention has shorter running time than the Otsu algorithm, which shows that the algorithm provided by the invention has smaller calculation amount.
TABLE 1 comparison of time(s) required for binarization of the pictures in FIG. 2
Figure BDA0001134085770000111
The invention solves the problem of blind threshold value selection and trial and error in the traditional processing of ferrographic abrasive grain images, provides a ferrographic abrasive grain image self-adaptive threshold value binarization processing method, converts a two-dimensional gray image into a three-dimensional histogram, and sets an acceptable error range according to the characteristics of a slice gray frequency curve and a first order difference quotient and a second order difference quotient so as to select an optimal segmentation threshold value. The processing result retains the advantage of accuracy of the Otsu algorithm in processing the ferrograph image of the large abrasive particle, and simultaneously overcomes the defect of introducing excessive noise when the Otsu algorithm is used for processing the ferrograph image of the small abrasive particle. Meanwhile, compared with the Otsu algorithm, the search range and the calculation amount are greatly reduced. Therefore, the self-adaptive threshold value binarization processing method for the ferrographic abrasive grain image provided by the invention realizes the automatic segmentation of the ferrographic abrasive grain image, reduces the operation amount while improving the segmentation accuracy, and effectively improves the ferrographic abrasive grain image processing capability.
The present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof, and it is therefore intended that all such changes and modifications as fall within the true spirit and scope of the invention be considered as within the following claims.

Claims (9)

1. A binarization processing method for an adaptive ferrographic abrasive particle image is characterized by comprising the following steps:
s1, carrying out graying processing on the color image of the ferrographic abrasive particle image, and drawing a gray frequency curve of the obtained gray image;
s2, using the gray frequency curve obtained in step S1 to judge whether the gray image needs to be gray-scale inverted, and when the sum of the gray peak front frequency is SFront sideGreater than the sum of the frequency values after the peak value of the gray scaleRear endCarrying out image gray scale turnover on the gray scale image, otherwise, carrying out image gray scale turnover on the gray scale image is not needed;
s3, drawing a three-dimensional gray histogram of the gray image obtained in the step S2 and drawing a slice gray frequency curve of the three-dimensional gray histogram;
s4, solving a first order difference quotient and a second order difference quotient of the slice gray frequency curve obtained in the step S3, and drawing a curve of two times of the first order difference quotient and the second order difference quotient changing along with the change of the gray value;
s5, determining an optimal binarization threshold value according to the first order difference quotient and the curve of the second order difference quotient obtained in the step S4, wherein the curve is changed along with the change of the gray value in a two-fold mode, and obtaining a binary image;
wherein the step of determining the optimal binarization threshold comprises:
(1) taking the gray value corresponding to the minimum value of the first-order difference quotient as a search starting point, and putting all gray values meeting the condition that the first-order difference quotient is larger than e1 into a matrix, wherein e1 is a set threshold;
(2) sequentially checking second-order difference quotients corresponding to elements in the matrix, and if two times of the second-order difference quotients are smaller than e2, ending the search, wherein e2 is a set threshold value;
s6, if the image gray scale is not turned in the step S2, the binary image obtained in the step S5 is a final binary image; if the image grayscale inversion is performed in step S2, the binary image obtained in step S5 is subjected to image grayscale inversion again to obtain a final binary image.
2. The adaptive ferrographic abrasive grain image binarization processing method according to claim 1, wherein in step S2, the image gray scale flipping process operates according to formula (I):
V1=255-V0(I)
wherein, V1And V0Respectively representing the gray values before and after the gray inversion.
3. The adaptive iron spectrum abrasive grain image binarization processing method according to claim 1, wherein in the step (1) of determining the optimal binarization threshold value, e1 is-0.5% m n, wherein m and n are respectively the total number of rows and the total number of columns of iron spectrum abrasive grain image pixel points.
4. The adaptive iron spectrum abrasive grain image binarization processing method according to claim 1, wherein in the step (2) of determining the optimal binarization threshold value, e2 is 0.05% m n, wherein m and n are respectively the total number of rows and the total number of columns of iron spectrum abrasive grain image pixel points.
5. The adaptive ferrographic abrasive particle image binarization processing method according to claim 1, wherein in step S1, the ferrographic abrasive particle image is acquired from an online or offline oil monitoring system.
6. The adaptive ferrographic abrasive particle image binarization processing method as claimed in claim 1, wherein in step S1, when drawing the corresponding gray frequency curve according to the gray image, the gray frequency corresponding to each gray value is first calculated, and then the coordinate position of the gray frequency is determined and the lines are connected point by point.
7. The adaptive ferrographic abrasive particle image binarization processing method as claimed in claim 1, wherein in step S3, when drawing the corresponding slice gray frequency curve according to the three-dimensional gray histogram, firstly slicing the three-dimensional gray histogram at each gray value, then calculating the gray frequency of the factor of each slice, and finally determining the coordinate position and connecting the lines point by point.
8. The adaptive ferrographic abrasive grain image binarization processing method according to claim 1, wherein in step S5, the first order difference quotient is according to a definition formula of the first order difference quotient
Figure FDA0002260955670000021
And (6) performing calculation.
9. The adaptive ferrographic abrasive grain image binarization processing method according to claim 1, wherein in step S5, the second order difference quotient is according to a definition formula of the second order difference quotient
Figure FDA0002260955670000022
And (6) performing calculation.
CN201610913176.5A 2016-10-19 2016-10-19 Self-adaptive ferrographic abrasive particle image binarization processing method Active CN107967690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610913176.5A CN107967690B (en) 2016-10-19 2016-10-19 Self-adaptive ferrographic abrasive particle image binarization processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610913176.5A CN107967690B (en) 2016-10-19 2016-10-19 Self-adaptive ferrographic abrasive particle image binarization processing method

Publications (2)

Publication Number Publication Date
CN107967690A CN107967690A (en) 2018-04-27
CN107967690B true CN107967690B (en) 2020-06-09

Family

ID=61997062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610913176.5A Active CN107967690B (en) 2016-10-19 2016-10-19 Self-adaptive ferrographic abrasive particle image binarization processing method

Country Status (1)

Country Link
CN (1) CN107967690B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110473213B (en) * 2019-08-16 2021-08-10 重庆邮电大学 Iron spectrum image segmentation method, device and system based on prior lattice
CN110715886B (en) * 2019-10-29 2020-09-01 南京航空航天大学 Oil wear debris online monitoring method based on optical low-coherence imaging
CN113313647A (en) * 2021-05-31 2021-08-27 齐鲁工业大学 Intelligent denoising method for leather fiber MCT tomography image and application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5164993A (en) * 1991-11-25 1992-11-17 Eastman Kodak Company Method and apparatus for automatic tonescale generation in digital radiographic images
CN101630411A (en) * 2009-07-02 2010-01-20 浙江省电力公司 Automatic threshold value image segmentation method based on entropy value and facing to transmission line part identification
CN103218793A (en) * 2013-04-01 2013-07-24 天津天地伟业数码科技有限公司 Adaptive hierarchical linear graphics enhancement method based on field programmable gate array (FPGA) platform
CN105654501A (en) * 2016-02-22 2016-06-08 北方工业大学 Self-adaptive image segmentation method based on fuzzy threshold
CN105913415A (en) * 2016-04-06 2016-08-31 吴晓军 Image sub-pixel edge extraction method having extensive adaptability

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100450839B1 (en) * 2001-10-19 2004-10-01 삼성전자주식회사 Device and method for detecting edge of each face of three dimensional image
US7245751B2 (en) * 2002-02-22 2007-07-17 Agfa-Gevaert N.V. Gradation processing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5164993A (en) * 1991-11-25 1992-11-17 Eastman Kodak Company Method and apparatus for automatic tonescale generation in digital radiographic images
CN101630411A (en) * 2009-07-02 2010-01-20 浙江省电力公司 Automatic threshold value image segmentation method based on entropy value and facing to transmission line part identification
CN103218793A (en) * 2013-04-01 2013-07-24 天津天地伟业数码科技有限公司 Adaptive hierarchical linear graphics enhancement method based on field programmable gate array (FPGA) platform
CN105654501A (en) * 2016-02-22 2016-06-08 北方工业大学 Self-adaptive image segmentation method based on fuzzy threshold
CN105913415A (en) * 2016-04-06 2016-08-31 吴晓军 Image sub-pixel edge extraction method having extensive adaptability

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Grey level reduction for segmentation, threshholding and binarisation of images based on optimal partitioning on an interval;M.K. Quweider ; J.D. Scargle ; B. Jackson;《IET Image Processing》;20070611;第1卷(第2期);103-111 *
Image Binarization under Non-uniform Illumination;Wei Wei;《International Congress on Image and Signal Processing》;20131218;第2013年卷(第6期);604-609 *
基于Canny理论的去阴影自适应边缘检测;敬泽;《中国优秀硕士学位论文全文数据库》;20120415;第2012年卷(第04期);I138-2289 *

Also Published As

Publication number Publication date
CN107967690A (en) 2018-04-27

Similar Documents

Publication Publication Date Title
CN115082683B (en) Injection molding defect detection method based on image processing
CN109829876B (en) Chain plate defect online detection device and method based on machine vision
CN109242853B (en) PCB defect intelligent detection method based on image processing
CN116385439B (en) Motor rubber shock pad quality detection method based on image processing
CN115829883A (en) Surface image denoising method for dissimilar metal structural member
CN103996209A (en) Infrared vessel object segmentation method based on salient region detection
CN107967690B (en) Self-adaptive ferrographic abrasive particle image binarization processing method
Niu et al. Image segmentation algorithm for disease detection of wheat leaves
CN109416749B (en) Image gray scale classification method and device and readable storage medium
CN115100174B (en) Ship sheet metal part paint surface defect detection method
CN108596151B (en) Method for rapidly extracting ship target slice in large-scene SAR image
CN111986222A (en) Intelligent electric meter chip image binarization processing method based on self-adaptive mixed threshold value
CN113256624A (en) Continuous casting round billet defect detection method and device, electronic equipment and readable storage medium
CN116309577B (en) Intelligent detection method and system for high-strength conveyor belt materials
CN115049651B (en) Metal plate stamping abnormity detection method
CN116630304B (en) Lithium battery mold processing detection method and system based on artificial intelligence
CN115049671A (en) Cloth surface defect detection method and system based on computer vision
CN110942444A (en) Object detection method and device
CN108230334B (en) High-concentration wind-blown sand image segmentation method based on gray threshold
CN104268845A (en) Self-adaptive double local reinforcement method of extreme-value temperature difference short wave infrared image
CN107133958B (en) Optical remote sensing ship slice segmentation method based on block particle size pre-judging balance histogram
CN113971681A (en) Edge detection method for belt conveyor in complex environment
CN114882387B (en) Bearing raceway bruise identification and automatic polishing positioning method in grinding process
CN110827272B (en) Tire X-ray image defect detection method based on image processing
CN114359276B (en) Steel die blanking optimization scheme obtaining method based on pockmark defects

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