[go: up one dir, main page]

CN104268904A - Method and device for extracting main color of image - Google Patents

Method and device for extracting main color of image Download PDF

Info

Publication number
CN104268904A
CN104268904A CN201410459673.3A CN201410459673A CN104268904A CN 104268904 A CN104268904 A CN 104268904A CN 201410459673 A CN201410459673 A CN 201410459673A CN 104268904 A CN104268904 A CN 104268904A
Authority
CN
China
Prior art keywords
pixel
point group
seed point
picture
seed
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.)
Pending
Application number
CN201410459673.3A
Other languages
Chinese (zh)
Inventor
周峰
贺旭军
刘桂峰
姚辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Juntian Electronic Technology Co Ltd
Original Assignee
Zhuhai Juntian Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Juntian Electronic Technology Co Ltd filed Critical Zhuhai Juntian Electronic Technology Co Ltd
Priority to CN201410459673.3A priority Critical patent/CN104268904A/en
Publication of CN104268904A publication Critical patent/CN104268904A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a method and device for extracting the main color of an image, and relates to the technical field of image processing. The method and device for extracting the main color of the image resolve the problem in the prior art that the main color of an image can not be extracted accurately. The method includes the steps that at least two pixel points are selected in the image randomly; the selected pixel points serve as seed points, and a seed point group is set for each seed point; a seed point of which the RGB value is most similar to that of each pixel point is determined for the corresponding pixel point in the image; each pixel point is added to the seed point group where the seed point most similar to the corresponding pixel point is located; the average RGB value of each seed point group is calculated; whether each average RGB value is equal to the original RGB value of the corresponding seed point group is compared; when the convergence of the seed points is finished or the cycle index reaches a cycle index threshold value, the color corresponding to the average RGB value of the seed point group comprising the most pixel points is extracted to serve as the main color of the image. The method and device are mainly used for extracting the main color of the image in the software interface development process.

Description

