CN106447603A - Color image graying method - Google Patents
Color image graying method Download PDFInfo
- Publication number
- CN106447603A CN106447603A CN201610859787.6A CN201610859787A CN106447603A CN 106447603 A CN106447603 A CN 106447603A CN 201610859787 A CN201610859787 A CN 201610859787A CN 106447603 A CN106447603 A CN 106447603A
- Authority
- CN
- China
- Prior art keywords
- color
- coloured image
- image
- data
- represent
- 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
- 238000000034 method Methods 0.000 title claims abstract description 72
- 238000004458 analytical method Methods 0.000 claims abstract description 34
- 238000006243 chemical reaction Methods 0.000 claims abstract description 33
- 230000008569 process Effects 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 22
- 238000003672 processing method Methods 0.000 claims description 16
- 230000008859 change Effects 0.000 claims description 12
- 238000000638 solvent extraction Methods 0.000 claims description 5
- 239000003086 colorant Substances 0.000 abstract description 11
- 230000003252 repetitive effect Effects 0.000 abstract description 4
- 230000011218 segmentation Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 239000011159 matrix material Substances 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000003064 k means clustering Methods 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 101100136092 Drosophila melanogaster peng gene Proteins 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 238000011960 computer-aided design Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000005242 forging Methods 0.000 description 2
- 238000003709 image segmentation Methods 0.000 description 2
- 238000012804 iterative process Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000035945 sensitivity Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 206010008190 Cerebrovascular accident Diseases 0.000 description 1
- 241000196324 Embryophyta Species 0.000 description 1
- 241000219000 Populus Species 0.000 description 1
- 208000006011 Stroke Diseases 0.000 description 1
- 238000009412 basement excavation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000000205 computational method Methods 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 239000005022 packaging material Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
- 238000003892 spreading Methods 0.000 description 1
Classifications
-
- G06T3/04—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a color image graying method. The method includes the following steps that: 1) color analysis is performed on a color image A, the colors of the image A are classified, so that a plurality of color values can be obtained; 2) after being expanded, the classified color values are converted into data, and different data represent different color ranges; and 3) gray conversion is performed on a color image B of which the shape and colors are the same with the color image A through using the above data, so that a corresponding gray scale image B can be obtained. With the method of the present invention adopted, the problem of repetitive operation in repeated image color conversion can be solved, and conversion speed is improved, and image data are reduced by 2/3.
Description
Technical field
The invention belongs to field of information processing, and in particular to a kind of coloured image gray processing method.
Background technology
In daily life, a large amount of coloured images bring visual enjoyment, and therefore requirement of the people to cromogram be increasingly
The application of high, cromogram is more and more extensive, such as advertisement, packaging material etc..
At present in the expression of image, gray level image and coloured image is broadly divided into.Gray level image with a byte representation,
The size of its value is for 0--255. coloured image with three byte representations, and the color of each pixel is divided into tri- components of R, G, B, and
Each component is 0--255, and such a pixel can have the color change of 2,55*,255,*25,5=1,600 ten thousand.Color to be distinguished
Details, color change, brightness flop relative difficulty are than larger.If it W, is highly H that picture traverse is, then the data of piece image
For 3*W*H, this data is three times of formed objects gray level image.
Common processing method is that coloured image is converted to gray level image process, is on the one hand to utilize greyscale image data
Advantage more than the ripe Processing Algorithm of relatively small, gray level image, while reduce image procossing complexity, therefore, general cromogram
As Processing Algorithm is first coloured image to be converted to gray level image, then processed for gray level image.
The transfer algorithm of gray level image is converted to coloured image, numerous scientific workers have carried out numerous studies work:
Li Dong (Li Dong. a kind of color changeover method [J] based on color theme. Xinxiang University journal .2015,32 (9):29--32.)
A kind of color changeover method based on color theme is proposed, the method can maintain the space in region while color ratio is controlled
Concordance, helps people to realize the reception and registration of certain artistic conception;(Li Ruijuan, Chu Gaoli, Deng Qian, the king such as Li Ruijuan, Chu Gaoli, Deng Qian
Na. print quality detection color transformation model research:Packaging Engineering .2015,36 (11):145--148.) survey based on color target
Amount data, using three dimensional lookup table method and polynomial regression, set up RGB and CIE L*a*b* color space conversion model respectively
Method obtain reasonable effect;Wang Hui, old little carving, Wang Yigang (Wang Hui, old little carving, Wang Yigang. the improved non-linear overall situation
Mapping gray processing method [J]. computer-aided design and graphics journal [J], 2013,25 (10):1476 1479,1488.)
Improved non-linear global map gray processing method is proposed, to strengthen the edge feature of gray level image;Song Mingli, Wang Huiqiong,
Chen Chun (Song Mingli, Wang Huiqiong, Chen Chun. the color conversion [J] based on gauss hybrid models. computer-aided design and graphics
Journal, 2008,20 (11):1471 1476,1482.) a kind of color conversion method based on gauss hybrid models is proposed;Zhang Jian
Moral, Shao Dinghong (Zhang Jiande, Shao Dinghong. the improved image gray processing algorithm [J] based on color space distance. machinery and electronics,
2008, (1):A kind of improved image gray processing algorithm based on color space distance 63--65) is proposed, introduces Gauss operator
Processed, the target in image and background are separated;Refined of sea of Zhang Quanfa poplar court grade (Zhang Quanfa, Yang Haibin, Ren Chaodong,
Li Huan. quick high-fidelity gray processing technique study [J] of coloured image. Zhengzhou University's journal (Edition), 201, (3):66--
69.) a kind of quick high-fidelity gray processing method of coloured image is proposed, by the weights of reasonable approximate red, green, blue component, is obtained
Coloured image is completed to the very high and conversion speed of fidelity computing formula quickly and be converted to gray level image;The auspicious Jiang Tian of Liu Qing sends out
(Liu Qingxiang, Jiang Tianfa. the research [J] of transfer algorithm between colored and gray level image. Wuhan University of Technology's journal (traffic science with
Engineering version) .2003, (3):A kind of HLS model that 32 coloured images be converted into 8 gray level images 344--346.) is proposed
Transfer algorithm;Zhou Jin and, Peng Futang (Zhou Jinhe, Peng Futang. a kind of selectable image gray processing method [J]. computer work
Journey, 2006, (20):198--200.) propose a kind of the random color gray scale that chooses is turned to black, and get over the color distance
Remote color, the higher method of its gray value realizes conversion;Zhang Zhijun, and Sun Zhihui (Zhang Zhijun, Sun Zhihui. based on VC platform
The gray processing technology [J] of coloured image. automatic technology and application, 2005,24 (1):61--64.) utilize palette techniques reality
The existing gray processing based on the coloured image of VC platform;Zhang Mingjun, Li Xuan, Wang Yujia (Zhang Mingjun, Li Xuan, Wang Yujia. based on gray scale
Change the color images under water [J] of weighed value adjusting. Harbin Engineering University's journal, 2015,36 (5):707--713.)
(Zhang,Mingjun;Li,Xuan;Wang, Yujia, Underwater color image segmentation based
on weight adjustment for color-to-gray[J].Harbin Gongcheng Daxue Xuebao/
Journal of Harbin Engineering University, v 36, n 5, p 707-713, May 25,2015.) propose
A kind of color image segmentation method under water based on gray processing weighed value adjusting;Old forging raw Song Fengfei, Zhang Qun (old forging life, Song Fengfei,
Zhang Qun. a kind of self adaptation global map method [J] of coloured image gray processing. computer system application, 2013,22 (9):
164 167,171.) a kind of self adaptation global map method of coloured image gray processing is proposed, to the cromogram with theme color
As the gray level image visual effect for significantly improving can be obtained;Guo Yanling, Peng Jinye, Wang great Kai (Guo Yanling, Peng Jinye, Wang great
Triumphant.Improve the colour-gray level image alternative approach [C] of TV restoration model. computer engineering and application, 2009,45 (07):
A kind of colour-gray level image alternative approach of improvement TV restoration model 192--194.) is proposed, is proposed using Sapiro etc.
The level set concept of vector image, in conjunction with full Variational Restoration, establishes new transformation model;Zhang Weixiang, Zhou Bingfeng (Zhang Weixiang,
Zhou Bingfeng. a kind of coloured image based on gradient field turns the method [J] of gray level image. image technology, 2007, (03):20--
22.) 0 a kind of method that coloured image based on gradient field turns gray level image is proposed.
Coloured image is converted to gray level image a variety of methods, and in RGB model, if during R=G=B, colour is table
Show a kind of greyscale color, the wherein value of R=G=B is called gray value.Therefore, each pixel of gray level image only needs a byte to deposit
Gray value (also known as brightness value) is put, tonal range is 0-255.With the process of a pixel of a byte representation image colored
Image gray processing.
The gray processing of image is processed, and conventional has following four design:
1st, weighted mean method
According to importance and other indexs, three components are weighted averagely with different weights.As human eye is not to
With the sensitivity difference of color, therefore, average energy is weighted to RGB three-component and obtains more rational gray level image.
Different weights are given according to importance or other indexs to R, G, B, and make the value weighted average of R, G, B, i.e.,
R=G=B=(WrR+WgG+WbB)/3
Wherein Wr, Wg, Wb are respectively the weights of R, G, B.Wr, Wg, Wb take different values, and weighted average method is just formed not
Same gray level image.Due to sensitivity highest of the human eye to green, redness is taken second place, minimum to blueness, therefore makes Wg>Wr>Wb will
Obtain the rational gray level image of comparison.Experiment and theoretical derivation prove, when working as Wr=0.30, Wg=0.59, Wb=0.11, i.e., when
Vgray=0.30R+0.59G+0.11B
During R=G=B=Vgray, rational gray level image can be obtained.
2nd, mean value method:Meansigma methodss are obtained using the value of R, G, B, i.e.,
R=G=B=(R+G+B)/3
This meansigma methods is the gray value of gray level image.
3rd, maximum value process:The value of R, G, B is made to be equal to maximum in 3 values one, i.e.,
R=G=B=max (R, G, B)
Take gray value of the maximum for gray level image.
4th, LUT Method:256 kinds of gray values are obtained using the combination of 256 R, G, B values.
But, for the coloured image of some limited kind of colors, said method once will be transported for each image
Calculate, reduce efficiency.
Content of the invention
It is an object of the invention to provide a kind of coloured image gray processing method, to overcome the problems of the prior art, this
Invention solves the problems, such as the repetitive operation in the conversion of multiimage's color, improves conversion speed, view data is reduced 2/
3.Extensive lookups table method improves the reliability of conversion to a certain extent, selects different range of error, can improve conversion
Tolerance and precision.
For reaching above-mentioned purpose, the present invention is adopted the following technical scheme that:
A kind of coloured image gray processing method, comprises the following steps:
1) color analysis record analyses process are carried out to coloured image A, by the color of image A carry out classification obtain some
Plant color value;
2) data will be converted to after the color value extension of classification, different color gamuts are represented with different data;
3) it is directed to and coloured image A shape and color identical coloured image B, directly applies above-mentioned data to carry out gray scale and turn
Get corresponding gray-scale maps B in return.
Further, step 1) in carry out color analysis record analyses process to coloured image A, by the color of image A
The concrete grammar that is classified is:
1.1) color value of any pixel in coloured image A is set as c (r, g, b), wherein r=0,1,2 ..., 255, g
=0,1,2 ..., 255, b=0,1,2 ..., 255;
1.2) for two color image pixel ci=(ri,gi,bi) and cj=(rj,gj,bj), i, j=0,1,2 ..., M*
N-1, if met:F(ri,gi,bi,rj,gj,bj(Δ r, Δ g, Δ b), then the two pixels are identical, i.e. color phase for)≤Δ f
With, otherwise, the two pixel differences, i.e. color difference;Wherein M, N represent columns and the line number of coloured image A, and F represents pixel
Between parser, Δ f be a kind of criterion;
1.3) after color analysis, coloured image A is represented using n kind color, respectively c0=(r0,g0,b0)、c1
=(r1,g1,b1)、...、cn-1=(rn-1,gn-1,bn-1).
Further, the parser between pixel be partitioning algorithm, clustering algorithm or become scaling method;Criterion be Euclidean away from
From, mahalanobis distance or function.
Further, step 2) it is specially:To color value c (c0,c1,...,cn-1) changed, c0Be converted to d0、c1Turn
It is changed to d1、...、cn-1Be converted to dn-1, described be converted to indirect assignment, or for linearly or nonlinearly converting.
Further, step 3) in the method for coloured image B gray processing be directly:
Any pixel c for coloured image Bk=(rk,gk,bk) (k=0,1,2,3 ..., M*N-1), if it and coloured silk
Analysis result c of color image Al=(rl,gl,bl) meet between (l=0,1,2 ... n-1)
Then think that the two pixels are identical, i.e., color is identical;Identical color is with same numeral di(i=0,1,2,
... n-1) representing, in formula, K, G are respectively a kind of conversion, Δ rlRepresent rlSide-play amount, Δ glRepresent glSide-play amount, Δ bl
Represent blSide-play amount, l=0,1,2 ..., n-1.
Further, the actual conditions for meeting between any pixel of coloured image B and the analysis result of coloured image A
For:
Further, step 3) the middle classification results for applying coloured image A, enter to coloured image B according to extensive lookups table
Row gradation conversion, concretely comprises the following steps:
1) extensive lookups table is constructed:Represent by the n kind color expansion that obtains of analysis and with n data, respectively:d0=
(r0,g0,b0)、d0=(r0,g0,b0±Δb)、d0=(r0,g0±Δg,b0)、d0=(r0±Δr,g0,b0)、d0=(r0,g0±
Δg,b0±Δb)、d0=(r0±Δr,g0±Δg,b0)、d0=(r0±Δr,g0,b0±Δb)、d0=(r0±Δr,g0±
Δg,b0±Δb)、...、di=(ri,gi,bi)、di=(ri,gi,bi±Δb)、di=(ri,gi±Δg,bi)、di=(ri±
Δr,gi,bi)、di=(ri,gi±Δg,bi±Δb)、di=(ri±Δr,gi±Δg,bi)、di=(ri±Δr,gi,bi±
Δb)、di=(ri±Δr,gi±Δg,bi±Δb)、...、dn-1=(rn-1±Δr,gn-1±Δg,bn-1±Δb);
2) apply this n data to represent coloured image B, realize the gray processing to coloured image B and change.
Compared with prior art, the present invention has following beneficial technique effect:
The present invention is split to coloured image A, is partitioned into different colours, with the different color of different digitized representations,
The numeral had both represented color while can be regarded as a kind of gray value, can be simultaneously used in the process of colored and gray level image, i.e.,
Can be to the market demand Color Image Processing algorithm, it is also possible to the market demand gray level image Processing Algorithm, for and color
Color image A shape, color identical image B, can directly apply above-mentioned segmentation result to be changed, so only need to carry out
Once split computing, then segmentation result is applied in a large amount of identical image, so as to data volume can be reduced in a large number, improve algorithm
Speed, reduction algorithm difficulty, solve the problems, such as the repetitive operation in the conversion of multiimage's color, improve conversion speed, will figure
As data reduction 2/3, extensive lookups table method can further improve conversion speed.
Description of the drawings
Fig. 1 is method of the present invention general flow chart;
Fig. 2 is the color analysis algorithm flow chart of the present invention;
Fig. 3 is K- means clustering algorithm flow chart;
Fig. 4 is FCM clustering algorithm flow chart;
Fig. 5 is construction extensive lookups table algorithm flow chart;
Fig. 6 is extensive lookups table color transfer algorithm flow chart.
Specific embodiment
Below in conjunction with the accompanying drawings the present invention is described in further detail:
Referring to Fig. 1, it is contemplated that, for the coloured image of some limited kind of colors, if color of image is fewer, color relative
The little application scenario of the change of single, shade, change of color brightness, it may be considered that with fewer data represent color,
Gradation conversion is carried out than conversion method faster.First color is analyzed, then analysis result is applied to gray scale and turns
In changing, based on the coloured image gray processing algorithm steps of color analysis it is:
1st, coloured image A is split, intermediate result is recorded, is partitioned into different colours;
2nd, combine segmentation result and extend intermediate result;
3rd, with the color gamut that different digitized representations is different, the numeral had both represented color while can be regarded as a kind of ash
Angle value, can be simultaneously used in the process of colored and gray level image, you can to the market demand Color Image Processing algorithm, also may be used
With to the market demand gray level image Processing Algorithm;
4th, for shape, color identical image B in clustering algorithm, directly apply above-mentioned segmentation result carry out turn
Change.
Advantage of this is that and only need to once be split computing, then segmentation result is applied to a large amount of identical image
In, so as to data volume can be reduced in a large number, improved algorithm speed, reduced algorithm difficulty.
Speed is improved further can by setting up the method for extensive lookups table, extended method is as shown in Figure 5.
As shown in Fig. 2 the purpose of color analysis is that color is classified, same color is divided into a class, different colours
Be divided into different classes, if in coloured image any pixel color value be c (r, g, b), wherein r=0,1,2 ..., 255, g
=0,1,2 ..., 255, b=0,1,2 ..., 255, M, N represent the columns of image and line number, r represent red, g represent green,
B represents blue.After color analysis, coloured image can be represented with n kind color, respectively c0=(r0,g0,b0)、c1=
(r1,g1,b1)、...、cn-1=(rn-1,gn-1,bn-1), Δ riRepresent riSide-play amount, Δ giRepresent giSide-play amount, Δ biRepresent
biSide-play amount, i=0,1,2 ..., n-1.
For two color image pixel ci=(ri,gi,bi) and cj=(rj,gj,bj), i, j=0,1,2 ..., M*N-1,
If met:
F(ri,gi,bi,rj,gj,bj)≤Δf(Δr,Δg,Δb)
Then think that the two pixels are identical, i.e., color is identical;Otherwise, then it is assumed that the two pixel differences, i.e. color difference;
Identical pixel (color) is with same color ci=(ri,gi,bi) (or ci) (i=0,1,2 ..., n-1) representing, n is this
The number of colours of image.In formula, F represents the parser between pixel, such as partitioning algorithm, clustering algorithm, change scaling method etc., analysis
Intermediate result is recorded in algorithm;Δ f is a kind of criterion, such as Euclidean distance, mahalanobis distance, function etc..
Color value c (the c obtained by above-mentioned color analysis0,c1,...,cn-1) changed, c0Be converted to d0、c1Be converted to
d1..., conversion here can be indirect assignment, or certain linearly or nonlinearly convert.
If be analyzed with the method for cluster, n kind color has n cluster centre ci=(ri,gi,bi), i=0,1,
2nd ..., n-1, each cluster centre ciA kind of color is represented, clustering algorithm is relatively more, conventional has K- mean cluster and obscure
Cluster.
1st, K- mean cluster
K- mean cluster (K-Means clustering) is that one kind that Mac Queen James B is proposed is non-supervisory in real time
Clustering algorithm, as shown in Figure 3.The algorithm belongs to the clustering algorithm based on distance, as the efficiency of the algorithm is higher, so in section
Learn with industrial circle, be widely used when clustering to large-scale data, be a kind of extremely influential technology.
The basic ideas of K- means clustering algorithm be minimize object function on the basis of data are divided into predetermined
Class number K, its principle is simple, be suitable for processing mass data.The running of K- means clustering algorithm is:Cluster is first specified
The value, the condition of convergence of number K, K initial cluster center or maximum iteration time, then according to the similarity measurement criterion that specifies
(distance), by each data distribution in data set to the cluster centre of " nearest " or " most like ", records allocation result, is formed
K different class, then respectively using the mean vector of each apoplexy due to endogenous wind data as the new cluster centre of this class, by data according to phase
Redistributed like property measurement criterion, clustered through iterating when meeting the condition of convergence or reaching maximum iteration time
Process terminates.
Sample in sample space is divided into K class, the center of each class is, with representing sample xiCorresponding
Cluster centre cjThe distance between, then all data points in sample space are with cluster centre which is located apart from summation target
Function J is representing, its mathematic(al) representation is:
The cluster centre value of each class is:
njRepresent the number of same class data.
Object function J directly reflects the quality of Clustering Effect, and its value is less, then it represents that the cluster is compacter, more independent.Cause
This can be improved and be optimized clustering schemes by the value of constantly reduction object function, the cluster when J minimalization, as most
Excellent clustering schemes.Record analyses process is needed during the algorithm is realized.
2nd, fuzzy clustering
FCM Algorithms (Fuzzy C-Means) abbreviation FCM.The method is proposed at first by Dunn, then by Bezdek
Develop and promoted FCM algorithm.FCM algorithm is the fuzzy clustering method based on object function most popular at present, its core
Thought is thought exactly data set to be divided into multiple class clusters, and the similarity each other of the data object in same class cluster is very big, no
Data object similarity in similar cluster is very little.FCM is the algorithm based on Fuzzy Set Theory, and it is attributed to one cluster
With the nonlinear programming problem that certain constrains, by an iterative process constantly optimization object function and obtain data set
Fuzzy division and cluster result.FCM algorithm is the earliest clustering algorithm based on object function, is also based on object function cluster
In algorithm, theoretical research obtains relatively sufficient algorithm, and oneself is through being widely used in image procossing, computer vision, pattern at present
The different field such as identification data excavation.
By sample space X={ x0,x1,…,xi,…,xn-1Sample be divided into C subset S0, S1,…,Sc-1, cluster centre
For C={ c0,c1,…,cj,…,cc-1, use dij=(xi,cj) represent sample xiCorresponding center cjThe distance between, uij
Represent sample xiTo jth class SjDegree of membership, then the object function J of FCM algorithmFCMBe mathematically represented as:
ui jMeet the constraint condition:
uij≥0,0≤j≤c-1,0≤i≤n-1.
Subordinated-degree matrix U={ uijIt is c × n matrix.
dijFor the distance between i-th sample in sample space and j-th cluster centre, m ∈ [1, ∞) be more than etc.
In 1 Fuzzy Exponential, the effect of m is the fog-level for adjusting subordinated-degree matrix U, and m value is bigger, then subordinated-degree matrix U's is fuzzy
Degree is higher, and the optimum valuing range for finding m through experimental analysiss is [1.5,2.5], and ordinary circumstance is ordered m=2.FCM is clustered
The cluster process of algorithm is substantially to object function JFCMThe process that minimizes in an iterative process, data are in each cluster
Degree of membership u of the heartijIt is to be calculated according to Lagrange Multiplier Method:
The flow process of FCM clustering algorithm is as shown in Figure 4:
It is actually repeatedly excellent during iteration that flow process according to FCM algorithm can be seen that FCM clustering algorithm
Change the process of cluster centre and subordinated-degree matrix, therefore this method is also commonly known as K means method or dynamic state clustering.FCM
Not only computational methods simple operation speed is fast for clustering algorithm, and has and compare intuitively geometry implication, but it can only use phase
Therefore the cluster centre that answers relatively is suitable for the data class cluster of the non-convex shape such as bulbous-style, and calculates representing whole class
Method is all more sensitive to noise data in general.Through constantly proving, the convergence has been proved:
FCM algorithm can start to converge to its object function J along an iteration subsequence from any given initial pointFCMLocal minimum point
Or saddle point.Record analyses process is needed during the algorithm is realized.
3rd, record analyses process
Different from general partitioning algorithm, this algorithm records different pieces of information between lower class when clustering according to the method described above
Mapping, such as Ci (Ri, Gi, Bi) -- > Di, Ci (Ri+1, Gi, Bi) -- > Di etc., a conversion table thus can be formed, as 1 institute of table
Show, table 1 is usually a discontinuous table, and it is the enumerated table of cluster result.
1 look-up table configuration of table
R | G | B | D |
… | … | … | … |
Ri-1 | Gi-1 | Bi-1 | Di |
Ri-1 | Gi-1 | Bi | Di |
Ri-1 | Gi | Bi | Di |
Ri+1 | Gi+1 | Bi+1 | Di |
Rj | Gj | Bj | Dj |
… | … | … | … |
For, color number identical image B identical with image A color, the segmentation result of direct application image A is become
Change, conversion method has:
1st, extension conversion
Any pixel c for coloured image Bk=(rk,gk,bk) (k=0,1,2,3 ..., M*N-1), if it and coloured silk
Analysis result c of color image Al=(rl,gl,bl) meet between (l=0,1,2 ... n-1)
Then think that the two pixels are identical, i.e., color is identical;Identical pixel (color) is with same numeral di(i=0,
1st, 2 ..., n-1) representing, it is believed that the algorithm be.Otherwise, then it is assumed that the two pixel differences,
I.e. color is different, and color is not simultaneously need to the new value of distribution.In formula, K, G are certain conversion, Δ rlRepresent rlSide-play amount, Δ gl
Represent glSide-play amount, Δ blRepresent blSide-play amount, l=0,1,2 ..., n-1.Due to due to display format, usual n is little
In 256, and number of colours is far longer than n.
Most typical such as:
Then think ck=(rk,gk,bk) and cl=(rl,gl,bl) color is identical, identical color can with identical value come
Represent.
2nd, extensive lookups table conversion
In order to improve arithmetic speed, can be in the method for application construction extensive lookups table:Found respectively according to color analysis first
The color value of class and scope, construct extensive lookups table according to color value and scope:d0=(r0,g0,b0)、d0=(r0,g0,b0±Δ
b)、d0=(r0,g0±Δg,b0)、d0=(r0±Δr,g0,b0)、d0=(r0,g0±Δg,b0±Δb)、d0=(r0±Δr,
g0±Δg,b0)、d0=(r0±Δr,g0,b0±Δb)、d0=(r0±Δr,g0±Δg,b0±Δb)、...、di=(ri,
gi,bi)、di=(ri,gi,bi±Δb)、di=(ri,gi±Δg,bi)、di=(ri±Δr,gi,bi)、di=(ri,gi±Δg,
bi±Δb)、di=(ri±Δr,gi±Δg,bi)、di=(ri±Δr,gi,bi±Δb)、di=(ri±Δr,gi±Δg,
bi±Δb)、...、dn-1=(rn-1±Δr,gn-1±Δg,bn-1± Δ b), extensive lookups table structure is as shown in table 2.
2 extensive lookups table structure of table
Application extension look-up table is changed, it is necessary first to construct color table, and the method for constructing color table has:
1), intermediate result item is inserted:During analysis color, the periphery centered on certain color has been saved
The total data of color, the data are entirely insertable in look-up table, and give these data with color center identical data (such as
Table 1);
2) extension is inserted:Extension be around certain color center be considered as same color whole colors, give
Extension and color center identical data, i.e., be extended according to Δ r, Δ g, Δ b, and spreading result is as shown in table 2.
If the robustness of coloured image algorithm is relatively good, for same width coloured image, same partitioning algorithm is used, point
It is identical to cut result;For shape and color identical image, the color value of its corresponding point is basically identical, it follows that such as
The color segmentation result of fruit one width figure of application splitting other width figure, as a result should be identical;So, we can just answer
With the above results, gradation conversion is carried out to coloured image according to extensive lookups table.Flow chart is as shown in Figure 6.
For any pixel P (r in image Bi,gi,bi), the process of application extension look-up table is:
1st, in extensive lookups table, r is foundiOK;
2nd, find in extensive lookups table and riIdentical giOK;
3rd, find in extensive lookups table and ri、giIdentical biOK, the corresponding value of the row is transformation result gray value;
4th, in extensive lookups table if there is no with riOr giOr biIdentical row, changes extensive lookups table, inserts new
Categorical data simultaneously gives new value;
5th, repeat 1-4 till the data of all images B have been traveled through.
For m same color image:p1、p2、...、pm-1If will detect whether they are identical, conventional algorithm is to use
This m coloured image of same algorithm process, then comparative result, such benefit is that algorithm is fixed, and weak point is to process
Data volume big, process time is long.
The dominant ideas of the present invention are first to width coloured image applied analysis algorithm therein, find out whole in image
Color and the color gamut close with each color, then distribute data to shades of colour, represent one with data
Kind of color gamut (in view of the color error that caused of impact of parser and other factors, represents one with a number
In the range of color, i.e. a number corresponds to multiple color value);Then by this analysis result application and other images, exist first
All colours are traveled through in other images, then these color corresponding conversion are and data as before, so as to realize to whole
The conversion process of image;The analysis to all images is so avoided, parser is reduced to 1/m.
The present invention solves the problems, such as the repetitive operation in the conversion of multiimage's color, improves conversion speed, by picture number
According to reducing 2/3.
Claims (7)
1. a kind of coloured image gray processing method, it is characterised in that comprise the following steps:
1) color analysis record analyses process are carried out to coloured image A, the color of image A is carried out classification and obtains several face
Colour;
2) data will be converted to after the color value extension of classification, different color gamuts are represented with different data;
3) it is directed to and coloured image A shape and color identical coloured image B, directly applies above-mentioned data to carry out gradation conversion and obtain
To corresponding gray-scale maps B.
2. a kind of coloured image gray processing method according to claim 1, it is characterised in that step 1) in coloured image
A carries out color analysis record analyses process, and the concrete grammar classified by the color of image A is:
1.1) color value of any pixel in coloured image A is set as c (r, g, b), wherein r=0,1,2 ..., 255, g=0,
1,2 ..., 255, b=0,1,2 ..., 255;
1.2) for two color image pixel ci=(ri,gi,bi) and cj=(rj,gj,bj), i, j=0,1,2 ..., M*N-1,
If met:F(ri,gi,bi,rj,gj,bj(Δ r, Δ g, Δ b), then the two pixels are identical, i.e., color is identical, no for)≤Δ f
Then, the two pixel differences, i.e. color difference;Wherein M, N represent columns and the line number of coloured image A, and F represents between pixel
Parser, Δ f is a kind of criterion;
1.3) after color analysis, coloured image A is represented using n kind color, respectively c0=(r0,g0,b0)、c1=
(r1,g1,b1)、...、cn-1=(rn-1,gn-1,bn-1).
3. a kind of coloured image gray processing method according to claim 2, it is characterised in that the parser between pixel
For partitioning algorithm, clustering algorithm or change scaling method;Criterion is Euclidean distance, mahalanobis distance or function.
4. a kind of coloured image gray processing method according to claim 2, it is characterised in that step 2) it is specially:To face
Colour c (c0,c1,...,cn-1) changed, c0Be converted to d0、c1Be converted to d1、...、cn-1Be converted to dn-1, described be converted to
Indirect assignment, or for linearly or nonlinearly converting.
5. a kind of coloured image gray processing method according to claim 2, it is characterised in that step 3) in directly to colour
The method of image B gray processing is:
Any pixel c for coloured image Bk=(rk,gk,bk) (k=0,1,2,3 ..., M*N-1), if it and cromogram
Analysis result c as Al=(rl,gl,bl) meet between (l=0,1,2 ... n-1)
Then think that the two pixels are identical, i.e., color is identical;Identical color is with same numeral di(i=0,1,2 ... n-1)
To represent, in formula, K, G are respectively a kind of conversion, Δ rlRepresent rlSide-play amount, Δ glRepresent glSide-play amount, Δ blRepresent bl's
Side-play amount, l=0,1,2 ..., n-1.
6. a kind of coloured image gray processing method according to claim 5, it is characterised in that any picture of coloured image B
Between element and the analysis result of coloured image A, the actual conditions of satisfaction is:
7. a kind of coloured image gray processing method according to claim 2, it is characterised in that step 3) in application cromogram
As the classification results of A, gradation conversion is carried out to coloured image B according to extensive lookups table, is concretely comprised the following steps:
1) extensive lookups table is constructed:Represent by the n kind color expansion that obtains of analysis and with n data, respectively:d0=(r0,g0,
b0)、d0=(r0,g0,b0±Δb)、d0=(r0,g0±Δg,b0)、d0=(r0±Δr,g0,b0)、d0=(r0,g0±Δg,b0
±Δb)、d0=(r0±Δr,g0±Δg,b0)、d0=(r0±Δr,g0,b0±Δb)、d0=(r0±Δr,g0±Δg,b0
±Δb)、...、di=(ri,gi,bi)、di=(ri,gi,bi±Δb)、di=(ri,gi±Δg,bi)、di=(ri±Δr,gi,
bi)、di=(ri,gi±Δg,bi±Δb)、di=(ri±Δr,gi±Δg,bi)、di=(ri±Δr,gi,bi±Δb)、di
=(ri±Δr,gi±Δg,bi±Δb)、...、dn-1=(rn-1±Δr,gn-1±Δg,bn-1±Δb);
2) apply this n data to represent coloured image B, realize the gray processing to coloured image B and change.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610859787.6A CN106447603B (en) | 2016-09-28 | 2016-09-28 | A kind of color image gray processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610859787.6A CN106447603B (en) | 2016-09-28 | 2016-09-28 | A kind of color image gray processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106447603A true CN106447603A (en) | 2017-02-22 |
CN106447603B CN106447603B (en) | 2019-04-12 |
Family
ID=58171178
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610859787.6A Active CN106447603B (en) | 2016-09-28 | 2016-09-28 | A kind of color image gray processing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106447603B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108230405A (en) * | 2017-11-30 | 2018-06-29 | 中原智慧城市设计研究院有限公司 | Image white balancing treatment method based on gray processing |
CN108765501A (en) * | 2018-04-16 | 2018-11-06 | 深圳技术大学(筹) | A kind of image gray processing method and storage medium |
CN114268704A (en) * | 2021-12-20 | 2022-04-01 | 北京镁伽科技有限公司 | Image data conversion method, conversion device, signal generator, and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064766A (en) * | 2006-04-26 | 2007-10-31 | 夏普株式会社 | Image processing method and image processing apparatus |
CN101137067A (en) * | 2006-08-29 | 2008-03-05 | 扬智科技股份有限公司 | Color fast simplifying method |
CN102881001A (en) * | 2011-07-13 | 2013-01-16 | 富士通株式会社 | Device and method for converting color image into grey scale image |
US20140320505A1 (en) * | 2013-04-30 | 2014-10-30 | Kobo Incorporated | Greyscale animation |
-
2016
- 2016-09-28 CN CN201610859787.6A patent/CN106447603B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064766A (en) * | 2006-04-26 | 2007-10-31 | 夏普株式会社 | Image processing method and image processing apparatus |
CN101137067A (en) * | 2006-08-29 | 2008-03-05 | 扬智科技股份有限公司 | Color fast simplifying method |
CN102881001A (en) * | 2011-07-13 | 2013-01-16 | 富士通株式会社 | Device and method for converting color image into grey scale image |
US20140320505A1 (en) * | 2013-04-30 | 2014-10-30 | Kobo Incorporated | Greyscale animation |
Non-Patent Citations (3)
Title |
---|
刘勇: "关于彩色化灰度图像的算法研究及实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
罗婷婷: "两种改进的彩色图像灰度化算法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
赵晨炜: "基于模糊聚类的彩色图像分割方法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108230405A (en) * | 2017-11-30 | 2018-06-29 | 中原智慧城市设计研究院有限公司 | Image white balancing treatment method based on gray processing |
CN108765501A (en) * | 2018-04-16 | 2018-11-06 | 深圳技术大学(筹) | A kind of image gray processing method and storage medium |
WO2019200689A1 (en) * | 2018-04-16 | 2019-10-24 | 深圳技术大学(筹) | Image graying method and device, and storage medium |
CN114268704A (en) * | 2021-12-20 | 2022-04-01 | 北京镁伽科技有限公司 | Image data conversion method, conversion device, signal generator, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106447603B (en) | 2019-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103854261B (en) | The bearing calibration of colour cast image | |
CN102902956B (en) | A kind of ground visible cloud image identifying processing method | |
CN100589521C (en) | Method for printing and outputting L*a*b* image with high fidelity | |
CN102184250B (en) | Garment fabric sample retrieving method based on colored image matching | |
CN103793888B (en) | Image enhancing method based on main colors of reference image | |
CN106454300B (en) | Color domain expanding system and method | |
CN107657619A (en) | A kind of low-light (level) Forest fire image dividing method | |
CN106447603A (en) | Color image graying method | |
CN103839079A (en) | Similar image colorization algorithm based on classification learning | |
CN103617596A (en) | Image color style transformation method based on flow pattern transition | |
CN106919910B (en) | Traffic sign identification method based on HOG-CTH combined features | |
CN103914124B (en) | Energy-conservation Color Mapping Approach towards three-dimensional scenic | |
CN107169508A (en) | A kind of cheongsam Image emotional semantic method for recognizing semantics based on fusion feature | |
CN101853513B (en) | Time and space significance visual attention method based on entropy | |
CN107481206A (en) | MIcrosope image background equalization Processing Algorithm | |
CN103946868A (en) | Processing method and system for medical images | |
CN107680142A (en) | Improve the method for the overlapping mapping of overseas color | |
CN101359366B (en) | Pattern matching recognition system and implementing method thereof | |
CN102945556A (en) | Seven color separation algorithm based on cellular element partition neugebauer equation | |
CN107146258B (en) | Image salient region detection method | |
CN1307484C (en) | Method for color separation page description grey scale grating | |
CN106296749A (en) | RGB D image eigen decomposition method based on L1 norm constraint | |
CN106599185B (en) | HSV-based image similarity identification method | |
CN104240197A (en) | Achromatic algorithm capable of maintaining contrast ratio, color consistency and gray pixel characteristics | |
CN104463917B (en) | Based on the normalized image vision conspicuousness detection method of division |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |