CN109410295A - Color setting method, device, equipment and computer readable storage medium - Google Patents
Color setting method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN109410295A CN109410295A CN201811074154.XA CN201811074154A CN109410295A CN 109410295 A CN109410295 A CN 109410295A CN 201811074154 A CN201811074154 A CN 201811074154A CN 109410295 A CN109410295 A CN 109410295A
- Authority
- CN
- China
- Prior art keywords
- color
- value
- background
- layer
- target
- 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 31
- 239000003086 colorant Substances 0.000 claims abstract description 28
- 238000004590 computer program Methods 0.000 claims description 22
- 238000010422 painting Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 5
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 238000004043 dyeing Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/40—Filling a planar surface by adding surface attributes, e.g. colour or texture
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
Abstract
The invention discloses a color setting method, a color setting device, color setting equipment and a computer readable storage medium, wherein the method comprises the following steps: reading a background layer comprising one or more colors; obtaining the main color of the background layer according to the color value of the pixel point of the background layer; acquiring a first color with a preset color contrast degree with the main color of the background layer; and setting the first color as a default color value of the background layer, so as to edit and draw the background layer according to the first color value by default. The invention can automatically set the painting brush with proper color according to the color of the background layer, thereby facilitating the operation and the watching of a writer.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of color setting method, device, equipment and computer
Readable storage medium storing program for executing.
Background technique
Drawing board refers to that one kind can be write in specific region using input equipments such as mouse/touch screen/touch tablets
With the application software of erasing person's handwriting.Drawing board is according to the different drawing boards that can be substantially divided into fixed background figure of its Background and without solid
Determine the drawing board of Background.For the drawing board of fixed background figure, the brush color of drawing board can be fixed (such as blackish green black
Paintbrush of the backboard scape with white);But it then should not be using fixed brush color, because this has for the drawing board of no fixed background figure
It is likely to occur brush color and the comparison of Background color is excessively weak, cause the written handwriting on drawing board that cannot significantly be seen
It arrives.
Currently, for the drawing board of no fixed background figure, the method that takes colour table to take color is generallyd use the color of paintbrush is arranged.
The advantages of taking colour table to take color is that the customized degree of user is high, the disadvantage is that not fast enough and automation, writer need to spend volume
Outer energy and time goes to select color appropriate, and which results in the dispersions of writer and participant's attention.
Summary of the invention
The embodiment of the present invention proposes a kind of color setting method, device, equipment and computer readable storage medium, for
The paintbrush of suitable color can be arranged automatically according to Background, facilitate the operation of writer for drawing board without fixed background figure.
The embodiment of the invention provides a kind of color setting methods, comprising:
Reading includes the Background From Layer of one or more colors;
According to the color value of the pixel of the Background From Layer, the primary color of the Background From Layer is obtained;
Obtain the first color that there is pre-color comparison degree with the primary color of the Background From Layer;
First color is set to the default color values of the Background From Layer, to default root on the Background From Layer
Editor's drafting is carried out according to first color value.
Preferably, the color value of the pixel according to the Background From Layer obtains the main face of the Background From Layer
Color, specifically:
The color value of each pixel on the Background From Layer is extracted, statistics each color is worth corresponding pixel quantity,
And set the most color value of pixel quantity to the primary color of the Background From Layer;
Then the primary color of the acquisition and the Background From Layer has the first color of pre-color comparison degree, specifically
Are as follows:
The primary color is projected into hsv color space, obtains HSV value corresponding with the primary color;
Reverse phase is carried out to the H value in the HSV value, obtains H ' value;
The first color is obtained according to the H ' value.
Preferably, the color value of the pixel according to the Background From Layer obtains the main face of the Background From Layer
Color, specifically:
The color value of each pixel on the Background From Layer is extracted, statistics each color is worth corresponding pixel quantity;
N number of color value that pixel quantity is arranged in top N is obtained, the primary color of the Background From Layer is obtained;
Then the primary color of the acquisition and the Background From Layer has the first color of pre-color comparison degree specific
Include:
N number of color value is projected into hsv color space, obtains N number of H value corresponding with the N number of color value;
According to N number of H value and preset form and aspect angle distance threshold, target H value set is obtained;
The first color is obtained according to the target H value set.
It is preferably, described that target H value set is obtained according to N number of H value and preset form and aspect angle distance threshold,
Specifically:
Obtain the target H value that preset form and aspect angle distance threshold is all larger than with the absolute value of the difference of N number of H value, and according to
Acquired target H value generates target H value set.
It is preferably, described that target H value set is obtained according to N number of H value and preset form and aspect angle distance threshold,
It specifically includes:
S1: it judges whether there is and is all larger than preset form and aspect angle with the form and aspect angular distance of the H value in background H value set
The target H value of distance threshold;Wherein, the background H value set initially includes N number of face that the pixel quantity is arranged in top N
The corresponding N number of H value of color value;
S2: if it exists, then target H value set is generated according to acquired target H value;
S3: if it does not exist, then the last bit H value in background H value set, and return step S1 are deleted;Wherein, the last bit H
Value is the least H value of the pixel quantity of corresponding color value in all H values of background H value set.
It is preferably, described that first color is obtained according to the target H value set, specifically:
Obtain the most corresponding first H value of color value of pixel quantity;
It calculates in target H value set, the maximum target H value of color contrast degree with the first H value;
The first color is obtained according to the target H value.
Preferably, the form and aspect angle distance threshold is 120 °, and the hue angle when the H value of two colors on hue circle
When degree distance is 180 ° closer, the color contrast degree of the two colors is bigger.
The embodiment of the invention also provides a kind of colors, and device is arranged, comprising:
Background From Layer reading unit, for read include one or more colors Background From Layer;
Primary color acquiring unit obtains the Background for the color value according to the pixel of the Background From Layer
The primary color of layer;
First color acquiring unit with the primary color of the Background From Layer there is pre-color to compare degree for obtaining
The first color;
Color setting unit, for setting first color to the default color values of the Background From Layer, in institute
It states to default on Background From Layer and editor's drafting is carried out according to first color value.
Preferably, the primary color acquiring unit is specifically used for, and extracts each pixel on the Background From Layer
Color value, statistics each color is worth corresponding pixel quantity, and sets the Background for the most color value of pixel quantity
The primary color of layer;
Then the first color acquiring unit, specifically includes:
Projection module obtains corresponding with the primary color for the primary color to be projected hsv color space
HSV value;
Inversed module obtains H ' value for carrying out reverse phase to the H value in the HSV value;
First color obtains module, for obtaining the first color according to the H ' value.
Preferably, the primary color acquiring unit specifically includes:
Statistical module counts each color value pair for extracting the color value of each pixel on the Background From Layer
The pixel quantity answered;
Primary color obtains module, and the N number of color value for being arranged in top N for obtaining pixel quantity obtains the background
The primary color of figure layer;
Then the first color acquiring unit, specifically includes:
Projection module obtains corresponding with N number of color value for N number of color value to be projected hsv color space
N number of H value;
Target H value set obtains module, for obtaining according to N number of H value and preset form and aspect angle distance threshold
Target H value set;
First color obtains module, for obtaining the first color according to the target H value set.
Preferably, the target H value set obtains module and is specifically used for:
It obtains and is all larger than the target H value in preset form and aspect angle distance threshold with the form and aspect angular distance of N number of H value, and
Target H value set is generated according to acquired target H value.
Preferably, the target H value set obtains module and specifically includes:
Judging submodule, for judge whether there is be all larger than with the form and aspect angular distance of the H value in background H value set it is pre-
If form and aspect angle distance threshold target H value;Wherein, the background H value set initially includes that the pixel quantity is arranged in
The corresponding N number of H value of N number of color value of top N;If it exists, then target H value set is notified to generate submodule;If it does not exist, then lead to
Know deletion submodule;
Target H value set generates submodule, for generating target H value set according to acquired target H value;
Submodule is deleted, for deleting the last bit H value in background H value set, and notifies judging submodule;Wherein, described
Last bit H value is the least H value of the pixel quantity of corresponding color value in all H values of background H value set.
Preferably, first color obtains module and specifically includes:
First H value acquisition submodule, for obtaining the corresponding first H value of the most color value of pixel quantity;
Target H value computational submodule, for calculating in target H value set, most with the color contrast degree of the first H value
Big target H value;
First color acquisition submodule, for obtaining the first color according to the target H value.
Preferably, the form and aspect angle distance threshold is 120 °, and when the form and aspect angular distance of the H value of two colors more connects
At nearly 180 °, the color contrast degree of the two colors is bigger.
Equipment is set the embodiment of the invention also provides a kind of color, including processor, memory and is stored in described
In memory and it is configured the computer program executed by the processing, the processor is realized when executing the computer program
Such as above-mentioned color setting method.
The embodiment of the invention also provides a kind of computer readable storage mediums, including processor, memory and storage
In the memory and it is configured the computer program executed by the processing, the processor executes the computer program
Shi Shixian for example above-mentioned color setting method.
In said one embodiment, since the primary color of the first color and the Background From Layer has scheduled color pair
Than degree, thus can at least guarantee the most of person's handwritings drawn on the Background From Layer or editor information can by with
Meeting person and writer easily distinguish, meanwhile, writer is not needed yet by taking colour table to select color, facilitates book
The operation of writer.
Detailed description of the invention
In order to illustrate more clearly of technical solution of the present invention, attached drawing needed in embodiment will be made below
Simply introduce, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, general for this field
For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram for the color setting method that first embodiment of the invention provides.
Fig. 2 is a kind of schematic diagram for hue circle that first embodiment of the invention provides.
Fig. 3 is the structural schematic diagram for the color setting device that second embodiment of the invention provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, first embodiment of the invention provides a kind of color setting method, include at least:
S101, reading include the Background From Layer of one or more colors.
In the present embodiment, the editable application software opening the drawing board for the figure layer that has powerful connections or with Background From Layer
When, the Background From Layer can be read.Wherein, the Background From Layer can only include a kind of color, also may include there are many face
Color or pattern etc., the present invention is not specifically limited.
In addition, the Background From Layer can be variable, for example, several Background From Layers can be preset, opening every time
It is loaded with a Background From Layer is randomly choosed when drawing board or application software.
S102 obtains the primary color of the Background From Layer according to the color value of the pixel of the Background From Layer.
In the present embodiment, after obtaining the Background From Layer, it can extract each pixel on the Background From Layer
Color value, to obtain the primary color of the Background From Layer according to the color value of each pixel.
In one implementation:
The corresponding pixel quantity of each color value that the Background From Layer includes can be counted, then there will be most pixels
The color value of quantity is set as the primary color of the Background From Layer.
In another implementation:
The corresponding pixel quantity of each color value that the Background From Layer includes can be counted, then arranges pixel quantity
The primary color of the Background From Layer is set as in N number of color value of preceding N.
Wherein, N can be a fixed numerical value, such as can be set to 3,4,5.It is also possible to before requiring pixel quantity
The pixel quantity summation of N number of color value of N is at least up to the predetermined ratio of the total pixel number amount of Background From Layer, for example, at least up to
To 70% etc..
S103 obtains the first color for having pre-color comparison degree with the primary color of the Background From Layer.
In the present embodiment, the color contrast degree is defined as the difference of two kinds of colors, wherein color contrast degree is got over
Greatly, show that the difference of the two colors is bigger, comparison when display is also more obvious.For example, cyan and red are in color
Complementary color each other in phase, then correspondingly, its color contrast degree is also the largest.
In one implementation, the color contrast degree of two kinds of colors can pass through its form and aspect angle on hue circle
Distance judges.
Specifically, the color indicated for one with RGB can be projected into HSV space, obtain its corresponding HSV
Value, wherein H indicates form and aspect, and S indicates saturation degree, and V indicates lightness.Form and aspect are the primary features of color, are that difference is not various homochromy
Color most accurate standard.The form and aspect of different colours can pass through its form and aspect angle on hue circle (as shown in Figure 2)
To indicate, wherein the power of hue contrast can be divided into:
Same form and aspect: form and aspect angular distance of the form and aspect of two kinds of colors on hue circle is 0 °;
Neighbouring form and aspect: 15 ° to 30 ° of form and aspect angular distance of the form and aspect of two kinds of colors on hue circle;
Similar form and aspect: the form and aspect of two kinds of colors are in the form and aspect angular distance on hue circle between 30 ° to 60 °;
Middle dyeing phase: the form and aspect of two kinds of colors are in the form and aspect angular distance on hue circle between 60 ° to 90 °;
Contrastive colours: the form and aspect of two kinds of colors are between 90 ° to 120 ° in the form and aspect angular distance on hue circle;It mends
Form and aspect: form and aspect angular distance of the form and aspect of two kinds of colors on hue circle is 180 °.
As can be seen that form and aspect angular distance maximum value of the form and aspect of two kinds of colors on hue circle is 180 °, and when two
When the form and aspect angular distance of color is between 120 ° to 180 °, just there is obvious contrast effect, it can be in display
It is distinguished by being relatively easy to.
S104 sets first color to the default color values of the Background From Layer, on the Background From Layer
Default carries out editor's drafting according to first color value.
In the present embodiment, after determining first color, the Background From Layer is set by first color
Default color values, in this way, when writer needs to carry out person's handwriting drafting or other edit operations on Background From Layer, it can be automatic
Default carries out editor's drafting with first color.Since the primary color of the first color and the Background From Layer is with scheduled
Color contrast degree, thus can at least guarantee that the most of person's handwritings drawn on the Background From Layer or editor's information all may be used
Easily to be distinguished by participant and writer, meanwhile, it does not need writer yet and selects color by taking colour table, side
Writer operation.
Some currently preferred embodiments of the present invention to be described in further detail below convenient for the understanding of the present invention.
On the basis of first embodiment, in a preferred embodiment:
Step S102, specifically:
The color value of each pixel on the Background From Layer is obtained, statistics each color is worth corresponding pixel quantity,
And set the most color value of pixel quantity to the primary color of the Background From Layer;
Then step S103 is specifically included:
The primary color is projected into hsv color space, obtains HSV value corresponding with the primary color;
Reverse phase is carried out to the H value in the HSV value, obtains H ' value;
The first color is obtained according to the H ' value.
In the present embodiment, H ' value and form and aspect angular distance of the H value on hue circle are 180 °, therefore the primary color
There is maximum color contrast degree with first color, so as to most significantly show the pen of paintbrush on Background From Layer
Mark.
It should be noted that the S value and V value of the first color can be identical as the S value of the primary color and V value, it can also
To reduce by the saturation degree S of first color according to the actual needs to reach subdued colour, the present invention is not specifically limited.
In a preferred embodiment:
Step S102, specifically:
The color value of each pixel on the Background From Layer is extracted, statistics each color is worth corresponding pixel quantity;
N number of color value that pixel quantity is arranged in top N is obtained, the primary color of the Background From Layer is obtained;
Then step S103 is specifically included:
N number of color value is projected hsv color space by S1031, obtains N number of H corresponding with the N number of color value
Value;
S1032 obtains target H value set according to N number of H value and preset form and aspect angle distance threshold;
S1033 obtains the first color according to the target H value set.
In above-described embodiment, it is contemplated that Background From Layer may include multiple color, if the only face most according to pixel quantity
Color generates the first color, then the person's handwriting that may cause paintbrush can not be aware in partial region.For example, a Background From Layer packet
Red and cyan is included, and red ratio is slightly larger than the ratio of cyan, be then cyan with the color of red reverse phase, if by described the
One color is set as cyan, then the person's handwriting drawn in the cyan areas of Background From Layer is caused to be difficult to check.
For this purpose, in the present embodiment, N number of color value that pixel quantity is arranged in top N can be obtained simultaneously, obtain the back
The primary color of scape figure layer.The first color is being selected simultaneously, may require that the color of the form and aspect of the first color and the form and aspect of N number of color value
Phase angular distance is all larger than default form and aspect angle distance threshold (for example, being all larger than 120 °), so, it is ensured that with described first
The person's handwriting that color is drawn can be viewed significantly in most of region of the Background From Layer.
For example, it is assumed that N number of H value of N number of color value is 80 °, 100 °, 150 °, and form and aspect angle distance threshold is 120 °, then
According to basic set operation rule, the target H value set being calculated is [270 °, 320 °].
In a preferred embodiment, S1032 is specifically included:
S1: judge whether there is with the absolute value of the difference of the H value in background H value set be all larger than preset form and aspect angle away from
Target H value from threshold value;Wherein, the background H value set initially includes N number of color that the pixel quantity is arranged in top N
It is worth corresponding N number of H value;
S2: if it exists, then target H value set is generated according to acquired target H value;
S3: if it does not exist, then the last bit H value in background H value set, and return step S1 are deleted;Wherein, the last bit H
Value is the least H value of the pixel quantity of corresponding color value in all H values of background H value set.
In above-described embodiment, in fact it could happen that the case where target H value set is empty set, i.e., no satisfactory target H value.
For example, it is assumed that N number of H value of N number of color value is 80 °, 100 °, 205 °, and form and aspect angle distance threshold is 120 °, then is calculated
Target H value set be empty set.
For this purpose, in the present embodiment, if the target H value set being calculated is empty set, deleting in background H value set
Last bit H value (such as 205 °), then at this time background H value set be 80 °, 100 °, the target H value set being calculated be [220 °,
320°]。
The present embodiment ensure that available required target H value set, and due to deletion by deleting last bit H value
It is last bit H value, thus the influence to whole drafting effect is smaller.
It is preferably, described that first color is obtained according to the target H value set, specifically:
Obtain the most corresponding first H value of color value of pixel quantity;
It calculates in target H value set, the maximum target H value of color contrast degree with the first H value;
The first color is obtained according to the target H value.
In the present embodiment, for example, the most corresponding first H value of color value of pixel quantity is 80 °, target H value set
It for [220 °, 320 °], then chooses 260 ° and is used as target H value, and the first color is generated by the target H value.At this point, generate
First color and the most important color of the Background From Layer have maximum color contrast degree, therefore can guarantee as far as possible
The display effect drawn on Background From Layer.
It should be noted that the form and aspect angle distance threshold is not limited to above-mentioned 120 referred to ° in above-described embodiment,
It can be configured according to actual needs, and the present invention is not specifically limited.
Referring to Fig. 3, second embodiment of the invention additionally provides a kind of color setting device, comprising:
Background From Layer reading unit 10, for read include one or more colors Background From Layer;
Primary color acquiring unit 20 obtains the background for the color value according to the pixel of the Background From Layer
The primary color of figure layer;
First color acquiring unit 30 with the primary color of the Background From Layer there is pre-color to compare journey for obtaining
First color of degree;
Color setting unit 40, for setting first color to the default color values of the Background From Layer, with
Default carries out editor's drafting according to first color value on the Background From Layer.
Preferably, the primary color acquiring unit 20 is specifically used for, and extracts each pixel on the Background From Layer
Color value, statistics each color is worth corresponding pixel quantity, and sets the background for the most color value of pixel quantity
The primary color of figure layer;
Then the first color acquiring unit 30, specifically includes:
Projection module obtains corresponding with the primary color for the primary color to be projected hsv color space
HSV value;
Inversed module obtains H ' value for carrying out reverse phase to the H value in the HSV value;
First color obtains module, for obtaining the first color according to the H ' value.
Preferably, the primary color acquiring unit 20 specifically includes:
Statistical module counts each color value pair for extracting the color value of each pixel on the Background From Layer
The pixel quantity answered;
Primary color obtains module, and the N number of color value for being arranged in top N for obtaining pixel quantity obtains the background
The primary color of figure layer;
Then the first color acquiring unit 30, specifically includes:
Projection module obtains corresponding with N number of color value for N number of color value to be projected hsv color space
N number of H value;
Target H value set obtains module, for obtaining according to N number of H value and preset form and aspect angle distance threshold
Target H value set;
First color obtains module, for obtaining the first color according to the target H value set.
Preferably, the target H value set obtains module and is specifically used for:
It obtains and is all larger than the target H value in preset form and aspect angle distance threshold with the form and aspect angular distance of N number of H value, and
Target H value set is generated according to acquired target H value.
Preferably, the target H value set obtains module and specifically includes:
Judging submodule, for judge whether there is be all larger than with the form and aspect angular distance of the H value in background H value set it is pre-
If form and aspect angle distance threshold target H value;Wherein, the background H value set initially includes that the pixel quantity is arranged in
The corresponding N number of H value of N number of color value of top N;If it exists, then target H value set is notified to generate submodule;If it does not exist, then lead to
Know deletion submodule;
Target H value set generates submodule, for generating target H value set according to acquired target H value;
Submodule is deleted, for deleting the last bit H value in background H value set, and notifies judging submodule;Wherein, described
Last bit H value is the least H value of the pixel quantity of corresponding color value in all H values of background H value set.
Preferably, first color obtains module and specifically includes:
First H value acquisition submodule, for obtaining the corresponding first H value of the most color value of pixel quantity;
Target H value computational submodule, for calculating in target H value set, most with the color contrast degree of the first H value
Big target H value;
First color acquisition submodule, for obtaining the first color according to the target H value.
Preferably, the form and aspect angle distance threshold is 120 °, and when the form and aspect angular distance of the H value of two colors more connects
At nearly 180 °, the color contrast degree of the two colors is bigger.
Third embodiment of the invention provides a kind of color setting device, including processor, memory and is stored in institute
The computer program executed by the processing is stated in memory and is configured, the processor executes real when the computer program
Now color setting method as in the first embodiment.
Fourth embodiment of the invention additionally provides a kind of computer readable storage medium, the computer readable storage medium
Computer program including storage.Wherein, the computer readable storage medium institute is controlled when the computer program is run
A kind of color setting method described in above-mentioned first embodiment is executed in equipment.
Illustratively, computer program described in third embodiment of the invention and fourth embodiment can be divided into one
A or multiple modules, one or more of modules are stored in the memory, and are executed by the processor, with complete
At the present invention.One or more of modules can be the series of computation machine program instruction section that can complete specific function, should
Instruction segment is used to describe the computer program in the implementation procedure realizing a kind of color and being arranged in equipment.For example, this hair
Device described in bright second embodiment.
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng the processor is the control centre of the color setting method, utilizes various interfaces and the connection entirely realization
The various pieces of color setting method.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes
Computer program in the memory and/or module are stored, and calls the data being stored in memory, realization is based on
The various functions of the item tracing method of Internet of Things.The memory can mainly include storing program area and storage data area,
In, storing program area can application program needed for storage program area, at least one function (such as sound-playing function, text
Conversion function etc.) etc.;Storage data area can store that (for example audio data, text disappear according to the created data that use of mobile phone
Cease data etc.) etc..In addition, memory may include high-speed random access memory, it can also include nonvolatile memory, example
Such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure
Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other volatibility are solid
State memory device.
Wherein, if the module of the realization be realized in the form of SFU software functional unit and as independent product sale or
In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that
The step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie
Matter may include: can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice
Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions
Believe signal.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with
It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual
It needs that some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.In addition, device provided by the invention
In embodiment attached drawing, the connection relationship between module indicate between them have communication connection, specifically can be implemented as one or
A plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, it can understand
And implement.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto,
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by anyone skilled in the art,
It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with scope of protection of the claims
Subject to.
Claims (10)
1. a kind of color setting method characterized by comprising
Reading includes the Background From Layer of one or more colors;
According to the color value of the pixel of the Background From Layer, the primary color of the Background From Layer is obtained;
Obtain the first color that there is pre-color comparison degree with the primary color of the Background From Layer;
First color is set to the default color values of the Background From Layer, to default on the Background From Layer according to institute
It states the first color value and carries out editor's drafting.
2. color setting method according to claim 1, which is characterized in that the pixel according to the Background From Layer
Color value, obtain the primary color of the Background From Layer, specifically:
The color value of each pixel on the Background From Layer is extracted, statistics each color is worth corresponding pixel quantity, and will
The most color value of pixel quantity is set as the primary color of the Background From Layer;
Then the primary color of the acquisition and the Background From Layer has the first color of pre-color comparison degree, specifically:
The primary color is projected into hsv color space, obtains HSV value corresponding with the primary color;
Reverse phase is carried out to the H value in the HSV value, obtains H ' value;
The first color is obtained according to the H ' value.
3. color setting method according to claim 1, which is characterized in that the pixel according to the Background From Layer
Color value, obtain the primary color of the Background From Layer, specifically:
The color value of each pixel on the Background From Layer is extracted, statistics each color is worth corresponding pixel quantity;
N number of color value that pixel quantity is arranged in top N is obtained, the primary color of the Background From Layer is obtained;
Then there is the primary color of the acquisition and the Background From Layer the first color of pre-color comparison degree to specifically include:
N number of color value is projected into hsv color space, obtains N number of H value corresponding with the N number of color value;
According to N number of H value and preset form and aspect angle distance threshold, target H value set is obtained;
The first color is obtained according to the target H value set.
4. color setting method according to claim 3, which is characterized in that described according to N number of H value and preset
Form and aspect angle distance threshold obtains target H value set, specifically:
The target H value that preset form and aspect angle distance threshold is all larger than with the form and aspect angular distance of N number of H value is obtained, and according to institute
The target H value of acquisition generates target H value set.
5. color setting method according to claim 3, which is characterized in that described according to N number of H value and preset
Form and aspect angle distance threshold obtains target H value set, specifically includes:
S1: it judges whether there is and is all larger than preset form and aspect angular distance with the form and aspect angular distance of the H value in background H value set
The target H value of threshold value;Wherein, the background H value set initially includes N number of color value that the pixel quantity is arranged in top N
Corresponding N number of H value;
S2: if it exists, then target H value set is generated according to acquired target H value;
S3: if it does not exist, then the last bit H value in background H value set, and return step S1 are deleted;Wherein, the last bit H value is
In all H values of background H value set, the least H value of the pixel quantity of corresponding color value.
6. color setting method according to claim 3, which is characterized in that described to be obtained according to the target H value set
First color, specifically:
Obtain the most corresponding first H value of color value of pixel quantity;
It calculates in target H value set, the maximum target H value of color contrast degree with the first H value;
The first color is obtained according to the target H value.
7. color setting method according to claim 4, which is characterized in that the form and aspect angle distance threshold is 120, and
When form and aspect angular distance of the H value on hue circle of two colors is closer to 180.When, the color contrast degree of the two colors
It is bigger.
8. device is arranged in a kind of color characterized by comprising
Background From Layer reading unit, for read include one or more colors Background From Layer;
Primary color acquiring unit obtains the Background From Layer for the color value according to the pixel of the Background From Layer
Primary color;
First color acquiring unit, for obtaining there is pre-color comparison degree with the primary color of the Background From Layer the
One color;
Color setting unit, for setting first color to the default color values of the Background From Layer, in the back
Default carries out editor's drafting according to first color value in scape figure layer.
9. equipment is arranged in a kind of color, which is characterized in that including processor, memory and storage in the memory and by
The computer program that configuration is executed by the processing, the processor realize such as claim 1 when executing the computer program
To 7 described in any item color setting methods.
10. a kind of computer readable storage medium, which is characterized in that including processor, memory and be stored in the storage
In device and it is configured the computer program executed by the processing, the processor is realized when executing the computer program as weighed
Benefit requires 1 to 7 described in any item color setting methods.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811074154.XA CN109410295B (en) | 2018-09-14 | 2018-09-14 | Color setting method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811074154.XA CN109410295B (en) | 2018-09-14 | 2018-09-14 | Color setting method, device, equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109410295A true CN109410295A (en) | 2019-03-01 |
CN109410295B CN109410295B (en) | 2023-09-15 |
Family
ID=65464910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811074154.XA Active CN109410295B (en) | 2018-09-14 | 2018-09-14 | Color setting method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109410295B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111091607A (en) * | 2019-12-24 | 2020-05-01 | 厦门美图之家科技有限公司 | Color matching method and device, electronic equipment and storage medium |
CN111612857A (en) * | 2020-05-28 | 2020-09-01 | 北京学之途网络科技有限公司 | Color obtaining method and device, electronic equipment and readable storage medium |
CN113256498A (en) * | 2021-06-24 | 2021-08-13 | 杭州未名信科科技有限公司 | Interpolation method, device and equipment based on three-dimensional color space and storage medium |
CN113377311A (en) * | 2021-06-10 | 2021-09-10 | 广州朗国电子科技有限公司 | Electronic blackboard control system and method and electronic equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102769758A (en) * | 2012-07-18 | 2012-11-07 | 京东方科技集团股份有限公司 | Method and system for processing RGB (red, green and blue) data |
CN104811677A (en) * | 2015-05-22 | 2015-07-29 | 广东欧珀移动通信有限公司 | Display control method and device of mobile terminal |
CN104834454A (en) * | 2014-02-10 | 2015-08-12 | 宏碁股份有限公司 | Electronic device and display method thereof |
CN105979400A (en) * | 2016-06-28 | 2016-09-28 | 乐视控股(北京)有限公司 | Screen brightness adjusting method, device and terminal |
CN106775747A (en) * | 2016-12-28 | 2017-05-31 | Tcl集团股份有限公司 | A kind of method and apparatus of color configuration |
US20180174331A1 (en) * | 2016-12-20 | 2018-06-21 | Canon Kabushiki Kaisha | Method, system and apparatus for modifying a scene model |
CN108320312A (en) * | 2017-01-18 | 2018-07-24 | 阿里巴巴集团控股有限公司 | Color matching method and device, the terminal of picture |
CN108389163A (en) * | 2018-01-22 | 2018-08-10 | 西安工程大学 | A kind of self-adapting enhancement method based on half-light coloured image |
-
2018
- 2018-09-14 CN CN201811074154.XA patent/CN109410295B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102769758A (en) * | 2012-07-18 | 2012-11-07 | 京东方科技集团股份有限公司 | Method and system for processing RGB (red, green and blue) data |
CN104834454A (en) * | 2014-02-10 | 2015-08-12 | 宏碁股份有限公司 | Electronic device and display method thereof |
CN104811677A (en) * | 2015-05-22 | 2015-07-29 | 广东欧珀移动通信有限公司 | Display control method and device of mobile terminal |
CN105979400A (en) * | 2016-06-28 | 2016-09-28 | 乐视控股(北京)有限公司 | Screen brightness adjusting method, device and terminal |
US20180174331A1 (en) * | 2016-12-20 | 2018-06-21 | Canon Kabushiki Kaisha | Method, system and apparatus for modifying a scene model |
CN106775747A (en) * | 2016-12-28 | 2017-05-31 | Tcl集团股份有限公司 | A kind of method and apparatus of color configuration |
CN108320312A (en) * | 2017-01-18 | 2018-07-24 | 阿里巴巴集团控股有限公司 | Color matching method and device, the terminal of picture |
CN108389163A (en) * | 2018-01-22 | 2018-08-10 | 西安工程大学 | A kind of self-adapting enhancement method based on half-light coloured image |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111091607A (en) * | 2019-12-24 | 2020-05-01 | 厦门美图之家科技有限公司 | Color matching method and device, electronic equipment and storage medium |
CN111091607B (en) * | 2019-12-24 | 2023-08-29 | 厦门美图之家科技有限公司 | Color matching method and device, electronic equipment and storage medium |
CN111612857A (en) * | 2020-05-28 | 2020-09-01 | 北京学之途网络科技有限公司 | Color obtaining method and device, electronic equipment and readable storage medium |
CN111612857B (en) * | 2020-05-28 | 2024-03-26 | 北京明略昭辉科技有限公司 | Color acquisition method and device, electronic equipment and readable storage medium |
CN113377311A (en) * | 2021-06-10 | 2021-09-10 | 广州朗国电子科技有限公司 | Electronic blackboard control system and method and electronic equipment |
CN113256498A (en) * | 2021-06-24 | 2021-08-13 | 杭州未名信科科技有限公司 | Interpolation method, device and equipment based on three-dimensional color space and storage medium |
CN113256498B (en) * | 2021-06-24 | 2021-11-02 | 杭州未名信科科技有限公司 | Interpolation method, device and equipment based on three-dimensional color space and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109410295B (en) | 2023-09-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109410295A (en) | Color setting method, device, equipment and computer readable storage medium | |
US11037275B2 (en) | Complex architecture for image processing | |
CN108255555B (en) | A kind of system language switching method and terminal device | |
CN104866323B (en) | Unlocking interface generation method and device and electronic equipment | |
CN104978186B (en) | A kind of rendering intent and device of interface skin | |
CN104076928B (en) | A kind of method for adjusting text importing image | |
CN106156237B (en) | Information processing method, information processing unit and user equipment | |
CN105955754B (en) | A kind of user interface character displaying method and device | |
CN109408177A (en) | Method and device for configuring color of characters in picture and electronic equipment | |
CN105005461A (en) | Icon display method and terminal | |
CN108366203A (en) | Composition method, composition device, electronic equipment and storage medium | |
CN111957040A (en) | Method and device for detecting shielding position, processor and electronic device | |
CN107801013A (en) | White balancing treatment method and device, electronic installation and computer-readable recording medium | |
CN106201212A (en) | Generation method, device and the mobile terminal of a kind of application icon | |
CN108304839A (en) | A kind of image processing method and device | |
US9679386B2 (en) | Image processing device capable of segmenting an image into plural areas | |
CN106162303B (en) | Information processing method, information processing unit and user equipment | |
CN104461614A (en) | Method for processing theme resource and electronic device | |
CN110444181A (en) | Display methods, device, terminal and computer readable storage medium | |
CN104093010B (en) | A kind of image processing method and device | |
CN115509474A (en) | Title display method, title display device, storage medium and electronic equipment | |
CN103020651B (en) | Method for detecting sensitive information of microblog pictures | |
US20170147987A1 (en) | Method and apparatus for generating a combined calendar | |
CN113837181B (en) | Screening method, screening device, computer equipment and computer readable storage medium | |
CN106843784B (en) | Method and device for displaying data |
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 |