Take pictures processing method and processing device
Technical field
The invention belongs to technical field of mobile terminals, more particularly to one kind is taken pictures processing method and processing device.
Background technology
With the development of science and technology, smart mobile phone turns into the electronic equipment being in the most contact in people's daily life.Existing intelligence
The camera function of energy mobile phone is various, such as panorama, night scene stabilization, filter etc., meets the diversified demand of taking pictures of people.But
Existing smart mobile phone can not realize that monochrome is taken pictures, i.e., can not obtain the photo that destination object is highlighted with pre-set color value,
For example only red black and white picture is presented in lip.
The content of the invention
In consideration of it, taken pictures processing method and processing device the embodiments of the invention provide one kind, with realize photographic subjects object with
The image that pre-set color highlights, the artistic feeling of image captured by lifting.
First aspect, there is provided one kind is taken pictures processing method, and methods described includes:
After camera lens gathers image, the color value of each pixel in described image is obtained;
When including goal-selling object in detecting described image, pixel corresponding to the goal-selling object is set
It is the second color value that color value, which is the first color value and sets the color value of the pixel of remainder in described image,;
In described image the pixel of remainder be described image in addition to pixel corresponding to the goal-selling object
Rest of pixels.
Further, it is described when including goal-selling object in detecting described image, the goal-selling pair is set
As the color value of corresponding pixel is the first color value and to set the color value of the pixel of remainder in described image be the
Second colors value specifically includes:
When including goal-selling object in detecting described image, obtain pixel corresponding to the goal-selling object and
The color value of the pixel;
Whether the color value for judging pixel corresponding to the goal-selling object is the first color value;
If so, the color value for setting the pixel of remainder in described image is the second color value;
Otherwise, the color value of pixel corresponding to the goal-selling object is set for the first color value and the figure is set
As the color value of the pixel of upper remainder is the second color value.
Further, second color value is the gray value of pixel.
Further, the color value is RGB rgb format, including red input pixels value, green-component pixel values
With blue-component pixels value.
Further, before the color value of each pixel in obtaining described image, methods described also includes:
When starting camera function, goal-selling object detection functions are opened, to obtain in camera lens acquired image
Goal-selling object.
Second aspect, there is provided one kind is taken pictures processing unit, and described device includes:
Acquisition module, for after camera lens gathers image, obtaining the color value of each pixel in described image;
Setup module, for when including goal-selling object in detecting described image, setting the goal-selling pair
As the color value of corresponding pixel is the first color value and to set the color value of the pixel of remainder in described image be the
Second colors value;
In described image the pixel of remainder be described image in addition to pixel corresponding to the goal-selling object
Rest of pixels.
Further, the setup module includes:
Acquiring unit, for when including goal-selling object in detecting described image, obtaining the goal-selling pair
As the color value of corresponding pixel and the pixel;
Judging unit, for judging whether the color value of pixel corresponding to the goal-selling object is the first color value;
First setting unit, for when the judged result of judging unit is is, setting remainder in described image
The color value of pixel is the second color value;
Second setting unit, for when the judged result of judging unit is no, setting the goal-selling object corresponding
The color value of pixel be the first color value and to set the color value of pixel of remainder in described image be the second color
Value.
Further, second color value is the gray value of pixel.
Further, the color value is RGB rgb format, including red input pixels value, green-component pixel values
With blue-component pixels value.
Further, described device also includes:
Starting module, for when starting camera function, opening goal-selling object detection functions, being adopted with obtaining camera lens
Goal-selling object in the image of collection.
Compared with prior art, the embodiment of the present invention is by after camera lens gathers image, obtaining each in described image
The color value of pixel;When including goal-selling object in detecting described image, set corresponding to the goal-selling object
It is the second color value that the color value of pixel, which is the first color value and sets the color value of the pixel of remainder in described image,;
Wherein, the pixel of remainder is remaining in described image in addition to pixel corresponding to the goal-selling object in described image
Pixel, it is achieved thereby that monochrome is taken pictures, acquired photo is highlighted on goal-selling object with pre-set color, and except pre-
If the remainder outside destination object then shows other colors, existing camera function is enriched.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also
To obtain other accompanying drawings according to these accompanying drawings.
Fig. 1 is the first implementation process figure of the processing method of taking pictures that the embodiment of the present invention one provides;
Fig. 2 is the second implementation process figure of the processing method of taking pictures that the embodiment of the present invention two provides;
Fig. 3 is the composition structure chart for the processing unit of taking pictures that the embodiment of the present invention three provides.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
The embodiment of the present invention is by after camera lens gathers image, obtaining the color value of each pixel in described image;
Detect when goal-selling object is included in described image, the color value of pixel corresponding to the goal-selling object is set for the
One color value and the color value for setting the pixel of remainder in described image are the second color value;Wherein, in described image
The pixel of remainder is the rest of pixels in addition to pixel corresponding to the goal-selling object in described image, it is achieved thereby that
Monochrome is taken pictures, and acquired photo is highlighted on goal-selling object with pre-set color, and in addition to goal-selling object
Remainder then shows other colors, has greatly improved the shooting experience sense of user.The embodiment of the present invention additionally provides accordingly
Device, be described in detail individually below.
Embodiment one
Fig. 1 shows the first implementation process of the processing method of taking pictures that the embodiment of the present invention one provides, for convenience of description,
It illustrate only part related to the present invention.
In embodiments of the present invention, methods described is applied to the mobile terminal with camera function.The mobile terminal bag
Include but be not limited to mobile phone, pocket computer (Pocket personal Computer, PPC), palm PC, individual digital
Assistant (Personal Digital Assistant, PDA) etc., preferably smart mobile phone, tablet personal computer etc..The mobile terminal
On be provided with camera, image processor.
As shown in figure 1, methods described includes:
In step S101, after camera lens gathers image, the color value of each pixel in described image is obtained.
The camera function key that user presses mobile terminal offer is taken pictures, and camera captures current view data, and
Described image data are handled and exported by imaging sensor, so as to obtain each pixel in camera lens acquired image
Color value.
Preferably, the color value is RGB rgb format, including red input pixels value, green-component pixel values and
Blue-component pixels value.When the image data format of imaging sensor output is yuv forms, then by the image of the yuv forms
Data conversion is into rgb format data.For example yuv forms are when being converted into rgb format, it is assumed that the yuv forms of view data are expressed as
(Y, U, V), corresponding rgb format are 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 detection function, in the image for the rgb format for getting imaging sensor output
After data, local feature detection is carried out to described image data, by judging current picture number in the grader pre-set
According to whether corresponding feature is met, to detect goal-selling object.Wherein, the detection of the goal-selling object is special by HAAR
Levy algorithm to carry out, HAAR characteristics algorithms are done by using the local feature data sample obtained under the conditions of various different scenes
Cultivate the grader of obtained corresponding topical feature.Preferably, the destination object includes but is not limited to red lip, Young Pioneer, four
Angle windmill, eyeball etc..
In step s 102, when including goal-selling object in detecting described image, the goal-selling pair is set
As the color value of corresponding pixel is the first color value and to set the color value of the pixel of remainder in described image be the
Second colors value.
In embodiments of the present invention, the pixel of remainder is to remove the goal-selling pair in described image in described image
As the rest of pixels outside corresponding pixel.
Wherein, first color value can be that user passes through the prompting frame of ejection when starting destination object detection function
The RGB color value of input, or the color value of pixel corresponding to the destination object of imaging sensor output.
Exemplarily, when the RGB color value that first color value is user's setting, second color value is pixel
Gray value, goal-selling object is included in image if detecting, the color of pixel corresponding to the goal-selling object is set
It is worth for the RGB color value colour of setting (i.e. user) set by user, and it is corresponding to removing the destination object in described image
Pixel outside remainder pixel carry out gray processing processing, so as to remove pixel corresponding to the destination object in described image
Black and white is presented in outer remainder, so that the image obtained after processing reaches the monochromatic effect taken pictures, i.e., only in target
The color of setting is shown on object, and other parts then show black-white colors, have greatly improved captured image
Artistic feeling.
Preferably, second color value can also be after filter is handled corresponding color value, such as black and white filter,
Miss old times or old friends filter, light green color filter, tone filter, develop and print filter etc..
The embodiment of the present invention is by after camera lens gathers image, obtaining the color value of each pixel in described image;
Detect when goal-selling object is included in described image, the color value of pixel corresponding to the goal-selling object is set for the
One color value and the color value for setting the pixel of remainder in described image are the second color value;Wherein, in described image
The pixel of remainder is the rest of pixels in addition to pixel corresponding to the goal-selling object in described image, it is achieved thereby that
Monochrome is taken pictures, and acquired photo is highlighted on goal-selling object with pre-set color, and in addition to goal-selling object
Remainder then shows other colors, has greatly improved the shooting experience sense of user.
Embodiment two
Fig. 2 shows the second implementation process of the processing method of taking pictures that the embodiment of the present invention two provides, for convenience of description,
It illustrate only part related to the present invention.
As shown in Fig. 2 methods described includes:
In step s 201, destination object camera function is started.
In step S202, after camera lens gathers image, the image of the yuv format of imaging sensor output is obtained, and will
The view data of the yuv format is converted to the image of rgb format.
In step S203, judge whether include goal-selling object in the image of the rgb format.
In embodiments of the present invention, the detection of the goal-selling object is carried out by HAAR characteristics algorithms, HAAR features
Algorithm is that the corresponding topical cultivated and obtained is done by using the local feature data sample obtained under the conditions of various different scenes
The grader of feature.When carrying out local feature detection, matched by being searched in grader, determine whether that destination object is clapped
According to destination object corresponding to function.Preferably, the destination object includes but is not limited to red lip, Young Pioneer, corner windmill, eyeball
Deng accordingly, the destination object camera function can realize the inspection to objects such as red lip, Young Pioneer, corner windmill, eyeballs
Survey.
If including goal-selling object in the image of the rgb format, step S204 is performed;Otherwise, step is performed
S207。
In step S204, the positional information of destination object in the picture is obtained according to the image of the rgb format, and
Whether the color value for judging pixel corresponding to the destination object is the first color value.
If the determination result is YES, then step S205 is performed;Otherwise, step S206 is performed.
In step S205, retain the color value of pixel corresponding to destination object, and the picture of remainder on image is set
The color value of element is the second color value.
In step S206, the color value of pixel corresponding to the goal-selling object is set for the first color value and set
The color value for putting the pixel of remainder on image is the second color value.
In step S207, it is the second color value to set color corresponding to each pixel on image.
It should be noted that first color value can be the color value that user sets before shooting, or institute
Color value corresponding to destination object specified in the goal-selling camera function of selection.Second color value can be that user exists
The color value of setting before shooting, or corresponding color value after the filter processing mode by user's setting, such as black and white
Filter, filter of missing old times or old friends, light green color filter, tone filter, develop and print filter etc..Therefore, it is above-mentioned that " picture of remainder on image is set
The color value of element be the second color value " set-up mode can be that the color value of pixel of directly remainder on setting image be
The color value set before taking pictures, or the pixel according to the filter processing mode that user sets to the remainder on image
Handled so that the color value of the pixel after processing is the second color value.
The embodiment of the present invention is by after camera lens gathers image, obtaining the color value of each pixel in described image;
Detect when goal-selling object is included in described image, the color value of pixel corresponding to the goal-selling object is set for the
One color value and the color value for setting the pixel of remainder in described image are the second color value;Wherein, in described image
The pixel of remainder is the rest of pixels in addition to pixel corresponding to the goal-selling object in described image, it is achieved thereby that
Monochrome is taken pictures, and acquired photo is highlighted on goal-selling object with pre-set color, and in addition to goal-selling object
Remainder then shows other colors, has greatly improved the shooting experience sense of user.
Embodiment three
Fig. 3 shows the composition structure for the processing unit of taking pictures that the embodiment of the present invention three provides, and for convenience of description, only shows
Part related to the present invention is gone out.
In embodiments of the present invention, described device is used to realize the processing method of taking pictures described in Fig. 1 or Fig. 2 embodiments, can
To be the unit for being built in the software unit of mobile terminal, hardware cell or software and hardware combining.The mobile terminal include but
It is not limited to mobile phone, pocket computer (Pocket personal Computer, PPC), palm PC, personal digital assistant
(Personal Digital Assistant, PDA), etc., preferably smart mobile phone, tablet personal computer etc..On the mobile terminal
It is provided with camera, image processor.
As shown in figure 3, described device includes:
Acquisition module 31, for after camera lens gathers image, obtaining the color value of each pixel in described image.
Setup module 32, for when including goal-selling object in detecting described image, setting the goal-selling
The color value of pixel corresponding to object is that the color value of the pixel of remainder in the first color value and setting described image is
Second color value.
In described image the pixel of remainder be described image in addition to pixel corresponding to the goal-selling object
Rest of pixels.
Further, the setup module 32 specifically includes:
Acquiring unit 321, for when including goal-selling object in detecting described image, obtaining the goal-selling
The color value of pixel corresponding to object and the pixel.
Judging unit 322, for judging whether the color value of pixel corresponding to the goal-selling object is the first color
Value.
First setting unit 323, for when the judged result of judging unit is is, setting remainder in described image
The color value of pixel be the second color value.
Second setting unit 324, for when the judged result of judging unit is no, setting the goal-selling object pair
It is the second face that the color value for the pixel answered, which is the first color value and sets the color value of the pixel of remainder in described image,
Colour.
Preferably, the color value is RGB rgb format, including red input pixels value, green-component pixel values and
Blue-component pixels value.When the image data format that the image of camera lens collection exports after imaging sensor is yuv forms, then
The view data of the yuv forms is converted into rgb format data.
Preferably, described device also includes:
Starting module 33, for when starting camera function, goal-selling object detection functions being opened, to obtain camera lens institute
Goal-selling object in the image of collection.
In embodiments of the present invention, first color value can be the color value that user sets before shooting, can also
The color value corresponding to destination object specified in the goal-selling camera function that is started.Second color value can be to use
The color value that family is set before shooting, or corresponding color value after the filter processing by user's setting, such as black and white
Filter, filter of missing old times or old friends, light green color filter, tone filter, develop and print filter etc..Therefore, above-mentioned second setting unit 324 sets image
The color value of the pixel of upper remainder is that the mode of the second color value can be the direct pixel for setting remainder on image
Color value be the color value set before taking pictures, or according to user setting filter processing mode to remaining on image
Partial pixel is handled so that the color value of the pixel after processing is the second color value.Exemplarily, second color
It is worth the gray value (i.e. black and white) for pixel, the dark yellow after filter of missing old times or old friends, light green color after light green color filter etc..
It should be noted that the device in the embodiment of the present invention can be used for realizing whole skills in above method embodiment
Art scheme, the function of its each functional module can be implemented according to the method in above method embodiment, and it is implemented
Process can refer to the associated description in above-described embodiment, and here is omitted.
The embodiment of the present invention is by after camera lens gathers image, obtaining the color value of each pixel in described image;
Detect when goal-selling object is included in described image, the color value of pixel corresponding to the goal-selling object is set for the
One color value and the color value for setting the pixel of remainder in described image are the second color value;Wherein, in described image
The pixel of remainder is the rest of pixels in addition to pixel corresponding to the goal-selling object in described image, it is achieved thereby that
Monochrome is taken pictures, and acquired photo is highlighted on goal-selling object with pre-set color, and in addition to goal-selling object
Remainder then shows other colors, has greatly improved the artistic feeling of captured image, also improves the shooting experience of user
Sense.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein
Member and algorithm steps, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
Performed with hardware or software mode, application-specific and design constraint depending on technical scheme.Professional and technical personnel
Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed
The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can be passed through
Its mode is realized.For example, device embodiment described above is only schematical, for example, the division of the unit, only
Only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be tied
Another system is closed or is desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or discussed
Mutual coupling or direct-coupling or communication connection can be the INDIRECT COUPLINGs or logical by some interfaces, device or unit
Letter connection, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be
People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained
Cover within protection scope of the present invention.Therefore, protection scope of the present invention described should be defined by scope of the claims.