CN114638827B - Visual detection method and device for impurities of lubricating oil machinery - Google Patents
Visual detection method and device for impurities of lubricating oil machinery Download PDFInfo
- Publication number
- CN114638827B CN114638827B CN202210534865.0A CN202210534865A CN114638827B CN 114638827 B CN114638827 B CN 114638827B CN 202210534865 A CN202210534865 A CN 202210534865A CN 114638827 B CN114638827 B CN 114638827B
- Authority
- CN
- China
- Prior art keywords
- gray
- region
- gray level
- adjacent
- scaling
- 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
Links
- 239000012535 impurity Substances 0.000 title claims abstract description 55
- 239000010687 lubricating oil Substances 0.000 title claims abstract description 53
- 238000001514 detection method Methods 0.000 title claims abstract description 19
- 230000000007 visual effect Effects 0.000 title abstract description 7
- 230000008859 change Effects 0.000 claims description 42
- 238000000034 method Methods 0.000 claims description 42
- 238000011179 visual inspection Methods 0.000 claims description 13
- 230000009466 transformation Effects 0.000 claims description 12
- 238000011156 evaluation Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 9
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 6
- 238000001914 filtration Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 abstract description 7
- 239000003921 oil Substances 0.000 description 9
- 238000005070 sampling Methods 0.000 description 8
- 241001270131 Agaricus moelleri Species 0.000 description 7
- 239000000314 lubricant Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 239000000428 dust Substances 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 150000003839 salts Chemical class 0.000 description 3
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 229910052799 carbon Inorganic materials 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000002184 metal Substances 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000005299 abrasion Methods 0.000 description 1
- 239000000654 additive Substances 0.000 description 1
- 239000002199 base oil Substances 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 210000000746 body region Anatomy 0.000 description 1
- 239000000356 contaminant Substances 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000001678 irradiating effect Effects 0.000 description 1
- 230000001050 lubricating effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000001579 optical reflectometry Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000004576 sand Substances 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000002904 solvent Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
The invention relates to the technical field of image data processing, in particular to a visual detection method and a visual detection device for mechanical impurities of lubricating oil.
Description
Technical Field
The invention relates to the technical field of image data processing, in particular to a visual detection method and device for impurities of lubricating oil machinery.
Background
The mechanical impurities originate from the external pollution of the oil production, storage and use or from the abrasion of the machine itself, but are mostly of the sandstone and carbon deposit type, and some organic metal salts which are difficult to dissolve in the solvent and are brought by the additives. Since the mechanical impurities destroy the oil film of the lubricating oil, increase wear, clog oil filters, and promote the formation of carbon deposits, the mechanical impurity content of the lubricating base oil should not exceed 0.005% in order to ensure the quality of the lubricating oil.
During actual detection, if the lubricating oil after being barreled is subjected to static detection, a manufacturer needs to bear quality risks, and if the lubricating oil in a dynamic state in the production process is detected, mechanical impurities of the lubricating oil are at different shooting visual angles, so that the detection results are different.
Disclosure of Invention
In order to solve the above technical problems, an object of the present invention is to provide a visual inspection method and device for detecting impurities in a lubricating oil machine, wherein the adopted technical scheme is as follows:
the embodiment of the invention provides a visual detection method for impurities in lubricating oil machinery, which comprises the following steps:
collecting a lubricating oil image after the impurity filtering process to obtain a corresponding gray image, obtaining a gray histogram of the gray image, and equalizing the gray histogram to obtain an equalized histogram;
performing peak and valley detection on the equilibrium histogram to divide the equilibrium histogram into a first region, a second region and a third region according to the position of the highest peak point and the position of the adjacent valley point before the highest peak point, wherein the first region is the region before the position of the adjacent valley point, the second region is the region between the position of the highest peak point and the position of the adjacent valley point before the highest peak point, and the third region is the region after the position of the highest peak point; calculating a gray level interval mean value according to the corresponding maximum gray level and the minimum gray level in the second region, constructing a gray level interval change curve by using the gray level interval between the adjacent gray levels in the second region and the difference between the gray level interval mean values based on the gray level interval mean value, and constructing a gray level change curve according to the quantity difference between the quantity of pixel points corresponding to the adjacent gray levels in the second region; confirming the optimal positions of the adjacent wave troughs by combining the gray level interval change curve and the gray level change curve, and respectively obtaining the scaling and stretching proportions of the first area, the second area and the third area according to the gray level corresponding to the optimal positions;
and acquiring a linear gray scale conversion formula of a corresponding region according to the scaling and stretching proportion to enhance the gray scale image, and detecting the type of mechanical impurities in the lubricating oil on the enhanced gray scale image.
Further, the method for acquiring the interval variation curve of the gray scale comprises the following steps:
and respectively calculating gray intervals between adjacent gray levels, acquiring a difference absolute value between the gray intervals and a gray interval mean value, and constructing a gray level interval change curve of the second area by taking the adjacent gray levels as abscissa and the difference absolute value as ordinate.
Further, the method for obtaining the gray level variation curve includes:
and respectively calculating the absolute value of the quantity difference between the quantity of the pixel points corresponding to the adjacent gray levels in the second area, and constructing a gray level change curve by taking the quantity difference as a vertical coordinate and the adjacent gray levels as a horizontal coordinate.
Further, the method for determining the optimal positions of the adjacent valley point positions by combining the gray level interval variation curve and the gray level variation curve comprises the following steps:
weighting and summing the slopes of corresponding line segments in the gray level interval change curve and the gray level change curve between the three adjacent gray levels to obtain slope evaluation values corresponding to the three adjacent gray levels, wherein the weight corresponding to the gray level interval change curve is greater than the weight corresponding to the gray level change curve, so that a plurality of slope evaluation values are obtained, the three adjacent gray levels corresponding to the minimum slope evaluation values are obtained to serve as target gray levels, and the position corresponding to the middle gray level in the target gray levels is taken as the optimal position of the adjacent valley point.
Further, the method for respectively obtaining the scaling and stretching ratios of the first region, the second region and the third region according to the gray level corresponding to the optimal position includes:
setting the gray level corresponding to the optimal position as P, the stretching ratio of the first regionWhereinis the stretch ratio of the first region,is the minimum gray level in the first region; scaling of the second regionWhereinis a scaling of the second area and,is the maximum gray level in the second region,is the minimum gray level in the second region; the scaling of the third region follows:whereinIs the scaling of the third region.
Further, the method for obtaining the linear gray scale transformation formula of the corresponding region according to the scaling and stretching ratio includes:
acquiring a gray level range of a first area, a gray level range of a second area and a gray level range of a third area according to the gray level of the highest peak point position and the gray level of the position of the immediately preceding adjacent valley point;
respectively obtaining a linear gray scale conversion formula of the corresponding region according to the gray scale range of each region and the corresponding scaling and stretching ratio, wherein the linear gray scale conversion formula of the first region is as follows:whereinis the gray value before the stretching is performed,is the gray value after the stretching process,is the stretch ratio of the first region; the linear gray scale transformation formula of the second region is as follows:whereinIs a constant number of times, and is,is the gray level of the position of the adjacent valley point,is the scaling of the second region; the linear gray scale transformation formula of the third region is as follows:whereinIs a constant number of times, and is,is a scaling of the third area and,the gray level of the highest peak point position.
Further, an embodiment of the present invention further provides a visual inspection apparatus for detecting impurities in a lubricating oil machine, including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor implements the steps of any one of the above methods when executing the computer program.
The embodiment of the invention at least has the following beneficial effects: the method comprises the steps of carrying out region division on a gray level histogram of a lubricating oil image based on detected peaks and troughs, obtaining target gray levels of the region division according to gray level intervals and gray level changes between adjacent divided gray levels, obtaining a scaling and stretching ratio of each divided region by using the target gray levels, obtaining a multi-section linear transformation formula of the gray level image by using the scaling and stretching ratio, achieving enhancement of the gray level image, not damaging the richness of the image, accurately detecting the type of mechanical impurities by using the enhanced gray level image, and reducing detection errors.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of a visual inspection system for detecting impurities in a lubricating oil machine according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for visually inspecting contaminants in a lubricating oil machine according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a gray histogram and an equilibrium histogram provided in an embodiment of the present invention, in which (a) is the gray histogram and (b) is the equilibrium histogram;
fig. 4 is a schematic diagram of a partitioning result of an equalization histogram according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given to a method and device for visually detecting impurities in a lubricating oil machine according to the present invention, with reference to the accompanying drawings and preferred embodiments, and the detailed implementation, structure, features and effects thereof. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of a visual inspection method and device for impurities of lubricating oil machinery provided by the invention in detail with reference to the accompanying drawings.
The specific scenes aimed by the invention are as follows: the package of lubricating oil is opaque oil drum, if find after the barrelling that mechanical impurity exceeds standard, then can cause a large amount of losses, therefore sampling test node is put before the barrelling, but the image of gathering on the production line has great problem, and automatic detection result fluctuates greatly, needs to do the enhancement processing to the image.
As an example, referring to fig. 1, an embodiment of the present invention provides a visual inspection system for mechanical impurities in lubricating oil, which is implemented by entering a lubricating oil sample 1 into a sampling channel 3 through a first micro pump 2, irradiating the sampling channel 3 with transmitted light, on one hand, acquiring a lubricating oil image through a camera 4, on the other hand, returning the lubricating oil sample 1 in the sampling channel 3 to an oil pool 7 through a second micro pump 6, and inputting the acquired lubricating oil image into a computer 5 for analysis processing to display an experimental result, where the analysis processing process of the computer is the visual inspection method for mechanical impurities in lubricating oil provided in this embodiment.
Since the mechanical impurities include dust and minute impurities, it is necessary to take an image of the lubricant flowing uniformly through the sampling channel 3 with a high resolution by the camera and to take images of a plurality of frames of the lubricant with a reduced height as much as possible. The power of the first micro pump 2 is adjusted to make the lubricating oil spread evenly on the sampling channel 3, the bottom of the sampling channel 3 needs to be kept white and clean, and the thickness of the flowing oil is controlled to be 0.5 mm-1 cm.
Referring to fig. 2, a flow chart of steps of a method for visually detecting impurities in a lubricating oil machine according to an embodiment of the present invention is shown, the method including the steps of:
and S001, collecting the lubricating oil image after the impurity filtering process to obtain a corresponding gray level image, acquiring a gray level histogram of the gray level image, and equalizing the gray level histogram to obtain an equilibrium histogram.
Specifically, a camera is used for shooting a plurality of lubricating oil images, the first lubricating oil image and the last lubricating oil image are removed, and the rest lubricating oil images are selected for processing. Since the characteristic calculation amount of a color image is exponentially increased relative to a gray image, and the basic factor for detecting mechanical impurities is to detect gradient information, a corresponding gray image is obtained by using a weighted average method for a lubricating oil image.
For the lubricating oil sample after the impurity filtering process is finished, large impurities do not exist, the lubricating oil sample is basically dust or tiny fragments, salt and the like, the image is easily interfered by noise of factory environment, equipment and the like in the acquisition process, particularly, the image in a dynamic state is shot, noise points not only blur the quality of the whole image, but also generate dead spots, the dead spots and the image of tiny impurities are difficult to distinguish through a computer, the influence on the detection result is great, and therefore, the image preprocessing is carried out on the gray level image, and the method comprises the following steps:
firstly, using traditional noise reduction method to make noise reduction pretreatment, then utilizing background difference method to obtain area presenting motion state, namely settingRepresents the firstThe pixel points in the frame gray scale image,is the firstAnd (3) carrying out subtraction on pixel points in the frame gray image to obtain pixel points in a motion state, wherein the pixel points are represented by:(ii) a Setting a threshold value T through the variance obtained by the gray values of all pixel points and the average gray value under the uniform and impurity-free state of the lubricating oil,the pixel points of (2) are pixel points in a motion state, and the rest parts are dead points;and detecting adjacent pixel points in eight adjacent directions of all the pixel points in the image, and if the pixel points are isolated points, determining that the pixel points are dead points and removing the dead points.
Further, a gray level histogram of the preprocessed gray level image is obtained, since the surface of the lubricating oil has light reflectivity, the corresponding gray level in the gray level histogram is shifted to the right, and the gray level of the lubricating oil is lower due to mechanical impurities, so that the highlight part of the image needs to be suppressed, referring to fig. 3, (a) is a gray level histogram, and (b) is an equilibrium histogram, wherein the abscissa of the gray level histogram and the equilibrium histogram is gray level I, and the ordinate is the number G of pixels corresponding to the gray level, and further the gray level histogram is equalized to obtain the corresponding equilibrium histogram.
Step S002, performing peak and valley detection on the equilibrium histogram to divide the equilibrium histogram into a first area, a second area and a third area according to the position of the highest peak point and the position of the adjacent valley point before the highest peak point, wherein the first area is the area before the position of the adjacent valley point, the second area is the area between the position of the highest peak point and the position of the adjacent valley point before the highest peak point, and the third area is the area after the position of the highest peak point; calculating a gray level interval mean value according to the corresponding maximum gray level and the minimum gray level in the second region, constructing a gray level interval change curve by using the difference between the gray level interval between the adjacent gray levels in the second region and the gray level interval mean value based on the gray level interval mean value, and constructing a gray level change curve according to the quantity difference between the quantity of pixel points corresponding to the adjacent gray levels in the second region; and confirming the optimal position of the adjacent trough point by combining the gray level interval change curve and the gray level change curve, and respectively obtaining the scaling and stretching proportion of the first area, the second area and the third area according to the gray level corresponding to the optimal position.
Specifically, although the gray levels of the impurities are all low-brightness, the gray levels are densely spaced, which means that the similarity is large, and a large gray difference should exist between the target detection object and most of the surrounding pixel points, so that the characteristics can be more obviously recognized by the computer. Because the color difference and the reflection difference of the impurities are different, the embodiment of the invention hopes not only to detect the impurities through the gray scale gradient, but also to distinguish the types of each impurity, so that the gray scales of the impurities should have obvious gray scale difference, and the equalization histogram is secondarily enhanced, which comprises the following steps:
performing peak and valley detection on the equilibrium histogram to obtain a highest peak point position and a previous adjacent valley position, and then dividing the equilibrium histogram into a first region, a second region and a third region by using the highest peak point position and the previous adjacent valley point position, wherein the first region is a region before the adjacent valley point position, the second region is a region between the highest peak point position and the previous adjacent valley point position, and the third region is a region after the highest peak point position, as shown in fig. 4, a schematic diagram of a division result of the equilibrium histogram is shown, in the diagram, a region a is the first region, a region B is the second region, and a region C is the third region.
Based on the divided equilibrium histogram, it can be known that the gray levels corresponding to the second region and the third region are gray levels of the main pixel points in the lubricant image, i.e. the lubricant pixel points, and therefore, the gray levels need to be slightly different and concise, in other words, the gray level interval between the position of the highest peak point and the position of the previous adjacent valley needs to be shortened, and the position of the highest peak point is made to be steeper; the pixel type of the first region is complex, part of the pixel type is impurities, part of the pixel type is edges of the sampling oil channel, and the like, so that the difference between different gray levels of the part is larger, different mechanical impurities are better protruded, namely, the gray level range of the first region is stretched, and the gray level interval is increased. Therefore, for the equilibrium histogram, only the positions of the adjacent wave troughs need to be adjusted, and the adjustment method is as follows: for detecting mechanical impurities, the more complicated gray level composition has the greater influence on the detection of the mechanical impurities, so that other main body regions such as lubricating oil and the like are more concise and better, and therefore, the gray level interval mean value is calculated according to the maximum gray level and the minimum gray level in the second region, and then the calculation formula of the gray level interval mean value is as follows:
wherein,is the mean value of the gray scale interval; n is the number of gray levels contained in the second region;the maximum gray level is the gray level of the highest peak point position;is the minimum gray level, i.e. the gray level of the position of the adjacent valley point.
Based on the mean value of the gray level interval, constructing a change curve of the gray level interval by using the difference between the gray level interval between adjacent gray levels in the second area and the mean value of the gray level interval: and respectively calculating gray intervals between adjacent gray levels, acquiring a difference absolute value between the gray intervals and a gray interval mean value, and constructing a gray level interval change curve of the second area by taking the adjacent gray levels as abscissa and the difference absolute value as ordinate.
Note that the gray scale interval change curve is used to reflect the arrangement relationship of the gray scales in the second region.
And similarly, respectively calculating the absolute value of the quantity difference between the numbers of the pixels corresponding to the adjacent gray levels in the second area, and constructing a gray level change curve by taking the absolute value of the quantity difference as a vertical coordinate and the adjacent gray levels as a horizontal coordinate.
Furthermore, the gray level interval change curve and the gray level change curve refer to a gray level interval characteristic and a gray level change characteristic between three adjacent gray levels, so when the slope of the line segment corresponding to the adjacent gray levels in the gray level interval change curve and the gray level change curve is increased sharply, it indicates that the gray level interval corresponding to the line segment is larger, and the gray level is in a fault, and also indicates that a larger contrast difference exists between the gray levels corresponding to the line segment, and the adjacent valley point position is contracted to the range thereof, so that the obtained contrast of the second region is the lowest without destroying the richness of the image, so that the second region corresponds to the whole monotonous sense in the lubricating oil image and still has an obvious gray level gradient, and the optimal position of the adjacent valley point position is obtained by combining the gray level interval change curve and the gray level change curve, the method specifically comprises the following steps: therefore, the slopes of the corresponding line segments in the gray scale interval change curve and the gray scale change curve between the adjacent three gray scales are weighted and summed to obtain slope evaluation values corresponding to the adjacent three gray scales, the weight corresponding to the gray scale interval change curve is greater than the weight corresponding to the gray scale change curve, so as to obtain a plurality of slope evaluation values, the adjacent three gray scales corresponding to the minimum slope evaluation values are obtained and used as target gray scales, and the position corresponding to the middle gray scale in the target gray scales is used as the optimal position of the adjacent valley point positions.
Further, setting the gray level corresponding to the optimal position as P, and respectively obtaining the scaling and stretching ratios of the first region, the second region and the third region according to the gray level P, that is, the stretching ratio of the first regionWhereinIs the minimum gray level in the first region; scaling of the second regionWhereinis the maximum gray level in the second region,is the minimum gray level in the second region; for the color of the lubricant oil and impurities, part of the metal salt impurities do appear to be higher than the grey level of the lubricant oil, but the third region should not have too bright a grey level, so that it is also necessary to shorten the grey level interval, and the scaling degree of the third region is only larger than that of the second region, so that the scaling ratio of the third region follows:。
and S003, acquiring a linear gray scale conversion formula of the corresponding region according to the scaling and stretching ratio to enhance the gray scale image, and detecting the type of the mechanical impurities in the lubricating oil for the enhanced gray scale image.
In particular, the gray level according to the position of the highest peak pointAnd the gray level of the position of the valley point adjacent to the formerAcquiring a gray scale range of the first regionA gray scale range of the second regionThe gray scale range of the third regionWhereinFor the maximum gray level in the gray image, respectively obtaining the linear gray level transformation formula of the corresponding region according to the gray level range of each region and the corresponding scaling and stretching ratio, where the linear gray level transformation formula of the first region is:whereinis the gray value before the stretching is performed,the gray value after stretching; the linear gray scale transformation formula of the second region is as follows:whereinIs a constant; the linear gray scale transformation formula of the third region isIn whichIs a constant.
And respectively utilizing the linear gray scale conversion formula corresponding to each region to carry out scaling and stretching on each gray scale value in the gray scale image so as to obtain an enhanced gray scale image. And (3) selecting an OTSU threshold method to perform threshold segmentation on the enhanced gray level image, marking the pixel points smaller than the threshold as 1, and marking the pixel points larger than the threshold as 0 to obtain a binary image, wherein white points in the binary image are mechanical impurities, so that the pixel points corresponding to the mechanical impurities are used as marking pixel points, the speed of the marking pixel points in adjacent frames is calculated, and the type of the mechanical impurities is determined according to the speed.
It should be noted that the sand flow rate is slow and the dust flow rate is fast in the mechanical impurities.
In summary, an embodiment of the present invention provides a visual inspection method for mechanical impurities in lubricating oil, which collects a lubricating oil image to obtain a gray level histogram of the gray level image, performs region division on the gray level histogram of the lubricating oil image based on detected peaks and troughs, obtains a target gray level of the region division according to a gray level interval and a gray level change between adjacent divided gray levels, obtains a scaling and stretching ratio of each divided region by using the target gray level, obtains a multi-segment linear transformation formula of the gray level image by using the scaling and stretching ratio, so as to enhance the gray level image without destroying richness of the image, and can accurately detect types of the mechanical impurities by using the enhanced gray level image, thereby reducing detection errors.
Based on the same inventive concept as the method, the embodiment of the present invention further provides a visual inspection device for mechanical impurities in lubricating oil, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the visual inspection methods for mechanical impurities in lubricating oil when executing the computer program.
It should be noted that: the sequence of the above embodiments of the present invention is only for description, and does not represent the advantages or disadvantages of the embodiments. And that specific embodiments have been described above. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (4)
1. A visual inspection method for impurities in lubricating oil machinery is characterized by comprising the following steps:
collecting a lubricating oil image after the impurity filtering process to obtain a corresponding gray image, obtaining a gray histogram of the gray image, and equalizing the gray histogram to obtain an equalized histogram;
performing peak and valley detection on the equilibrium histogram to divide the equilibrium histogram into a first region, a second region and a third region according to the position of the highest peak point and the position of the adjacent valley point before the highest peak point, wherein the first region is the region before the position of the adjacent valley point, the second region is the region between the position of the highest peak point and the position of the adjacent valley point before the highest peak point, and the third region is the region after the position of the highest peak point; calculating a gray level interval mean value according to the corresponding maximum gray level and the minimum gray level in the second region, constructing a gray level interval change curve by using the gray level interval between the adjacent gray levels in the second region and the difference between the gray level interval mean values based on the gray level interval mean value, and constructing a gray level change curve according to the quantity difference between the quantity of pixel points corresponding to the adjacent gray levels in the second region; confirming the optimal position of the adjacent trough point by combining the gray level interval change curve and the gray level change curve, and respectively obtaining the scaling and stretching proportions of the first area, the second area and the third area according to the gray level corresponding to the optimal position;
acquiring a linear gray scale conversion formula of a corresponding region according to the scaling and stretching proportion to enhance the gray scale image, and detecting the type of mechanical impurities in lubricating oil on the enhanced gray scale image;
the method for confirming the optimal position of the adjacent wave trough point position by combining the gray level interval change curve and the gray level change curve comprises the following steps:
weighting and summing the slopes of corresponding line segments between the three adjacent gray levels in a gray level interval change curve and a gray level change curve respectively to obtain slope evaluation values corresponding to the three adjacent gray levels, wherein the weight corresponding to the gray level interval change curve is greater than the weight corresponding to the gray level change curve, so that a plurality of slope evaluation values are obtained, the three adjacent gray levels corresponding to the minimum slope evaluation values are obtained to serve as target gray levels, and the position corresponding to the middle gray level in the target gray levels is taken as the optimal position of the adjacent valley point;
the method for respectively obtaining the scaling and stretching ratios of the first region, the second region and the third region according to the gray level corresponding to the optimal position comprises the following steps:
setting the gray level corresponding to the optimal position as P, the stretching ratio of the first regionWhereinis the stretch ratio of the first region,is the minimum gray level in the first region; scaling of the second regionWhereinis a scaling of the second area and,is the maximum gray level in the second region,is the minimum gray level in the second region; the scaling of the third region follows:in whichIs the scaling of the third region;
the method for acquiring the linear gray scale transformation formula of the corresponding region according to the scaling and stretching proportion comprises the following steps:
acquiring a gray level range of a first area, a gray level range of a second area and a gray level range of a third area according to the gray level of the highest peak point position and the gray level of the position of the immediately preceding adjacent valley point;
respectively obtaining a linear gray scale conversion formula of the corresponding region according to the gray scale range of each region and the corresponding scaling and stretching ratio, wherein the linear gray scale conversion formula of the first region is as follows:whereinis the gray value before the stretching is performed,is the gray value after the stretching process,is the stretch ratio of the first region; the linear gray scale transformation formula of the second region is as follows:whereinIs a constant number of times, and is,is the gray level of the position of the adjacent valley point,is the scaling of the second region; the linear gray scale transformation formula of the third region is as follows:whereinIs a constant number of times, and is,is a scaling of the third area and,the gray level of the highest peak point position.
2. The visual inspection method for impurities in lubricating oil machinery according to claim 1, wherein the method for obtaining the interval variation curve between gray levels comprises:
and respectively calculating gray intervals between adjacent gray levels, acquiring a difference absolute value between the gray intervals and a gray interval mean value, and constructing a gray level interval change curve of the second area by taking the adjacent gray levels as abscissa and the difference absolute value as ordinate.
3. The visual inspection method for impurities in lubricating oil machinery as claimed in claim 1, wherein the method for obtaining the gray scale variation curve comprises:
and respectively calculating the absolute value of the quantity difference between the numbers of the pixels corresponding to the adjacent gray levels in the second area, and constructing a gray level change curve by taking the absolute value of the quantity difference as a vertical coordinate and the adjacent gray levels as a horizontal coordinate.
4. Visual inspection device for impurities in lubricating oil machinery, comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210534865.0A CN114638827B (en) | 2022-05-18 | 2022-05-18 | Visual detection method and device for impurities of lubricating oil machinery |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210534865.0A CN114638827B (en) | 2022-05-18 | 2022-05-18 | Visual detection method and device for impurities of lubricating oil machinery |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114638827A CN114638827A (en) | 2022-06-17 |
CN114638827B true CN114638827B (en) | 2022-08-05 |
Family
ID=81953377
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210534865.0A Active CN114638827B (en) | 2022-05-18 | 2022-05-18 | Visual detection method and device for impurities of lubricating oil machinery |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114638827B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114998313B (en) * | 2022-07-18 | 2022-10-21 | 山东海鑫达石油机械有限公司 | Fluid conveying pipe orifice burr identification and positioning method based on visual positioning |
CN115115621B (en) * | 2022-08-24 | 2022-11-11 | 聊城市泓润能源科技有限公司 | Lubricating oil pollution degree detection method based on image processing |
CN115100212B (en) * | 2022-08-29 | 2022-11-18 | 卡松科技股份有限公司 | Method for detecting pollution degree of lubricating oil |
CN115205165B (en) * | 2022-09-16 | 2022-12-09 | 山东联博新材料科技有限公司 | Spraying method of anticorrosive material for industrial machine housing |
CN116363129B (en) * | 2023-05-31 | 2023-08-22 | 山东辰欣佛都药业股份有限公司 | Intelligent lamp inspection system for eye drop production |
CN116952785B (en) * | 2023-09-20 | 2023-12-12 | 深圳市华加生物科技有限公司 | Electronic tobacco tar deterioration detection method based on image data |
CN117115494B (en) * | 2023-10-23 | 2024-02-06 | 卡松科技股份有限公司 | Lubricating oil impurity pollution detection method and device based on artificial intelligence |
CN117788464B (en) * | 2024-02-26 | 2024-04-30 | 卡松科技股份有限公司 | Industrial gear oil impurity visual detection method |
CN118096849A (en) * | 2024-04-26 | 2024-05-28 | 卡松科技股份有限公司 | Visual-assisted green environment-friendly lubricating oil quality detection method |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7840066B1 (en) * | 2005-11-15 | 2010-11-23 | University Of Tennessee Research Foundation | Method of enhancing a digital image by gray-level grouping |
US20100278423A1 (en) * | 2009-04-30 | 2010-11-04 | Yuji Itoh | Methods and systems for contrast enhancement |
CN101742084B (en) * | 2010-01-29 | 2012-05-30 | 昆山锐芯微电子有限公司 | Contrast ratio enhancement processing method and processing device |
CN108062508B (en) * | 2017-10-13 | 2019-06-04 | 西安科技大学 | The extracting method of equipment in substation's complex background infrared image |
CN108805829B (en) * | 2018-05-25 | 2021-01-01 | 浙江科澜信息技术有限公司 | Image data processing method, device, equipment and computer readable storage medium |
CN108961251A (en) * | 2018-07-24 | 2018-12-07 | 武汉纺织大学 | A kind of raw cotton fault and defects inspecting and recognition methods and system |
CN109460754B (en) * | 2019-01-31 | 2019-05-14 | 深兰人工智能芯片研究院(江苏)有限公司 | A kind of water surface foreign matter detecting method, device, equipment and storage medium |
CN110838091B (en) * | 2019-10-25 | 2022-06-17 | 北京中电慧视科技有限公司 | Fully self-adaptive infrared image contrast enhancement method and system |
CN113034452B (en) * | 2021-03-15 | 2022-09-27 | 南京理工大学 | Weldment contour detection method |
CN113516627A (en) * | 2021-05-11 | 2021-10-19 | 南京理工大学 | Device and method for detecting foreign matters in wine bottle |
CN114240807B (en) * | 2022-02-28 | 2022-05-17 | 山东慧丰花生食品股份有限公司 | Peanut aflatoxin detection method and system based on machine vision |
CN114494256B (en) * | 2022-04-14 | 2022-06-14 | 武汉金龙电线电缆有限公司 | Electric wire production defect detection method based on image processing |
-
2022
- 2022-05-18 CN CN202210534865.0A patent/CN114638827B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114638827A (en) | 2022-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114638827B (en) | Visual detection method and device for impurities of lubricating oil machinery | |
CN114937055B (en) | Image self-adaptive segmentation method and system based on artificial intelligence | |
CN111814711A (en) | Image feature fast matching method and system applied to mine machine vision | |
CN116703898B (en) | Quality detection method for end face of precision mechanical bearing | |
CN111598869B (en) | Method, equipment and storage medium for detecting Mura of display screen | |
CN112581434A (en) | Image identification method for product defect detection | |
CN110992288B (en) | Video image blind denoising method used in mine shaft environment | |
CN111723634B (en) | Image detection method and device, electronic equipment and storage medium | |
CN116452598A (en) | Axle production quality rapid detection method and system based on computer vision | |
CN115496692A (en) | Lubricating oil abrasive particle image enhancement method | |
CN111968095A (en) | Product surface defect detection method, system, device and medium | |
CN113469921B (en) | Image defect repairing method, system, computer device and storage medium | |
CN111753693B (en) | Target detection method under static scene | |
CN111046862A (en) | Character segmentation method and device and computer readable storage medium | |
CN116883408B (en) | Integrating instrument shell defect detection method based on artificial intelligence | |
CN107993219A (en) | A kind of deck of boat detection method of surface flaw based on machine vision | |
CN114612345A (en) | Light source detection method based on image processing | |
CN109543686A (en) | Character recognition based on adaptive multi-thresholding pre-processes binarization method | |
CN113899349B (en) | Sea wave parameter detection method, equipment and storage medium | |
CN101937562A (en) | Construction method for gray-level information content histogram | |
CN112686896B (en) | Glass defect detection method based on frequency domain and space combination of segmentation network | |
CN110186929A (en) | A kind of real-time product defect localization method | |
CN117132487A (en) | Microscope image processing method | |
CN116486273A (en) | Method for extracting water body information of small sample remote sensing image | |
CN100371944C (en) | Greyscale image partition method based on light distribution character of reflection or penetrance |
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 |