Extract method and the device of picture domain color
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of method and the device that extract picture domain color.
Background technology
At present, when carrying out computer software interface development, in order to develop beautiful interface, dazzle cruel software product, meet the requirement at user to user interface, the technology often used is exactly extract the domain color of picture.
The method of existing extraction picture domain color mainly contains two kinds.Wherein a kind of method is: R, G, B value of pixels all in picture added up respectively, calculates R, G, B mean value of all pixels, using color corresponding for this R, G, B mean value as domain color; Another method is: have the maximum point of identical R, G, B value in statistics picture, using color corresponding for this R, G, B value as domain color.
Realizing in process of the present invention, inventor finds at least there is following technical matters in prior art:
Adopt the method for existing two kinds of extraction picture domain color, the domain color obtained is often not accurate enough, is not the color expected, differs greatly with expection.
Summary of the invention
In view of this, the method for the extraction picture domain color that the embodiment of the present invention provides and device, can get the domain color of picture more accurately.
On the one hand, the embodiment of the present invention provides a kind of method extracting picture domain color, comprising:
At least two pixels are chosen at random in picture;
Using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group;
For pixel each in described picture determines a rgb value and the immediate Seed Points of described pixel;
Described pixel is added in the seed point group at the immediate Seed Points place with described pixel;
Calculate the average RGB value of described seed point group;
Whether more described average RGB value is equal with the former rgb value of described seed point group;
If equal, then obtain the number of the pixel comprised in each seed point group;
If unequal, then judge whether cycle index reaches cycle index threshold value, if do not reach cycle index threshold value, then using described average RGB value as new Seed Points, return execution above-mentioned steps; If reach cycle index threshold value, obtain the number of the pixel comprised in each seed point group;
Extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.
On the other hand, the embodiment of the present invention provides a kind of device extracting picture domain color, comprising:
Pixel chooses unit, for choosing at least two pixels at random in picture;
Seed point group setting unit, for using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group;
Closest to Seed Points determining unit, for determining a rgb value and the immediate Seed Points of described pixel for pixel each in described picture;
Pixel adding device, for adding in the seed point group at the immediate Seed Points place with described pixel by described pixel;
Average RGB value computing unit, for calculating the average RGB value of described seed point group;
Whether rgb value comparing unit is equal with the former rgb value of described seed point group for more described average RGB value;
Cycle index judging unit, for judging whether cycle index reaches cycle index threshold value;
New seed point setting unit, for using described average RGB value as new Seed Points;
Pixel number acquiring unit, for when described average RGB value is equal with the former rgb value of described seed point group, obtain the number of the pixel comprised in each seed point group, or, when the former rgb value of described average RGB value and described seed point group is unequal, at described new seed point setting unit using described average RGB value as new Seed Points, and described seed point group setting unit, closest to Seed Points determining unit, pixel adding device, after average RGB value computing unit and rgb value comparing unit repeat corresponding actions, when described cycle index judging unit judges that cycle index reaches cycle index threshold value, obtain the number of the pixel comprised in each seed point group,
Domain color extraction unit, for extracting the domain color of color corresponding to the average RGB value that comprises the maximum seed point group of pixel number as described picture.
The method of the extraction picture domain color that the embodiment of the present invention provides and device, using random at least two pixels chosen in picture as Seed Points, for each Seed Points arranges a seed point group, for pixel each in described picture determines a rgb value and the immediate Seed Points of described pixel, described pixel is added in the seed point group at the immediate Seed Points place with described pixel, calculate the average RGB value of described seed point group, whether more described average RGB value is equal with the former rgb value of described seed point group, if when Seed Points has been restrained or cycle index reaches cycle index threshold value, extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.Compared with prior art, the present invention can get the domain color of picture more accurately, and accessed picture domain color more presses close to former picture.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet that the present invention extracts method one embodiment of picture domain color;
Fig. 2 is the schematic flow sheet of S10 in Fig. 1;
Fig. 3 is the schematic flow sheet of S12 in Fig. 1;
Fig. 4 is the structural representation that the present invention extracts device one embodiment of picture domain color;
Fig. 5 is the structural representation that in Fig. 4, pixel chooses unit 10;
Fig. 6 is the structural representation closest to Seed Points determining unit 12 in Fig. 4.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Referring to Fig. 1, the embodiment of the present invention provides a kind of method extracting picture domain color, comprising:
S10, in picture, choose at least two pixels at random;
S11, using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group;
S12, determine a rgb value and the immediate Seed Points of described pixel for pixel each in described picture;
S13, described pixel is added in the seed point group at the immediate Seed Points place with described pixel;
S14, calculate the average RGB value of described seed point group;
Whether S15, more described average RGB value be equal with the former rgb value of described seed point group, if equal, then performs step S18; If unequal, then perform step S16;
S16, judge whether cycle index reaches cycle index threshold value, if do not reach cycle index threshold value, then perform step S17; If reach cycle index threshold value, then perform step S18;
S17, using described average RGB value as new Seed Points, return perform S11 to S15;
S18, obtain the number of the pixel comprised in each seed point group;
S19, extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.
The method of the extraction picture domain color that the embodiment of the present invention provides, using random at least two pixels chosen in picture as Seed Points, for each Seed Points arranges a seed point group, for pixel each in described picture determines a rgb value and the immediate Seed Points of described pixel, described pixel is added in the seed point group at the immediate Seed Points place with described pixel, calculate the average RGB value of described seed point group, whether more described average RGB value is equal with the former rgb value of described seed point group, if when Seed Points has been restrained or cycle index reaches cycle index threshold value, extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.Compared with prior art, the present invention can get the domain color of picture more accurately, and accessed picture domain color more presses close to former picture.
Alternatively, extract in method one embodiment of picture domain color in the present invention, described at random in picture, choose at least two pixels (S10) before, also can comprise:
Pre-set cycle index threshold value.
Alternatively, extract in method one embodiment of picture domain color in the present invention, describedly at random in picture, choose at least two pixels (S10) and can comprise:
In picture, choose at least two unduplicated pixels at random, wherein, R, G, B component between any two pixels have at least one not identical.
Alternatively, extract in method one embodiment of picture domain color in the present invention, describedly at random in picture, choose at least two pixels (S10) and can comprise:
For the picture with Alpha passage, pixel Alpha value being less than predetermined value is removed.
In the present embodiment, the pixel in advance Alpha value being less than predetermined value is removed, can avoid that Alpha value is too low to have a negative impact to extraction picture domain color, thus ensure, when extracting the picture with Alpha passage, the domain color of picture to be obtained more accurately.
Referring to Fig. 2, alternatively, extract in method one embodiment of picture domain color in the present invention, describedly at random in picture, choose at least two pixels (S10) and can comprise:
S101, setting brightness range and saturation degree scope;
S102, the pixel not in described brightness range or saturation degree scope in described picture to be removed.
In the present embodiment, do not remove in picture at the pixel of brightness range or saturation degree scope in advance, the domain color of picture can be got on the one hand more accurately; The extraction efficiency of picture domain color can be improved on the other hand.
Alternatively, extract in method one embodiment of picture domain color in the present invention, describedly a seed point group (S11) is set can comprises for each Seed Points:
For described seed point group arranges four variable R t, Gt, Bt, Pt, wherein, Rt represents the summation of all pixel R component in described seed point group, Gt represents the summation of all pixel G components in described seed point group, Bt represents the summation of all pixel B components in described seed point group, and Pt represents the total number comprising pixel in described seed point group.
Referring to Fig. 3, alternatively, extract in method one embodiment of picture domain color in the present invention, described is that in described picture, each pixel determines that a rgb value and the immediate Seed Points of described pixel (S12) can comprise:
S121, calculate pixel distance between pixel and each Seed Points;
S122, determine that the Seed Points minimum with the pixel distance of described pixel is as rgb value and the immediate Seed Points of described pixel.
Alternatively, in the present embodiment, the pixel distance (S121) between described calculating pixel and each Seed Points can comprise:
Calculate the pixel distance S between pixel and each Seed Points, described S=(r1-r2) * (r1-r2)+(g1-g2) * (g1-g2)+(b1-b2) * (b1-b2), wherein, R, G, B value of described pixel is respectively r1, g1, b1, and R, G, B value of described Seed Points is respectively r2, g2, b2.
Alternatively, extract in method one embodiment of picture domain color in the present invention, describedly described pixel added to (S13) in the seed point group at the immediate Seed Points place with described pixel and can comprise:
The Rt of described seed point group is added the R component of described pixel, the Gt of described seed point group is added the G component of described pixel, by the B component that the Bt of described seed point group adds described pixel, described Pt is added 1.
Alternatively, extract in method one embodiment of picture domain color in the present invention, the average RGB value (S14) of the described seed point group of described calculating can comprise:
Calculate the value of Rt/Pt, Gt/Pt, Bt/Pt respectively, using the average RGB value of the value of Rt/Pt, Gt/Pt, Bt/Pt as described seed point group.
Referring to Fig. 4, the embodiment of the present invention provides a kind of device extracting picture domain color, and the device of described extraction picture domain color comprises: pixel chooses unit 10, for choosing at least two pixels at random in picture, seed point group setting unit 11, for using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group, closest to Seed Points determining unit 12, for determining a rgb value and the immediate Seed Points of described pixel for pixel each in described picture, pixel adding device 13, for adding in the seed point group at the immediate Seed Points place with described pixel by described pixel, average RGB value computing unit 14, for calculating the average RGB value of described seed point group, whether rgb value comparing unit 15 is equal with the former rgb value of described seed point group for more described average RGB value, cycle index judging unit 16, for judging whether cycle index reaches cycle index threshold value, new seed point setting unit 17, for using described average RGB value as new Seed Points, pixel number acquiring unit 18, for when described average RGB value is equal with the former rgb value of described seed point group, obtain the number of the pixel comprised in each seed point group, or, when the former rgb value of described average RGB value and described seed point group is unequal, at described new seed point setting unit 17 using described average RGB value as new Seed Points, and described seed point group setting unit 11, closest to Seed Points determining unit 12, pixel adding device 13, after average RGB value computing unit 14 and rgb value comparing unit 15 repeat corresponding actions, when described cycle index judging unit 16 judges that cycle index reaches cycle index threshold value, obtain the number of the pixel comprised in each seed point group, domain color extraction unit 19, for extracting the domain color of color corresponding to the average RGB value that comprises the maximum seed point group of pixel number as described picture.
The device of the extraction picture domain color that the embodiment of the present invention provides, using random at least two pixels chosen in picture as Seed Points, for each Seed Points arranges a seed point group, for pixel each in described picture determines a rgb value and the immediate Seed Points of described pixel, described pixel is added in the seed point group at the immediate Seed Points place with described pixel, calculate the average RGB value of described seed point group, whether more described average RGB value is equal with the former rgb value of described seed point group, if when Seed Points has been restrained or cycle index reaches cycle index threshold value, extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.Compared with prior art, the present invention can get the domain color of picture more accurately, and accessed picture domain color more presses close to former picture.
Alternatively, extract in device one embodiment of picture domain color in the present invention, the device of described extraction picture domain color also can comprise:
Cycle index threshold setting unit, for pre-setting cycle index threshold value.
Alternatively, extract in device one embodiment of picture domain color in the present invention, described pixel chooses unit 10, also can be used in picture, choosing at least two unduplicated pixels at random, wherein, R, G, B component between any two pixels have at least one not identical.
Alternatively, extract in device one embodiment of picture domain color in the present invention, described pixel chooses unit 10, also can be used for for the picture with Alpha passage, and pixel Alpha value being less than predetermined value is removed.
In the present embodiment, do not remove in picture at the pixel of brightness range or saturation degree scope in advance, thus the domain color of picture can be got more accurately.
Referring to Fig. 5, alternatively, extract in device one embodiment of picture domain color in the present invention, described pixel is chosen unit 10 and also can be comprised:
Range set module 101, for setting brightness range and saturation degree scope;
Pixel removes module 102, for not removing in described picture at the pixel of described brightness range or saturation degree scope.
In the present embodiment, do not remove in picture at the pixel of brightness range or saturation degree scope in advance, the domain color of picture can be got on the one hand more accurately; The extraction efficiency of picture domain color can be improved on the other hand.
Alternatively, extract in device one embodiment of picture domain color in the present invention, described seed point group setting unit 11, also can be used for for described seed point group arranges four variable R t, Gt, Bt, Pt, wherein, Rt represents the summation of all pixel R component in described seed point group, and Gt represents the summation of all pixel G components in described seed point group, Bt represents the summation of all pixel B components in described seed point group, and Pt represents the total number comprising pixel in described seed point group.
Referring to Fig. 6, alternatively, extract in device one embodiment of picture domain color in the present invention, describedly can to comprise closest to Seed Points determining unit 12:
Pixel distance computing module 121, for calculating the pixel distance between pixel and each Seed Points;
Closest to Seed Points determination module 122, for determining that the Seed Points minimum with the pixel distance of described pixel is as rgb value and the immediate Seed Points of described pixel.
Alternatively, in the present embodiment, described pixel distance computing module 121, also can be used for calculating the pixel distance S between pixel and each Seed Points, described S=(r1-r2) * (r1-r2)+(g1-g2) * (g1-g2)+(b1-b2) * (b1-b2), wherein, R, G, B value of described pixel is respectively r1, g1, b1, and R, G, B value of described Seed Points is respectively r2, g2, b2.
Alternatively, extract in device one embodiment of picture domain color in the present invention, described pixel adding device 13, also can be used for the R component Rt of described seed point group being added described pixel, the Gt of described seed point group is added the G component of described pixel, the Bt of described seed point group is added the B component of described pixel, described Pt is added 1.
Alternatively, extract in device one embodiment of picture domain color in the present invention, described average RGB value computing unit 14, also can be used for the value calculating Rt/Pt, Gt/Pt, Bt/Pt respectively, using the average RGB value of the value of Rt/Pt, Gt/Pt, Bt/Pt as described seed point group.
The embodiment of the present invention extracts method and the device of picture domain color, goes for the domain color extracting picture in software interface exploitation, obtains the domain color of picture more accurately.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (RandomAccess Memory, RAM) etc.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (20)

