CN114494205A - Door and window corrosion degree determination method based on self-adaptive color grading - Google Patents
Door and window corrosion degree determination method based on self-adaptive color grading Download PDFInfo
- Publication number
- CN114494205A CN114494205A CN202210102914.3A CN202210102914A CN114494205A CN 114494205 A CN114494205 A CN 114494205A CN 202210102914 A CN202210102914 A CN 202210102914A CN 114494205 A CN114494205 A CN 114494205A
- Authority
- CN
- China
- Prior art keywords
- chromaticity
- rust
- interval
- color
- door
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Abstract
The invention discloses a door and window corrosion degree judging method based on self-adaptive color grading, relates to the field of artificial intelligence, and is mainly used for judging the door and window corrosion degree. The method comprises the following steps: collecting rusted door and window pictures; acquiring pictures with different corrosion grades and chromaticity histograms thereof; dividing the chromatic value into chromatic intervals, and acquiring the chromatic histogram area of each chromatic interval in different corrosion grade pictures; calculating the similarity and uniqueness of each chromaticity interval; color level division is carried out, and the weight of each color level is calculated; acquiring the area proportion of each color level in the rusted door and window pictures and the area proportion of the color levels in the pictures with different rust grades; calculating the area proportion approach value of each color level; and taking the corrosion grade corresponding to the highest approach value as the corrosion degree of the corroded door and window. According to the technical means provided by the invention, the characteristic colors representing the corrosion degree are independently divided through color classification, and weights are given to the characteristic colors, so that the corrosion grade classification can be more accurately realized.
Description
Technical Field
The invention relates to the field of artificial intelligence, in particular to a method for judging the tampering and rusting degree of people based on self-adaptive color grading.
Background
At present, the rust removal of the door and window steel plates needs to judge the rust grade firstly, and a corresponding rust removal scheme is provided according to the rust grade. However, most of the currently used techniques for identifying the corrosion grade of metal plates are electromagnetic detection, ultrasonic detection and radioisotope detection, and these detection methods have many advantages, but have the disadvantages of high detection cost, small application range and the like.
Meanwhile, in the current visual-based rust degree determination method, the rust degree is determined by the number of rust pixels, but the method can only realize simple hierarchical division and cannot fully reflect the rust degree.
Disclosure of Invention
The invention provides a door and window corrosion degree judging method based on self-adaptive color grading, which aims to solve the existing problems and comprises the following steps: collecting rusted door and window pictures and performing semantic segmentation to obtain rusted area pictures; obtaining standard corrosion pictures with different corrosion grades, and obtaining a chromaticity category set; obtaining a color hierarchy set through a chroma category intersection; acquiring the area proportion of each color level in each standard rusty picture and rusty door and window picture; calculating the similarity of each color level, calculating the uniqueness of each color level according to the similarity, and calculating the weight of each color level according to the uniqueness; and calculating the corrosion grade corresponding to the highest similarity value as the corrosion degree of the corroded door and window.
According to the technical means provided by the invention, the characteristic colors capable of representing the corrosion degree are independently divided through color classification, higher weight is given, and the corrosion grade division can be more accurately realized.
The invention adopts the following technical scheme that a door and window corrosion degree judging method based on self-adaptive color grading comprises the following steps:
and collecting the rusted door and window pictures and performing semantic segmentation to obtain rusted area pictures.
And obtaining standard rust pictures with different rust grades, converting the standard rust pictures into HSV color space, and obtaining the chromaticity histogram of the standard rust pictures with different rust grades.
And uniformly dividing the chromaticity value into a plurality of chromaticity intervals, and obtaining the chromaticity histogram area of each chromaticity interval in standard rust pictures with different rust grades.
And calculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval, and calculating the uniqueness of each corresponding chromaticity interval according to the similarity.
And carrying out color level division on the chromaticity intervals according to the uniqueness of each chromaticity interval to obtain a plurality of color levels, and calculating the weight corresponding to each color level according to the uniqueness of each chromaticity interval.
And acquiring the area proportion of each color level in the rusted door and window picture and the area proportion of each color level in each standard rusted picture with different rusty grades.
And respectively calculating the area ratio of each color level of the rusted door and window picture and the area ratio of each color level of the standard rusted picture with different rusty grades to be close to each other by utilizing the weight.
And taking the rust grade of the standard rust picture corresponding to the obtained highest approach value as the rust degree of the rusted door and window.
Further, a door and window corrosion degree determination method based on self-adaptive color grading, which is a method for calculating the similarity of the chromaticity histogram regions of all standard corrosion pictures with different corrosion grades in each corresponding chromaticity interval, and comprises the following steps:
calculating the dispersion difference R of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity intervalq;
Calculating the mean value of the frequency deviation of the chromaticity histogram area of the standard rust picture with different rust grades in each corresponding chromaticity interval
Calculating the comprehensive increase and decrease consistency Q of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity intervalq;
By said difference of dispersion RqMean value of frequency deviationAnd comprehensive increase and decrease of consistency QqCalculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval, wherein the expression is as follows:
wherein, XqThe similarity of the chromaticity histogram area of the standard rust pictures with different rust grades in the corresponding qth chromaticity interval, QqRepresents the said comprehensive increase and decrease consistency corresponding to the qth chromaticity interval, RqRepresents the dispersion difference corresponding to the q-th chromaticity interval,and the average value of the frequency deviation corresponding to the qth chroma interval is represented.
Further, a door and window corrosion degree judging method based on self-adaptive color grading calculates the uniqueness of each corresponding chromaticity interval according to the similarity:
calculating the expression of the uniqueness T of each chromaticity interval as follows:
wherein, TqDenotes the uniqueness of the qth chromaticity interval, XqAnd representing the similarity of the chrominance histogram areas of the standard rust pictures with different rust grades in the corresponding q-th chrominance interval.
Further, a door and window corrosion degree judging method based on self-adaptive color grading, wherein a method for dividing the color grades of the chromaticity intervals according to the uniqueness of each chromaticity interval comprises the following steps:
the uniqueness of T<α1The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha1<T<α2The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha2<T<α3The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha3<T<α4The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha4<T<α5The continuous chrominance interval of (a) is divided into a color hierarchy;
wherein alpha is1、α2、α3、α4、α5Is [ alpha ]1,α5]The threshold interval of (2).
Further, a door and window corrosion degree judging method based on self-adaptive color grading calculates the weight corresponding to each color level according to the uniqueness of each chromaticity interval:
the expression for calculating the weight for each color level is:
where ρ isrRepresenting the r-th colour levelThe weight of the weight is calculated,the uniqueness of the qth chromaticity interval in the mth color layer is shown, and e the number of chromaticity intervals in the mth color layer is shown.
Further, the door and window corrosion degree determination method based on self-adaptive color grading utilizes the weights to respectively calculate the approximate values of the area proportion of each color grade of the corroded door and window picture and the area proportion of each color grade of the standard corrosion picture with different corrosion grades:
the expression for calculating the proximity value is:
wherein the content of the first and second substances,showing the area ratio of each color level of the rusted door and window picture and theThe area ratio of each color level of the standard rust picture of each rust grade is approximate to a value, WrRepresenting the area proportion occupied by the r-th color level in the rusty door and window picture,indicating the r-th color level atArea ratio, rho, occupied in standard rust pictures of individual rust gradesrIs the weight of the r-th color level.
Further, a door and window rust degree determination method based on self-adaptive color grading uniformly divides the chroma value into a plurality of chroma intervals, and obtains the chroma histogram area of each chroma interval in different rust grade standard rust pictures:
uniformly dividing the chromatic value into q chromatic intervals, counting the areas occupied by the chromatic histogram of the standard rust picture with different rust grades in each chromatic interval, and obtaining each chromatic interval containingAnd (4) corresponding chromaticity histograms of standard rust pictures of various grades.
The invention has the beneficial effects that: according to the technical means provided by the invention, the characteristic colors capable of representing the corrosion degree are independently divided through color classification, higher weight is given, and the corrosion grade division can be more accurately realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a method for determining corrosion degree of a door/window based on adaptive color classification according to an embodiment of the present invention;
fig. 2 is another door and window corrosion degree determination method based on adaptive color grading according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Example 1
As shown in fig. 1, a method for determining door and window rusting degree based on adaptive color grading according to an embodiment of the present invention includes:
101. and collecting the rusted door and window pictures and performing semantic segmentation to obtain rusted area pictures.
The scenario addressed by the present embodiment is: the door and window has a plurality of corrosion traces, and the corrosion degree of the door and window is judged by analyzing the corrosion traces, so that the door and window is convenient for further corrosion treatment.
The door and window picture is shot through the camera to the embodiment, handles the picture, carries out the corrosion degree according to characteristic information in the image and divides.
In another embodiment, the method for acquiring the door and window pictures may be any device with the functions of processing pixels and data, such as a mobile phone, a camera, and the like, and the method for acquiring the door and window pictures is not limited at all.
102. And obtaining standard rust pictures with different rust grades, converting the standard rust pictures into HSV color space, and obtaining the chromaticity histogram of the standard rust pictures with different rust grades.
Because the invention carries out corrosion degree analysis based on color characteristics, the door and window pictures need to be converted into HSV space, and H channel chrominance images are extracted, so that the door and window chrominance images can be obtained.
And acquiring corrosion example pictures of different levels of corrosion grades in a network database.
And (3) cutting out a non-rusting area: according to experience, the chromaticity threshold value of the rusty area is A ═ 15-35]In the standard chroma picture, when the chroma value h epsilon A of the pixel is kept unchanged, and when h does not belong to the range, the pixel value is replaced byHere, theAnd (4) representing the mean value of the chromaticity of the non-rust area in the door and window picture, and processing by the method to obtain the standard picture.
And correspondingly counting the processed standard corrosion grade chromaticity picture to generate a chromaticity histogram.
103. And uniformly dividing the chromaticity value into a plurality of chromaticity intervals, and obtaining the chromaticity histogram area of each chromaticity interval in standard rust pictures with different rust grades.
Uniformly dividing the chromatic value into q chromatic intervals, counting the areas occupied by the chromatic histogram of the standard rust picture with different rust grades in each chromatic interval, and obtaining each chromatic interval containingAnd (4) corresponding chromaticity histograms of standard rust pictures of various grades.
104. And calculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval, and calculating the uniqueness of each corresponding chromaticity interval according to the similarity.
Calculating the peak deviation degree of the chromaticity histogram area of the standard rust picture with different rust grades in each corresponding chromaticity interval;
calculating the dispersion difference of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval;
calculating the mean value of the frequency deviation of the chromaticity histogram area of the standard corrosion pictures with different corrosion grades in each corresponding chromaticity interval;
calculating the comprehensive increase and decrease consistency of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval;
through the peak deviation F, the dispersion difference R and the frequency deviation mean valueAnd calculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval by comprehensively increasing and decreasing the consistency Q.
105. And carrying out color level division on the chromaticity intervals according to the uniqueness of each chromaticity interval to obtain a plurality of color levels, and calculating the weight corresponding to each color level according to the uniqueness of each chromaticity interval.
The method for dividing the chrominance intervals into color levels according to the uniqueness of each chrominance interval comprises the following steps:
the uniqueness of T<α1The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha1<T<α2The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha2<T<α3The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha3<T<α4The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha4<T<α5Is divided into a color hierarchy.
Wherein alpha is1、α2、α3、α4、α5Is [ alpha ]1,α5]The threshold interval of (2).
Calculating the uniqueness of each color level through the similarity, and calculating the weight of the corresponding color level in standard corrosion pictures of different corrosion levels according to the multi-characteristics of each color level.
Since the area proportion of each color hierarchy in the rust pictures of different levels is different, and a representative color hierarchy exists in the rust picture of a certain level, the characteristics of the rust hierarchy can be well reflected, in this embodiment, the weight of each color hierarchy is calculated, so that the weighted approximate value of the area proportion of each color hierarchy is performed.
106. And acquiring the area proportion of each color level in the rusted door and window picture and the area proportion of each color level in each standard rusted picture with different rusty grades.
After the color levels are divided, the corresponding color areas of the standard pictures of the rust levels are divided by using the chromaticity interval of each color level, the number of pixels of each color level is counted to obtain the color area vector of each level, and the color area vector is subjected to normalization processing to obtain the area ratio.
107. And respectively calculating the area ratio of each color level of the rusted door and window picture and the area ratio of each color level of the standard rusted picture with different rusty grades to be close to each other by utilizing the weight.
And comparing the area proportion occupied by each color level in the obtained door and window sliding window corrosion picture with standard corrosion pictures with different corrosion levels respectively, and judging according to the obtained approach value.
The expression for calculating the proximity value is:
wherein the content of the first and second substances,showing the area ratio of each color level and the second color level of the rusty door and window pictureThe area ratio of each color level of the standard rust picture of each rust grade is approximate to a value, WrRepresenting the area proportion occupied by the r-th color level in the rusty door and window picture,indicating the r-th color level atArea ratio, rho, occupied in standard rust pictures of individual rust gradesrIs the weight of the r-th color level.
108. And taking the rust grade of the standard rust picture corresponding to the obtained highest approach value as the rust degree of the rusted door and window.
And judging through the calculated similarity value to obtain the corrosion grade of the standard corrosion picture corresponding to the maximum similarity value, and taking the grade as the door and window corrosion degree grade.
According to the technical means provided by the invention, the characteristic colors capable of representing the corrosion degree are independently divided through color classification, higher weight is given, and the corrosion grade division can be more accurately realized.
Example 2
As shown in fig. 2, another door and window corrosion degree determination method based on adaptive color grading according to an embodiment of the present invention includes:
201. and collecting the rusted door and window pictures and performing semantic segmentation to obtain rusted area pictures.
The scenario addressed by the present embodiment is: the door and window has a plurality of corrosion traces, and the corrosion degree of the door and window is judged by analyzing the corrosion traces, so that the door and window is convenient for further corrosion treatment. This embodiment is through shooting door and window picture, handles the picture, carries out the corrosion degree according to the interior characteristic information of image and divides.
Because the shot door and window images contain a lot of background information which can affect the quality of subsequent level division, the door and window images need to be divided first. The style and the color of the door and window are various, and the background area object is not fixed, so the invention utilizes a DNN semantic segmentation mode to identify the object in the segmented image.
The relevant content of the DNN network is as follows:
the data set used is a door and window image data set acquired on the front side.
The pixels needing to be segmented are divided into two types, namely the labeling process of the corresponding label of the training set is as follows: and in the semantic label of the single channel, the label of the pixel at the corresponding position belonging to the background class is 0, and the label of the pixel belonging to the door and window is 1.
The task of the network is classification, so the loss function used is a cross entropy loss function.
202. And obtaining standard rust pictures with different rust grades, converting the standard rust pictures into HSV color space, and obtaining the chromaticity histogram of the standard rust pictures with different rust grades.
The tarnish characteristic changes can be seen by observing images of different tarnish grades: the A-grade rust has rust spots in a small area, the B-grade rust has discrete small paint coats falling off, the C-grade rust has a concentrated rust area, the rust area presents a dense granular feeling caused by falling of rust particles, and the D-grade rust has a massive rust pit caused by falling of deep rust blocks. For the performance characteristics of different corrosion grades, the door and window corrosion grades can be divided by analyzing the door and window pictures based on the representation.
Replacing the color of the non-rusting area in the standard picture with the color of the non-rusting area in the door and window picture: obtaining example pictures with different levels of corrosion, and segmenting a non-corrosion area in a standard picture by using a color threshold, wherein the specific process comprises the following steps:
obtaining standard example pictures of different levels: and acquiring corrosion example pictures of different levels of corrosion grades in a network database.
And converting the example picture from the RGB space to the HSV space, and extracting the chrominance picture of the H channel.
And (3) cutting out a non-rusting area: according to experience, the chromaticity threshold value of the rusty area is A ═ 15-35]In the standard chroma picture, when the chroma value h epsilon A of the pixel is kept unchanged, and when h does not belong to the range, the pixel value is replaced byHere, theAnd (4) representing the mean value of the chromaticity of the non-rust area in the door and window picture, and processing by the method to obtain the standard picture.
And correspondingly counting the processed standard corrosion grade chromaticity pictures to generate a chromaticity histogram.
203. And uniformly dividing the chromaticity value into a plurality of chromaticity intervals, and obtaining the chromaticity histogram area of each chromaticity interval in standard rust pictures with different rust grades.
Uniformly dividing the chromaticity value into a plurality of chromaticity intervals, and obtaining the chromaticity histogram area of each chromaticity interval in standard rust pictures with different rust grades:
uniformly dividing the chromatic value into q chromatic intervals, counting the areas occupied by the chromatic histogram of the standard rust picture with different rust grades in each chromatic interval, and obtaining each chromatic interval containingAnd (4) corresponding chromaticity histograms of standard rust pictures of various grades.
Taking A, B, C, D four-grade standard rust picture as an example, the histogram areas are La, Lb, Lc, Ld, i.e. in this embodiment,a value of 4; obtaining the chromaticity histogram area of each standard rust level picture of each interval, and assuming that the chromaticity histogram area set of each standard rust level picture in the qth chromaticity interval is as follows:
Uq={Laq,Lbq,Lcq,Ldq}
2041. calculating the similarity of the chromaticity histogram areas of all standard rust pictures with different rust grades in each corresponding chromaticity interval, and calculating the uniqueness of each corresponding chromaticity interval according to the similarity;
the method for calculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval comprises the following steps:
calculating the dispersion difference of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval;
respectively calculating the dispersion difference of the histogram region sets, taking the qth histogram region set as an example, calculating the dispersion difference of each histogram in the region set, LaqHas a color value interval of min (ha)q)~max(haq) The frequency value corresponding to each chromaticity isAnalogy to this way to obtainLbq,Lcq,LdqCorresponding sequence of frequency values in LaqFor example, the histogram dispersion in the chromaticity interval is calculated as:
faq,iis represented by LaqThe frequency value corresponding to the ith gray-scale value in the histogram of the region,is represented by LaqFrequency mean of region histogram, g represents LaqThe number of gray values in the region histogram.
The dispersion difference between the histogram regions of each level in the region histogram set is as follows:
σaqis represented by LaqDispersion of the region histogram, σ bqRepresents LbqDispersion of the region histogram.
Calculating the mean value of the frequency deviation of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval;
respectively calculating the frequency deviation mean value of the region histograms in the region histogram set to obtain a histogram region La of the corrosion grade AqFor example, the region histogram and Lb are calculated separatelyq,Lcq,LdqThe frequency deviation mean value of the histogram of the region, the frequency value corresponding to each histogram region in the chromaticity interval isRust of grade AThe mean value of the frequency deviation between the histogram region of the corrosion picture and the histogram region of the B-grade corrosion picture is
Is represented by LaqThe frequency value corresponding to the ith gray-scale value in the histogram of the region,represents LbqFrequency value e corresponding to gray value of region histogram i1,e2Respectively representing the minimum gray value and the maximum gray value of the chroma interval corresponding to the region histogram set.
Obtaining the average value of frequency deviation among histograms in other regions by analogy with the method, and obtaining the comprehensive frequency deviation H of the q-th chroma interval by averagingq。
Calculating the comprehensive increase and decrease consistency of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval;
calculating LaqThe frequency value fa corresponding to the chromatic value is classifiediWith an amplification of
ZaiIs represented by LaqFrequency value amplification of region histogram at i gray value
Analog LaqDetermining Lb by frequency value whole amplitude calculation mode of region histogram at i gray valueqFrequency value amplification Zb of region histogram at i gray valuei
The histogram of the two regions has a consistency of increasing and decreasing
ZaiIs represented by LaqFrequency value amplification of class at i-gray value, ZbiRepresents LbqFrequency value amplification of region histogram at i gray value, YiIs represented by LaqRegion histogram and LbqConsistency of increase and decrease of region histogram at gray value i
When the consistency Y is increased or decreasedi<2 and Zai*ZbiWhen the number is more than 0, the position is considered to be increased or decreased. The number M of the positions with the consistency increased or decreased is counted in the mode
Thus the proportion of the consistency of the two categories in the intersection is
M represents ZaiRegion histogram and ZbiThe number N of increase/decrease consistency chroma values between the region histograms indicates the number of histogram regions in the q-th chroma bin.
Analogy is carried out to find the increase and decrease consistency of two region histograms in the q chromaticity interval region histogram sets.
Calculating the comprehensive consistency of increase and decrease of histogram sets of Q chroma interval regions by averaging Qq
By said difference of dispersion RqMean value of frequency deviationAnd comprehensive increase and decrease consistency QqCalculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval, wherein the expression is as follows:
wherein, XqThe chroma histogram area of standard rust pictures representing different rust grades corresponds to the q-th colorSimilarity between degree intervals, QqRepresents the integrated increase/decrease consistency, R, corresponding to the qth chromaticity intervalqRepresents the dispersion difference corresponding to the qth chromaticity interval,and the average value of the frequency deviation corresponding to the qth chroma interval is represented.
Calculating the uniqueness of each corresponding chromaticity interval according to the similarity:
calculating the expression of the uniqueness T of each chromaticity interval as follows:
wherein, TqDenotes the uniqueness of the qth chromaticity interval, XqAnd representing the similarity of the chrominance histogram areas of the standard rust pictures with different rust grades in the corresponding q-th chrominance interval.
And carrying out normalization processing on the calculated uniqueness value.
2042. Carrying out color level division on the chromaticity intervals according to the uniqueness of each chromaticity interval to obtain a plurality of color levels, and calculating the weight corresponding to each color level according to the uniqueness of each chromaticity interval;
the method for dividing the chrominance intervals into color levels according to the uniqueness of each chrominance interval comprises the following steps:
the uniqueness of T<α1The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha1<T<α2The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha2<T<α3The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha3<T<α4The continuous chromaticity interval is divided into a color level;
the single piece of the Chinese characterCharacteristic alpha4<T<α5Is divided into a color hierarchy.
Wherein alpha is1、α2、α3、α4、α5Is [ alpha ]1,α5]Threshold interval of (2), in this embodiment α1Is 0.5, alpha2Is 0.7, alpha3Is 0.85, alpha4Is 0.95, alpha5Is 1.
Calculating the weight corresponding to each color level according to the uniqueness of each chromaticity interval:
the expression for calculating the weight for each color level is:
where ρ isrA weight representing the r-th color level,the uniqueness of the qth chromaticity interval in the mth color layer is shown, and e the number of chromaticity intervals in the mth color layer is shown.
The larger the value, the larger the difference of the color histogram distribution, i.e. the stronger the difference between the rust levels can be represented, and thus the heavier the weight.
2043. Acquiring the area proportion of each color level in the rusted door and window picture and the area proportion of each color level in each standard rusted picture with different rusty grades;
205. respectively calculating the area proportion of each color level of the rusted door and window picture and the area proportion of each color level of the standard rusted picture with different rusty grades to be close to each other by utilizing the weight;
after the color levels are divided, the corresponding color areas of the standard pictures of the rust levels are divided by using the chromaticity intervals of the levels, the number of pixels of each color level is counted to obtain the color area vector of each color level in the pictures of the rust levels, and the color area vectors are normalized to obtain the area ratio. .
And similarly, dividing to obtain the area proportion of each color level in the picture of the rusted door and window area.
And respectively calculating the area proportion of each color level of the rusted door and window picture and the area proportion of each color level of the standard rusted picture of different rusty grades to be close to a value by utilizing the weight:
the expression for calculating the proximity value is:
wherein the content of the first and second substances,showing the area ratio of each color level of the rusted door and window picture and theThe area ratio of each color level of the standard rust picture of each rust grade is approximate to a value, WrRepresents the area proportion occupied by the r-th color level in the rusty door and window picture,indicating the r-th color level atArea ratio, rho, occupied in standard rust pictures of individual rust gradesrIs the weight of the r-th color level.
206. And taking the rust grade of the standard rust picture corresponding to the obtained highest approach value as the rust degree of the rusted door and window.
In this embodiment, when the approaching value of the rusted door and window picture and the a-level rusted picture is the maximum, the rusted level of the rusted door and window picture is a.
According to the technical means provided by the invention, the characteristic colors capable of representing the corrosion degree are independently divided through color classification, higher weight is given, and the corrosion grade division can be more accurately realized.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (7)
1. A door and window corrosion degree judging method based on self-adaptive color grading is characterized by comprising the following steps:
collecting rusted door and window pictures and performing semantic segmentation to obtain rusted area pictures;
obtaining standard corrosion pictures with different corrosion grades, converting the standard corrosion pictures into HSV color space, and obtaining chromaticity histograms of the standard corrosion pictures with different corrosion grades;
uniformly dividing the chromaticity value into a plurality of chromaticity intervals, and acquiring a chromaticity histogram area of each chromaticity interval in standard rust pictures with different rust grades;
calculating the similarity of the chromaticity histogram areas of all standard rust pictures with different rust grades in each corresponding chromaticity interval, and calculating the uniqueness of each corresponding chromaticity interval according to the similarity;
carrying out color hierarchy division on the chrominance intervals according to the uniqueness of each chrominance interval to obtain a plurality of color hierarchies, and calculating the weight corresponding to each color hierarchy according to the uniqueness of each chrominance interval;
acquiring the area proportion of each color level in the rusted door and window picture and the area proportion of each color level in each standard rusted picture with different rusty grades;
respectively calculating the area proportion of each color level of the rusted door and window picture and the area proportion of each color level of the standard rusted picture with different rusty grades to be close to each other by utilizing the weight;
and taking the rust grade of the standard rust picture corresponding to the obtained highest approach value as the rust degree of the rusted door and window.
2. The door and window corrosion degree judging method based on the self-adaptive color grading according to claim 1, wherein the method for calculating the similarity of the chromaticity histogram regions of the standard corrosion pictures with different corrosion grades in each corresponding chromaticity interval is as follows:
calculating the dispersion difference R of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity intervalq;
Calculating the mean value of the frequency deviation of the chromaticity histogram area of the standard rust picture with different rust grades in each corresponding chromaticity interval
Calculating the comprehensive increase and decrease consistency Q of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity intervalq;
By said difference of dispersion RqMean value of frequency deviationAnd comprehensive increase and decrease consistency QqCalculating the similarity of the chromaticity histogram areas of the standard rust pictures with different rust grades in each corresponding chromaticity interval, wherein the expression is as follows:
wherein XqThe chrominance histogram area of standard rust pictures representing different rust grades is in the corresponding q-th chrominance intervalDegree of similarity, QqRepresents the integrated increase/decrease consistency, R, corresponding to the qth chromaticity intervalqRepresents the dispersion difference corresponding to the qth chromaticity interval,and the average value of the frequency deviation corresponding to the qth chroma interval is represented.
3. The door and window rusting degree judgment method based on adaptive color grading according to claim 2, wherein the uniqueness corresponding to each chromaticity interval is calculated according to the similarity:
calculating the expression of the uniqueness T of each chromaticity interval as follows:
wherein, TqDenotes the uniqueness of the qth chromaticity interval, XqAnd representing the similarity of the chrominance histogram areas of the standard rust pictures with different rust grades in the corresponding q-th chrominance interval.
4. The method for determining the rusting degree of a door and window based on the adaptive color grading according to claim 3, wherein the method for dividing the chromaticity intervals in the color grading mode according to the uniqueness of each chromaticity interval comprises the following steps:
the uniqueness of T<α1The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha1<T<α2The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha2<T<α3The continuous chromaticity interval is divided into a color level;
the uniqueness of alpha3<T<α4The continuous chromaticity interval is divided into a color level;
will be describedThe uniqueness of alpha4<T<α5The continuous chromaticity interval is divided into a color level;
wherein alpha is1、α2、α3、α4、α5Is [ alpha ]1,α5]The threshold interval of (2).
5. The method for determining the rusting degree of a door and window based on adaptive color grading according to claim 3, wherein the weight corresponding to each color grade is calculated according to the uniqueness of each chromaticity interval:
the expression for calculating the weight for each color level is:
where ρ isrWeight, T, representing the r-th color levelrqThe uniqueness of the qth chromaticity interval in the mth color layer is shown, and e the number of chromaticity intervals in the mth color layer is shown.
6. The method for determining the door and window corrosion degree based on the adaptive color grading according to claim 5, wherein the weights are used for respectively calculating the approximate values of the area ratio of each color level of the corroded door and window picture and the area ratio of each color level of the standard corrosion picture with different corrosion grades:
the expression for calculating the proximity value is:
wherein the content of the first and second substances,showing the area ratio of each color level of the rusted door and window picture and theThe area ratio of each color level of the standard rust picture of each rust grade is approximate to a value, WrRepresenting the area proportion occupied by the r-th color level in the rusty door and window picture,indicating the r-th color level atArea ratio, rho, occupied in standard rust pictures of individual rust gradesrIs the weight of the r-th color level.
7. The door and window rusting degree judging method based on the adaptive color grading according to claim 1, wherein the chromatic value is uniformly divided into a plurality of chromatic intervals, and each chromatic interval is obtained in a chromatic histogram area of a standard rusting picture with different rusting grades:
uniformly dividing the chromatic value into q chromatic intervals, counting the areas occupied by the chromatic histogram of the standard rust picture with different rust grades in each chromatic interval, and obtaining each chromatic interval containingAnd (4) corresponding chromaticity histograms of standard rust pictures of various grades.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210102914.3A CN114494205B (en) | 2022-01-27 | 2022-01-27 | Door and window corrosion degree determination method based on self-adaptive color grading |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210102914.3A CN114494205B (en) | 2022-01-27 | 2022-01-27 | Door and window corrosion degree determination method based on self-adaptive color grading |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114494205A true CN114494205A (en) | 2022-05-13 |
CN114494205B CN114494205B (en) | 2023-04-18 |
Family
ID=81476395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210102914.3A Active CN114494205B (en) | 2022-01-27 | 2022-01-27 | Door and window corrosion degree determination method based on self-adaptive color grading |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114494205B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107185854A (en) * | 2017-05-17 | 2017-09-22 | 河北工业大学 | The algorithm of photovoltaic cell acetes chinensis and color classification based on RGB channel |
CN108416771A (en) * | 2018-03-07 | 2018-08-17 | 南京工业大学 | A kind of metal material corrosion area detection method based on monocular camera |
CN108563991A (en) * | 2018-03-08 | 2018-09-21 | 佛山市云米电器科技有限公司 | Kitchen fume concentration division methods and oil smoke concentration detection and interference elimination method |
-
2022
- 2022-01-27 CN CN202210102914.3A patent/CN114494205B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107185854A (en) * | 2017-05-17 | 2017-09-22 | 河北工业大学 | The algorithm of photovoltaic cell acetes chinensis and color classification based on RGB channel |
CN108416771A (en) * | 2018-03-07 | 2018-08-17 | 南京工业大学 | A kind of metal material corrosion area detection method based on monocular camera |
CN108563991A (en) * | 2018-03-08 | 2018-09-21 | 佛山市云米电器科技有限公司 | Kitchen fume concentration division methods and oil smoke concentration detection and interference elimination method |
Non-Patent Citations (4)
Title |
---|
强振平等: "局部累积直方图在彩色图像检索中的应用", 《计算机与数字工程》 * |
李正君等: "基于优化颜色直方图的图像检索方法", 《微计算机信息》 * |
纪钢等: "在HSV下的材料腐蚀特征区域颜色与边界量化处理", 《重庆理工大学学报(自然科学)》 * |
纪钢等: "基于腐蚀产物颜色分析的材料腐蚀程度评定方法", 《重庆理工大学学报(自然科学)》 * |
Also Published As
Publication number | Publication date |
---|---|
CN114494205B (en) | 2023-04-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Guo et al. | Hierarchical method for foreground detection using codebook model | |
WO2022099598A1 (en) | Video dynamic target detection method based on relative statistical features of image pixels | |
CN106096610B (en) | A kind of file and picture binary coding method based on support vector machines | |
CN115082683A (en) | Injection molding defect detection method based on image processing | |
CN107729812B (en) | Method suitable for recognizing vehicle color in monitoring scene | |
CN115222743A (en) | Furniture surface paint spraying defect detection method based on vision | |
CN110210477A (en) | A kind of digital instrument Recognition of Reading method | |
CN111967511B (en) | Foundation cloud picture classification method based on heterogeneous feature fusion network | |
CN115331119B (en) | Solid waste identification method | |
CN108829711B (en) | Image retrieval method based on multi-feature fusion | |
Fung et al. | A review of evaluation of optimal binarization technique for character segmentation in historical manuscripts | |
CN113537099A (en) | Dynamic detection method for fire smoke in highway tunnel | |
CN116503394B (en) | Printed product surface roughness detection method based on image | |
CN109858570A (en) | Image classification method and system, computer equipment and medium | |
CN109190455B (en) | Black smoke vehicle identification method based on Gaussian mixture and autoregressive moving average model | |
CN115205289B (en) | Vision-based cork wood floor raw material grading method | |
CN106570885A (en) | Background modeling method based on brightness and texture fusion threshold value | |
CN115100174A (en) | Ship sheet metal part paint surface defect detection method | |
CN115131375A (en) | Automatic ore cutting method | |
CN116246174B (en) | Sweet potato variety identification method based on image processing | |
CN114494205B (en) | Door and window corrosion degree determination method based on self-adaptive color grading | |
Jassim | Hybrid image segmentation using discerner cluster in FCM and histogram thresholding | |
Fahrurozi et al. | Wood classification based on edge detections and texture features selection | |
CN112784880B (en) | Method for marking visibility grade of expressway in foggy days based on natural feature statistical method | |
CN115393748A (en) | Method for detecting infringement trademark based on Logo recognition |
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 |