Summary of the invention
Given this, embodiments provide one and to take pictures processing method and device, to realize the image that photographic subjects object highlights with pre-set color, promote the artistic feeling of captured image.
First aspect, provide one and to take pictures processing method, described method comprises:
After camera lens gathers image, obtain the color value of each pixel in described image;
Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value;
On described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object.
Further, described detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is that the second color value specifically comprises:
Detect in described image comprise goal-selling object time, obtain the color value of pixel corresponding to described goal-selling object and described pixel;
Whether the color value judging the pixel that described goal-selling object is corresponding is the first color value;
If so, the color value arranging the pixel of remainder on described image is the second color value;
Otherwise the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value.
Further, described second color value is the gray value of pixel.
Further, described color value is RGB rgb format, comprises red input pixels value, green-component pixel values and blue-component pixels value.
Further, before the color value obtaining each pixel in described image, described method also comprises:
When starting camera function, open goal-selling object detection functions, to obtain the goal-selling object in image that camera lens gathers.
Second aspect, provide one and to take pictures processing unit, described device comprises:
Acquisition module, for after camera lens gathers image, obtains the color value of each pixel in described image;
Module is set, for detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value;
On described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object.
Further, the described module that arranges comprises:
Acquiring unit, for detect in described image comprise goal-selling object time, obtain the color value of pixel corresponding to described goal-selling object and described pixel;
Judging unit, for judging whether the color value of the pixel that described goal-selling object is corresponding is the first color value;
First setting unit, for when the judged result of judging unit is for being, the color value arranging the pixel of remainder on described image is the second color value;
Second setting unit, for when the judged result of judging unit is no, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value.
Further, described second color value is the gray value of pixel.
Further, described color value is RGB rgb format, comprises red input pixels value, green-component pixel values and blue-component pixels value.
Further, described device also comprises:
Starting module, for when starting camera function, opening goal-selling object detection functions, to obtain the goal-selling object in image that camera lens gathers.
Compared with prior art, the embodiment of the present invention, by after camera lens gathers image, obtains the color value of each pixel in described image; Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value; Wherein, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object, thus achieve monochrome and take pictures, the photo obtained highlights with pre-set color on goal-selling object, remainder except goal-selling object then shows other colors, has enriched existing camera function.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The embodiment of the present invention, by after camera lens gathers image, obtains the color value of each pixel in described image; Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value; Wherein, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object, thus achieve monochrome and take pictures, the photo obtained highlights with pre-set color on goal-selling object, remainder except goal-selling object then shows other colors, improves the shooting experience sense of user widely.The embodiment of the present invention additionally provides corresponding device, is described in detail respectively below.
embodiment one
Fig. 1 shows the first realization flow of the processing method of taking pictures that the embodiment of the present invention one provides, and for convenience of explanation, illustrate only part related to the present invention.
In embodiments of the present invention, described method is applied to the mobile terminal with camera function.Described mobile terminal includes but not limited to mobile phone, pocket computer (Pocket personal Computer, PPC), palmtop PC, personal digital assistant (Personal Digital Assistant, PDA) etc., smart mobile phone, panel computer etc. is preferably.Described mobile terminal is provided with camera, image processor.
As shown in Figure 1, described method comprises:
In step S101, after camera lens gathers image, obtain the color value of each pixel in described image.
The camera function key that user presses mobile terminal to be provided is taken pictures, and camera captures current view data, and is processed by imageing sensor described view data and export, thus obtains the color value of each pixel in the image that gathers of camera lens.
Preferably, described color value is RGB rgb format, comprises red input pixels value, green-component pixel values and blue-component pixels value.When the image data format that imageing sensor exports is yuv form, then convert the view data of described yuv form to rgb format data.Such as, when yuv format conversion becomes rgb format, suppose that the yuv form of view data is expressed as (Y, U, V), corresponding rgb format is expressed as (R, G, B), and conversion formula is:
R=Y+1.4075*(V-128)
G=Y-0.3455*(U-128)-0.7169*(V-128)
B=Y+1.779*(U-128)
If user is provided with destination object measuring ability, then after the view data getting the rgb format that imageing sensor exports, local feature detection is carried out to described view data, by judging at the grader pre-set whether current view data meets corresponding feature, to detect goal-selling object.Wherein, the detection of described goal-selling object is undertaken by HAAR characteristics algorithm, and HAAR characteristics algorithm is that the local feature data sample by obtaining under being used in various different scene condition makees the grader cultivating the corresponding topical feature obtained.Preferably, described destination object includes but not limited to red lip, Young Pioneer, corner windmill, eyeball etc.
In step s 102, detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value.
In embodiments of the present invention, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object.
Wherein, described first color value can be user's RGB color value by the prompting frame input of ejection when starting destination object measuring ability, the color value of the pixel that the destination object that also can export for imageing sensor is corresponding.
Exemplarily, when described first color value is the RGB color value that user sets, described second color value is the gray value of pixel, if detect in image and comprise goal-selling object, the RGB color value of color value set by user (i.e. the colour of user's setting) of pixel corresponding to described goal-selling object is then set, and gray processing process is carried out to the pixel of the remainder on described image except pixel corresponding to described destination object, black and white is presented to make the remainder on described image except pixel corresponding to described destination object, thus the image obtained after making process reaches the effect that monochrome is taken pictures, the i.e. only color of display setting on destination object, other parts then show black-white colors, improve the artistic feeling of captured image widely.
Preferably, described second color value can also be color value corresponding after filter process, such as black and white filter, filter of missing old times or old friends, light green color filter, tone filter, develops and prints filter etc.
The embodiment of the present invention, by after camera lens gathers image, obtains the color value of each pixel in described image; Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value; Wherein, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object, thus achieve monochrome and take pictures, the photo obtained highlights with pre-set color on goal-selling object, remainder except goal-selling object then shows other colors, improves the shooting experience sense of user widely.
embodiment two
Fig. 2 shows the second realization flow of the processing method of taking pictures that the embodiment of the present invention two provides, and for convenience of explanation, illustrate only part related to the present invention.
As shown in Figure 2, described method comprises:
In step s 201, destination object camera function is started.
In step S202, after camera lens gathers image, obtain the image of the yuv format that imageing sensor exports, and the view data of described yuv format is converted to the image of rgb format.
In step S203, judge whether comprise goal-selling object in the image of described rgb format.
In embodiments of the present invention, the detection of described goal-selling object is undertaken by HAAR characteristics algorithm, and HAAR characteristics algorithm is that the local feature data sample by obtaining under being used in various different scene condition makees the grader cultivating the corresponding topical feature obtained.When carrying out local feature and detecting, by searching coupling in grader, determine whether the destination object that destination object camera function is corresponding.Preferably, described destination object includes but not limited to red lip, Young Pioneer, corner windmill, eyeball etc., and accordingly, described destination object camera function can realize the detection to objects such as red lip, Young Pioneer, corner windmill, eyeballs.
If comprise goal-selling object in the image of described rgb format, then perform step S204; Otherwise, perform step S207.
In step S204, according to the image acquisition destination object positional information in the picture of described rgb format, and whether the color value judging the pixel that described destination object is corresponding is the first color value.
If the determination result is YES, then step S205 is performed; Otherwise, perform step S206.
In step S205, retain the color value of pixel corresponding to destination object, and the color value arranging the pixel of remainder on image is the second color value.
In step S206, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on image is the second color value.
In step S207, arranging the color that on image, each pixel is corresponding is the second color value.
It should be noted that, the color value that described first color value can set before shooting for user, color value that also can be corresponding for the destination object specified in selected goal-selling camera function.The color value that described second color value can set before shooting for user also can be color value corresponding after the filter processing mode of user's setting, such as black and white filter, filter of missing old times or old friends, light green color filter, tone filter, develops and prints filter etc.Therefore, the set-up mode of above-mentioned " color value arranging the pixel of remainder on image is the second color value " can be the color value set before taking pictures for the color value directly arranging the pixel of remainder on image, also can for processing according to the pixel of filter processing mode to the remainder on image of user's setting, the color value making the pixel after processing is the second color value.
The embodiment of the present invention, by after camera lens gathers image, obtains the color value of each pixel in described image; Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value; Wherein, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object, thus achieve monochrome and take pictures, the photo obtained highlights with pre-set color on goal-selling object, remainder except goal-selling object then shows other colors, improves the shooting experience sense of user widely.
embodiment three
Fig. 3 shows the composition structure of the processing unit of taking pictures that the embodiment of the present invention three provides, and for convenience of explanation, illustrate only part related to the present invention.
In embodiments of the present invention, described device, for realizing the processing method of taking pictures described in Fig. 1 or Fig. 2 embodiment, can be the unit being built in the software unit of mobile terminal, hardware cell or software and hardware combining.Described mobile terminal includes but not limited to mobile phone, pocket computer (Pocket personalComputer, PPC), palmtop PC, personal digital assistant (Personal Digital Assistant, PDA), etc., be preferably smart mobile phone, panel computer etc.Described mobile terminal is provided with camera, image processor.
As shown in Figure 3, described device comprises:
Acquisition module 31, for after camera lens gathers image, obtains the color value of each pixel in described image.
Module 32 is set, for detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value.
On described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object.
Further, the described module 32 that arranges specifically comprises:
Acquiring unit 321, for detect in described image comprise goal-selling object time, obtain the color value of pixel corresponding to described goal-selling object and described pixel.
Judging unit 322, for judging whether the color value of the pixel that described goal-selling object is corresponding is the first color value.
First setting unit 323, for when the judged result of judging unit is for being, the color value arranging the pixel of remainder on described image is the second color value.
Second setting unit 324, for when the judged result of judging unit is no, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value.
Preferably, described color value is RGB rgb format, comprises red input pixels value, green-component pixel values and blue-component pixels value.The image data format that the image of camera lens collection exports after imageing sensor is yuv form, then convert the view data of described yuv form to rgb format data.
Preferably, described device also comprises:
Starting module 33, for when starting camera function, opening goal-selling object detection functions, to obtain the goal-selling object in image that camera lens gathers.
In embodiments of the present invention, the color value that described first color value can set before shooting for user, color value that also can be corresponding for the destination object specified in started goal-selling camera function.The color value that described second color value can set before shooting for user also can be color value corresponding after the filter process of user's setting, such as black and white filter, filter of missing old times or old friends, light green color filter, tone filter, develops and prints filter etc.Therefore, the color value that above-mentioned second setting unit 324 arranges the pixel of remainder on image is the mode of the second color value can be the color value set before taking pictures for the color value directly arranging the pixel of remainder on image, also can for processing according to the pixel of filter processing mode to the remainder on image of user's setting, the color value making the pixel after processing is the second color value.Exemplarily, described second color value is the dark yellow after the gray value (i.e. black and white) of pixel, filter of missing old times or old friends, the light green color etc. after light green color filter.
It should be noted that, device in the embodiment of the present invention may be used for the whole technical schemes realized in said method embodiment, the function of its each functional module can according to the method specific implementation in said method embodiment, its specific implementation process can refer to the associated description in above-described embodiment, repeats no more herein.
The embodiment of the present invention, by after camera lens gathers image, obtains the color value of each pixel in described image; Detect in described image comprise goal-selling object time, the color value arranging pixel corresponding to described goal-selling object is the color value of the first color value and the pixel arranging remainder on described image is the second color value; Wherein, on described image, the pixel of remainder is the rest of pixels on described image except pixel corresponding to described goal-selling object, thus achieve monochrome and take pictures, the photo obtained highlights with pre-set color on goal-selling object, remainder except goal-selling object then shows other colors, improve the artistic feeling of captured image widely, also improve the shooting experience sense of user.
Those of ordinary skill in the art can recognize, in conjunction with unit and the algorithm steps of each example of embodiment disclosed herein description, can realize with the combination of electronic hardware or computer software and electronic hardware.These functions perform with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can use distinct methods to realize described function to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the specific works process of the system of foregoing description, device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that disclosed apparatus and method can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.
If described function using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. various can be program code stored medium.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection range of claim.