1. extract a method for picture domain color, it is characterized in that, comprising:
At least two pixels are chosen at random in picture;
Using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group;
For pixel each in described picture determines a rgb value and the immediate Seed Points of described pixel;
Described pixel is added in the seed point group at the immediate Seed Points place with described pixel;
Calculate the average RGB value of described seed point group;
Whether more described average RGB value is equal with the former rgb value of described seed point group;
If equal, then obtain the number of the pixel comprised in each seed point group;
If unequal, then judge whether cycle index reaches cycle index threshold value, if do not reach cycle index threshold value, then using described average RGB value as new Seed Points, return execution above-mentioned steps; If reach cycle index threshold value, obtain the number of the pixel comprised in each seed point group;
Extract and comprise the domain color of color corresponding to the average RGB value of the maximum seed point group of pixel number as described picture.
2. the method for extraction picture domain color according to claim 1, is characterized in that, described at random in picture, choose at least two pixels before, also comprise:
Pre-set cycle index threshold value.
3. the method for extraction picture domain color according to claim 1, is characterized in that, describedly at random in picture, chooses at least two pixels and comprises:
In picture, choose at least two unduplicated pixels at random, wherein, R, G, B component between any two pixels have at least one not identical.
4. the method for extraction picture domain color according to claim 1, is characterized in that, describedly at random in picture, chooses at least two pixels and comprises:
For the picture with Alpha passage, pixel Alpha value being less than predetermined value is removed.
5. the method for extraction picture domain color according to claim 1, is characterized in that, describedly at random in picture, chooses at least two pixels and comprises:
Setting brightness range and saturation degree scope;
Do not remove in described picture at the pixel of described brightness range or saturation degree scope.
6. the method for extraction picture domain color according to claim 1, is characterized in that, describedly arranges a seed point group and comprises for each Seed Points:
For described seed point group arranges four variable R t, Gt, Bt, Pt, wherein, Rt represents the summation of all pixel R component in described seed point group, Gt represents the summation of all pixel G components in described seed point group, Bt represents the summation of all pixel B components in described seed point group, and Pt represents the total number comprising pixel in described seed point group.
7. the method for extraction picture domain color according to claim 6, is characterized in that, described is that in described picture, each pixel determines that a rgb value and the immediate Seed Points of described pixel comprise:
Calculate the pixel distance between pixel and each Seed Points;
Determine that the Seed Points minimum with the pixel distance of described pixel is as rgb value and the immediate Seed Points of described pixel.
8. the method for extraction picture domain color according to claim 7, is characterized in that, the pixel distance between described calculating pixel and each Seed Points comprises:
Calculate the pixel distance S between pixel and each Seed Points, described S=(r1-r2) * (r1-r2)+(g1-g2) * (g1-g2)+(b1-b2) * (b1-b2), wherein, R, G, B value of described pixel is respectively r1, g1, b1, and R, G, B value of described Seed Points is respectively r2, g2, b2.
9. the method for extraction picture domain color according to claim 8, is characterized in that, the described seed point group described pixel being added to the immediate Seed Points place with described pixel comprises:
The Rt of described seed point group is added the R component of described pixel, the Gt of described seed point group is added the G component of described pixel, by the B component that the Bt of described seed point group adds described pixel, described Pt is added 1.
10. the method for extraction picture domain color according to claim 9, is characterized in that, the average RGB value of the described seed point group of described calculating comprises:
Calculate the value of Rt/Pt, Gt/Pt, Bt/Pt respectively, using the average RGB value of the value of Rt/Pt, Gt/Pt, Bt/Pt as described seed point group.
11. 1 kinds of devices extracting picture domain color, is characterized in that, comprising:
Pixel chooses unit, for choosing at least two pixels at random in picture;
Seed point group setting unit, for using described at least two pixels as Seed Points, for each Seed Points arranges a seed point group;
Closest to Seed Points determining unit, for determining a rgb value and the immediate Seed Points of described pixel for pixel each in described picture;
Pixel adding device, for adding in the seed point group at the immediate Seed Points place with described pixel by described pixel;
Average RGB value computing unit, for calculating the average RGB value of described seed point group;
Whether rgb value comparing unit is equal with the former rgb value of described seed point group for more described average RGB value;
Cycle index judging unit, for judging whether cycle index reaches cycle index threshold value;
New seed point setting unit, for using described average RGB value as new Seed Points;
Pixel number acquiring unit, for when described average RGB value is equal with the former rgb value of described seed point group, obtain the number of the pixel comprised in each seed point group, or, when the former rgb value of described average RGB value and described seed point group is unequal, at described new seed point setting unit using described average RGB value as new Seed Points, and described seed point group setting unit, closest to Seed Points determining unit, pixel adding device, after average RGB value computing unit and rgb value comparing unit repeat corresponding actions, when described cycle index judging unit judges that cycle index reaches cycle index threshold value, obtain the number of the pixel comprised in each seed point group,
Domain color extraction unit, for extracting the domain color of color corresponding to the average RGB value that comprises the maximum seed point group of pixel number as described picture.
The device of 12. extraction picture domain color according to claim 11, is characterized in that, also comprise:
Cycle index threshold setting unit, for pre-setting cycle index threshold value.
The device of 13. extraction picture domain color according to claim 11, it is characterized in that, described pixel chooses unit, also for choosing at least two unduplicated pixels at random in picture, wherein, R, G, B component between any two pixels have at least one not identical.
The device of 14. extraction picture domain color according to claim 11, it is characterized in that, described pixel chooses unit, also for for the picture with Alpha passage, Alpha value is less than the pixel removal of predetermined value.
The device of 15. extraction picture domain color according to claim 11, it is characterized in that, described pixel is chosen unit and is comprised:
Range set module, for setting brightness range and saturation degree scope;
Pixel removes module, for not removing in described picture at the pixel of described brightness range or saturation degree scope.
The device of 16. extraction picture domain color according to claim 11, it is characterized in that, described seed point group setting unit, also for arranging four variable R t, Gt, Bt, Pt for described seed point group, wherein, Rt represents the summation of all pixel R component in described seed point group, and Gt represents the summation of all pixel G components in described seed point group, Bt represents the summation of all pixel B components in described seed point group, and Pt represents the total number comprising pixel in described seed point group.
The device of 17. extraction picture domain color according to claim 16, is characterized in that, describedly comprises closest to Seed Points determining unit:
Pixel distance computing module, for calculating the pixel distance between pixel and each Seed Points;
Closest to Seed Points determination module, for determining that the Seed Points minimum with the pixel distance of described pixel is as rgb value and the immediate Seed Points of described pixel.
The device of 18. extraction picture domain color according to claim 17, it is characterized in that, described pixel distance computing module, also for calculating the pixel distance S between pixel and each Seed Points, described S=(r1-r2) * (r1-r2)+(g1-g2) * (g1-g2)+(b1-b2) * (b1-b2), wherein, R, G, B value of described pixel is respectively r1, g1, b1, and R, G, B value of described Seed Points is respectively r2, g2, b2.
The device of 19. extraction picture domain color according to claim 18, it is characterized in that, described pixel adding device, also for the Rt of described seed point group being added the R component of described pixel, the Gt of described seed point group is added the G component of described pixel, the Bt of described seed point group is added the B component of described pixel, described Pt is added 1.
The device of 20. extraction picture domain color according to claim 19, it is characterized in that, described average RGB value computing unit, for calculating the value of Rt/Pt, Gt/Pt, Bt/Pt respectively, using the average RGB value of the value of Rt/Pt, Gt/Pt, Bt/Pt as described seed point group.
CN201410459673.3A 2014-09-10 2014-09-10 Method and device for extracting main color of image Pending CN104268904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410459673.3A CN104268904A (en) 2014-09-10 2014-09-10 Method and device for extracting main color of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410459673.3A CN104268904A (en) 2014-09-10 2014-09-10 Method and device for extracting main color of image

