CN106204690A - A kind of image processing method and device - Google Patents

A kind of image processing method and device Download PDF

Info

Publication number
CN106204690A
CN106204690A CN201510222313.6A CN201510222313A CN106204690A CN 106204690 A CN106204690 A CN 106204690A CN 201510222313 A CN201510222313 A CN 201510222313A CN 106204690 A CN106204690 A CN 106204690A
Authority
CN
China
Prior art keywords
color
chroma
lightness
saturation
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510222313.6A
Other languages
Chinese (zh)
Other versions
CN106204690B (en
Inventor
刘奎龙
李波
黄凯明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510222313.6A priority Critical patent/CN106204690B/en
Publication of CN106204690A publication Critical patent/CN106204690A/en
Application granted granted Critical
Publication of CN106204690B publication Critical patent/CN106204690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Color Image Communication Systems (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of image processing method and device, match colors in order to combine the color contrast of foreground image and background image, thus improve color matching effect.A kind of image processing method that the present invention provides, comprises determining that the foreground image in original image, and the body color of this foreground image;According to described body color, and the color matching rule for realizing foreground image and background image contrast display preset, obtain background color, and utilize this background color to obtain background image;By described foreground image and the described background image synthesis target image obtained.The color contrast that present invention incorporates foreground image and background image is matched colors, thus improves color matching effect.

Description

A kind of image processing method and device
Technical field
The present invention relates to image technique field, particularly relate to a kind of image processing method and device.
Background technology
Display advertisement (display ads) on internet media has text advertisements and image ad (banner) Two classes.Data analysis finds, the flow introduced by image ad and the flow phase introduced by text advertisements Ratio, clicking rate (CTR, number of clicks and the ratio of exposure frequency) is higher, it is easier to attract user to pay close attention to.
In prior art, can be used for making the scheme of image ad, such as by prior art, to product figure As carrying out scratching figure, and complete the making of image ad.The program is widely used in actual production.
But, color matching effect is poor.
Summary of the invention
Embodiments provide a kind of image processing method and device, in order to combine foreground image and background The color contrast of image is matched colors, thus improves color matching effect.
A kind of image processing method that the embodiment of the present invention provides, including:
Determine the foreground image in original image, and the body color of this foreground image;
According to described body color, and preset for realizing foreground image and background image contrast display Color matching rule, obtains background color, and utilizes this background color to obtain background image;
By described foreground image and the described background image synthesis target image obtained.
With it, the body color of the foreground image in original image can be utilized, and the use preset Regular with the color matching of background image contrast display in realizing foreground image, obtain background color, and utilize this back of the body Scape color obtains background image;By described foreground image and the described background image synthesis target image obtained. Thus the color contrast combining foreground image and background image is matched colors, improve color matching effect, with And Consumer's Experience effect, and then the clicking rate of the image related contents such as image ad can be improved.
Optionally it is determined that the foreground image in original image, and the body color of this foreground image, specifically Including:
Determine the gray value of each pixel of original image;
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture;
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.
Alternatively, according to described body color, and being used for of presetting realizes foreground image and background image pair Than the color matching rule of display, obtain background color, specifically include:
Utilize the lightness of body color, and the multiple lightness ranges preset, determine the lightness model of background color Enclose, and select a lightness as the lightness of background color from the lightness range belonging to background color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma of body color, and the chroma angle preset, determine the chroma of background color;
Utilize the lightness of background color, saturation and chroma, determine background color.
Alternatively, utilize the lightness of body color, and the multiple lightness ranges preset, determine background color Lightness range, including:
When the lightness of described body color belongs to the first default lightness range, determine the lightness of background color Scope belongs to the second default lightness range;When the lightness of described body color belongs to the second default lightness model When enclosing, determine that the lightness range of background color belongs to the first default lightness range;Wherein, described first bright Degree scope is greater than or equal to described second lightness range.
Alternatively, utilize the saturation of body color, and the multiple saturation scopes preset, determine background The saturation scope of color, including:
When the saturation of described body color belongs to the first default saturation scope, determine background color Saturation scope belongs to the second default saturation scope;When the saturation of described body color belongs to default During the second saturation scope, determine that the saturation scope of background color belongs to the first default saturation scope; Wherein, described first saturation scope is greater than or equal to described second lightness range.
Alternatively, utilize the chroma of body color, and the chroma angle preset, determine the coloured silk of background color Degree, including:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
Alternatively, the method also includes:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
Alternatively, described labelling includes: word, figure and/or symbol.
Alternatively, the described color determining this labelling, specifically include: determine saturation in described foreground image The highest color, using this color as the color of this labelling.
A kind of image processing apparatus that the embodiment of the present invention provides, including:
First module, for determining the foreground image in original image, and the main body face of this foreground image Color;
Second unit, for according to described body color, and being used for of presetting realizes foreground image and background The color matching rule that image comparison shows, obtains background color, and utilizes this background color to obtain Background Picture;
Unit the 3rd, for by described foreground image and the described background image synthesis target image obtained.
Alternatively, described first module specifically for:
Determine the gray value of each pixel of original image;
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture;
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.
Alternatively, second unit is according to described body color, and being used for of presetting realizes foreground image and the back of the body The color matching rule that scape image comparison shows, when obtaining background color, specifically for:
Utilize the lightness of body color, and the multiple lightness ranges preset, determine the lightness model of background color Enclose, and select a lightness as the lightness of background color from the lightness range belonging to background color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma of body color, and the chroma angle preset, determine the chroma of background color;
Utilize the lightness of background color, saturation and chroma, determine background color.
Alternatively, second unit utilizes the lightness of body color, and the multiple lightness ranges preset, and determines During the lightness range of background color, specifically for:
When the lightness of described body color belongs to the first default lightness range, determine the lightness of background color Scope belongs to the second default lightness range;When the lightness of described body color belongs to the second default lightness model When enclosing, determine that the lightness range of background color belongs to the first default lightness range;Wherein, described first bright Degree scope is greater than or equal to described second lightness range.
Alternatively, second unit utilizes the saturation of body color, and the multiple saturation scopes preset, When determining the saturation scope of background color, specifically for:
When the saturation of described body color belongs to the first default saturation scope, determine background color Saturation scope belongs to the second default saturation scope;When the saturation of described body color belongs to default During the second saturation scope, determine that the saturation scope of background color belongs to the first default saturation scope; Wherein, described first saturation scope is greater than or equal to described second lightness range.
Alternatively, second unit utilizes the chroma of body color, and the chroma angle preset, and determines background During the chroma of color, specifically for:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
Alternatively, described Unit the 3rd is additionally operable to:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
Alternatively, described labelling includes: word, figure and/or symbol.
Alternatively, described first module is additionally operable to determine the color that in described foreground image, saturation is the highest, will This color is as the color of described labelling, and is sent to described Unit the 3rd.
Accompanying drawing explanation
The schematic flow sheet of a kind of image processing method that Fig. 1 provides for the embodiment of the present invention;
The method flow signal of a kind of body color determining foreground image that Fig. 2 provides for the embodiment of the present invention Figure;
The grey level histogram signal of the body color of a kind of foreground image that Fig. 3 provides for the embodiment of the present invention Figure;
A kind of HSV space schematic diagram that Fig. 4 provides for the embodiment of the present invention;
The structural representation of a kind of image processing apparatus that Fig. 5 provides for the embodiment of the present invention.
Detailed description of the invention
Embodiments provide a kind of image processing method and device, in order to combine foreground image and background The color contrast of image is matched colors, thus improves color matching effect.
The embodiment of the present invention proposes a kind of scheme that can be subject image and carry out Automatic color matching, and the program is defeated Enter the original image for object, shown that by statistics the body color of this object is distributed, give according to body color Go out the schemes such as background color matching, word color matching.
See Fig. 1, a kind of image processing method that the embodiment of the present invention provides, including step:
S101, the foreground image determined in original image, and the body color of this foreground image;
Wherein, described foreground image, i.e. original image go out the image of object of background itself.
The primary color of the body color of described foreground image, i.e. object.
S102, according to described body color, and being used for of presetting realizes foreground image and contrasts with background image The color matching rule of display, obtains background color, and utilizes this background color to obtain background image;
The color matching rule for realizing foreground image and background image contrast display preset, i.e. according to main body face The concrete value of the various eigenvalues of color, it is contemplated that the contrast of color matching, pre-sets the phase of some color matchings The rules such as the span answering eigenvalue, rear extended meeting is described in detail in conjunction with specific embodiments.
S103, by described foreground image and described obtain background image synthesis target image.
With it, the body color of the foreground image in original image can be utilized, and the use preset Regular with the color matching of background image contrast display in realizing foreground image, obtain background color, and utilize this back of the body Scape color obtains background image;By described foreground image and the described background image synthesis target image obtained. Thus the color contrast combining foreground image and background image is matched colors, improve color matching effect, with And Consumer's Experience effect, and then the clicking rate of the image related contents such as image ad can be improved.
Optionally it is determined that the foreground image in original image, and the body color of this foreground image, specifically Including:
Determine the gray value of each pixel of original image.Specifically, each pixel can first be calculated The value of RGB of point, calculates the gray value of this pixel according further to the value of RGB.
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture.Specifically, prior art can be used according to the gray value of each pixel, remove in original image Background colour, thus obtain foreground image.
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.Specifically, the histogram distribution of the gray value of foreground image can be passed through, Get the body color of foreground image.
For example, with reference to Fig. 2, step S101 specifically includes following steps:
S201, acquisition original image, and open original image.
S202, original image is converted into rgb format, to facilitate point processing, i.e. determines in original image The value of the RGB of each pixel.
S203, the RGB value of foundation pixel, calculate the gray value of each pixel.
Wherein, the gray value calculating pixel is prior art, such as, for each pixel, according to public Formula: gray value=(3*R+6*G+B)/10, wherein, R, G, B represent this pixel respectively Red (R), green (G), blue (B) value.
Gray scale uses black tone to represent object.Each gray scale object has from 0% (white) (black to 100% Color) brightness value.The image using black and white or gray scale scanning instrument to generate generally shows with gray scale.Use gray scale Also colored picture proof can be converted to high-quality black and white picture proof.The edge of image is the most basic feature of image.
Because human eye is to the perception of RGB color and differs, so needing the when of conversion to give different power Weight.For physiology and Psychological Angle, human eye is more sensitive to green, causes green to have human eye Fluorescence, the most therefore, calculating gray value when, green weight ratio is bigger.Such as in above formula G Weights 6 bigger.
In S204, foundation original image, the gray value of all pixels, removes the background colour of original image, The image of the foreground image in original image, i.e. object itself.
In embodiments of the present invention, the background colour of image is removed according to gray value.Referring specifically to Fig. 3, former The grey level histogram of beginning image shows, has a peak value between 0~100, and this peak color is relatively deep, most In the case of be the color of foreground image, between 200~225, have a peak value, the color that this peak value represents is relatively Shallow, it is in most cases the background color of original image.Can be by before in original image by this rectangular histogram The chromatic zones of the color and background image of scape image separates, thus takes out background colour, determines foreground image.
The window change of gray scale of the prior art is common a kind of point processing.See Fig. 3, bimodal between The lowest point be T, when this original image is carried out window transform, window upper limit can be with value as T, lower limit It is 0, the result after conversion, i.e. can eliminate background colour.
S205, obtain the histogram distribution of the gray value of foreground image, such that it is able to get in foreground image Primary color, i.e. the body color of foreground image.
Alternatively, when needs are for labellings such as image configurations words, the color of this labelling is also predefined.
Specifically, can obtain the colour that in foreground image, saturation is the highest, the body color of foreground image is Refer to the most color having on product, and the acquisition methods of the highest colour of saturation is first by foreground image The colour that represents of the RGB of each pixel be converted into HSV (H: form and aspect, S: saturation, V: lightness) The colour (conversion regime is prior art) represented, then travels through all pixels of foreground image, finds S It is worth the highest point.Illustrate: the product of a black has one little for redness, then the main body of product Color is black, and the highest colour of saturation is red.
It is described below about the mutually conversion between RGB and HSV:
HSV model is generally used in Computer Image Processing application.A color must be selected to answer user In the various applied environment of particular image element, commonly used HSV colour wheel.Wherein, tone represents For annulus, it is possible to use an independent triangle represents saturation and lightness.Typically, this triangle The vertical axis instruction saturation of shape, and trunnion axis represents lightness.In this manner, selection color can be first In annulus, first select tone, then from triangle, select saturation and the lightness wanted.
The another kind of visual method seeing Fig. 4, HSV model is cone.In this expression, tone quilt Being expressed as the angle around circular cone central shaft, saturation is represented as the center of circle of the cross section from circular cone to this point Distance, lightness is represented as the center of circle distance to summit of the cross section from circular cone.
Except mode indicated above, prior art also uses hexagonal pyramid body and is indicated.This method is more It is suitable in a single object, show this HSV color space;But due to its three-dimensional nature, it Be not suitable for selecting color in two-dimension computer interface.
HSV color space feels the mode of color closer to the mankind, and scheme of colour is more directly perceived.And RGB It it is the convenient computer disposal of additive primaries model.
One, rgb value is converted to HSV value
For the rgb value of each pixel, (r, g, b), if should (r, g b) be the color of a pixel respectively Red, green and blue coordinate, their value is the real number between 0 to 1.If max equal to r, g and The maximum in b.If min is equal to the reckling in these values.Find in HSV space corresponding (h, s, v) value, h ∈ here [0,360) be the hue angle of angle, and s, v ∈ [0,1] are full With degree and lightness, equation below is used to calculate:
Wherein, the value of h is generally standardized between 0 to 360 °.And h=0 is for max= When (being exactly Lycoperdon polymorphum Vitt) of min rather than stay h undefined.
s = 0 , if max = 0 max - min max = 1 - min max , otherwise
υ=max
Thus obtain the HSV value of this pixel.
Two, it is transformed into rgb value from HSV value.
For in HSV space (h, s, v) value definition a color give a picture represented with HSV Vegetarian refreshments, with h as above, and represent respectively s and v of saturation and lightness change in 0 to 1 it Between, corresponding in rgb space (r, g, b) three primary colors may be calculated:
h 60 - h i
P=υ × (1-s)
Q=υ × (1-f × s)
T=υ × (1-(1-f) × s)
Wherein, the intermediate variable during p, q, t represent calculating respectively.
For the pixel of each color rgb value (r, g, b):
( r , g , b ) = ( υ , t , p ) , if h i = 0 ( q , υ , p ) , if h i = 1 ( p , υ , t ) , if h i = 2 ( p , q , υ ) , if h i = 3 ( t , p , υ ) , if h i = 4 ( υ , p , q ) , if h i = 5
It is hereby achieved that the rgb value that the HSV value of any pixel point is corresponding.
Alternatively, according to described body color, and being used for of presetting realizes foreground image and background image pair Than the color matching rule of display, obtain background color, specifically include:
Utilize the lightness (being properly termed as brightness) of body color, and the multiple lightness ranges preset, determine The lightness range of background color, and select a lightness as background face from the lightness range belonging to background color The lightness of color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma (being properly termed as tone) of body color, and the chroma angle preset, determine background The chroma of color;
Utilize the lightness of background color, saturation and chroma, determine background color.
Wherein, the body color of foreground image is transformed into HSV space by rgb space, will each The RGB value of pixel is converted into HSV value.In HSV space, body color can be got Lightness, saturation and chroma.
Alternatively, utilize the lightness of body color, and the multiple lightness ranges preset, determine background color Lightness range, including:
When the lightness of described body color belongs to default the first lightness range (such as, [0.5,1]), really Determine the second lightness range (such as, [0,0.5]) that the lightness range of background color belongs to default;As described master When the lightness of body color belongs to the second default lightness range, determine that the lightness range of background color belongs to default The first lightness range;Wherein, described first lightness range is greater than or equal to described second lightness range.Its It is meant that: the color that colour match lightness that lightness is high is low, the color that colour match lightness that lightness is low is high.
Alternatively, utilize the saturation of body color, and the multiple saturation scopes preset, determine background The saturation scope of color, including:
When the saturation of described body color belongs to default the first saturation scope (such as, [0.5,1]), Determine that the saturation scope of background color belongs to default the second saturation scope (such as, [0,0.5]);When When the saturation of described body color belongs to the second default saturation scope, determine the saturation of background color Scope belongs to the first default saturation scope;Wherein, described first saturation scope is greater than or equal to described Second lightness range.It is meant that: the color that saturate colour match saturation is low, saturation is low The saturate color of colour match.
Alternatively, utilize the chroma of body color, and the chroma angle preset, determine the coloured silk of background color Degree, including:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
Wherein, the first chroma scope and the second chroma scope, relative set can be carried out according to actual needs, Such as can obtain corresponding scope by emulation, determine the chroma in the range of which by emulation, be suitable for adopting Matching colors by close chroma, the chroma in the range of which chroma is suitable for using the chroma that contrast is high to carry out Color matching.The first described chroma scope and the second chroma scope are not limited by the embodiment of the present invention.When So, do not use the first chroma scope and the second chroma scope can also realize color matching equally, pre-for example with one If fixing chroma angle be added with the chroma of body color, using that obtain and value as the chroma of background color Also possible.
The span of tone (namely H) be [0,360), in actual applications, can produce according to different industries Product choose the color matching of different tone, such as: choose 30 ° for close color matching, will the chroma of theme colors add The first chroma angle of 30 ° obtains the chroma of background color;Choose 180 ° to match colors for contrast, will theme The chroma of color adds that the second chroma angle of 180 ° obtains the chroma etc. of background color.
Furthermore it is also possible to the color that in employing body color, saturation is the highest is matched colors as word.Saturation ratio Higher color, easily produces contrast with background colour, and the most saturate color occurs in foreground image Crossing, such text color and foreground image can echo, and the purpose so processed is easily to make the marks such as word Note and foreground image more attract user to pay close attention to.
Therefore, alternatively, the method also includes:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
Alternatively, described labelling includes: word, figure and/or symbol.
Alternatively, the described color determining this labelling, specifically include: determine saturation in described foreground image The highest color, using this color as the color of this labelling.
In the embodiment of the present invention, in linux operating system, the scheme realized with python language can reach Optimal implementation result.
With said method accordingly, see Fig. 5, a kind of image processing apparatus that the embodiment of the present invention provides, Including:
First module 11, for determining the foreground image in original image, and the main body face of this foreground image Color;
Second unit 12, for according to described body color, and being used for of presetting realizes foreground image and the back of the body The color matching rule that scape image comparison shows, obtains background color, and utilizes this background color to obtain Background Picture;
3rd unit 13, for by described foreground image and the described background image synthesis target image obtained.
Alternatively, described first module specifically for:
Determine the gray value of each pixel of original image;
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture;
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.
Alternatively, second unit is according to described body color, and being used for of presetting realizes foreground image and the back of the body The color matching rule that scape image comparison shows, when obtaining background color, specifically for:
Utilize the lightness of body color, and the multiple lightness ranges preset, determine the lightness model of background color Enclose, and select a lightness as the lightness of background color from the lightness range belonging to background color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma of body color, and the chroma angle preset, determine the chroma of background color;
Utilize the lightness of background color, saturation and chroma, determine background color.
Alternatively, second unit utilizes the lightness of body color, and the multiple lightness ranges preset, and determines During the lightness range of background color, specifically for:
When the lightness of described body color belongs to the first default lightness range, determine the lightness of background color Scope belongs to the second default lightness range;When the lightness of described body color belongs to the second default lightness model When enclosing, determine that the lightness range of background color belongs to the first default lightness range;Wherein, described first bright Degree scope is greater than or equal to described second lightness range.
Alternatively, second unit utilizes the saturation of body color, and the multiple saturation scopes preset, When determining the saturation scope of background color, specifically for:
When the saturation of described body color belongs to the first default saturation scope, determine background color Saturation scope belongs to the second default saturation scope;When the saturation of described body color belongs to default During the second saturation scope, determine that the saturation scope of background color belongs to the first default saturation scope; Wherein, described first saturation scope is greater than or equal to described second lightness range.
Alternatively, second unit utilizes the chroma of body color, and the chroma angle preset, and determines background During the chroma of color, specifically for:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
Alternatively, described Unit the 3rd is additionally operable to:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
Alternatively, described labelling includes: word, figure and/or symbol.
Alternatively, described first module is additionally operable to determine the color that in described foreground image, saturation is the highest, will This color is as the color of described labelling, and is sent to described Unit the 3rd.
Above unit, all can be realized by entity apparatus such as processors.
In sum, the embodiment of the present invention proposes a kind of image Automatic color matching side based on Color Psychology Case, can apply to image ad manufacturing process, and the program is applicable to the making of all image ads, has Versatility.Make automatically to make the scheme of colour during image intention (banner) and be no longer necessary to the completeest Become, computer can be given and automatically provided scheme of colour by algorithm.And it is possible to according to subject image Body color, provides more particularly suitable scheme of colour from Color Psychology angle.The embodiment of the present invention is being carried out Image procossing storehouse (Python Image Library, PIL) can be used during image procossing, or based on (opening Source) cross-platform computer vision library (Open Source Computer Vision Library, OpenCV) issued Etc. prior art, scheme of colour have employed HSV color space, it is of course also possible to employing tone (H), Saturation (S), brightness (L) (being called for short HSL) color space etc.;It addition, the embodiment of the present invention is in color matching In scheme, Main Basis tone, saturation, lightness are matched colors, it is also possible to pass through according to product type etc. Machine learning provides other scheme of colour.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter Calculation machine program product.Therefore, the present invention can use complete hardware embodiment, complete software implementation or knot The form of the embodiment in terms of conjunction software and hardware.And, the present invention can use and wherein wrap one or more Computer-usable storage medium containing computer usable program code (include but not limited to disk memory and Optical memory etc.) form of the upper computer program implemented.
The present invention is with reference to method, equipment (system) and computer program product according to embodiments of the present invention The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and / or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/ Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification without deviating from this to the present invention Bright spirit and scope.So, if the present invention these amendment and modification belong to the claims in the present invention and Within the scope of its equivalent technologies, then the present invention is also intended to comprise these change and modification.

Claims (18)

1. an image processing method, it is characterised in that the method includes:
Determine the foreground image in original image, and the body color of this foreground image;
According to described body color, and preset for realizing foreground image and background image contrast display Color matching rule, obtains background color, and utilizes this background color to obtain background image;
By described foreground image and the described background image synthesis target image obtained.
Method the most according to claim 1, it is characterised in that determine the foreground picture in original image Picture, and the body color of this foreground image, specifically include:
Determine the gray value of each pixel of original image;
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture;
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.
Method the most according to claim 1, it is characterised in that according to described body color, and The color matching rule for realizing foreground image and background image contrast display preset, obtains background color, tool Body includes:
Utilize the lightness of body color, and the multiple lightness ranges preset, determine the lightness model of background color Enclose, and select a lightness as the lightness of background color from the lightness range belonging to background color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma of body color, and the chroma angle preset, determine the chroma of background color;
Utilize the lightness of background color, saturation and chroma, determine background color.
Method the most according to claim 3, it is characterised in that utilize the lightness of body color, with And the multiple lightness ranges preset, determine the lightness range of background color, including:
When the lightness of described body color belongs to the first default lightness range, determine the lightness of background color Scope belongs to the second default lightness range;When the lightness of described body color belongs to the second default lightness model When enclosing, determine that the lightness range of background color belongs to the first default lightness range;Wherein, described first bright Degree scope is greater than or equal to described second lightness range.
Method the most according to claim 3, it is characterised in that utilize the saturation of body color, And the multiple saturation scopes preset, determine the saturation scope of background color, including:
When the saturation of described body color belongs to the first default saturation scope, determine background color Saturation scope belongs to the second default saturation scope;When the saturation of described body color belongs to default During the second saturation scope, determine that the saturation scope of background color belongs to the first default saturation scope; Wherein, described first saturation scope is greater than or equal to described second lightness range.
Method the most according to claim 3, it is characterised in that utilize the chroma of body color, with And the chroma angle preset, determine the chroma of background color, including:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
Method the most according to claim 1, it is characterised in that the method also includes:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
Method the most according to claim 7, it is characterised in that described labelling includes: word, figure Shape and/or symbol.
Method the most according to claim 7, it is characterised in that the described color determining this labelling, Specifically include: determine the color that in described foreground image, saturation is the highest, using this color as the face of this labelling Color.
10. an image processing apparatus, it is characterised in that this device includes:
First module, for determining the foreground image in original image, and the main body face of this foreground image Color;
Second unit, for according to described body color, and being used for of presetting realizes foreground image and background The color matching rule that image comparison shows, obtains background color, and utilizes this background color to obtain Background Picture;
Unit the 3rd, for by described foreground image and the described background image synthesis target image obtained.
11. devices according to claim 10, it is characterised in that described first module specifically for:
Determine the gray value of each pixel of original image;
The gray value of each pixel according to described original image, determines the foreground picture in described original image Picture;
Determine the rectangular histogram of the gray value of foreground image in described original image, and utilize this rectangular histogram to determine The body color of this foreground image.
12. devices according to claim 10, it is characterised in that second unit is according to described main body Color, and the color matching rule for realizing foreground image and background image contrast display preset, carried on the back During scape color, specifically for:
Utilize the lightness of body color, and the multiple lightness ranges preset, determine the lightness model of background color Enclose, and select a lightness as the lightness of background color from the lightness range belonging to background color;And/or,
Utilize the saturation of body color, and the multiple saturation scopes preset, determine the full of background color With degree scope, and from the saturation scope belonging to background color, select full as background color of a saturation And degree;And/or,
Utilize the chroma of body color, and the chroma angle preset, determine the chroma of background color;
Utilize the lightness of background color, saturation and chroma, determine background color.
13. devices according to claim 12, it is characterised in that second unit utilizes body color Lightness, and preset multiple lightness ranges, when determining the lightness range of background color, specifically for:
When the lightness of described body color belongs to the first default lightness range, determine the lightness of background color Scope belongs to the second default lightness range;When the lightness of described body color belongs to the second default lightness model When enclosing, determine that the lightness range of background color belongs to the first default lightness range;Wherein, described first bright Degree scope is greater than or equal to described second lightness range.
14. devices according to claim 12, it is characterised in that second unit utilizes body color Saturation, and preset multiple saturation scopes, when determining the saturation scope of background color, specifically For:
When the saturation of described body color belongs to the first default saturation scope, determine background color Saturation scope belongs to the second default saturation scope;When the saturation of described body color belongs to default During the second saturation scope, determine that the saturation scope of background color belongs to the first default saturation scope; Wherein, described first saturation scope is greater than or equal to described second lightness range.
15. devices according to claim 12, it is characterised in that second unit utilizes body color Chroma, and preset chroma angle, when determining the chroma of background color, specifically for:
When the chroma of described body color belongs to the first default chroma scope, use the first chroma preset The chroma of angle and described body color determines the chroma of background color;When the chroma of described body color belongs to When the second default chroma scope, use the second chroma angle and the chroma of described body color preset Determine the chroma of background color;Wherein, described first chroma angle is less than described second chroma angle.
16. devices according to claim 10, it is characterised in that described Unit the 3rd is additionally operable to:
Determine and need the labelling of interpolation in described target image, and determine the color of this labelling, use this face This labelling is added in described target image by color.
17. devices according to claim 16, it is characterised in that described labelling includes: word, Figure and/or symbol.
18. devices according to claim 16, it is characterised in that described first module is additionally operable to really The color that in fixed described foreground image, saturation is the highest, using this color as the color of described labelling, and sends To described Unit the 3rd.
CN201510222313.6A 2015-05-04 2015-05-04 Image processing method and device Active CN106204690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510222313.6A CN106204690B (en) 2015-05-04 2015-05-04 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510222313.6A CN106204690B (en) 2015-05-04 2015-05-04 Image processing method and device

Publications (2)

Publication Number Publication Date
CN106204690A true CN106204690A (en) 2016-12-07
CN106204690B CN106204690B (en) 2020-04-17

Family

ID=57458897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510222313.6A Active CN106204690B (en) 2015-05-04 2015-05-04 Image processing method and device

Country Status (1)

Country Link
CN (1) CN106204690B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture
CN108416826A (en) * 2018-02-07 2018-08-17 李荣陆 A kind of planar design Automatic color matching device
CN109345612A (en) * 2018-09-13 2019-02-15 腾讯数码(天津)有限公司 A kind of image generating method, device, equipment and storage medium
CN109859283A (en) * 2018-12-22 2019-06-07 Oppo广东移动通信有限公司 One kind taking color method, takes color device, electronic equipment and can storage medium
CN110795659A (en) * 2019-09-25 2020-02-14 口碑(上海)信息技术有限公司 Method and device for generating page background picture
CN111199565A (en) * 2018-11-16 2020-05-26 阿里巴巴集团控股有限公司 Data processing method, device, system, electronic equipment and storage medium
CN111275777A (en) * 2018-12-04 2020-06-12 北京京东尚科信息技术有限公司 Automatic color matching method, device, medium and electronic equipment
CN112035210A (en) * 2020-09-30 2020-12-04 北京百度网讯科技有限公司 Method, apparatus, device and medium for outputting color information
CN112069340A (en) * 2020-09-04 2020-12-11 北京字节跳动网络技术有限公司 Background picture processing and search result display method, device, equipment and medium
CN113284198A (en) * 2021-05-13 2021-08-20 稿定(厦门)科技有限公司 Automatic image color matching method and device
CN114928731A (en) * 2022-05-05 2022-08-19 中国电子科技集团公司第十四研究所 Intelligent color interactive display method and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577336A (en) * 2003-07-04 2005-02-09 三菱电机株式会社 Method and apparatus for representing a group of images
CN102736920A (en) * 2012-06-11 2012-10-17 广东欧珀移动通信有限公司 Adaptive color matching method of desktop icon background mask
US20140029842A1 (en) * 2011-02-28 2014-01-30 International Business Machines Corporation Mapping colors of an image
CN104364825A (en) * 2012-04-09 2015-02-18 华为技术有限公司 Visual conditioning for augmented-reality-assisted video conferencing
CN104793937A (en) * 2015-04-17 2015-07-22 魅族科技(中国)有限公司 Start-up control method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1577336A (en) * 2003-07-04 2005-02-09 三菱电机株式会社 Method and apparatus for representing a group of images
US20140029842A1 (en) * 2011-02-28 2014-01-30 International Business Machines Corporation Mapping colors of an image
CN104364825A (en) * 2012-04-09 2015-02-18 华为技术有限公司 Visual conditioning for augmented-reality-assisted video conferencing
CN102736920A (en) * 2012-06-11 2012-10-17 广东欧珀移动通信有限公司 Adaptive color matching method of desktop icon background mask
CN104793937A (en) * 2015-04-17 2015-07-22 魅族科技(中国)有限公司 Start-up control method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108320312A (en) * 2017-01-18 2018-07-24 阿里巴巴集团控股有限公司 Color matching method and device, the terminal of picture
CN108416826A (en) * 2018-02-07 2018-08-17 李荣陆 A kind of planar design Automatic color matching device
CN109345612A (en) * 2018-09-13 2019-02-15 腾讯数码(天津)有限公司 A kind of image generating method, device, equipment and storage medium
CN111199565B (en) * 2018-11-16 2022-05-27 阿里巴巴集团控股有限公司 Data processing method, device, system, electronic equipment and storage medium
CN111199565A (en) * 2018-11-16 2020-05-26 阿里巴巴集团控股有限公司 Data processing method, device, system, electronic equipment and storage medium
CN111275777A (en) * 2018-12-04 2020-06-12 北京京东尚科信息技术有限公司 Automatic color matching method, device, medium and electronic equipment
CN109859283A (en) * 2018-12-22 2019-06-07 Oppo广东移动通信有限公司 One kind taking color method, takes color device, electronic equipment and can storage medium
CN109859283B (en) * 2018-12-22 2024-01-09 Oppo广东移动通信有限公司 Color taking method, color taking device, electronic equipment and storable medium
CN110795659A (en) * 2019-09-25 2020-02-14 口碑(上海)信息技术有限公司 Method and device for generating page background picture
CN112069340A (en) * 2020-09-04 2020-12-11 北京字节跳动网络技术有限公司 Background picture processing and search result display method, device, equipment and medium
CN112035210A (en) * 2020-09-30 2020-12-04 北京百度网讯科技有限公司 Method, apparatus, device and medium for outputting color information
CN112035210B (en) * 2020-09-30 2024-05-07 北京百度网讯科技有限公司 Method, apparatus, device and medium for outputting color information
CN113284198A (en) * 2021-05-13 2021-08-20 稿定(厦门)科技有限公司 Automatic image color matching method and device
CN114928731A (en) * 2022-05-05 2022-08-19 中国电子科技集团公司第十四研究所 Intelligent color interactive display method and equipment
CN114928731B (en) * 2022-05-05 2023-11-28 中国电子科技集团公司第十四研究所 Intelligent color interactive display method and device

Also Published As

Publication number Publication date
CN106204690B (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN106204690A (en) A kind of image processing method and device
CN105009580B (en) The display management of high dynamic range video
CN101409066B (en) Systems and methods for selective handling of out-of-gamut color conversions
US9041724B2 (en) Methods and apparatus for color rendering
US7945092B2 (en) Pixel processor
CN101360250B (en) Immersion method and system, factor dominating method, content analysis method and parameter prediction method
US8477135B2 (en) Method and apparatus for volume rendering using depth weighted colorization
CN102663741B (en) Method for carrying out visual stereo perception enhancement on color digit image and system thereof
CN108122546B (en) Display apparatus and image processing method thereof
CN109643446A (en) Circuit device, electronic equipment and error-detecting method
US8237747B2 (en) Method of converting signals for multi-primary color display
CN110335330A (en) Image simulation generation method and its system, deep learning algorithm training method and electronic equipment
KR20160068627A (en) Image processing device, image processing method and display device
EP3628187A1 (en) Method for simulating the rendering of a make-up product on a body area
EP3476122B1 (en) Rendering wide color gamut, two-dimensional (2d) images on three-dimensional (3d) capable displays
US9508317B2 (en) Display evaluation device, display evaluation method, and non-transitory computer readable medium
CN103686110A (en) Method and device for converting RGB (Red, Green and Blue) into RGBW (Red, Green, Blue and White)
CN109636751B (en) Edge processing method of special-shaped display panel, display panel and display device
WO2006111897A1 (en) Converting a three primary color input signal into four drive signals
Kim et al. Color modification for color-blind viewers using the dynamic color transformation
CN106548184A (en) A kind of method and apparatus of adjustment illumination balance
Lee et al. Converting color images to grayscale images by reducing dimensions
EP3195251B1 (en) Method to enhance contrast with reduced visual artifacts
CN107219629A (en) Method, storage medium and the equipment of anti-VR equipment dispersion are superimposed using RGB
Saito et al. Image-dependent three-dimensional gamut mapping using gamut boundary descriptor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240223

Address after: # 01-21, Lai Zan Da Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands

TR01 Transfer of patent right