CN117876360A - Intelligent detection method for lubricating oil quality based on image processing - Google Patents

Intelligent detection method for lubricating oil quality based on image processing Download PDF

Info

Publication number
CN117876360A
CN117876360A CN202410263664.0A CN202410263664A CN117876360A CN 117876360 A CN117876360 A CN 117876360A CN 202410263664 A CN202410263664 A CN 202410263664A CN 117876360 A CN117876360 A CN 117876360A
Authority
CN
China
Prior art keywords
detected
region
lubricating oil
bubble
degree
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
CN202410263664.0A
Other languages
Chinese (zh)
Other versions
CN117876360B (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 CN202410263664.0A priority Critical patent/CN117876360B/en
Priority claimed from CN202410263664.0A external-priority patent/CN117876360B/en
Publication of CN117876360A publication Critical patent/CN117876360A/en
Application granted granted Critical
Publication of CN117876360B publication Critical patent/CN117876360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of lubricating oil image bubble detection, in particular to an intelligent detection method for lubricating oil quality based on image processing. The method comprises the steps of obtaining a lubricating oil image; obtaining a region to be detected, and obtaining the bubble expression degree of the region to be detected by using the gray level confusion degree of the region to be detected and the gradient change direction of the edge pixel points; obtaining the light reflection degree of each region to be detected according to the position distribution of each region to be detected and each other region to be detected in the lubricating oil image and the gray scale characteristics and gradient distribution in each region to be detected, and further obtaining the self-adaptive smoothing coefficient; and detecting bubble defects in the lubricating oil image by using the adaptive smoothing coefficient. According to the invention, the situation that the bubble defect is not detected due to the light is avoided, and the image local information is adjusted through the self-adaptive smoothing coefficient, so that more details of the image can be reserved, and further the bubble region can be accurately segmented and detected.

Description

Intelligent detection method for lubricating oil quality based on image processing
Technical Field
The invention relates to the technical field of lubricating oil image bubble detection, in particular to an intelligent detection method for lubricating oil quality based on image processing.
Background
During stirring, pumping or handling of the oil tank, the lubricating oil is subjected to mechanical action and shearing force, so that air is brought into the oil, and bubbles are formed. And the existence of bubbles occupies the contact area between part of friction pair surfaces, so that the stability and thickness of a lubricating oil film can be reduced, and the lubricating effect of lubricating oil is reduced. In practice, therefore, an image of the lubricating oil is often acquired, and bubbles in the image of the lubricating oil are detected.
When the lubricating oil image is collected, as the oil surface is in a flat condition, part of light rays are reflected when the light rays irradiate on the lubricating oil surface from different angles, and the reflected light rays are gathered together to form a light reflecting area. The presence of the light-reflecting regions may cause a large variation in gray-scale contrast between partial regions in the lubricating oil image, so that the boundaries of the bubble regions become blurred or discontinuous, and thus the bubble regions in the lubricating oil image cannot be accurately segmented and detected.
Disclosure of Invention
In order to solve the technical problem that the boundary of a bubble area becomes fuzzy or discontinuous due to the fact that the gray contrast between partial areas of a lubricating oil image is greatly changed due to the influence of illumination, so that the bubble area in the lubricating oil image cannot be accurately segmented and detected, the invention aims to provide an intelligent detection method for the lubricating oil quality based on image processing, which adopts the following technical scheme:
an intelligent detection method of lubricating oil quality based on image processing, the method comprising:
acquiring a lubricating oil image;
uniformly dividing the lubricating oil image to obtain all areas to be detected of the lubricating oil image; obtaining the bubble expression degree of each region to be detected according to the gray level confusion degree of each region to be detected and the gradient change characteristics of the edge pixel points in each region to be detected;
obtaining a reference value coefficient of gray scale characteristics of each other region to be detected according to the position distribution and the bubble expression degree of each region to be detected and each other region to be detected; obtaining the reference gray scale characteristics of each other region to be detected according to the gray scale characteristics of each other region to be detected and the reference value coefficient; obtaining the regional gray scale credibility of each region to be detected according to the gray scale characteristics of each region to be detected and the reference gray scale characteristics of each other region to be detected; obtaining the light reflection degree of each region to be detected according to the gray level distribution characteristics, the edge discrete degree and the region gray level credibility of each region to be detected;
correcting a preset smoothing coefficient of each region to be detected by using the bubble expression degree and the light reflection degree of each region to be detected to obtain a self-adaptive smoothing coefficient;
and detecting bubble defects in the lubricating oil image according to the self-adaptive smoothing coefficient.
Further, the method for acquiring the gray level confusion degree comprises the following steps:
and in each to-be-detected area, accumulating and summing the difference between the gray value of each pixel point and the gray value mean value in the to-be-detected area to obtain the gray confusion degree in each to-be-detected area.
Further, the gradient change characteristic acquisition method comprises the following steps:
acquiring all edge pixel points in each region to be detected and gradient change directions of each edge pixel point; taking an included angle between the gradient change direction of each edge pixel point and the same horizontal direction as a gradient reference included angle of each edge pixel point;
and accumulating and summing the number of each gradient reference included angle to obtain gradient change characteristics of all edge pixel points in each region to be detected.
Further, the method for obtaining the bubble expression level comprises the following steps:
carrying out negative correlation mapping and normalization processing on gradient change characteristics of all edge pixel points in each region to be detected to obtain gradient change coefficients;
and taking the product of the gradient change coefficient and the gray level confusion degree in each area to be detected as the bubble expression degree in each area to be detected.
Further, the method for obtaining the reference value coefficient comprises the following steps:
taking any one of the areas to be detected as a target area;
calculating the position distance between the target area and each other area to be detected;
and carrying out negative correlation mapping normalization processing on the product of the position distance between the target region and each other region to be detected and the difference of the bubble expression degree, and obtaining the reference value coefficient of the gray scale characteristic of each other region to be detected.
Further, the method for acquiring the reference gray scale features comprises the following steps:
and taking the product of the gray value mean value of each other to-be-detected area of the target area and the reference value coefficient as the reference gray characteristic of each other to-be-detected area in the lubricating oil image.
Further, the method for acquiring the regional gray scale reliability comprises the following steps:
accumulating and summing the difference between the gray value mean value in the target area and the reference gray features in each other to-be-detected area to obtain the area gray reliability of the target area;
traversing each target area to obtain the regional gray scale credibility of all the areas to be detected.
Further, the method for obtaining the light reflection degree comprises the following steps:
carrying out negative correlation mapping on the connecting line between every two adjacent edge pixel points in each region to be detected and the variance of the included angle degree in the same horizontal direction to obtain the edge discrete degree of each region to be detected;
and taking the product of the gray value mean value in each region to be detected, the edge discrete degree and the region gray reliability as the light reflection degree of each region to be detected.
Further, the method for obtaining the adaptive smoothing coefficient comprises the following steps:
carrying out negative correlation mapping and normalization processing on products between the bubble expression degree and the light reflection degree of each region to be detected to obtain a smooth scale of each region to be detected;
presetting initial smoothing coefficients of all areas to be detected of the lubricating oil image; and taking the product of the initial smoothing coefficient and the smoothing scale of each region to be detected as an adaptive smoothing coefficient of each region to be detected.
Further, detecting the bubble defect in the lubricating oil image according to the adaptive smoothing coefficient includes:
image segmentation is carried out on each region to be detected in the lubricating oil image through a Markov random field algorithm by utilizing the self-adaptive smoothing coefficient, and an image segmentation result of a bubble region and a non-bubble region in the lubricating oil image is obtained;
and carrying out post-processing on the image segmentation result to obtain a bubble region detection result.
The invention has the following beneficial effects:
the method comprises the steps of obtaining a lubricating oil image; since the bubble area may not be uniform in the lubricating oil image, the lubricating oil image is uniformly divided, and all areas to be detected of the lubricating oil image are obtained; the bubble area distribution is irregular, and the gradient change directions of the edge pixel points of the bubble area are almost completely different, so that the bubble expression degree of each area to be detected is obtained according to the gray level confusion degree of each area to be detected and the gradient change characteristics of the edge pixel points in each area to be detected; obtaining a reference value coefficient of gray scale characteristics of each other to-be-detected area according to the position distribution and the bubble expression degree of each to-be-detected area and each other to-be-detected area, and reflecting the correlation of the two to-be-detected areas affected by illumination; obtaining reference gray scale characteristics of each other region to be detected according to the gray scale characteristics and the reference value coefficient of each other region to be detected; obtaining the regional gray scale credibility of each region to be detected according to the gray scale characteristics of each region to be detected and the reference gray scale characteristics of each other region to be detected, wherein the regional gray scale credibility can exclude the influence of the bubble region in the region to be detected and reflect the influence of illumination on the region to be detected; the more obvious the gray scale characteristics in the region to be detected are, the more likely the region to be detected is affected by illumination, and the gradient change direction of pixel points at the edge of the illumination region is more consistent relative to the bubble region, so that the light reflection degree of each region to be detected is obtained according to the gray scale distribution characteristics, the edge discrete degree and the region gray scale credibility of each region to be detected; correcting the preset smoothing coefficient of each region to be detected by utilizing the bubble expression degree and the light reflection degree of each region to be detected to obtain a self-adaptive smoothing coefficient; and detecting bubble defects in the lubricating oil image according to the adaptive smoothing coefficient. According to the invention, the condition that no bubble defect is detected due to light can be avoided, and meanwhile, the local information of the lubricating oil image is adjusted through the self-adaptive smoothing coefficient, so that the lubricating oil image can retain more details, and further, the bubble region in the lubricating oil image can be accurately segmented and detected.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an intelligent detection method for lubricating oil quality based on image processing according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects of the intelligent detection method for lubricating oil quality based on image processing according to the invention with reference to the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
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 invention provides a specific scheme of an intelligent detection method for lubricating oil quality based on image processing, which is specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for intelligently detecting oil quality of lubricating oil based on image processing according to an embodiment of the invention is shown, the method includes:
step S1: and acquiring a lubricating oil image.
The embodiment of the invention provides an intelligent detection method for lubricating oil quality based on image processing, which aims at intelligent detection of lubricating oil quality based on image processing and can be used for detecting bubble areas in a lubricating oil image, so that the lubricating oil image is acquired first.
In order to reduce the influence of light deflection and retain more characteristic information on the surface of lubricating oil, in one embodiment of the invention, a high-definition industrial camera is placed right above a conveyor belt for conveying the lubricating oil, the shooting angle of the high-definition industrial camera is kept vertical to the conveyor belt, a lubricating oil image is acquired, and the lubricating oil image is subjected to grey-scale treatment.
Thus, a lubricating oil image was obtained.
Step S2: evenly dividing the lubricating oil image to obtain all areas to be detected of the lubricating oil image; and obtaining the bubble expression degree of each region to be detected according to the gray level confusion degree of each region to be detected and the gradient change characteristics of the edge pixel points in each region to be detected.
In practical situations, the bubble area may not be uniform in the lubricating oil image, and the local characteristic change of the partial area of the lubricating oil image is easily omitted when the whole lubricating oil image is analyzed, so that in the embodiment of the invention, the lubricating oil image is uniformly divided, and all areas to be detected of the lubricating oil image are obtained.
In one embodiment of the invention, each area to be detected is set asSquare in size. It should be noted that, in an embodiment of the present invention, the parameter setting of the area to be detected may be set by an operator, which is not limited herein.
In the bubble region and the non-bubble region in the lubricating oil image, since the bubbles are generally transparent, the gray value of the pixel point in the bubble region is higher, and the lubricating oil quality has a damping effect, and the gray value of the pixel point in the non-bubble region is lower, the gray characteristic of the bubble region is more prominent than that of the non-bubble region. If no bubble area exists in each area to be detected, the gray scale characteristics in the whole area to be detected are uniform, and if the bubble area exists in each area to be detected, the more the bubble areas are, the more the gray scale characteristics in each area to be detected are disordered, so that the degree of disorder of the gray scale in each area to be detected can reflect the degree of the bubble expression in each area to be detected to a certain degree. Therefore, in the embodiment of the invention, the gray level confusion degree of each region to be detected is obtained.
Preferably, in one embodiment of the present invention, the method for acquiring the gray level confusion degree includes:
and in each to-be-detected area, accumulating and summing the difference between the gray value of each pixel point and the gray value mean value in the to-be-detected area to obtain the gray confusion degree in each to-be-detected area. In one embodiment of the present invention, the gray level confusion degree calculation formula is as follows:
in the method, in the process of the invention,indicate->The degree of grey scale confusion in the areas to be detected; />Indicate->The number of pixel points in the areas to be detected; />Indicate->Sequence numbers of pixel points in the areas to be detected; />Indicate->Gray values of the mth pixel point in the areas to be detected; />Indicate->And the gray value average value of the pixel points in the areas to be detected.
In the gray level confusion degree calculation formula, the firstThe larger the difference between each pixel point in the to-be-detected area and the whole gray scale characteristic of the to-be-detected area is, the more the pixel points are more prominent relative to the whole gray scale characteristic of the to-be-detected area, and the +.>The more uneven the distribution of the gray values of the pixel points in the area to be detected is, the +.>The greater the degree of greyscale disorder in the individual areas to be detected, the +.>The more bubble areas within each area to be detected.
In practical situations, as the lubricating oil image may be affected by illumination, the gray distribution in the region to be detected is also uneven, and the gray features of part of the region are more prominent relative to the whole gray features of the region to be detected, a large number of edge pixel points with consistent gradient change directions can be generated in the illumination region. The bubble area usually presents a circular edge shape characteristic, so that gradient change directions of edge pixel points of the bubble area are almost completely different, interference of illumination on the bubble area in the area to be detected can be eliminated through the gradient change directions of the edge pixel points in the area to be detected, and in the embodiment of the invention, the gradient change characteristic of the edge pixel points in each area to be detected is obtained.
Preferably, in one embodiment of the present invention, the gradient change feature acquisition method includes:
edge detection is carried out on the lubricating oil image, an edge image of the lubricating oil image is obtained, and all edge pixel points in each area to be detected and gradient change directions of all edge pixel points are obtained; taking an included angle between the gradient change direction of each edge pixel point and the same horizontal direction as a gradient reference included angle of each edge pixel point; acquiring all value possibilities of the gradient reference included angles; and accumulating and summing the number of each gradient reference included angle to obtain the gradient change characteristics of all edge pixel points in each region to be detected. In one embodiment of the present invention, the gradient change characteristic calculation formula is as follows:
in the method, in the process of the invention,indicate->Gradient change characteristics of edge pixel points in the areas to be detected; />Indicate->The types of gradient reference included angles in the areas to be detected; />Indicate->Serial numbers of gradient reference included angle types in the areas to be detected; />Indicate->The first part of the region to be detected>The number of gradient reference angles.
In the gradient change characteristic calculation formula, the firstThe fewer the number of repeated gradient direction and horizontal direction included angle degrees of all edge pixel points in the to-be-detected area, namely the more the variety of gradient reference included angles, the ladder of the edge pixel points in the to-be-detected areaThe smaller the possibility that the degree change direction is repeated, the higher the possibility that the edge pixel point is used as the bubble area edge pixel point, at this time +.>The higher the degree of performance of the bubble area within the individual areas to be detected.
Preferably, in one embodiment of the present invention, the method for obtaining the expression level of the air bubble includes:
carrying out negative correlation mapping and normalization processing on gradient change characteristics of all edge pixel points in each region to be detected to obtain gradient change coefficients; and taking the product of the gradient change coefficient and the gray level confusion degree in each region to be detected as the bubble expression degree in each region to be detected. In one embodiment of the present invention, the bubble performance level calculation formula is as follows:
in the method, in the process of the invention,indicate->The bubble expression degree of each area to be detected; />Indicate->The degree of grey scale confusion in the areas to be detected; />Indicate->Gradient change characteristics of edge pixel points in the areas to be detected; />Representing an exponent based on a natural constantA function.
In the bubble expression level calculation formula, the firstThe greater the degree of greyscale disorder in the individual areas to be detected, the description +.>The more uneven the distribution of the gray values of the pixel points in the areas to be detected is, the more the number of the bubble areas appears; first->The more inconsistent the gradient change characteristics of the edge pixel points in the area to be detected, the description of the +.>The larger the proportion of the bubble region pixel points in the region to be detected to occupy the edge pixel points, namely +.>The smaller the illumination influence in each region to be detected, the greater the bubble performance degree.
Thus, the bubble expression degree of each region to be detected is obtained.
Step S3: obtaining a reference value coefficient of gray scale characteristics of each other region to be detected according to the position distribution and the bubble expression degree of each region to be detected and each other region to be detected; obtaining reference gray scale characteristics of each other region to be detected according to the gray scale characteristics and the reference value coefficient of each other region to be detected; obtaining the regional gray level credibility of each region to be detected according to the gray level characteristics of each region to be detected and the reference gray level characteristics of each other region to be detected; and obtaining the light reflection degree of each region to be detected according to the gray level distribution characteristics, the edge discrete degree and the region gray level credibility of each region to be detected.
Since the light can simultaneously influence a plurality of areas to be detected in the lubricating oil image, the gray values of pixel points in the plurality of areas to be detected, which are influenced by illumination, are higher, when the positions of the two areas to be detected differ far, the influence of the light on the two areas to be detected is greatly different, and the larger the position difference of the two areas to be detected is, the weaker the local correlation between the two areas to be detected is, and the lower the reference value of the influence of one area to be detected on the illumination of the other area to be detected is; if the bubble expression degree between the two areas to be detected is more approximate, the degree that the two areas to be detected are affected by the illumination is more approximate. In order to study the correlation of other areas to be detected to the influence of illumination when each area to be detected receives the influence of illumination, in the embodiment of the invention, the reference value coefficient of gray scale characteristics of each other area to be detected is obtained according to the position distribution and the bubble expression degree of each area to be detected and each other area to be detected.
Preferably, in one embodiment of the present invention, the method for obtaining the reference value coefficient includes:
taking any one area to be detected as a target area; calculating the position distance between the target area and each other to-be-detected area, wherein the farther the position distance is, the worse the correlation between each other to-be-detected area and the target area, which is affected by the same illumination, is, and the lower the reference value of each other to-be-detected area to the target area is; and carrying out negative correlation mapping normalization processing on the product of the position distance between the target region and each other region to be detected and the difference of the bubble expression degree, and obtaining the reference value coefficient of the gray scale characteristic of each other region to be detected. In one embodiment of the present invention, the reference value coefficient calculation formula is as follows:
in the method, in the process of the invention,a serial number indicating the target area in the lubricating oil image; />Representing the sequence of any one of the other regions to be detectedA number; />Indicate the +.>Reference value coefficients of gray features of other areas to be detected; />An abscissa indicating a position of the target region in the lubricating oil image; />Representing the ordinate of the position of the target area in the lubricating oil image; />Indicate the +.>The abscissa of the positions of other areas to be detected in the lubricating oil image; />Representing the first of the target areasThe ordinate of the positions of the other areas to be detected in the lubricating oil image; />Representing the degree of bubble expression within the target region;indicate the +.>The bubble expression degree in other areas to be detected; />An exponential function based on a natural constant is represented.
In a reference value coefficient meterIn the calculation formula, the total weight of the product,the larger the description target area and +.>The further apart the position of the other areas to be detected is, the target area is now located from +.>The smaller the correlation of the other areas to be detected, which are affected by the same illumination, the +.>The lower the reference value of the other areas to be detected to the target area is; />The smaller, the description of the +.>The more closely the bubble expression level in the other region to be detected is to the bubble expression level in the target region, the target region is at the same time +.>The more similar the degree of influence of light in the other areas to be detected is, the +.>The higher the reference value of the other areas to be detected for the target area.
When researching whether each area to be detected is affected by illumination, the difference between the gray scale characteristics of each area to be detected and the gray scale characteristics of each other area to be detected needs to be compared, in the practical situation, the higher the overall gray scale value of the area to be detected affected by illumination is, the higher the overall gray scale value of the area to be detected is, the higher the reliability of the area to be detected affected by illumination is, and the higher the overall gray scale value is due to the fact that the air bubble area possibly appears in the other area to be detected, the gray scale characteristics in each other area to be detected need to be adjusted through the reference value coefficient so as to be compared with the target area, and the reliability of the target area affected by illumination is analyzed. Therefore, in the embodiment of the invention, the reference gray scale characteristic of each other region to be detected is obtained according to the gray scale characteristic and the reference value coefficient of each other region to be detected; and obtaining the regional gray level reliability of each region to be detected according to the gray level characteristics of each region to be detected and the reference gray level characteristics of each other region to be detected.
Preferably, in an embodiment of the present invention, the method for acquiring the reference gray scale feature includes:
in the lubricating oil image, the product of the gray value mean value of each other to-be-detected area of the target area and the reference value coefficient is used as the reference gray characteristic of each other to-be-detected area. In one embodiment of the present invention, the reference gray scale feature calculation formula is as follows:
in the method, in the process of the invention,a serial number indicating the target area in the lubricating oil image; />A sequence number representing any one of the other areas to be detected; />Indicate the +.>Reference gray scale characteristics of other areas to be detected; />Indicate the +.>Average gray values of the other areas to be detected; />Indicate the +.>And the reference value coefficients of other areas to be detected.
In the reference gray feature calculation formula, the first of the target regionThe smaller the reference value coefficient of the other region to be detected, the description +.>The less likely the gray features of the other regions to be detected and the gray features of the target region are formed by the same illumination influence, the less the +.>Average gray value of the other areas to be detected, i.e. the +.th of the target area>The smaller the reference value coefficient of the other areas to be detected, the +.>The smaller the reference gray scale features of the other regions to be detected.
Preferably, in one embodiment of the present invention, the method for obtaining regional gray scale reliability includes:
accumulating and summing the difference between the gray value mean value in the target area and the reference gray features in each other to-be-detected area to obtain the area gray reliability of the target area; because the target area is any area to be detected, traversing each target area to obtain the area gray scale credibility of each area to be detected. In one embodiment of the present invention, the regional gray scale confidence calculation formula is as follows:
in the method, in the process of the invention,a serial number indicating the target area in the lubricating oil image; />Region gray scale reliability representing a target region; />Representing the number of other areas to be detected of the target area; />The serial numbers of other areas to be detected of the target area are represented; />Representing an average gray value of the target region; />Indicate the +.>Reference gray scale characteristics of other areas to be detected.
In the regional gray scale credibility calculation formula, the larger the sum of the difference between the gray scale characteristics of the target region and the reference gray scale characteristics in each other region to be detected of the target region is, the more prominent the gray scale characteristics of the target region relative to the whole lubricating oil image are, and the larger the influence of the bubble region is eliminated, the higher the regional gray scale credibility of the target region is; since the target area is any one to-be-detected area, the area gray scale credibility of each target area is calculated to obtain the area gray scale credibility of each to-be-detected area.
Since the lubricating oil image has the to-be-detected area with the bubble area and the illumination area, in the practical situation, the worse the to-be-detected area has to-be-detected area performance degree of the bubble, the study on the light reflection degree in each to-be-detected area should be performed. In each region to be detected, the more obvious the gray scale characteristics are in the region to be detected, the more likely the region to be detected is affected by illumination; the outline of the illumination area is larger and more neat relative to the outline of the bubble area, so that the gradient change direction of the pixel points at the edge of the illumination area is more consistent relative to the bubble area; the higher the region gray level reliability of the region to be detected is, the more likely the region to be detected is affected by illumination. Therefore, in the embodiment of the invention, the light reflection degree of each region to be detected is obtained according to the gray distribution characteristics, the edge discrete degree and the region gray reliability of each region to be detected.
Preferably, in one embodiment of the present invention, the method for obtaining the light reflection degree includes:
carrying out negative correlation mapping on the connecting line between every two adjacent edge pixel points in each region to be detected and the variance of the included angle degrees in the same horizontal direction to obtain the edge discrete degree of each region to be detected; and taking the product of the gray value mean value, the edge discrete degree and the region gray reliability in each region to be detected as the light reflection degree of each region to be detected. In one embodiment of the present invention, the light reflection degree calculation formula is as follows:
in the method, in the process of the invention,indicate->The light reflection degree of each region to be detected; />Indicate->Average gray values of the areas to be detected; />Indicate->Variance of gradient reference included angle values in the areas to be detected; />Indicate->Regional gray scale credibility of each region to be detected; />Representing the normalization function.
In the light reflection degree calculation formula, the whole gray value of the illumination area is larger than that of other normal areas, so the firstThe larger the average gray value of the individual areas to be detected, the first +.>The higher the light reflection degree of the areas to be detected is; first->The smaller the variance of the gradient reference included angle value of the region to be detected, the description is +.>The more uniform the gradient change direction of the edge pixel points in the region to be detected is, the +.>The more likely the edge area within the individual areas to be examined is the illumination area, in this case +.>The larger the->The higher the light reflection degree of the areas to be detected is; />The larger the description is->The more prominent the gray-scale features are with respect to the whole lubricating oil image, at this time +.>The greater the extent to which the individual areas to be detected are affected by the illumination, i.e.the +.>The higher the degree of reflection of light from the individual areas to be detected.
Step S4: and correcting the preset smoothing coefficient of each region to be detected by utilizing the bubble expression degree and the light reflection degree of each region to be detected to obtain the self-adaptive smoothing coefficient.
In the areas to be detected, the same smoothing coefficient is adopted for the whole lubricating oil image in the original image segmentation algorithm, and different gray scale characteristics in each area to be detected are ignored, so that the bubble areas and the non-bubble areas cannot be accurately segmented. Therefore, the original smoothing coefficient should be corrected by using the bubble expression degree and the light reflection degree, so in the embodiment of the invention, the preset smoothing coefficient of each region to be detected is corrected by using the bubble expression degree and the light reflection degree of each region to be detected, and the adaptive smoothing coefficient is obtained.
Preferably, in one embodiment of the present invention, the method for obtaining the adaptive smoothing coefficient includes:
carrying out negative correlation mapping and normalization processing on products between the bubble expression degree and the light reflection degree of each region to be detected to obtain a smooth scale of each region to be detected; presetting initial smoothing coefficients of all areas to be detected of a lubricating oil image; and taking the product of the initial smoothing coefficient of each region to be detected and the smoothing scale as the adaptive smoothing coefficient of each region to be detected. In one embodiment of the present invention, the adaptive smoothing coefficient calculation formula is as follows:
in the method, in the process of the invention,indicate->Adaptive smoothing coefficients for the individual regions to be detected; />Representing preset smoothing coefficients of all areas to be detected in the lubricating oil image; />Indicate->The bubble expression degree of each area to be detected; />Indicate->The light reflection degree of each region to be detected; />An exponential function based on a natural constant is represented.
In the adaptive smoothing coefficient calculation formula, the firstThe greater the bubble representation of the individual regions to be detected, the greater the probability of bubble defects occurring in the region to be detected, the smaller the smoothing coefficients should be used in the image segmentation algorithm to increase the texture details of the region to be detected, i.e. +.>The smaller the adaptive smoothing coefficients of the areas to be detected; and->The greater the light reflection degree in the region to be detected, the greater the interference of the pixel points in the region to be detected affected by illumination, namely +.>The greater the likelihood that the behavior of the individual regions to be detected with respect to the bubble region may be disturbed by light, the smaller smoothing coefficients should be used for the regions to be detected to increase the texture details of the regions to be detected, at which point +.>The smaller the adaptive smoothing coefficients for the individual regions to be detected.
Step S5: and detecting bubble defects in the lubricating oil image according to the adaptive smoothing coefficient.
Preferably, in one embodiment of the present invention, detecting bubble defects in a lubricating oil image according to an adaptive smoothing coefficient includes:
dividing the lubricating oil image by using a Markov random field algorithm; establishing a probability map model of the lubricating oil image through a Markov random field algorithm; specific parameters of a Markov random field algorithm, such as initial smoothing coefficients, local neighborhood and the like, are preset; image segmentation is carried out on each region to be detected in the lubricating oil image by using a self-adaptive smoothing coefficient through a Markov random field algorithm, and a bubble region and a non-bubble region in the lubricating oil image are distinguished; and carrying out post-processing on the image segmentation result, including operations such as filling small areas, edge optimization and the like, so as to obtain a bubble area detection result.
In other embodiments of the present invention, other image segmentation algorithms such as a threshold segmentation algorithm may be used to perform the operation, where the markov random field algorithm and the threshold segmentation algorithm are technical means well known to those skilled in the art, and are not limited and described herein.
Thus, the detection of the bubble region in the lubricating oil image is completed.
In summary, the present invention obtains a lubricating oil image; evenly dividing the lubricating oil image to obtain all areas to be detected of the lubricating oil image; according to the gray level confusion degree of each region to be detected and the gradient change characteristics of the edge pixel points in each region to be detected, the bubble expression degree of each region to be detected is obtained; obtaining a reference value coefficient of gray scale characteristics of each other region to be detected according to the position distribution and the bubble expression degree of each region to be detected and each other region to be detected; obtaining reference gray scale characteristics of each other region to be detected according to the gray scale characteristics and the reference value coefficient of each other region to be detected; obtaining the regional gray level credibility of each region to be detected according to the gray level characteristics of each region to be detected and the reference gray level characteristics of each other region to be detected; obtaining the light reflection degree of each region to be detected according to the gray distribution characteristics, the edge discrete degree and the region gray credibility of each region to be detected; correcting the preset smoothing coefficient of each region to be detected by utilizing the bubble expression degree and the light reflection degree of each region to be detected to obtain a self-adaptive smoothing coefficient; and detecting bubble defects in the lubricating oil image according to the adaptive smoothing coefficient. According to the invention, the condition that no bubble defect is detected due to light can be avoided, and meanwhile, the local information of the lubricating oil image is adjusted through the self-adaptive smoothing coefficient, so that the lubricating oil image can retain more details, and further, the bubble region in the lubricating oil image can be accurately segmented and detected.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (10)

1. An intelligent detection method for lubricating oil quality based on image processing is characterized by comprising the following steps:
acquiring a lubricating oil image;
uniformly dividing the lubricating oil image to obtain all areas to be detected of the lubricating oil image; obtaining the bubble expression degree of each region to be detected according to the gray level confusion degree of each region to be detected and the gradient change characteristics of the edge pixel points in each region to be detected;
obtaining a reference value coefficient of gray scale characteristics of each other region to be detected according to the position distribution and the bubble expression degree of each region to be detected and each other region to be detected; obtaining the reference gray scale characteristics of each other region to be detected according to the gray scale characteristics of each other region to be detected and the reference value coefficient; obtaining the regional gray scale credibility of each region to be detected according to the gray scale characteristics of each region to be detected and the reference gray scale characteristics of each other region to be detected; obtaining the light reflection degree of each region to be detected according to the gray level distribution characteristics, the edge discrete degree and the region gray level credibility of each region to be detected;
correcting a preset smoothing coefficient of each region to be detected by using the bubble expression degree and the light reflection degree of each region to be detected to obtain a self-adaptive smoothing coefficient;
and detecting bubble defects in the lubricating oil image according to the self-adaptive smoothing coefficient.
2. The intelligent detection method of lubricating oil quality based on image processing according to claim 1, wherein the method for obtaining the degree of gray scale confusion comprises the following steps:
and in each to-be-detected area, accumulating and summing the difference between the gray value of each pixel point and the gray value mean value in the to-be-detected area to obtain the gray confusion degree in each to-be-detected area.
3. The intelligent detection method of lubricating oil quality based on image processing according to claim 1, wherein the method for acquiring gradient change characteristics comprises the following steps:
acquiring all edge pixel points in each region to be detected and gradient change directions of each edge pixel point; taking an included angle between the gradient change direction of each edge pixel point and the same horizontal direction as a gradient reference included angle of each edge pixel point;
and accumulating and summing the number of each gradient reference included angle to obtain gradient change characteristics of all edge pixel points in each region to be detected.
4. The intelligent detection method for lubricating oil quality based on image processing according to claim 1, wherein the method for acquiring the bubble expression level comprises the following steps:
carrying out negative correlation mapping and normalization processing on gradient change characteristics of all edge pixel points in each region to be detected to obtain gradient change coefficients;
and taking the product of the gradient change coefficient and the gray level confusion degree in each area to be detected as the bubble expression degree in each area to be detected.
5. The intelligent detection method of lubricating oil quality based on image processing according to claim 1, wherein the acquisition method of the reference value coefficient comprises the following steps:
taking any one of the areas to be detected as a target area;
calculating the position distance between the target area and each other area to be detected;
and carrying out negative correlation mapping normalization processing on the product of the position distance between the target region and each other region to be detected and the difference of the bubble expression degree, and obtaining the reference value coefficient of the gray scale characteristic of each other region to be detected.
6. The intelligent detection method for lubricating oil quality based on image processing according to claim 5, wherein the method for acquiring the reference gray scale features comprises the following steps:
and taking the product of the gray value mean value of each other to-be-detected area of the target area and the reference value coefficient as the reference gray characteristic of each other to-be-detected area in the lubricating oil image.
7. The intelligent detection method for lubricating oil quality based on image processing according to claim 5, wherein the method for acquiring regional gray scale reliability comprises the following steps:
accumulating and summing the difference between the gray value mean value in the target area and the reference gray features in each other to-be-detected area to obtain the area gray reliability of the target area;
traversing each target area to obtain the regional gray scale credibility of all the areas to be detected.
8. The intelligent detection method of lubricating oil quality based on image processing according to claim 1, wherein the method for obtaining the light reflection degree comprises the following steps:
carrying out negative correlation mapping on the connecting line between every two adjacent edge pixel points in each region to be detected and the variance of the included angle degree in the same horizontal direction to obtain the edge discrete degree of each region to be detected;
and taking the product of the gray value mean value in each region to be detected, the edge discrete degree and the region gray reliability as the light reflection degree of each region to be detected.
9. The intelligent detection method of lubricating oil quality based on image processing according to claim 1, wherein the method for obtaining the adaptive smoothing coefficient comprises the following steps:
carrying out negative correlation mapping and normalization processing on products between the bubble expression degree and the light reflection degree of each region to be detected to obtain a smooth scale of each region to be detected;
presetting initial smoothing coefficients of all areas to be detected of the lubricating oil image; and taking the product of the initial smoothing coefficient and the smoothing scale of each region to be detected as an adaptive smoothing coefficient of each region to be detected.
10. The intelligent detection method for lubricating oil quality based on image processing according to claim 1, wherein detecting bubble defects in the lubricating oil image according to the adaptive smoothing coefficient comprises:
image segmentation is carried out on each region to be detected in the lubricating oil image through a Markov random field algorithm by utilizing the self-adaptive smoothing coefficient, and an image segmentation result of a bubble region and a non-bubble region in the lubricating oil image is obtained;
and carrying out post-processing on the image segmentation result to obtain a bubble region detection result.
CN202410263664.0A 2024-03-08 Intelligent detection method for lubricating oil quality based on image processing Active CN117876360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410263664.0A CN117876360B (en) 2024-03-08 Intelligent detection method for lubricating oil quality based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410263664.0A CN117876360B (en) 2024-03-08 Intelligent detection method for lubricating oil quality based on image processing

Publications (2)

Publication Number Publication Date
CN117876360A true CN117876360A (en) 2024-04-12
CN117876360B CN117876360B (en) 2024-07-02

Family

ID=

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021000524A1 (en) * 2019-07-03 2021-01-07 研祥智能科技股份有限公司 Hole protection cap detection method and apparatus, computer device and storage medium
WO2023134792A2 (en) * 2022-12-15 2023-07-20 苏州迈创信息技术有限公司 Led lamp wick defect detection method
WO2023134789A1 (en) * 2022-10-25 2023-07-20 苏州德斯米尔智能科技有限公司 Automatic inspection method for belt-type conveying device
CN116612126A (en) * 2023-07-21 2023-08-18 青岛国际旅行卫生保健中心(青岛海关口岸门诊部) Container disease vector biological detection early warning method based on artificial intelligence
CN116630314A (en) * 2023-07-24 2023-08-22 日照元鼎包装有限公司 Image processing-based preservation carton film coating detection method
CN117095008A (en) * 2023-10-20 2023-11-21 深圳市高进实业有限公司 Intelligent detection method for defects of steel bar pipe of clock
CN117115153A (en) * 2023-10-23 2023-11-24 威海坤科流量仪表股份有限公司 Intelligent printed circuit board quality detection method based on visual assistance
CN117173189A (en) * 2023-11-03 2023-12-05 南通江华机械有限公司 Visual inspection system for polishing effect of aluminum alloy surface
CN117197141A (en) * 2023-11-07 2023-12-08 山东远盾网络技术股份有限公司 Method for detecting surface defects of automobile parts

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021000524A1 (en) * 2019-07-03 2021-01-07 研祥智能科技股份有限公司 Hole protection cap detection method and apparatus, computer device and storage medium
WO2023134789A1 (en) * 2022-10-25 2023-07-20 苏州德斯米尔智能科技有限公司 Automatic inspection method for belt-type conveying device
WO2023134792A2 (en) * 2022-12-15 2023-07-20 苏州迈创信息技术有限公司 Led lamp wick defect detection method
CN116612126A (en) * 2023-07-21 2023-08-18 青岛国际旅行卫生保健中心(青岛海关口岸门诊部) Container disease vector biological detection early warning method based on artificial intelligence
CN116630314A (en) * 2023-07-24 2023-08-22 日照元鼎包装有限公司 Image processing-based preservation carton film coating detection method
CN117095008A (en) * 2023-10-20 2023-11-21 深圳市高进实业有限公司 Intelligent detection method for defects of steel bar pipe of clock
CN117115153A (en) * 2023-10-23 2023-11-24 威海坤科流量仪表股份有限公司 Intelligent printed circuit board quality detection method based on visual assistance
CN117173189A (en) * 2023-11-03 2023-12-05 南通江华机械有限公司 Visual inspection system for polishing effect of aluminum alloy surface
CN117197141A (en) * 2023-11-07 2023-12-08 山东远盾网络技术股份有限公司 Method for detecting surface defects of automobile parts

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
翟伟良;李有煊;黄浩湄;黄茂发;陈俊杰;莫锦超;: "基于机器视觉的金属表面缺陷检测方法研究", 科技传播, no. 09, 8 May 2017 (2017-05-08) *
闵永智;岳彪;马宏锋;肖本郁;: "基于图像灰度梯度特征的钢轨表面缺陷检测", 仪器仪表学报, no. 04, 15 April 2018 (2018-04-15) *

Similar Documents

Publication Publication Date Title
CN115311292B (en) Strip steel surface defect detection method and system based on image processing
CN115829883B (en) Surface image denoising method for special-shaped metal structural member
CN117173189B (en) Visual inspection system for polishing effect of aluminum alloy surface
CN116740070B (en) Plastic pipeline appearance defect detection method based on machine vision
CN115100203B (en) Method for detecting quality of steel bar polishing and rust removal
CN114219805B (en) Intelligent detection method for glass defects
CN115272321B (en) Textile defect detection method based on machine vision
CN116596936A (en) Solar wing sailboard quality detection method based on image data
CN116777916B (en) Defect detection method based on metal shell of pump machine
CN117095008B (en) Intelligent detection method for defects of steel bar pipe of clock
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN116402808B (en) Intelligent detection method for manufacturing cable clamp plate die
CN116630304B (en) Lithium battery mold processing detection method and system based on artificial intelligence
CN105283750B (en) Method for handling the digital picture of surface of tyre to detect abnormal
CN116559183A (en) Method and system for improving defect judging efficiency
CN116152242B (en) Visual detection system of natural leather defect for basketball
CN115511907B (en) Scratch detection method for LED screen
CN111754538A (en) Threshold segmentation method for USB surface defect detection
CN115953409A (en) Injection molding surface defect detection method based on image processing
CN117830139B (en) High-strength stamping part defect detection method
CN117764986A (en) titanium plate surface defect detection method based on image processing
CN116152115A (en) Garbage image denoising processing method based on computer vision
CN117876360B (en) Intelligent detection method for lubricating oil quality based on image processing
CN117876360A (en) Intelligent detection method for lubricating oil quality based on image processing
CN116152255B (en) Modified plastic production defect judging method

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