CN116778261A - Raw oil grade classification method based on image processing - Google Patents

Raw oil grade classification method based on image processing Download PDF

Info

Publication number
CN116778261A
CN116778261A CN202311048512.0A CN202311048512A CN116778261A CN 116778261 A CN116778261 A CN 116778261A CN 202311048512 A CN202311048512 A CN 202311048512A CN 116778261 A CN116778261 A CN 116778261A
Authority
CN
China
Prior art keywords
raw oil
image
standard deviation
pixel point
pixel
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
CN202311048512.0A
Other languages
Chinese (zh)
Other versions
CN116778261B (en
Inventor
司传煜
王宾
张金刚
王东
张美荣
任洪娜
司洋洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Hengxin Technology Development Co ltd
Original Assignee
Shandong Hengxin Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Hengxin Technology Development Co ltd filed Critical Shandong Hengxin Technology Development Co ltd
Priority to CN202311048512.0A priority Critical patent/CN116778261B/en
Publication of CN116778261A publication Critical patent/CN116778261A/en
Application granted granted Critical
Publication of CN116778261B publication Critical patent/CN116778261B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis

Abstract

The application relates to the field of image processing, in particular to a classification method of raw oil based on image processing, which collects raw oil images; obtaining standard deviation shadow values of all pixel points according to the gray level information of the local window of each pixel point of the raw oil image; obtaining impurity contrast factors of all pixel points according to standard deviation shadow values of all pixel points; obtaining the final weight of each pixel point according to the impurity contrast factor of each pixel point, and obtaining a raw oil enhanced image by combining a CLAHE algorithm; and dividing the raw oil enhanced image to obtain impurity region pixel points, and obtaining raw oil grade classification according to the number of the impurity region pixel points and a preset threshold value. The method has the advantages that the classification of the raw oil grade is realized, the detection precision of the impurity edge in the raw oil is improved, the contrast enhancement effect of impurity pixel points is improved, and the accurate classification of the raw oil grade is facilitated.

Description

Raw oil grade classification method based on image processing
Technical Field
The application relates to the field of image processing, in particular to a classification method of raw oil and the like based on image processing.
Background
The raw oil is the original petroleum or vegetable oil used for producing various chemical products or fuels, mainly comprises different hydrocarbon compounds and derivatives thereof, is the basic material of a plurality of oil products, and has important applications in different fields, so that the raw oil is classified according to the impurity content of the raw oil, and is treated to different degrees according to different grades of the raw oil. Because the raw oil is relatively viscous, impurities such as solids, suspended matters and the like contained in the raw oil can be wrapped by the raw oil, the color difference between the impurities and the raw oil is small, and the difficulty in identifying the impurities is high when the impurities in the raw oil are identified and classified by an edge detection algorithm.
When the traditional image enhancement algorithm is used for enhancing the raw oil image, detailed information in the image can be reserved, local texture characteristics of the image can be reserved better, but parameter setting is difficult, and a plurality of attempts can be needed to obtain relatively suitable parameters.
In summary, the application provides a raw oil grade classification method based on image processing, which adopts a CCD camera to collect raw oil images, combines the difference characteristics between raw oil and impurities, and performs characteristic enhancement on the raw oil images by optimizing the transformation function of a CLAHE algorithm (limiting contrast self-adaptive histogram equalization algorithm) to complete the grade classification of the raw oil.
Disclosure of Invention
In order to solve the technical problems, the application provides a raw oil grade classification method based on image processing to solve the existing problems.
The method for classifying the raw oil based on image processing adopts the following technical scheme:
one embodiment of the present application provides a method for classifying a raw oil based on image processing, the method comprising the steps of:
collecting an original raw oil image and preprocessing to obtain the raw oil image;
obtaining the number of areas divided by the raw oil image according to the energy gradient of the raw oil image; obtaining raw oil standard gray values of all pixel points according to gray information of the pixel points in the local window of each pixel point in each region of the raw oil image; obtaining standard deviation shadow values of all pixel points according to the absolute value of the difference between the gray value of each pixel point and the standard gray value of the raw oil in each region; according to the standard deviation shadow value of each pixel point in the local window, each standard deviation shadow level of the local window; obtaining the direction run-length difference of each standard deviation shadow level according to the distribution of each standard deviation shadow level of the local window; obtaining impurity contrast factors of all pixel points according to the direction run-length differences of all standard deviation image levels in the local windows of all pixel points;
obtaining the weight of each pixel point according to the impurity contrast factor of each pixel point; obtaining the final weight of each pixel point according to the weight of each pixel point and the standard deviation shadow value of each pixel point in the local window;
obtaining an accumulated distribution function of standard deviation shadow values of the raw oil image according to the final weight of each pixel point, and obtaining a raw oil enhanced image by combining the accumulated distribution function and a contrast-limited self-adaptive histogram equalization algorithm;
and dividing the raw oil enhanced image by using an Ojin threshold segmentation method to obtain impurity region pixel points, and obtaining raw oil grade classification according to the number of the impurity region pixel points and a preset threshold.
Preferably, the specific method for obtaining the number of areas divided by the raw oil image according to the energy gradient of the raw oil image comprises the following steps:
and (3) taking the ratio of the energy gradient of the raw oil image to the area of the raw oil image as the average energy gradient of the raw oil image, and obtaining the number of areas divided by the raw oil image according to square rounding of the average energy gradient.
Preferably, the specific method for obtaining the standard gray value of the raw oil of each pixel point according to the gray information of the pixel point in the local window of each pixel point in each region of the raw oil image comprises the following steps:
respectively calculating the gray average value, the gray standard deviation and the gray range in each pixel local window in each region according to the gray information in each pixel local window in each region;
taking the difference between the gray average value of the local window and the gray average value of the region as a first priority, taking the gray extremely poor of the local window as a second priority, and taking the gray standard deviation of the local window as a third priority;
and finding a raw oil standard window according to the priority sequences of the first priority, the second priority and the third priority, and taking the gray average value of the raw oil standard window as the standard gray value of the raw oil without impurities.
Preferably, the specific method for each standard deviation shadow level of the local window according to the standard deviation shadow value of each pixel point in the local window is as follows:
taking the standard deviation shadow value of each pixel point in the local window as the same standard deviation shadow level; and counting the number of different standard deviation image stages in the local window to be used as the standard deviation image stages of the local window.
Preferably, the expression for obtaining the directional run-length difference of each standard deviation stage according to the distribution of each standard deviation stage of the local window is:
according to each pixel point in each standard deviation image level of the local window, calculating the sequence distribution condition of each pixel point in each direction in the local window;
the difference average value calculated based on each pixel point in the direction with the largest sequence distribution difference is recorded as the largest difference;
and solving the average value of the maximum difference of each pixel point in each standard deviation image stage in the local window to obtain the direction run-length difference of each standard deviation image stage in the local window.
Preferably, the expression for obtaining the impurity contrast factor of each pixel point according to the directional run-length difference of each standard deviation image level in each pixel point local window is as follows:
in the method, in the process of the application,representing the number of standard deviation shadow value stages occurring within the local window,representing the first in a partial windowThe probability of occurrence of a standard deviation stage,representing the first in a partial windowThe direction run-length differences of the standard deviation stage,the impurity contrast factor of each pixel is represented.
Preferably, the expression for obtaining the weight of each pixel point according to the impurity contrast factor of each pixel point is:
in the method, in the process of the application,to take the following measuresAs a function of the base of the exponentiation,the weights of the pixel points are represented,the impurity contrast factor of each pixel point is represented,representing the growth rate for adjusting the pixel point weight functionIs used for the weight adjustment factor of (a).
Preferably, the expression for obtaining the final weight of each pixel point according to the weight of each pixel point and the standard deviation shadow value of each pixel point in the local window is as follows:
in the method, in the process of the application,for the size of the partial window(s),representing within a partial windowThe pixel weights of the locations are weighted and,representing within a partial windowStandard deviation of pixel points of the position,is the standard deviation shadow value of the pixel point,representing the final weight of each pixel.
Preferably, the specific method for obtaining the cumulative distribution function of the standard deviation shadow value of the raw oil image according to the final weight of each pixel point is as follows:
summing the final weights of all pixel points with the same standard deviation shadow value according to the final weights of all pixel points in the raw oil image to obtain a probability density function of all standard deviation shadow values;
and obtaining the cumulative distribution function of each standard deviation shadow value in the raw oil image based on the probability density function of each standard deviation shadow value.
Preferably, the specific method for obtaining the classification of the raw oil grade according to the number of the pixel points of the impurity region and a preset threshold value comprises the following steps:
threshold segmentation is carried out on the raw oil enhanced image by using an Ojin threshold segmentation method, so as to obtain impurity region pixel points;
the method comprises the steps of recording the number of pixel points of an impurity region in a raw oil enhanced image as a first number, recording the number of pixel points of the raw oil region in the raw oil image as a second number, and recording the ratio of the first number to the second number as an impurity ratio;
respectively comparing the impurity ratio with a preset primary threshold and a preset secondary threshold, dividing a raw oil image with the impurity ratio lower than the primary threshold into one stage, dividing a raw oil image with the impurity ratio higher than the primary threshold and lower than the secondary threshold into two stages, dividing a raw oil image with the impurity ratio higher than the secondary threshold into three stages, and completing classification of the raw oil grade
The application has at least the following beneficial effects:
compared with the traditional CLAHE algorithm, the method can classify the raw oil, analyzes the gray value gradient condition of the pixel points at the edge of the impurity to obtain the direction run difference aiming at the characteristic difference between the raw oil and the impurity, and more accurately reflects the direction change condition of each pixel point;
meanwhile, the weights of the pixels with the same standard deviation shadow value as the central pixel in each pixel window are combined, the standard deviation shadow value duty ratio of the pixel is represented by using the sum of the weights, the probability density function of the standard deviation shadow value of the raw oil image is obtained after normalization through counting the weights of the pixels with the same standard deviation shadow value in the raw oil image, so that the cumulative distribution function of the CLAHE algorithm is optimized, the contrast enhancement effect of the impurity pixels is reflected more truly, the detection precision of impurities in the raw oil is improved, and the accurate classification of the raw oil grade is facilitated.
Drawings
In order to more clearly illustrate the embodiments of the application 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 application, 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 a raw oil grade classification method based on image processing provided by the application.
Detailed Description
In order to further describe the technical means and effects adopted by the application to achieve the preset aim, the following detailed description is given below of the image processing-based raw oil classification method according to the application, and the specific implementation, structure, characteristics and effects thereof, with reference to the accompanying drawings and preferred embodiments. 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 application belongs.
The following specifically describes a specific scheme of the raw oil grade classification method based on image processing provided by the application with reference to the accompanying drawings.
The embodiment of the application provides a raw oil classification method based on image processing.
Specifically, the following classification method of raw oil based on image processing is provided, referring to fig. 1, the method includes the following steps:
and S001, collecting a raw oil image and preprocessing.
In the embodiment, the raw oil is classified according to the grade of the raw oil mainly by an image processing technology, and an original raw oil image is shot and collected by a CCD camera, wherein the image is an RGB image, and the original raw oil image is converted into a raw oil gray image.
Because noise is possibly generated due to the influence of factors such as environment and the like in the shooting process, the quality of an image and the result of subsequent analysis are influenced, according to the embodiment of the application, the obtained gray image is subjected to denoising treatment, and the common denoising method mainly comprises bilateral filtering denoising, gaussian filtering denoising, mean filtering denoising and the like.
Thus, the method can be used for collecting and preprocessing the raw oil image for classifying the grade of the raw oil.
And step S002, constructing an impurity contrast factor by analyzing the difference characteristics between the raw oil pixel points and the impurity pixel points in the raw oil gray level image, optimizing the transformation function of the CLAHE algorithm, and enhancing the raw oil image.
The cumulative distribution function of the CLAHE algorithm only considers the probability density of gray level of each pixel point in the image, and the contrast enhancement of the image is controlled by the slope of the cumulative distribution function to a large extent. The gradient of the cumulative distribution function in the traditional CLAHE algorithm is steeper, so that the gray value of each pixel point cannot extend to the whole value range, and the raw oil and impurities cannot be enhanced separately. If the pixel gray value range extends greatly, the contrast is improved, and the picture distortion can be caused.
According to the embodiment of the application, the local characteristic construction weight of the raw oil image is considered, and the CLAHE algorithm is subjected to self-adaptive weighting treatment, so that the contrast between the raw oil in the enhanced raw oil image and impurities is more obvious.
In order to achieve a better image enhancement effect, the embodiment of the application performs region division on the raw oil image according to the definition of the raw oil image, and the calculation formula of the division region number in the CLAHE algorithm is as follows:
in the method, in the process of the application,to divide the raw oil image into the number of areas,in order to be a function of the rounding-off,represents the average energy gradient obtained from the ratio of the raw oil image energy gradient to the raw oil image area,is a proportionality coefficient.
It should be noted that the number of the substrates,typically take an empirical value of 4. The calculation of the image energy gradient is a known technique, and the detailed calculation process is not repeated in the present application.
After the number of divided areas is obtained, the raw oil image is uniformly divided intoAnd the areas. For convenience of description, the embodiment of the application takes the region s as an example to construct the impurity contrast factor, and the construction process of the rest regions is similar.
The impurity content in the raw oil is low, the gray average value of the region can be calculated according to the gray value of each pixel point in the region, and the raw oil is mixed with the raw oilThe local window slides in the area, a window gray average value, a gray standard deviation and a gray range are calculated according to gray values of all pixel points in the local window, a raw oil standard window is found according to the priority that the difference between the window gray average value and the area gray average value is smaller than a first threshold value, the gray range is minimum, and the gray standard deviation is minimum, and the raw oil standard window gray average value is used as a standard gray value when raw oil is free of impurities. The first threshold takes an empirical value of 5,can be set by the practitioner at his own discretion, whereSet to 5.
The absolute value of the difference between the gray value of each pixel point in the area and the standard gray value of the raw oil is recorded as each pixel pointTraversing the whole area, replacing the standard deviation shadow value of all pixel points with the gray value of the pixel point, marking the replaced result as a difference shadow area, and marking the value of each pixel point in the difference shadow area as the standard deviation shadow value. The larger the standard deviation value of each pixel point in the difference area is, the more likely the pixel point belongs to the impurity pixel point.
Since the gray value of the impurity pixel point in the region has a characteristic of becoming larger gradually in one direction, the impurity is covered with crude oil, resulting in relatively less conspicuous edge portions of the impurity.
In order to reflect the degree of the impurity pixel points in the raw oil image, each pixel point in the difference image area is taken, one pixel point is taken as an example, and the taken pixel point is taken as the center and the sizeIs a local window of the pixel point. According to the distribution condition of standard deviation image level in the local window of the pixel point, calculating the impurity contrast factor of the pixel pointThe calculation formula is as follows:
in the method, in the process of the application,representing the number of standard deviation shadow value stages occurring within the local window,representing the first in a partial windowProbability of occurrence of a standard deviation stage, i.e. the first in a partial windowThe ratio of the number of occurrences of the standard deviation stage to the number of total pixels of the window,representing the first in a partial windowThe direction run-length differences of the standard deviation stage,the impurity contrast factor of each pixel is represented.
The smaller the number of standard deviation image levels in the local window of the pixel point is and the larger the direction run difference of the standard deviation image levels is, that is, the more obvious the impurities in the window are, the larger the direction difference is, and the greater the impurity contrast of the pixel point is. The degree of enhancement should be greater when the subsequent step is to perform contrast enhancement.
Wherein, the first pixel in the local window of the pixel pointThe calculation method of the directional run-length differences of the standard deviation image stages is as follows:
in the method, in the process of the application,in order to take the maximum function in the set,representing the first in a partial windowThe number of occurrences of the individual standard deviation stage,indicating the direction of the pixel point within the local window,representing the first in a partial windowThe first standard deviation image stageThe standard deviation is as followsThe length of the sequence of standard deviation values in the direction,representing the first in a partial windowThe first standard deviation image stageThe standard deviation is as followsIn the direction ofStandard deviation of the pixel points,representing the first in a partial windowThe first standard deviation stageThe value of the standard deviation shadow is calculated,representing the first in a partial windowThe direction run-length differences of the standard deviation stage.
It should be noted that the number of the substrates,taking 1 to represent 0 degrees direction i.e. horizontal right direction,taking 2 to indicate a 45 degree direction i.e. a direction rotated 45 degrees horizontally and counterclockwise to the right,taking 3 to represent the 90 degree direction i.e. the vertically upward direction,let 4 denote 135 degrees, i.e. a direction rotated 45 degrees vertically upwards and anticlockwise. Calculating the first in the local window of the pixel pointThe first standard deviation stageTaking the average value of the maximum difference values of the standard deviation shadow values in all directions, and thenThe difference between the standard deviation shadow values is averaged, and the larger the value is, the more likely the standard deviation shadow level is an impurity pixel point in the local window, the higher the contrast is, and the higher the enhancement degree is when the contrast enhancement is carried out in the subsequent step.
The main color of the raw oil is orange, the outline of each impurity is relatively fuzzy, no clear edge line exists, the contrast is low, the gray value of the pixel point is relatively close, and the problem of excessive amplification noise can occur in the histogram equalization process, so that the change of the pixel point weight function is relatively gentle for low-contrast images, and the change of the pixel point weight function is relatively rapid for high-contrast images.
In view of this situation, the embodiment of the application constructs a pixel point weight formula with relatively mild growth trend, is more suitable for processing raw oil images, and a weight calculation formula for one pixel point in a difference region is as follows:
in the method, in the process of the application,to take the following measuresAs a function of the base of the exponentiation,the weights of the pixel points are represented,the impurity contrast factor of each pixel point is represented,representing a weighted adjustment factor for adjusting the rate of increase of the pixel point weight function.
It should be noted that the number of the substrates,typically an empirical value of 2.8 is taken. If the impurity contrast of the pixel point is larger, the weight of the pixel point should be larger, but setting the impurity contrast factor to this weight directly causes a problem of excessive amplification noise, so that the weight of the pixel point is controlled to be gently increased, i.e., the pixel point is relatively gently enhanced.
Since the number of pixels having the same standard deviation value as the pixel appears around any one pixel in the region is small, even if the weight of the pixel is large, it is insufficient to determine that the pixel is an impurity pixel, that is, the pixel may be a noise point.
For this case, for each pixel pointThe weight of the pixel point with the same standard deviation shadow value as the pixel point in the local window is also used as the final weight for evaluating the central pixel point
In the method, in the process of the application,for the size of the partial window(s),representing within a partial windowThe pixel weights of the locations are weighted and,representing within a partial windowStandard deviation of pixel points of the position,as the standard deviation shadow value of the pixel point,the standard deviation shadow value representing the pixel point isIs added to the final weight of (a).
It should be noted that, the degree of influence of the pixel points with the same characteristics around the pixel point on the central pixel point is represented by calculating the average value of the sum of the weights with the same standard deviation shadow value as the central pixel point in the local window with each pixel point as the central pixel point and recording the average value as the final weight.
According to the final weight of each pixel point obtained in the above steps, the probability density function of each standard deviation shadow value in the region can be obtained by calculation, and further the cumulative distribution function is obtained, and the calculation formula is as follows:
in the method, in the process of the application,representing that the standard deviation shadow value in the raw oil image isIs the first of (2)The final weight of the individual pixel points,representing that the standard deviation shadow value in the raw oil image isIs a function of the probability density of (c) in the (c),representing that the raw oil images have the same standard deviation shadow valueIs used in the number of (a) and (b),indicating that the data in brackets is normalized,is the standard deviation shadow value in the raw oil image,representing that the standard deviation shadow value in the raw oil image isIs a cumulative distribution function of (1). The obtained cumulative distribution function is the transformation function in the CLAHE algorithm.
And replacing the accumulated distribution function in the original CLAHE algorithm with the transformation function obtained in the previous step by using the transformation function obtained in the previous step, and carrying out contrast-limiting enhancement on the raw oil image by using the CLAHE algorithm to obtain the raw oil enhanced image.
The raw oil enhanced image is obtained, so that the identification of impurities in the raw oil enhanced image can be realized conveniently in subsequent steps.
And step S003, classifying the raw oil according to the impurity proportion in the raw oil enhanced image obtained by the segmentation algorithm.
And (3) carrying out threshold segmentation on the raw oil enhanced image by using an Ojin threshold segmentation method to obtain impurity region pixel points, and calculating the impurity duty ratio, namely the proportion of the number of the impurity pixel points to the total pixel points.
And grading the raw oil according to the impurity ratio. Impurity duty cycle is below a first thresholdWhen the raw oil is classified into one grade, the impurity ratio is higher than the first grade threshold valueWhen it is lower than the second thresholdAnd when the impurity ratio is higher than a second-level threshold value, classifying the raw oil into three stages. Wherein the first level thresholdTypically takes the empirical value of 0.03, the second order thresholdTypically take an empirical value of 0.06.
To this end, a classification of the raw oil is achieved.
In summary, the embodiment of the application provides a raw oil grade classification method based on image processing, which adopts a CCD camera to collect raw oil images, combines the difference characteristics between raw oil and impurities, and performs characteristic enhancement on the raw oil images by optimizing the transformation function of a CLAHE algorithm to complete the grade classification of the raw oil.
Compared with the traditional CLAHE algorithm, the method provided by the embodiment of the application aims at the characteristic difference between the raw oil and the impurities, analyzes the gray value gradient condition of the pixel points at the edge of the impurities to obtain the direction run difference, and more accurately reflects the direction change condition of each pixel point;
meanwhile, the weights of the pixels with the same standard deviation shadow value as the central pixel in each pixel window are combined, the standard deviation shadow value duty ratio of the pixel is represented by using the sum of the weights, the probability density function of the standard deviation shadow value of the raw oil image is obtained after normalization through counting the weights of the pixels with the same standard deviation shadow value in the raw oil image, so that the cumulative distribution function of the CLAHE algorithm is optimized, the contrast enhancement effect of the impurity pixels is reflected more truly, the detection precision of impurities in the raw oil is improved, and the accurate classification of the raw oil grade is facilitated.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. 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 are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and the same or similar parts of each embodiment are referred to each other, and each embodiment mainly describes differences from other embodiments.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; the technical solutions described in the foregoing embodiments are modified or some of the technical features are replaced equivalently, so that the essence of the corresponding technical solutions does not deviate from the scope of the technical solutions of the embodiments of the present application, and all the technical solutions are included in the protection scope of the present application.

Claims (10)

1. A method for classifying a raw oil based on image processing, characterized in that the method comprises the steps of:
collecting an original raw oil image and preprocessing to obtain the raw oil image;
obtaining the number of areas divided by the raw oil image according to the energy gradient of the raw oil image; obtaining raw oil standard gray values of all pixel points according to gray information of the pixel points in the local window of each pixel point in each region of the raw oil image; obtaining standard deviation shadow values of all pixel points according to the absolute value of the difference between the gray value of each pixel point and the standard gray value of the raw oil in each region; according to the standard deviation shadow value of each pixel point in the local window, each standard deviation shadow level of the local window; obtaining the direction run-length difference of each standard deviation shadow level according to the distribution of each standard deviation shadow level of the local window; obtaining impurity contrast factors of all pixel points according to the direction run-length differences of all standard deviation image levels in the local windows of all pixel points;
obtaining the weight of each pixel point according to the impurity contrast factor of each pixel point; obtaining the final weight of each pixel point according to the weight of each pixel point and the standard deviation shadow value of each pixel point in the local window;
obtaining an accumulated distribution function of standard deviation shadow values of the raw oil image according to the final weight of each pixel point, and obtaining a raw oil enhanced image by combining the accumulated distribution function and a contrast-limited self-adaptive histogram equalization algorithm;
and dividing the raw oil enhanced image by using an Ojin threshold segmentation method to obtain impurity region pixel points, and obtaining raw oil grade classification according to the number of the impurity region pixel points and a preset threshold.
2. The method for classifying a raw oil based on image processing as claimed in claim 1, wherein the specific method for obtaining the number of areas divided by the raw oil image from the energy gradient of the raw oil image is as follows:
and (3) taking the ratio of the energy gradient of the raw oil image to the area of the raw oil image as the average energy gradient of the raw oil image, and obtaining the number of areas divided by the raw oil image according to square rounding of the average energy gradient.
3. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the specific method for obtaining raw oil standard gray values of each pixel point according to gray information of the pixel point in each pixel point local window in each region of the raw oil image is as follows:
respectively calculating the gray average value, the gray standard deviation and the gray range in each pixel local window in each region according to the gray information in each pixel local window in each region;
taking the difference between the gray average value of the local window and the gray average value of the region as a first priority, taking the gray extremely poor of the local window as a second priority, and taking the gray standard deviation of the local window as a third priority;
and finding a raw oil standard window according to the priority sequences of the first priority, the second priority and the third priority, and taking the gray average value of the raw oil standard window as the standard gray value of the raw oil without impurities.
4. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the specific method for classifying each standard deviation image level of the local window according to the standard deviation image values of each pixel point in the local window is as follows:
taking the standard deviation shadow value of each pixel point in the local window as the same standard deviation shadow level; and counting the number of different standard deviation image stages in the local window to be used as the standard deviation image stages of the local window.
5. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the expression for obtaining the directional run-length differences of each standard deviation stage from the distribution of each standard deviation stage of the local window is:
according to each pixel point in each standard deviation image level of the local window, calculating the sequence distribution condition of each pixel point in each direction in the local window;
the difference average value calculated based on each pixel point in the direction with the largest sequence distribution difference is recorded as the largest difference;
and solving the average value of the maximum difference of each pixel point in each standard deviation image stage in the local window to obtain the direction run-length difference of each standard deviation image stage in the local window.
6. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the expression for obtaining the impurity contrast factor of each pixel according to the directional run-length difference of each standard deviation image level in each pixel partial window is:
in the method, in the process of the application,representing the number of standard deviation values present in the local window, +.>Representing the%>Probability of occurrence of a standard deviation stage, +.>Representing the%>Direction run-length difference of each standard deviation stage, < ->The impurity contrast factor of each pixel is represented.
7. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the expression for obtaining the weight of each pixel point according to the impurity contrast factor of each pixel point is:
in the method, in the process of the application,to->An exponential function of the base +.>Weights representing pixel points, +.>Impurity contrast factor representing each pixel, < +.>Representing a weighted adjustment factor for adjusting the rate of increase of the pixel point weight function.
8. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the expression for obtaining the final weight of each pixel point according to the weight of each pixel point and the standard deviation of each pixel point in the local window is:
in the method, in the process of the application,for the local window size +.>Representing +.>Pixel weight of location, +.>Representing +.>Standard deviation of pixel points of the position, < ->Is the standard deviation of pixel points, < >>Representing the final weight of each pixel.
9. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the specific method for obtaining the cumulative distribution function of the standard deviation of the raw oil image according to the final weight of each pixel point is as follows:
summing the final weights of all pixel points with the same standard deviation shadow value according to the final weights of all pixel points in the raw oil image to obtain a probability density function of all standard deviation shadow values;
and obtaining the cumulative distribution function of each standard deviation shadow value in the raw oil image based on the probability density function of each standard deviation shadow value.
10. The method for classifying raw oil based on image processing as claimed in claim 1, wherein the specific method for obtaining raw oil classification according to the number of pixels in the impurity region and a preset threshold value is as follows:
threshold segmentation is carried out on the raw oil enhanced image by using an Ojin threshold segmentation method, so as to obtain impurity region pixel points;
the method comprises the steps of recording the number of pixel points of an impurity region in a raw oil enhanced image as a first number, recording the number of pixel points of the raw oil region in the raw oil image as a second number, and recording the ratio of the first number to the second number as an impurity ratio;
and respectively comparing the impurity ratio with a preset primary threshold and a preset secondary threshold, dividing the raw oil image with the impurity ratio lower than the primary threshold into one stage, dividing the raw oil image with the impurity ratio higher than the primary threshold and lower than the secondary threshold into two stages, dividing the raw oil image with the impurity ratio higher than the secondary threshold into three stages, and finishing classification of the raw oil grade.
CN202311048512.0A 2023-08-21 2023-08-21 Raw oil grade classification method based on image processing Active CN116778261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311048512.0A CN116778261B (en) 2023-08-21 2023-08-21 Raw oil grade classification method based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311048512.0A CN116778261B (en) 2023-08-21 2023-08-21 Raw oil grade classification method based on image processing

Publications (2)

Publication Number Publication Date
CN116778261A true CN116778261A (en) 2023-09-19
CN116778261B CN116778261B (en) 2023-11-14

Family

ID=88011992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311048512.0A Active CN116778261B (en) 2023-08-21 2023-08-21 Raw oil grade classification method based on image processing

Country Status (1)

Country Link
CN (1) CN116778261B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110517327A (en) * 2019-08-30 2019-11-29 大连海事大学 A kind of underwater picture Enhancement Method based on color correction and contrast stretching
CN112365424A (en) * 2020-11-17 2021-02-12 昆明物理研究所 Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium
CN114092361A (en) * 2022-01-20 2022-02-25 浙江芯昇电子技术有限公司 Image local contrast enhancement method for optimizing CLAHE
US20220076392A1 (en) * 2020-09-04 2022-03-10 Abova, Inc Method for x-ray dental image enhancement
CN114283076A (en) * 2021-12-08 2022-04-05 凌云光技术股份有限公司 Image processing method based on transmissivity and CLAHE algorithm
EP4091130A1 (en) * 2020-08-28 2022-11-23 Aselsan Elektronik Sanayi ve Ticaret Anonim Sirketi Variable clipping level calculation method for clahe algorithm
US20230186439A1 (en) * 2021-06-28 2023-06-15 Zhejiang Gongshang University Lane detection method integratedly using image enhancement and deep convolutional neural network
CN116563166A (en) * 2023-05-19 2023-08-08 重庆真测科技股份有限公司 Image enhancement method, device, storage medium and equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110517327A (en) * 2019-08-30 2019-11-29 大连海事大学 A kind of underwater picture Enhancement Method based on color correction and contrast stretching
EP4091130A1 (en) * 2020-08-28 2022-11-23 Aselsan Elektronik Sanayi ve Ticaret Anonim Sirketi Variable clipping level calculation method for clahe algorithm
US20220076392A1 (en) * 2020-09-04 2022-03-10 Abova, Inc Method for x-ray dental image enhancement
CN112365424A (en) * 2020-11-17 2021-02-12 昆明物理研究所 Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium
US20230186439A1 (en) * 2021-06-28 2023-06-15 Zhejiang Gongshang University Lane detection method integratedly using image enhancement and deep convolutional neural network
CN114283076A (en) * 2021-12-08 2022-04-05 凌云光技术股份有限公司 Image processing method based on transmissivity and CLAHE algorithm
CN114092361A (en) * 2022-01-20 2022-02-25 浙江芯昇电子技术有限公司 Image local contrast enhancement method for optimizing CLAHE
CN116563166A (en) * 2023-05-19 2023-08-08 重庆真测科技股份有限公司 Image enhancement method, device, storage medium and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张学典;杨帆;常敏;: "基于图像信息熵统计直方图的图像增强算法", 包装工程, no. 13 *
李嘉雯;杜文莉;李进龙;钱锋;: "基于改进模糊C均值聚类算法的乙烯裂解原料识别", 化工学报, no. 12 *

Also Published As

Publication number Publication date
CN116778261B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
Tan et al. Exposure based multi-histogram equalization contrast enhancement for non-uniform illumination images
CN107680054B (en) Multi-source image fusion method in haze environment
CN108876743B (en) Image rapid defogging method, system, terminal and storage medium
CN107507173B (en) No-reference definition evaluation method and system for full-slice image
CN108765336B (en) Image defogging method based on dark and bright primary color prior and adaptive parameter optimization
CN109978848B (en) Method for detecting hard exudation in fundus image based on multi-light-source color constancy model
CN110852955B (en) Image enhancement method based on image intensity threshold and adaptive cutting
CN114118144A (en) Anti-interference accurate aerial remote sensing image shadow detection method
CN110910317B (en) Tongue image enhancement method
CN109377450A (en) A kind of edge-protected denoising method
CN115131375B (en) Automatic ore cutting method
CN115578660B (en) Land block segmentation method based on remote sensing image
CN115512224A (en) Road crack detection method with enhanced curve fitting contrast
CN114066757A (en) Digital detail enhancement regularization parameter self-adaptive selection method based on guided filtering
CN111667509B (en) Automatic tracking method and system for moving target under condition that target and background colors are similar
CN116778261B (en) Raw oil grade classification method based on image processing
CN116862809A (en) Image enhancement method under low exposure condition
CN116246174A (en) Sweet potato variety identification method based on image processing
CN110647843B (en) Face image processing method
CN112541859A (en) Illumination self-adaptive face image enhancement method
CN117575953B (en) Detail enhancement method for high-resolution forestry remote sensing image
CN117173642B (en) Building construction video real-time monitoring and early warning method based on big data
CN117274113B (en) Broken silicon wafer cleaning effect visual detection method based on image enhancement
CN114820397B (en) Image enhancement method and system based on attention degree
CN111223060B (en) Image processing method based on self-adaptive PLIP model

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