Publications (1)

Publication Number Publication Date
CN104268904A true CN104268904A (en) 2015-01-07

Family

ID=52160423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410459673.3A Pending CN104268904A (en) 2014-09-10 2014-09-10 Method and device for extracting main color of image

Country Status (1)

Country Link
CN (1) CN104268904A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657482A (en) * 2015-02-26 2015-05-27 深圳市中兴移动通信有限公司 Method for displaying application interface and terminal
CN107710278A (en) * 2015-06-18 2018-02-16 日本电气方案创新株式会社 Image processing equipment, image processing method and computer readable recording medium storing program for performing
CN108334531A (en) * 2017-09-19 2018-07-27 平安普惠企业管理有限公司 Picture tone extracting method, equipment and computer readable storage medium
CN109491739A (en) * 2018-10-30 2019-03-19 北京字节跳动网络技术有限公司 A kind of theme color is dynamically determined method, apparatus, electronic equipment and storage medium
US10304408B2 (en) 2016-07-14 2019-05-28 Guangzhou Shenma Mobile Information Technology Co., Ltd. Method and apparatus for changing background color of toolbar with dominant color of picture
CN110349223A (en) * 2018-04-08 2019-10-18 中兴通讯股份有限公司 A kind of method and device of image procossing
CN111104193A (en) * 2018-10-25 2020-05-05 北京奇虎科技有限公司 Application program activity interface display method, device, storage medium, and terminal device
CN117391115A (en) * 2023-12-06 2024-01-12 宁波邻家网络科技有限公司 Two-dimensional code generation method, system and storage medium based on image color

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030194126A1 (en) * 1999-02-05 2003-10-16 Samsung Electronics Co., Ltd. Color image processing method and apparatus thereof
CN102592272A (en) * 2011-01-12 2012-07-18 腾讯科技(深圳)有限公司 Extracting method and device of picture dominant tone
CN102722880A (en) * 2011-03-29 2012-10-10 阿里巴巴集团控股有限公司 Image main color identification method and apparatus thereof, image matching method and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030194126A1 (en) * 1999-02-05 2003-10-16 Samsung Electronics Co., Ltd. Color image processing method and apparatus thereof
CN102592272A (en) * 2011-01-12 2012-07-18 腾讯科技(深圳)有限公司 Extracting method and device of picture dominant tone
CN102722880A (en) * 2011-03-29 2012-10-10 阿里巴巴集团控股有限公司 Image main color identification method and apparatus thereof, image matching method and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
喻钧 等: "基于光谱色的迷彩主色提取方法", 《兵工自动化》 *
贾宗豹 等: "基于OSTU分割与K-均值聚类的MPEG-7主颜色提取算法", 《计算机应用与软件》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657482A (en) * 2015-02-26 2015-05-27 深圳市中兴移动通信有限公司 Method for displaying application interface and terminal
CN107710278A (en) * 2015-06-18 2018-02-16 日本电气方案创新株式会社 Image processing equipment, image processing method and computer readable recording medium storing program for performing
US10304408B2 (en) 2016-07-14 2019-05-28 Guangzhou Shenma Mobile Information Technology Co., Ltd. Method and apparatus for changing background color of toolbar with dominant color of picture
RU2693303C2 (en) * 2016-07-14 2019-07-02 Гуанчжоу Шэньма Мобайл Информэйшн Текнолоджи Ко., Лтд. Method and device for changing background colour of tool panel according to dominant colour of image
CN108334531A (en) * 2017-09-19 2018-07-27 平安普惠企业管理有限公司 Picture tone extracting method, equipment and computer readable storage medium
CN110349223A (en) * 2018-04-08 2019-10-18 中兴通讯股份有限公司 A kind of method and device of image procossing
CN111104193A (en) * 2018-10-25 2020-05-05 北京奇虎科技有限公司 Application program activity interface display method, device, storage medium, and terminal device
CN109491739A (en) * 2018-10-30 2019-03-19 北京字节跳动网络技术有限公司 A kind of theme color is dynamically determined method, apparatus, electronic equipment and storage medium
CN109491739B (en) * 2018-10-30 2023-04-07 北京字节跳动网络技术有限公司 Theme color dynamic determination method and device, electronic equipment and storage medium
CN117391115A (en) * 2023-12-06 2024-01-12 宁波邻家网络科技有限公司 Two-dimensional code generation method, system and storage medium based on image color

