CN114638827A - 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 PDF

Info

Publication number
CN114638827A
CN114638827A CN202210534865.0A CN202210534865A CN114638827A CN 114638827 A CN114638827 A CN 114638827A CN 202210534865 A CN202210534865 A CN 202210534865A CN 114638827 A CN114638827 A CN 114638827A
Authority
CN
China
Prior art keywords
gray
region
gray level
adjacent
lubricating oil
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210534865.0A
Other languages
Chinese (zh)
Other versions
CN114638827B (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.)
Kasong Science And Technology Co ltd
Original Assignee
Kasong Science And Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kasong Science And Technology Co ltd filed Critical Kasong Science And Technology Co ltd
Priority to CN202210534865.0A priority Critical patent/CN114638827B/en
Publication of CN114638827A publication Critical patent/CN114638827A/en
Application granted granted Critical
Publication of CN114638827B publication Critical patent/CN114638827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding

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

Visual detection method and device for impurities of lubricating oil machinery
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 the abrasion of the machine itself, but are mostly of the sand and carbon type, as well as some organic metal salts brought by the additives which are poorly soluble in the solvent. Since the mechanical impurities destroy the oil film of the lubricating oil, increase wear, block the oil filter, 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 mean value of gray intervals according to the corresponding maximum gray level and the minimum gray level in the second region, constructing a change curve of gray level intervals by using the gray intervals between the adjacent gray levels in the second region and the difference between the mean values of gray intervals based on the mean value of gray intervals, and constructing a change curve of gray levels 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 the gray scale interval between adjacent gray scale levels, acquiring the absolute value of the difference between the gray scale interval and the mean value of the gray scale interval, and constructing a gray scale interval change curve of the second area by taking the adjacent gray scale levels as the abscissa and taking the absolute value of the difference to the ordinate.
Further, the method for obtaining the gray level variation curve includes:
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 quantity absolute value 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 a gray level interval change curve and a gray level change curve between 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 used 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 region
Figure DEST_PATH_IMAGE002
Wherein, in the step (A),
Figure DEST_PATH_IMAGE004
is the stretch ratio of the first region,
Figure DEST_PATH_IMAGE006
is the minimum gray level in the first region; scaling of the second region
Figure DEST_PATH_IMAGE008
Wherein, in the step (A),
Figure DEST_PATH_IMAGE010
is a scaling of the second area and,
Figure DEST_PATH_IMAGE012
is the maximum gray level in the second region,
Figure DEST_PATH_IMAGE014
is the minimum gray level in the second region; the scaling of the third region follows:
Figure DEST_PATH_IMAGE016
wherein
Figure DEST_PATH_IMAGE018
Is 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 threshold value 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:
Figure DEST_PATH_IMAGE020
wherein, in the process,
Figure DEST_PATH_IMAGE022
is the gray value before the stretching is performed,
Figure DEST_PATH_IMAGE024
is the gray value after the stretching process,
Figure 718258DEST_PATH_IMAGE004
is the stretch ratio of the first region; the linear gray scale transformation formula of the second region is as follows:
Figure DEST_PATH_IMAGE026
wherein
Figure DEST_PATH_IMAGE028
Is a constant number of times, and is,
Figure DEST_PATH_IMAGE030
is the gray level of the position of the adjacent valley point,
Figure 87928DEST_PATH_IMAGE010
is a scaling of the second region; the linear gray scale transformation formula of the third region is as follows:
Figure DEST_PATH_IMAGE032
wherein
Figure DEST_PATH_IMAGE034
Is a constant number of times, and is,
Figure 398824DEST_PATH_IMAGE018
is a scaling of the third area and,
Figure DEST_PATH_IMAGE036
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 level histogram and an equilibrium histogram provided in an embodiment of the present invention, in which (a) is the gray level 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 the color image is exponentially increased relative to the 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 the 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 setting
Figure DEST_PATH_IMAGE038
Represents the first
Figure DEST_PATH_IMAGE040
The pixel points in the frame gray scale image,
Figure DEST_PATH_IMAGE042
is the first
Figure DEST_PATH_IMAGE044
The pixel points in the frame gray level image are subtracted from the two adjacent frame gray level images to obtain the pixel points in the motion state
Figure DEST_PATH_IMAGE046
Represents:
Figure DEST_PATH_IMAGE048
(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,
Figure DEST_PATH_IMAGE050
the pixel points of (1) are pixel points in a motion state, and the rest parts are dead points;
Figure 562344DEST_PATH_IMAGE050
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, so the equalization histogram is secondarily enhanced, and the process is as follows:
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:
Figure DEST_PATH_IMAGE052
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE054
is the mean value of the gray scale interval; n is ash contained in the second regionThe number of the degree;
Figure DEST_PATH_IMAGE056
the maximum gray level is the gray level of the highest peak point position;
Figure DEST_PATH_IMAGE058
is the minimum gray level, i.e. the gray level of the adjacent valley position.
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 the gray scale interval between adjacent gray scale levels, acquiring the absolute value of the difference between the gray scale interval and the mean value of the gray scale interval, and constructing a gray scale interval change curve of the second area by taking the adjacent gray scale levels as the abscissa and taking the absolute value of the difference to the 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 region, and constructing a gray level change curve by taking the quantity absolute value 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 region
Figure 563667DEST_PATH_IMAGE002
Wherein
Figure 245184DEST_PATH_IMAGE006
Is the minimum gray level in the first region; scaling of the second region
Figure 981059DEST_PATH_IMAGE008
Wherein, in the step (A),
Figure 22702DEST_PATH_IMAGE012
is the maximum gray level in the second region,
Figure 488318DEST_PATH_IMAGE014
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 gray level of the lubricant oil, but the third region should not have excessively bright gray levels, so that the gray level pitch also needs to be shortened, 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:
Figure 950523DEST_PATH_IMAGE016
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, according to the gray level of the position of the highest peak point
Figure 49061DEST_PATH_IMAGE036
And the gray level of the position of the wave trough point adjacent to the former one
Figure 848389DEST_PATH_IMAGE030
Obtaining a gray level threshold for a first region
Figure DEST_PATH_IMAGE060
A gray scale range of the second region
Figure DEST_PATH_IMAGE062
Third region of the gray scale range
Figure DEST_PATH_IMAGE064
In which
Figure DEST_PATH_IMAGE066
For 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:
Figure 474237DEST_PATH_IMAGE020
wherein, in the step (A),
Figure 248289DEST_PATH_IMAGE022
is a gray value before the stretching is performed,
Figure 286653DEST_PATH_IMAGE024
is the gray value after stretching; the linear gray scale transformation formula of the second region is as follows:
Figure 30618DEST_PATH_IMAGE026
in which
Figure 516832DEST_PATH_IMAGE028
Is a constant; the linear gray scale transformation formula of the third region is
Figure 320840DEST_PATH_IMAGE032
Wherein
Figure 643236DEST_PATH_IMAGE034
Is 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.
All 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 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 (7)

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 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.
2. The visual inspection method for impurities in lubricating oil machinery according to claim 1, characterized in that the method for acquiring the interval variation curve between the gray levels comprises the following steps:
and respectively calculating the gray scale interval between adjacent gray scale levels, acquiring the absolute value of the difference between the gray scale interval and the mean value of the gray scale interval, and constructing a gray scale interval change curve of the second area by taking the adjacent gray scale levels as the abscissa and taking the absolute value of the difference to the 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 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 absolute value difference as a vertical coordinate and the adjacent gray levels as a horizontal coordinate.
4. The method of claim 1, wherein said method of determining the optimal location of said adjacent valley point locations in combination with said gray scale interval variation curve and said gray scale variation curve comprises:
weighting and summing the slopes of corresponding line segments in a gray level interval change curve and a gray level change curve between 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 used as the optimal position of the adjacent valley point.
5. The visual inspection method for impurities in lubricating oil machinery according to claim 1, wherein the method for obtaining the scaling and stretching ratios of the first region, the second region and the third region respectively according to the gray levels corresponding to the optimal positions comprises:
setting the gray level corresponding to the optimal position as P, the stretching ratio of the first region
Figure 129186DEST_PATH_IMAGE001
Wherein, in the step (A),
Figure 955059DEST_PATH_IMAGE002
is the stretch ratio of the first region,
Figure 569449DEST_PATH_IMAGE003
is the minimum gray level in the first region; scaling of the second region
Figure 723350DEST_PATH_IMAGE004
Wherein, in the process,
Figure 199331DEST_PATH_IMAGE005
is a scaling of the second area and,
Figure 20656DEST_PATH_IMAGE006
is the maximum gray level in the second region,
Figure 307412DEST_PATH_IMAGE007
is the minimum gray level in the second region; the scaling of the third region follows:
Figure 214188DEST_PATH_IMAGE008
wherein
Figure 228281DEST_PATH_IMAGE009
Is a scaling of the third area.
6. The visual inspection method for impurities in lubricating oil machinery according to claim 1, wherein the method for obtaining the linear gray scale transformation formula of the corresponding region according to the scaling and stretching ratio comprises:
acquiring a gray level threshold value 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:
Figure 169692DEST_PATH_IMAGE010
wherein, in the step (A),
Figure 120025DEST_PATH_IMAGE011
is the gray value before the stretching is performed,
Figure 514097DEST_PATH_IMAGE012
is a gray value after the stretching is performed,
Figure 331881DEST_PATH_IMAGE002
is the stretch ratio of the first region; linear gray scale of the second regionThe transformation formula is as follows:
Figure 862219DEST_PATH_IMAGE013
wherein
Figure 490778DEST_PATH_IMAGE014
Is a constant number of times, and is,
Figure 231201DEST_PATH_IMAGE015
is the gray level of the position of the adjacent valley point,
Figure 728041DEST_PATH_IMAGE005
is the scaling of the second region; the linear gray scale transformation formula of the third region is as follows:
Figure 752366DEST_PATH_IMAGE016
wherein
Figure 410881DEST_PATH_IMAGE017
Is a constant number of times, and is,
Figure 45125DEST_PATH_IMAGE009
is a scaling of the third area and,
Figure 939131DEST_PATH_IMAGE018
the gray level of the position of the highest peak point.
7. 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 6 when executing the computer program.
CN202210534865.0A 2022-05-18 2022-05-18 Visual detection method and device for impurities of lubricating oil machinery Active CN114638827B (en)

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 true CN114638827A (en) 2022-06-17
CN114638827B 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114998313A (en) * 2022-07-18 2022-09-02 山东海鑫达石油机械有限公司 Fluid conveying pipe orifice burr identification and positioning method based on visual positioning
CN115100212A (en) * 2022-08-29 2022-09-23 卡松科技股份有限公司 Method for detecting pollution degree of lubricating oil
CN115115621A (en) * 2022-08-24 2022-09-27 聊城市泓润能源科技有限公司 Lubricating oil pollution degree detection method based on image processing
CN115205165A (en) * 2022-09-16 2022-10-18 山东联博新材料科技有限公司 Spraying method of anticorrosive material for industrial machine housing
CN116363129A (en) * 2023-05-31 2023-06-30 山东辰欣佛都药业股份有限公司 Intelligent lamp inspection system for eye drop production
CN116952785A (en) * 2023-09-20 2023-10-27 深圳市华加生物科技有限公司 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
CN117788464A (en) * 2024-02-26 2024-03-29 卡松科技股份有限公司 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

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101742084A (en) * 2010-01-29 2010-06-16 昆山锐芯微电子有限公司 Contrast ratio enhancement processing method and processing device
US20100278423A1 (en) * 2009-04-30 2010-11-04 Yuji Itoh Methods and systems for contrast enhancement
US7840066B1 (en) * 2005-11-15 2010-11-23 University Of Tennessee Research Foundation Method of enhancing a digital image by gray-level grouping
CN108062508A (en) * 2017-10-13 2018-05-22 西安科技大学 The extracting method of equipment in substation's complex background infrared image
CN108805829A (en) * 2018-05-25 2018-11-13 浙江科澜信息技术有限公司 Video 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
CN109460754A (en) * 2019-01-31 2019-03-12 深兰人工智能芯片研究院(江苏)有限公司 A kind of water surface foreign matter detecting method, device, equipment and storage medium
CN110838091A (en) * 2019-10-25 2020-02-25 北京中电慧视科技有限公司 Fully self-adaptive infrared image contrast enhancement method and system
CN113034452A (en) * 2021-03-15 2021-06-25 南京理工大学 Weldment contour detection method
CN113516627A (en) * 2021-05-11 2021-10-19 南京理工大学 Device and method for detecting foreign matters in wine bottle
CN114240807A (en) * 2022-02-28 2022-03-25 山东慧丰花生食品股份有限公司 Peanut aflatoxin detection method and system based on machine vision
CN114494256A (en) * 2022-04-14 2022-05-13 武汉金龙电线电缆有限公司 Electric wire production defect detection method based on image processing

Patent Citations (12)

* Cited by examiner, † Cited by third party
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
CN101742084A (en) * 2010-01-29 2010-06-16 昆山锐芯微电子有限公司 Contrast ratio enhancement processing method and processing device
CN108062508A (en) * 2017-10-13 2018-05-22 西安科技大学 The extracting method of equipment in substation's complex background infrared image
CN108805829A (en) * 2018-05-25 2018-11-13 浙江科澜信息技术有限公司 Video 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
CN109460754A (en) * 2019-01-31 2019-03-12 深兰人工智能芯片研究院(江苏)有限公司 A kind of water surface foreign matter detecting method, device, equipment and storage medium
CN110838091A (en) * 2019-10-25 2020-02-25 北京中电慧视科技有限公司 Fully self-adaptive infrared image contrast enhancement method and system
CN113034452A (en) * 2021-03-15 2021-06-25 南京理工大学 Weldment contour detection method
CN113516627A (en) * 2021-05-11 2021-10-19 南京理工大学 Device and method for detecting foreign matters in wine bottle
CN114240807A (en) * 2022-02-28 2022-03-25 山东慧丰花生食品股份有限公司 Peanut aflatoxin detection method and system based on machine vision
CN114494256A (en) * 2022-04-14 2022-05-13 武汉金龙电线电缆有限公司 Electric wire production defect detection method based on image processing

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
JINLE ZHAI等: ""Detection of impurity within grain samples by image analysis"", 《2021 7TH INTERNATIONAL SYMPOSIUM ON SYSTEM AND SOFTWARE RELIABILITY (ISSSR)》 *
XIAOMIAN LI等: ""Research on glass surface quality inspection based on machine vision"", 《AUSTRALIAN JOURNAL OF MECHANICAL ENGINEERING》 *
李刚: ""基于机器视觉的白酒液体杂质检测系统研究"", 《中国优秀硕士学位论文全文数据库 工程科技II辑》 *
杨嘉能: ""基于直方图均衡的图像增强算法优化研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
洪媛媛等: ""检测润滑油中机械杂质方法研究"", 《数字化用户》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114998313A (en) * 2022-07-18 2022-09-02 山东海鑫达石油机械有限公司 Fluid conveying pipe orifice burr identification and positioning method based on visual positioning
CN115115621A (en) * 2022-08-24 2022-09-27 聊城市泓润能源科技有限公司 Lubricating oil pollution degree detection method based on image processing
CN115115621B (en) * 2022-08-24 2022-11-11 聊城市泓润能源科技有限公司 Lubricating oil pollution degree detection method based on image processing
CN115100212A (en) * 2022-08-29 2022-09-23 卡松科技股份有限公司 Method for detecting pollution degree of lubricating oil
CN115100212B (en) * 2022-08-29 2022-11-18 卡松科技股份有限公司 Method for detecting pollution degree of lubricating oil
CN115205165A (en) * 2022-09-16 2022-10-18 山东联博新材料科技有限公司 Spraying method of anticorrosive material for industrial machine housing
CN116363129A (en) * 2023-05-31 2023-06-30 山东辰欣佛都药业股份有限公司 Intelligent lamp inspection system for eye drop production
CN116363129B (en) * 2023-05-31 2023-08-22 山东辰欣佛都药业股份有限公司 Intelligent lamp inspection system for eye drop production
CN116952785A (en) * 2023-09-20 2023-10-27 深圳市华加生物科技有限公司 Electronic tobacco tar deterioration detection method based on image data
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
CN117788464A (en) * 2024-02-26 2024-03-29 卡松科技股份有限公司 Industrial gear oil impurity visual detection method
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

Also Published As

Publication number Publication date
CN114638827B (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN114638827B (en) Visual detection method and device for impurities of lubricating oil machinery
CN114627117B (en) Knitted fabric defect detection method and system based on projection method
CN115496692B (en) Lubricating oil abrasive particle image enhancement method
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
CN111476758B (en) Defect detection method and device for AMOLED display screen, computer equipment and storage medium
CN111753693B (en) Target detection method under static scene
CN111723634B (en) Image detection method and device, electronic equipment and storage medium
CN113327206B (en) Image fuzzy processing method of intelligent power transmission line inspection system based on artificial intelligence
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN111046862A (en) Character segmentation method and device and computer readable storage medium
CN109543686A (en) Character recognition based on adaptive multi-thresholding pre-processes binarization method
CN115311289A (en) Method for detecting oil stain defects of plain-color cloth
CN113899349B (en) Sea wave parameter detection method, equipment and storage medium
CN101937562A (en) Construction method for gray-level information content histogram
CN113673396A (en) Spore germination rate calculation method and device and storage medium
CN117132487A (en) Microscope image processing method
CN100371944C (en) Greyscale image partition method based on light distribution character of reflection or penetrance
CN114581433A (en) Method and system for obtaining metal ball cavity inner surface appearance detection image
CN110838101B (en) Image segmentation quality evaluation method based on edge characteristics
CN113284158A (en) Image edge extraction method and system based on structural constraint clustering
CN114638833B (en) Non-ferrous metal calendering quality detection method and system based on machine vision
CN116228769B (en) Device and method suitable for flaw detection of steel wire braided tube
CN117974666B (en) Quality anomaly detection method for non-circular planetary gear

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