Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
A kind of filter processing method provided by the invention and shifting is discussed in detail below by several specific embodiments are enumerated
Dynamic terminal.
Referring to Fig.1, a kind of step flow chart of filter processing method of the embodiment of the present invention one is shown, specifically can wrap
Include following steps:
Step 101, the first input of user is received.
Wherein, for offset used by each Color Channel when the first input is for adjusting filter.
In practical applications, the first input can be carried out on interface of mobile terminal, can also by physical button into
Row, for example, the slide position on slider bar is adjusted, so that offset be adjusted in a certain range;Or exist in mobile terminal
When specified interface, pass through the physical button tuned up and the physical button turned down.Due to the value range 0 to 255 of Color Channel, then
The value of offset is also 0 to 255.
Specifically, user can operate the corresponding regulation button of red channel, green channel, blue channel respectively.
For example, G corresponds to green channel, and B corresponds to third blue channel, and user can be above R as shown in Fig. 2, R corresponds to red channel
Region slides up and down, and so as to adjust the size of red channel offset, can also slide up and down in G upper area, so as to adjust
The size of green channel offset can also be slided up and down in B upper area, so as to adjust the size of green channel offset.
In addition, user can also pass through a regulation button simultaneously adjust red channel, green channel, blue channel it is inclined
Shifting amount.As shown in figure 3, user can slide upward or downward on the screen, when upward sliding, red channel, green channel, indigo plant
Chrominance channel increases identical value simultaneously, and when slide downward, red channel, green channel, blue channel reduce identical value simultaneously.
The typical interface of the embodiment of the present invention is preview picture interface, and the previewing photos got are without filter or according to silent
Recognize after parameter filter, shows in photo preview interface., can be at this point, if user is dissatisfied to current previewing photos
Operation is adjusted on mobile terminal screen.
Step 102, in response to first input, the offset in the color of object channel of first object image is adjusted.
In practical applications, total drift amount usually requires the step number according to adjusting multiplied by the corresponding offset of every step.For example,
Sliding block is moved 3 steps by user, and every step corresponds to offset 2, then total drift amount is 2*3=6.
Step 103, the offset based on the color of object channel after adjusting generates color of object mapping table.
Wherein, color of object mapping table indicates after adjusting at least one Color Channel in secondary colour by the offset
Mapping secondary colour.Color of object mapping table can be understood as a kind of function for secondary colour, input the synthesis for pixel
Each color component in color exports as the secondary colour after adjustment.
In embodiments of the present invention, for each color value model in RGB (Red Green Blue, RGB) mode
Enclosing is 0 to 255, so that color of object mapping table needs map each value of each color, it may be assumed that will (i, j,
K) it is mapped as (i+i1, j+j1, k+k1), wherein i, j, k, i+i1, the equal value 0 to 255 of j+j1, k+k1, i1, j1, k1 take
Value -255 to 255, i1, j1, k1 value may be the same or different.
For example, for a secondary colour (50,123,142), wherein 50 be red channel, and 123 be green channel, and 142 are
Blue channel, if then the regulated quantity of red channel is 10, green regulated quantity is 15, and blue conciliation amount is -10, at this point, mesh
It marks color mapping table and secondary colour (50,123,142) is mapped as secondary colour (60,138,132).
It is appreciated that each color of object channel value after adjusting should all be more than or equal to 0 and be less than or equal in mapping
255.If being greater than 255 when tuning up, 255 are taken, if turn down, less than 0, then takes 0.
Optionally, in another embodiment of the invention, above-mentioned steps 103 include sub-step 1031:
Sub-step 1031 generates a color of object based on the offset at least one color of object channel after adjusting
Mapping table.
In embodiments of the present invention, red channel, green channel, blue channel can be adjusted respectively respectively, respectively
The amplitude of accommodation of Color Channel can be different.Specifically, when only one of Color Channel is adjusted, at this time there is only
One is directed to the offset of the Color Channel, to generate the color of object mapping for the Color Channel according to the offset
Table;When two or three Color Channels are adjusted, there are two or three offsets at this time, and each offset is right
A Color Channel is answered, to generate the color of object mapping for different color channels according to two or three offsets
Table.
The embodiment of the present invention can respectively be adjusted different color channels, realize flexible filter processing.
Optionally, in another embodiment of the invention, above-mentioned steps 103 include sub-step 1032 to 1034:
Sub-step 1032 obtains the offset at least one color of object channel after adjusting.
The embodiment of the present invention can be adjusted for a color of object channel, can also be directed to two or three targets
Color Channel is adjusted, and can correspond to identical or different offset.
Sub-step 1033 generates each target according to the offset at least one color of object channel after the adjusting
The offset of Color Channel combines.
Specifically, for each Color Channel, offset combination can be generated according to the different values of offset.Example
Such as, for red channel, the larger value, the median, smaller value in red channel offset adjustment process are taken, as red channel
Offset combination.To obtain generating offset combination for red channel, green channel, blue channel respectively.
It is appreciated that in practical applications, when the offset of three Color Channels is identical, offset combines may phase
Together.
Sub-step 1034, the offset combination based on all color of object channels, generates the mapping of at least two color of objects
Table;Wherein, each offset combination includes at least two offset values.
Specifically, the offset in each color of object channel is combined, is generated and is directed to respectively according to each offset value
The color of object mapping table in the color of object channel.For example, passing through larger, moderate, lesser offset respectively for red channel
Magnitude generates 3 color of object mapping tables;For green channel, 3 are generated by larger, moderate, lesser offset value respectively
A color of object mapping table;For blue channel, 3 color of objects are generated by larger, moderate, lesser offset value respectively
Mapping table.To obtain 9 color of object mapping tables.
Further, it is also possible to which the offset of different color channels is combined.For example, being directed to the biggish offset of red channel
Amount and the lesser offset of green channel, generate a color of object mapping table;Or, for the lesser offset of red channel,
The moderate offset of green channel and the biggish offset of blue channel, generate a color of object mapping table.
In embodiments of the present invention, the selection of a variety of filtering effects can be provided a user, so that filter is more flexible.
Optionally, in another embodiment of the invention, further include step A1 to A3 after above-mentioned steps 103:
Step A1 is stored at the filter in the case where receiving the request of the storage to the color of object mapping table
Manage corresponding color of object mapping table.
In embodiments of the present invention, when color of object mapping table is only one, the previewing photos after filter are one,
It can be the shooting operation for the previewing photos to store operation;When color mapping table is more than two, after filter
Previewing photos be two or more, thus store operation can for for each previewing photos preservation operation or user to it
In a previewing photos selection operation, the color of object mapping table used when at this point, storing the Photo Filter.
Step A2 receives second input of the user to the color of object mapping table.
Wherein, the second input can be the selection operation to color of object mapping table.
Step A3, using the color of object mapping table, filters the second target image in response to second input
Mirror processing.
In embodiments of the present invention, user can using before store color of object mapping table directly to previewing photos into
The processing of row filter adjusts operation without carrying out filter again, adjusts operation again according to the filter and generate color mapping table.
Specifically, firstly, starting camera obtains previewing photos, and the color of object mapping by step A1 storage is obtained
Table;Then, user can choose one of color of object mapping table, so that mobile terminal is according to the color of object mapping table pair
Previewing photos carry out filter processing.
The color of object mapping table that the embodiment of the present invention can generate before, directly progress filter processing, to have
Help save the filter processing time.
Step 104, according to the color of object mapping table, filter processing is carried out to the first object image, wherein institute
State color of object channel include red channel, green channel, in blue channel at least one of.
Wherein, filter is converted to the color of photo, and filter, which adjusts operation, can be used for adjusting the journey of colour switching
Degree.For example, filter, which is adjusted, operates adjustable three colors of RGB for RGB (Red Green Blue, RGB) mode
Value.
It is appreciated that filter adjusts operation as slide on the screen, one of direction is specified to increase color value,
Another direction reduces color value.In addition, filter adjusts operation can also realize that the embodiment of the present invention is to filter by physical button
The specific implementation that mirror adjusts operation is without restriction.
Specifically, color mapping table is determined firstly, adjusting according to filter and operating corresponding regulated quantity, wherein color mapping
Table is for indicating each color corresponding color value after the adjusting of the regulated quantity;Then, by each pixel in preview picture
Point finds corresponding color value after adjusting according to native color;Finally, former secondary colour is replaced using the color value after adjustment,
Obtain the preview picture after filter.
In the application scenarios for carrying out filter for previewing photos, it can be shown on the photo preview interface of mobile terminal
The previewing photos handled by filter.
Wherein, the real-time previewing photos of photo preview showing interface.Specifically, when user operated in progress filter adjusting
When suspending certain time in journey, filter processing is carried out to previewing photos by step 104 at this time, and show.
The embodiment of the present invention can carry out filter processing to photo in preview, thus direct when user clicks and shoots
Using the previewing photos by filter processing as shooting photo, do not need just to carry out filter to photo after clicking shooting,
To which the shooting processing time be effectively reduced while filter.
Optionally, in another embodiment of the invention, above-mentioned steps 104 include sub-step 1041 to 1042:
Sub-step 1041, for each pixel in the first object image, from the color of object mapping table
Search the corresponding mapping value in the color of object channel.
Specifically, by each secondary colour in the red channel of pixel, green channel, blue channel and color mapping table
Each Color Channel compare.If the equal value of red channel, green channel, blue channel is identical, color of object mapping table
In the secondary colour mapping secondary colour be the corresponding mapping secondary colour of the pixel;If wherein at least one is not identical, target
The mapping secondary colour of the secondary colour is not the corresponding mapping secondary colour of the pixel in color mapping table.
Sub-step 1042, for each pixel in the first object image, by the color of object of each pixel
The initial value in channel replaces with corresponding mapping value.
It is appreciated that each pixel in previewing photos is found into mapping secondary colour according to sub-step 1041, and
Former secondary colour is replaced, obtained photo is the previewing photos after filter.
Pixel each in picture can be carried out corresponding mapping according to target mapping table by the embodiment of the present invention, be helped
In the uniformity for guaranteeing filtering effects.
In embodiments of the present invention, the previewing photos after filter can be shown to user, and provide selection operation.Specifically
Ground when the previewing photos after filter only include one, directly shows the previewing photos at photo preview interface;Work as filter
When previewing photos later include two or more, by two photo displays at an intermediate displaying interface, and it is selected in user
In after one, the previewing photos of user's selection are shown at photo preview interface.
In embodiments of the present invention, the first input of user is received;In response to first input, first object figure is adjusted
The offset in the color of object channel of picture;Based on the offset in the color of object channel after adjusting, generates color of object and reflect
Firing table;According to the color of object mapping table, filter processing is carried out to the first object image;Wherein, the color of object
Channel include red channel, green channel, in blue channel at least one of.Operation can be adjusted according to filter to previewing photos
Different filter processing is carried out, the flexibility of filter processing is realized, and directly can carry out filter in preview interface, reduces
User's operation complexity.
Referring to Fig. 4, a kind of structural block diagram of mobile terminal of the embodiment of the present invention three is shown.
The mobile terminal 200 includes: the first input receiving module 201, offset adjustment module 202, color mapping table
Generation module 203, the first filter processing module 204.
The interactive relation between the function and each module of each module is described in detail below.
First input receiving module 201, for receiving the first input of user.
Offset adjustment module 202, in response to first input, the color of object for adjusting first object image to be logical
The offset in road.
Color mapping table generation module 203 generates mesh for the offset based on the color of object channel after adjusting
Mark color mapping table.
First filter processing module 204, for being carried out to the first object image according to the color of object mapping table
Filter processing;Wherein, the color of object channel include red channel, green channel, in blue channel at least one of.
Optionally, in another embodiment of the invention, above-mentioned color mapping table generation module 203, comprising:
First color mapping table generates submodule, for the offset based at least one color of object channel after adjusting
Amount, generates a color of object mapping table.
Optionally, in another embodiment of the invention, the color mapping table generation module 203, comprising:
Offset acquisition submodule, for obtaining the offset at least one color of object channel after adjusting.
Offset combination producing submodule, for the offset according at least one color of object channel after the adjusting
Amount generates the offset combination in each color of object channel.
Second color mapping table generates submodule, and the offset combination based on all color of object channels generates at least two
A color of object mapping table;Wherein, each offset combination includes at least two offset values.
Optionally, in another embodiment of the invention, the first filter processing module 204, comprising:
Mapping value searches submodule, for for each pixel in the first object image, from the target face
The corresponding mapping value in the color of object channel is searched in color mapping table.
Mapping value replaces submodule, for for each pixel in the first object image, by each pixel
The initial value in color of object channel replace with corresponding mapping value.
Optionally, in another embodiment of the invention, the mobile terminal further include:
Color mapping table memory module, for the case where receiving the request of the storage to the color of object mapping table
Under, it stores the filter and handles corresponding color of object mapping table.
Second input receiving module, for receiving second input of the user to the color of object mapping table.
Second filter processing module, for being inputted in response to described second, using the color of object mapping table, to second
Target image carries out filter processing.
In embodiments of the present invention, the first input of user is received;In response to first input, first object figure is adjusted
The offset in the color of object channel of picture;Based on the offset in the color of object channel after adjusting, generates color of object and reflect
Firing table;According to the color of object mapping table, filter processing is carried out to the first object image;Wherein, the color of object
Channel include red channel, green channel, in blue channel at least one of.Operation can be adjusted according to filter to previewing photos
Different filter processing is carried out, the flexibility of filter processing is realized, and directly can carry out filter in preview interface, reduces
User's operation complexity.
Embodiment is second is that the corresponding Installation practice of embodiment of the method one, detailed description are referred to embodiment one, herein
It repeats no more.
A kind of hardware structural diagram of Fig. 5 mobile terminal of each embodiment to realize the present invention, the mobile terminal 300
Including but not limited to: radio frequency unit 301, audio output unit 303, input unit 304, sensor 305, is shown network module 302
Show the components such as unit 306, user input unit 307, interface unit 308, memory 309, processor 310 and power supply 311.
It will be understood by those skilled in the art that mobile terminal structure shown in Fig. 5 does not constitute the restriction to mobile terminal, it is mobile whole
End may include perhaps combining certain components or different component layouts than illustrating more or fewer components.In the present invention
In embodiment, mobile terminal includes but is not limited to mobile phone, tablet computer, laptop, palm PC, car-mounted terminal, can wear
Wear equipment and pedometer etc..
Processor 310, for receiving the first input of user;In response to first input, first object image is adjusted
Color of object channel offset;Based on the offset in the color of object channel after adjusting, color of object mapping is generated
Table;According to the color of object mapping table, filter processing is carried out to the first object image;Wherein, the color of object is logical
Road include red channel, green channel, in blue channel at least one of.
In embodiments of the present invention, the first input of user is received;In response to first input, first object figure is adjusted
The offset in the color of object channel of picture;Based on the offset in the color of object channel after adjusting, generates color of object and reflect
Firing table;According to the color of object mapping table, filter processing is carried out to the first object image;Wherein, the color of object
Channel include red channel, green channel, in blue channel at least one of.Operation can be adjusted according to filter to previewing photos
Different filter processing is carried out, the flexibility of filter processing is realized, and directly can carry out filter in preview interface, reduces
User's operation complexity.
It should be understood that the embodiment of the present invention in, radio frequency unit 301 can be used for receiving and sending messages or communication process in, signal
Send and receive, specifically, by from base station downlink data receive after, to processor 310 handle;In addition, by uplink
Data are sent to base station.In general, radio frequency unit 301 includes but is not limited to antenna, at least one amplifier, transceiver, coupling
Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 301 can also by wireless communication system and network and other set
Standby communication.
Mobile terminal provides wireless broadband internet by network module 302 for user and accesses, and such as user is helped to receive
It sends e-mails, browse webpage and access streaming video etc..
Audio output unit 303 can be received by radio frequency unit 301 or network module 302 or in memory 309
The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 303 can also be provided and be moved
The relevant audio output of specific function that dynamic terminal 300 executes is (for example, call signal receives sound, message sink sound etc.
Deng).Audio output unit 303 includes loudspeaker, buzzer and receiver etc..
Input unit 304 is for receiving audio or video signal.Input unit 304 may include graphics processor
(Graphics Processing Unit, GPU) 3041 and microphone 3042, graphics processor 3041 is in video acquisition mode
Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out
Reason.Treated, and picture frame may be displayed on display unit 306.Through graphics processor 3041, treated that picture frame can be deposited
Storage is sent in memory 309 (or other storage mediums) or via radio frequency unit 301 or network module 302.Mike
Wind 3042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be
The format output that mobile communication base station can be sent to via radio frequency unit 301 is converted in the case where telephone calling model.
Mobile terminal 300 further includes at least one sensor 305, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 3061, and proximity sensor can close when mobile terminal 300 is moved in one's ear
Display panel 3061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify mobile terminal posture (ratio
Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);It passes
Sensor 305 can also include fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, wet
Meter, thermometer, infrared sensor etc. are spent, details are not described herein.
Display unit 306 is for showing information input by user or being supplied to the information of user.Display unit 306 can wrap
Display panel 3061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 3061.
User input unit 307 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.Specifically, user input unit 307 include touch panel 3071 and
Other input equipments 3072.Touch panel 3071, also referred to as touch screen collect the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 3071 or in touch panel 3071
Neighbouring operation).Touch panel 3071 may include both touch detecting apparatus and touch controller.Wherein, touch detection
Device detects the touch orientation of user, and detects touch operation bring signal, transmits a signal to touch controller;Touch control
Device processed receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 310, receiving area
It manages the order that device 310 is sent and is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc.
Seed type realizes touch panel 3071.In addition to touch panel 3071, user input unit 307 can also include other input equipments
3072.Specifically, other input equipments 3072 can include but is not limited to physical keyboard, function key (such as volume control button,
Switch key etc.), trace ball, mouse, operating stick, details are not described herein.
Further, touch panel 3071 can be covered on display panel 3061, when touch panel 3071 is detected at it
On or near touch operation after, send processor 310 to determine the type of touch event, be followed by subsequent processing device 310 according to touching
The type for touching event provides corresponding visual output on display panel 3061.Although in Fig. 5, touch panel 3071 and display
Panel 3061 is the function that outputs and inputs of realizing mobile terminal as two independent components, but in some embodiments
In, can be integrated by touch panel 3071 and display panel 3061 and realize the function that outputs and inputs of mobile terminal, it is specific this
Place is without limitation.
Interface unit 308 is the interface that external device (ED) is connect with mobile terminal 300.For example, external device (ED) may include having
Line or wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, storage card end
Mouth, port, the port audio input/output (I/O), video i/o port, earphone end for connecting the device with identification module
Mouthful etc..Interface unit 308 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and
By one or more elements that the input received is transferred in mobile terminal 300 or can be used in 300 He of mobile terminal
Data are transmitted between external device (ED).
Memory 309 can be used for storing software program and various data.Memory 309 can mainly include storing program area
The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 309 may include high-speed random access memory, it can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 310 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 309, and calls and is stored in storage
Data in device 309 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Managing device 310 may include one or more processing units;Preferably, processor 310 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 310.
Mobile terminal 300 can also include the power supply 311 (such as battery) powered to all parts, it is preferred that power supply 311
Can be logically contiguous by power-supply management system and processor 310, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
In addition, mobile terminal 300 includes some unshowned functional modules, details are not described herein.
Preferably, the embodiment of the present invention also provides a kind of mobile terminal, including processor 310, and memory 309 is stored in
On memory 309 and the computer program that can run on the processor 310, the computer program are executed by processor 310
Each process of the above-mentioned filter processing method embodiment of Shi Shixian, and identical technical effect can be reached, to avoid repeating, here
It repeats no more.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium
Calculation machine program, the computer program realize each process of above-mentioned filter processing method embodiment, and energy when being executed by processor
Reach identical technical effect, to avoid repeating, which is not described herein again.Wherein, the computer readable storage medium, such as only
Read memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation
RAM), magnetic or disk etc..
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service
Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form belongs within protection of the invention.