Similar Documents

Publication Publication Date Title
CN104268904A (en) Method and device for extracting main color of image
US10896349B2 (en) Text detection method and apparatus, and storage medium
US9852510B2 (en) Method and apparatus for dividing image area
CN105469027B (en) For the horizontal and vertical lines detection and removal of file and picture
US20210350205A1 (en) Convolution Processing Method and Apparatus for Convolutional Neural Network, and Storage Medium
US9053540B2 (en) Stereo matching by census transform and support weight cost aggregation
JP2008011267A5 (en)
CN110781923B (en) Feature extraction method and device
CN107247540B (en) Application icon adjusting method and device
JP2014131277A5 (en) Method and program for compressing binary image representing document
JP2012518223A5 (en)
CN104252620A (en) Character-touching graph verification code recognition method
US10922785B2 (en) Processor and method for scaling image
CN108446702B (en) Image character segmentation method, device, equipment and storage medium
CN112149672B (en) Image processing method and device, electronic equipment and storage medium
JP2018142852A5 (en)
CN104199784A (en) Data migration method and device based on hierarchical storage
JP2012022575A5 (en)
CN106933916B (en) JSON character string processing method and device
JP2010056691A5 (en)
JP2018506355A5 (en)
CN111141208B (en) Parallel line detection method and device
CN108268868A (en) Inclination value-acquiring method and device, terminal, the storage medium of ID Card Image
CN109844806A (en) A saliency map generation method and user terminal
CN104360854A (en) Information processing method and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150107