CN105303508B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN105303508B
CN105303508B CN201410320704.7A CN201410320704A CN105303508B CN 105303508 B CN105303508 B CN 105303508B CN 201410320704 A CN201410320704 A CN 201410320704A CN 105303508 B CN105303508 B CN 105303508B
Authority
CN
China
Prior art keywords
processing
picture
parameter
pixel
processing function
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.)
Active
Application number
CN201410320704.7A
Other languages
Chinese (zh)
Other versions
CN105303508A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410320704.7A priority Critical patent/CN105303508B/en
Publication of CN105303508A publication Critical patent/CN105303508A/en
Application granted granted Critical
Publication of CN105303508B publication Critical patent/CN105303508B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a kind of image processing method and devices, belong to field of image processing.This method comprises: when receiving the first process instruction to current processed picture, obtain corresponding first processing parameter of the first process instruction, first process instruction corresponds to the first processing function, and the first processing function is any processing function executed in processing function to current processed picture;It has been executed in the corresponding processing parameter of processing function to current processed picture, has obtained second processing parameter, second processing parameter corresponds to second processing function, and second processing function is the processing function executed in processing function in addition to the first processing function;Sequence is executed according to executed processing function, according to the first processing parameter and second processing parameter, successively the original image of current processed picture is handled, the picture that obtains that treated.Present invention reduces operation complexities, improve the efficiency of picture processing.

Description

Image processing method and device
Technical field
The present invention relates to field of image processing, in particular to a kind of image processing method and device.
Background technique
With the development of intelligent terminal and universal, terminal not only has the function of taking pictures, and also has the function of that picture is handled. For example, terminal can carry out recognition of face when handling picture, to the human face region recognized carry out mill skin, whitening, The colour of skin goes acne, thin face, big eye, the processing such as remove black eye, bright eye.
User can choose one or more functions in image processing function and handle the picture.For example, when using Family selection grinding skin function and have adjusted mill skin parameter when, terminal can according to the mill skin parameter to the human face region in the picture into Row mill skin processing, obtains the first processing picture.When user's reselection goes acne function and has adjusted acne parameter, terminal is according to this It goes acne parameter to carry out acne to the human face region in the first processing picture to handle, obtains second processing picture.If on carrying out After stating processing, user find mill skin parameter it is excessive, it is desirable to modify, due to mill skin processing be based on second processing picture into Row, thus the mill skin parameter be it is irreversible, that is to say, mill skin parameter can only increase and cannot reduce.If user wants to subtract Small mill skin parameter, user can only re-start processing to original picture, complicated for operation, and reduce the efficiency of picture processing.
Summary of the invention
In order to solve problems in the prior art, the embodiment of the invention provides a kind of image processing method and devices.It is described Technical solution is as follows:
On the one hand, a kind of image processing method is provided, which comprises
When receiving the first process instruction to current processed picture, first process instruction corresponding the is obtained One processing parameter, first process instruction correspond to the first processing function, first processing function be to it is described it is current Handle any processing function of picture executed in processing function;
It has been executed in the corresponding processing parameter of processing function to the current processed picture, has obtained second processing ginseng Number, the second processing parameter correspond to second processing function, and the second processing function is described executed in processing function Processing function in addition to first processing function;
According to it is described executed processing function execute sequence, joined according to first processing parameter and the second processing Number, is successively handled the original image of the current processed picture, the picture that obtains that treated.
On the other hand, a kind of picture processing unit is provided, described device includes:
First obtains module, for when receiving the first process instruction to current processed picture, obtains described the Corresponding first processing parameter of one process instruction, first process instruction correspond to the first processing function, first processing Function is any processing function executed in processing function to the current processed picture;
Second obtains module, for having executed the corresponding processing parameter of processing function to the current processed picture In, second processing parameter is obtained, the second processing parameter corresponds to second processing function, and the second processing function is described The processing function in processing function in addition to first processing function is executed;
Processing module, for according to it is described executed processing function execute sequence, according to first processing parameter and The second processing parameter is successively handled the original image of the current processed picture, the picture that obtains that treated.
In embodiments of the present invention, when terminal handles original image, after obtaining current processed picture, if with When family wants modification and executed any processing function in processing function corresponding processing parameter, which can arbitrarily be repaired Change, that is to say, which can not only increase, and also can reduce.After having modified processing parameter, terminal is according still further to It executes processing function and executes sequence, original image successively handled, the picture that obtains that treated reduces answering for operation Miscellaneous degree, and improve the efficiency of picture processing.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of image processing method flow chart provided in an embodiment of the present invention;
Fig. 2 is another image processing method flow chart provided in an embodiment of the present invention;
Fig. 3 is a kind of picture processing device structure diagram provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Before to the embodiment of the present invention carrying out that explanation is explained in detail, first application scenarios of the invention are introduced. When terminal gets a picture, if the picture is unable to satisfy the demand of user, user can be by the terminal to this Picture is handled.For example, the picture is portrait picture, terminal can carry out mill skin to the picture, whitening, the colour of skin, go acne, thin Face, big eye, the processing such as remove black eye, bright eye.Wherein, when terminal executes multiple processing functions to the picture, multiple processing function It can be that processing is overlapped to original image, for example, user selects mill skin, whitening and colour of skin processing, at this point, executing at whitening When reason, be based on mill skin after picture handled, execute the colour of skin processing when, be based on whitening after picture handled 's.After user has been handled, it is found that the parameter of whitening is larger, the face in the picture is too white, at this point, being somebody's turn to do if user reduces Whitening parameter, user can only abandon this processing result, handle again original image.So the embodiment of the present invention mentions A kind of image processing method is supplied, user, can to handle again original image without reselecting each processing function It is easy to operate arbitrarily to modify the corresponding processing parameter of each processing function, and improve the efficiency of picture processing.
Fig. 1 is a kind of image processing method flow chart provided in an embodiment of the present invention.Referring to Fig. 1, this method comprises:
Step 101: when receiving the first process instruction to current processed picture, it is corresponding to obtain the first process instruction The first processing parameter, the first process instruction correspond to the first processing function, the first processing function be to current processed picture Any processing function executed in processing function.
Step 102: having been executed in the corresponding processing parameter of processing function to current processed picture, obtained second processing Parameter, second processing parameter correspond to second processing function, and second processing function is to have executed in processing function except the first processing Processing function except function.
Step 103: sequence is executed according to executed processing function, according to the first processing parameter and second processing parameter, Successively the original image of current processed picture is handled, the picture that obtains that treated.
In embodiments of the present invention, when terminal handles original image, after obtaining current processed picture, if with When family wants modification and executed any processing function in processing function corresponding processing parameter, which can arbitrarily be repaired Change, that is to say, which can not only increase, and also can reduce.After having modified processing parameter, terminal is according still further to It executes processing function and executes sequence, original image successively handled, the picture that obtains that treated reduces answering for operation Miscellaneous degree, and improve the efficiency of picture processing.
Optionally, according to the first processing parameter and second processing parameter, successively to the original image of current processed picture It is handled, the picture that obtains that treated, comprising:
For any processing parameter in the first processing parameter and second processing parameter, based on preceding primary in the execution sequence The first obtained intermediate treatment picture is handled, parameter is managed according to this, to each pixel pair in the first intermediate treatment picture The pixel value answered carries out parallel processing.
Optionally, manage parameter according to this, to the corresponding pixel value of each pixel in the first intermediate treatment picture into Row parallel processing, comprising:
When the Processing Algorithm of the corresponding processing function of the processing parameter is the convolution algorithm that can symmetrically divide, manage according to this Parameter, it is corresponding to each pixel on the first direction in the first intermediate treatment picture according to first direction Processing Algorithm Pixel value carries out parallel processing;
Parameter is managed according to this, according to second direction Processing Algorithm, in the second direction in the first intermediate treatment picture The corresponding pixel value of each pixel carry out parallel processing, first direction Processing Algorithm and second direction Processing Algorithm are will to locate Adjustment method carries out twocouese and splits to obtain.
Optionally, according to the first processing parameter and second processing parameter, successively to the original image of current processed picture It is handled, the picture that obtains that treated, comprising:
If the first processing function is the first specified class processing function, processing function has been executed to current processed picture Third processing parameter can be obtained in corresponding processing parameter, third processing parameter is for obtaining current processed picture The corresponding processing parameter of one processing function;
Calculate the difference between the first processing parameter and third processing parameter;
When going to the first processing function according to the execution sequence for having executed processing function, the second intermediate treatment figure is obtained Piece, the second intermediate treatment picture are to have executed corresponding place according to a upper processing parameter for the first processing parameter in execution sequence It is obtained after reason function;
According to the difference of calculating, the corresponding pixel value of each pixel in the second intermediate treatment picture is handled;
By treated, the corresponding pixel value of each pixel is corresponding with each pixel in current processed picture Median pixel value is added, the picture that obtains that treated, which is during obtaining current processed picture It is obtained after executing the first processing function.
Optionally, according to the first processing parameter and second processing parameter, successively to the original image of current processed picture It is handled, the picture that obtains that treated, comprising:
If the first processing function is the second specified class processing function, the corresponding region of interest of the first processing function is obtained Domain;
When going to the first processing function according to the execution sequence for having executed processing function, the second intermediate treatment figure is obtained Piece;
According to the first processing parameter, at the corresponding pixel value of each pixel in the second intermediate treatment picture Reason;
When going to second processing function according to the execution sequence for having executed processing function, according to second processing parameter, The corresponding pixel value of each pixel in area-of-interest is handled, the picture that obtains that treated.
Optionally, when receiving the first process instruction to current processed picture, it is corresponding to obtain the first process instruction The first processing parameter before, further includes:
For having executed any processing function in processing function, from for executing processing when obtaining current processed picture In the corresponding pixel value of each pixel obtained after function, the corresponding extraneous pixel values of each pixel, irrelevant are obtained Value is according to obtaining after having executed corresponding processing function with the unrelated Processing Algorithm of processing parameter in corresponding algorithm;
The corresponding extraneous pixel values of each pixel that will acquire are cached;
Correspondingly, according to the first processing parameter and second processing parameter, successively to the original image of current processed picture It is handled, the picture that obtains that treated, comprising:
For any processing parameter in the first processing parameter and second processing parameter, obtain preceding primary in the execution sequence Handle the first obtained intermediate treatment picture;
According to processing parameter, according to Processing Algorithm relevant to processing parameter in corresponding Processing Algorithm, among first The corresponding pixel value of each pixel in processing picture is handled, and the corresponding correlated pixel value of each pixel is obtained;
The corresponding correlated pixel value of each pixel is carried out with the extraneous pixel values of corresponding each pixel in caching It is added, the picture that obtains that treated.
All the above alternatives can form alternative embodiment of the invention using any combination, herein no longer It repeats one by one.
Fig. 2 is a kind of image processing method flow chart provided in an embodiment of the present invention.Referring to fig. 2, this method comprises:
Step 201: for having executed any processing function in processing function, from for when obtaining current processed picture It executes in the corresponding pixel value of each pixel obtained after the processing function, obtains the corresponding irrelevant of each pixel Value, extraneous pixel values be according to corresponding processing function has been executed with the unrelated Processing Algorithm of processing parameter in corresponding algorithm after It obtains.
Wherein, each processing function corresponds to a Processing Algorithm, includes relevant to processing parameter in the Processing Algorithm Processing Algorithm and the Processing Algorithm unrelated with processing parameter.So the Processing Algorithm can be divided, obtain joining with processing The relevant Processing Algorithm of number and the Processing Algorithm unrelated with processing parameter.
In addition, current processed picture is according to having executed the corresponding Processing Algorithm of processing function, successively to currently having located The original image of reason picture is handled to obtain.That is, when progress single treatment function every to original image, original graph The pixel value of each pixel in piece can change.
For example, terminal is according to mill skin algorithm to each pixel in original image when executing grinding skin function to original image The corresponding pixel value of point is handled, and mill skin picture is obtained.If execute whitening function again, terminal is according to whitening algorithm opposite grinding The corresponding pixel value of each pixel in skin picture is handled, and whitening picture is obtained.
It should be added that the corresponding Processing Algorithm of processing function is also different, and right when processing function difference In different developers, the corresponding Processing Algorithm of same processing function is also different, and the embodiment of the present invention is to the specific of Processing Algorithm Content is not specifically limited.
It is corresponding that each pixel obtained after the processing function is executed when wherein, from for obtaining current processed picture In pixel value, the concrete operations for obtaining the corresponding extraneous pixel values of each pixel can be with are as follows: when current processed for obtaining When picture executes the processing function, the corresponding Processing Algorithm unrelated with processing parameter of function is managed according to this, to each pixel The corresponding pixel value of point is handled, and the corresponding extraneous pixel values of each pixel are obtained.
Based on above-mentioned example, when the processing function that first time executes is grinding skin function, skin Processing Algorithm can will be ground It is divided into and the unrelated Processing Algorithm of mill skin parameter and grinds the relevant Processing Algorithm of skin parameter.To the original of current processed picture When picture executes the grinding skin function, according to the Processing Algorithm unrelated with mill skin parameter, to each pixel pair in original image The pixel value answered is handled, and the corresponding extraneous pixel values of each pixel are obtained.It, can be by whitening when executing whitening function Algorithm partition is Processing Algorithm relevant to the unrelated Processing Algorithm of whitening parameter and whitening parameter.Opposite grinding skin picture executes whitening When function, according to the Processing Algorithm unrelated with whitening parameter, the corresponding pixel value of each pixel in opposite grinding skin picture is carried out Processing, obtains the corresponding extraneous pixel values of each pixel.
Step 202: the corresponding extraneous pixel values of each pixel that will acquire are cached.
Specifically, processing function can be identified to irrelevant corresponding with each pixel after the processing function is executed Value, the corresponding relationship being stored between processing function mark nothing to do with pixel value.
Wherein, in the corresponding relationship between processing function mark nothing to do with pixel value, extraneous pixel values can be added It labels, to indicate the corresponding pixel of the extraneous pixel values.It should be noted that addition label is a kind of implementation, The corresponding pixel of extraneous pixel values can also be indicated by other implementations, the embodiment of the present invention is no longer listed one by one.
Optionally, in embodiments of the present invention, can also be only more complicated to calculating, and it is long to calculate the time occupied Processing function execute step 201 and 202 method.The corresponding unrelated picture of each pixel after will execute the processing function After plain value is cached, when executing the processing function again, part relevant to processing parameter only need to be calculated, saves calculating Time.
It further, in embodiments of the present invention, can be with one processing function of every execution, after processing function processing The corresponding pixel value of each pixel stored.When executing sequence again according to executed processing function, to currently It, can be directly since the processing parameter of variation to the pixel value of each pixel when the original image of processing picture is handled It is handled, saves the picture processing time.
For example, the execution sequence for having executed function is mill skin, whitening, removes acne, thin face, big eye.It is executed when to original image After grinding skin function, each pixel respective pixel value after mill skin is stored.After opposite grinding skin picture executes whitening function, The corresponding pixel value of each pixel after whitening is stored.After going acne function to the execution of whitening picture, after going acne The corresponding pixel value of each pixel stored.After to going acne picture to execute thin face function, by each picture after thin face The corresponding pixel value of vegetarian refreshments is stored.It is after executing big eye function to thin face picture, each pixel after big eye is corresponding Pixel value stored.The corresponding picture of each pixel if execute whitening function again, after mill skin can be directly acquired Element value, then further according to whitening, go acne, thin face, big eye to execute sequence, the corresponding pixel value of each pixel after opposite grinding skin It is handled.
Step 203: when receiving the first process instruction to current processed picture, it is corresponding to obtain the first process instruction The first processing parameter, the first process instruction correspond to the first processing function, the first processing function be to current processed picture Any processing function executed in processing function.
Wherein, the first process instruction can be user's triggering, which can pass through clicking operation, double click operation, touching Touch the triggerings such as slide, voice operating.
Wherein, the first processing parameter can be user's self-setting, be also possible to that user provides from terminal it is multiple from It is selected in reason parameter, the embodiment of the present invention is not specifically limited in this embodiment.
Step 204: having been executed in the corresponding processing parameter of processing function to current processed picture, obtained second processing Parameter, second processing parameter correspond to second processing function, and second processing function is to have executed in processing function except the first processing Processing function except function.
Wherein, it when having executed processing function to current processed picture, by the mark for having executed processing function and can be somebody's turn to do The corresponding processing parameter of processing function is stored in the corresponding relationship between processing function mark and processing parameter.When acquisition second When processing parameter, second processing function can be obtained according to the mark of the first processing function, from the mark for having executed processing function The mark of energy.Then, according to the mark of second processing function, from the processing function of storage mark with it is corresponding between processing parameter Corresponding processing parameter is obtained in relationship, the processing parameter that will acquire is determined as second processing parameter.
Wherein, processing function mark can be the title of the processing function, can also be the processing function in all processing Serial number in function.
For example, the first processing function is identified as acne, skin can be ground from the mark for having executed processing function, whitening, gone In acne, thin face and big eye, select second processing function is identified as mill skin, whitening, thin face and big eye.According to second processing function Mark grind skin, can from Function Identification as shown in table 1 below it is corresponding with being obtained in the corresponding relationship between processing parameter from Managing parameter is 50.According to the mark whitening of second processing function, between Function Identification and processing parameter as shown in table 1 below It is 35 that corresponding processing parameter is obtained in corresponding relationship.According to the thin face of the mark of second processing function, from function as shown in table 1 below Can identify and obtain corresponding processing parameter in the corresponding relationship between processing parameter is 20.According to the mark of second processing function Big eye, it is 25 that corresponding processing parameter is obtained in the corresponding relationship between Function Identification as shown in table 1 below and processing parameter.
Table 1
Processing function mark Processing parameter
Grind skin 50
Whitening 35
Go acne 60
Thin face 20
Big eye 25
Step 205: when executing sequence according to executed processing function, being joined according to the first processing parameter and second processing Number, when successively handling the original image of current processed picture, in the first processing parameter and second processing parameter Any processing parameter, obtain the first intermediate treatment picture that preceding single treatment in the execution sequence obtains.
Wherein, when the processing parameter is the corresponding processing parameter of first processing function in execution sequence, in first Between processing picture be current processed picture original image.When the processing parameter is other processing functions pair in execution sequence When the processing parameter answered, the first intermediate treatment picture is that a upper processing parameter for the processing parameter has executed corresponding processing function Can after obtained picture.
Step 206: managing parameter according to this, calculated according to processing relevant to the processing parameter in corresponding Processing Algorithm Method handles the corresponding pixel value of each pixel in the first intermediate treatment picture, it is corresponding to obtain each pixel Correlated pixel value.
Specifically, parameter is managed according to this, it can be according to processing relevant to the processing parameter in corresponding Processing Algorithm Algorithm carries out parallel processing to the corresponding pixel value of each pixel in the first intermediate treatment picture, obtains each pixel Corresponding correlated pixel value.
Wherein, by the way of parallel processing, the speed of operation can be promoted, and then improve the efficiency of picture processing.
Preferably, when the Processing Algorithm of the corresponding processing function of the processing parameter is the convolution algorithm that can symmetrically divide, root According to the processing parameter, according to first direction Processing Algorithm, to each pixel on the first direction in the first intermediate treatment picture The corresponding pixel value of point carries out parallel processing.Parameter is managed according to this, according to second direction Processing Algorithm, to the first intermediate treatment The corresponding pixel value of each pixel in second direction in picture carries out parallel processing, the picture that obtains that treated, and first Direction Processing Algorithm and second direction Processing Algorithm are that the corresponding Processing Algorithm of the processing function is carried out twocouese to split to obtain.
For example, the Processing Algorithm of the processing function can be split as to X-direction Processing Algorithm and Y direction processing calculation Method.According to X-direction Processing Algorithm, to the corresponding pixel of each pixel in the X-direction in the first intermediate treatment picture Value carries out parallel processing.According to Y direction Processing Algorithm, to each pixel in the Y direction in the first intermediate treatment picture The corresponding pixel value of point carries out parallel processing.
Since the complexity of convolution algorithm is higher, so, the convolution algorithm that can symmetrically divide is divided into first direction processing After algorithm and second direction Processing Algorithm, the complexity of calculating can be reduced, and then reduce the time calculated.
Further, if the Processing Algorithm of the corresponding processing function of the processing parameter is not the convolution algorithm that can symmetrically divide When, then it does not need the Processing Algorithm carrying out twocouese fractionation, parameter can be directly managed according to this, according to the Processing Algorithm pair The corresponding pixel value of each pixel in first intermediate treatment picture carries out parallel processing.
Step 207: by the unrelated picture of the corresponding correlated pixel value of each pixel and corresponding each pixel in caching Plain value is added, the picture that obtains that treated.
Specifically, manage Function Identification according to this, from caching stored processing function mark nothing to do with pixel value it Between corresponding relationship in, obtain the extraneous pixel values of each pixel.Again by the corresponding correlated pixel value of each pixel and nothing It closes pixel value to be added, obtains each pixel treated pixel value, and then the picture that obtains that treated.
In order to further increase the efficiency of picture processing, the embodiment of the present invention also increases the first specified class processing function setting The step of mechanism of amount optimization operation, which can specifically include following (1)-(5):
(1) if, the first processing function be the first specified class processing function, to current processed picture execution place It manages in the corresponding processing parameter of function, obtains third processing parameter, third processing parameter is for obtaining current processed picture The corresponding processing parameter of the first processing function.
It specifically, can be according to the first processing function if the first processing function is the first specified class processing function Mark identifies from processing function and obtains corresponding processing parameter in the corresponding relationship between processing parameter, the processing that will acquire Parameter is determined as third processing parameter.
Wherein, the first specified class processing function can be the processing function handled the entirety of picture.For example, first Specified class processing function can be with are as follows: the processing functions such as mill skin, the colour of skin and blast.
(2), the difference between the first processing parameter and third processing parameter is calculated.
(3), when going to the first processing function according to the execution sequence for having executed processing function, the second middle is obtained Manage picture, the second intermediate treatment picture be executed according to a upper processing parameter for the first processing parameter in the execution sequence it is right It is obtained after the processing function answered.
(4), according to the difference, the corresponding pixel value of each pixel in the second intermediate treatment picture is handled.
Specifically, according to the difference, according to the corresponding Processing Algorithm of the first processing function, in the second intermediate treatment picture The corresponding pixel value of each pixel carry out parallel processing.
(5), by treated the corresponding pixel value of each pixel with to each pixel in current processed picture Corresponding median pixel value is added, the picture that obtains that treated, and median pixel value is to obtain the mistake of current processed picture It is obtained after executing the first processing function in journey.
When due to handling picture, some processing functions are only related to partial region, that is, only to the picture in partial region The pixel value of vegetarian refreshments is handled.So in embodiments of the present invention, when the first processing function is the second specified class processing function When, second processing function can carry out function treatment just for partial region, to improve picture treatment effeciency, including it is following (a)- (d) the step of:
If (a), the first processing function is the second specified class processing function, it is emerging to obtain the corresponding sense of the first processing function Interesting region.
Wherein, the second specified class processing function can be the processing function handled the part of picture, i.e., second refers to Determine the corresponding area-of-interest (region of interest, ROI) of class processing function.For example, the second specified class handles function It can be the processing functions such as thin face and big eye.
(b), when going to the first processing function according to the execution sequence for having executed processing function, the second middle is obtained Manage picture.
(c), according to the first processing parameter, the corresponding pixel value of each pixel in the second intermediate treatment picture is carried out Processing.
Specifically, according to the first processing parameter, according to the corresponding Processing Algorithm of the first processing function, to the second intermediate treatment The corresponding pixel value of each pixel in picture is handled.
(d), when going to second processing function according to the execution sequence for having executed processing function, joined according to second processing Number, handles the corresponding pixel value of each pixel in the corresponding area-of-interest of the first processing function, is handled Picture afterwards.
Specifically, when going to second processing function according to the execution sequence for having executed processing function, at second Parameter is managed, according to the corresponding Processing Algorithm of second processing function, to each of corresponding area-of-interest of the first processing function The corresponding pixel value of pixel is handled, the picture that obtains that treated.
For example, the first processing function is that it is corresponding to obtain big eye function when receiving the first process instruction for big eye function Area-of-interest.The corresponding area-of-interest of the big eye function is the region in human face region around eyes.When the big eye function of execution When energy, in order to keep the effect picture ultimately generated clear, according to big eye parameter, entire picture is handled.And for mill skin etc. Second processing function can be handled just in the corresponding pixel value of pixel middle in area-of-interest, be improved at picture The efficiency of reason.
Further, for grinding skin function, in the graphics processor of terminal, mill skin algorithm can be split as gradient fields With adjustment unit field, the corresponding gradient fields of pixel value of pixel can be first calculated on operation logic, then gradient fields, adjustment is single First field is multiplied with processing parameter, obtains the pixel value of each pixel.In this way in addition to mill skin for the first time, subsequent mill skin parameter When adjustment, processing parameter only need to be modified, substantially reduces and calculates the time.
Wherein, gradient fields are in all pixels, and the corresponding pixel value of which pixel will become larger, that is, which picture Region where vegetarian refreshments can brighten.Adjustment unit field be when processing parameter is a unit, for example, unit is 1, according to The unit pixel value that Processing Algorithm handles the pixel value of pixel.
In embodiments of the present invention, when terminal handles original image, after obtaining current processed picture, if with When family wants modification and executed any processing function in processing function corresponding processing parameter, which can arbitrarily be repaired Change, that is to say, which can not only increase, and also can reduce.After having modified processing parameter, terminal is according still further to It executes processing function and executes sequence, original image successively handled, the picture that obtains that treated reduces answering for operation Miscellaneous degree, and improve the efficiency of picture processing.
Fig. 3 is a kind of picture processing device structure diagram provided in an embodiment of the present invention.Referring to Fig. 3, which includes:
First obtains module 301, for obtaining first when receiving the first process instruction to current processed picture Corresponding first processing parameter of process instruction, the first process instruction correspond to the first processing function, and the first processing function is to working as Any processing function of preceding processed picture executed in processing function;
Second obtains module 302, for having been executed in the corresponding processing parameter of processing function to current processed picture, Second processing parameter is obtained, second processing parameter corresponds to second processing function, and second processing function is to have executed processing function In processing function in addition to the first processing function;
Processing module 303, for executing sequence according to executed processing function, at the first processing parameter and second Parameter is managed, successively the original image of current processed picture is handled, the picture that obtains that treated.
Optionally, processing module 303 includes:
First processing units, for being based on for any processing parameter in the first processing parameter and second processing parameter The first intermediate treatment picture that preceding single treatment obtains in execution sequence, according to processing parameter, in the first intermediate treatment picture The corresponding pixel value of each pixel carry out parallel processing.
Optionally, first processing units include:
First parallel processing subelement can symmetrically divide for the Processing Algorithm when the corresponding processing function of processing parameter When convolution algorithm, according to processing parameter, according to first direction Processing Algorithm, on the first direction in the first intermediate treatment picture The corresponding pixel value of each pixel carry out parallel processing;
Second parallel processing subelement is used for according to processing parameter, according to second direction Processing Algorithm, to the first middle It manages the corresponding pixel value of each pixel in the second direction in picture and carries out parallel processing, first direction Processing Algorithm and the Two direction Processing Algorithms are to split to obtain by Processing Algorithm progress twocouese.
Optionally, processing module 303 includes:
First acquisition unit, if for the first processing function be the first specified class processing function, to currently from Reason picture has executed in the corresponding processing parameter of processing function, obtains third processing parameter, third processing parameter is for obtaining The corresponding processing parameter of the first processing function of current processed picture;
First computing unit, for calculating the difference between the first processing parameter and third processing parameter;
Second acquisition unit, for when according to executed processing function execution sequence go to the first processing function when, The second intermediate treatment picture is obtained, the second intermediate treatment picture is the upper processing according to the first processing parameter in execution sequence Parameter obtains after having executed corresponding processing function;
The second processing unit is used for according to difference, to the corresponding pixel of each pixel in the second intermediate treatment picture Value is handled;
Second computing unit, for will be in treated the corresponding pixel value of each pixel and current processed picture The corresponding median pixel value of each pixel is added, the picture that obtains that treated, and median pixel value is to obtain currently having located It is obtained after executing the first processing function during reason picture.
Optionally, processing module 303 includes:
Third acquiring unit obtains the first processing if being the second specified class processing function for the first processing function The corresponding area-of-interest of function;
4th acquiring unit, for when according to executed processing function execution sequence go to the first processing function when, Obtain the second intermediate treatment picture;
Third processing unit is used for according to the first processing parameter, to each pixel pair in the second intermediate treatment picture The pixel value answered is handled;
Fourth processing unit, for when according to executed processing function execution sequence go to second processing function when, According to second processing parameter, the corresponding pixel value of each pixel in area-of-interest is handled, obtains that treated Picture.
Optionally, the device further include:
Third obtains module, for for having executed any processing function in processing function, from for obtain it is current It is executed when handling picture in the corresponding pixel value of each pixel obtained after processing function, obtains the corresponding nothing of each pixel Pixel value is closed, extraneous pixel values are to have executed corresponding processing with the unrelated Processing Algorithm of processing parameter according in corresponding algorithm It is obtained after function;
Cache module, the corresponding extraneous pixel values of each pixel for will acquire are cached;
Correspondingly, processing module 303 includes:
5th acquiring unit, for obtaining for any processing parameter in the first processing parameter and second processing parameter The first intermediate treatment picture that preceding single treatment obtains in execution sequence;
5th processing unit is used for according to processing parameter, according to place relevant to processing parameter in corresponding Processing Algorithm Adjustment method handles the corresponding pixel value of each pixel in the first intermediate treatment picture, obtains each pixel pair The correlated pixel value answered;
Third computing unit is used for corresponding each pixel in the corresponding correlated pixel value of each pixel and caching Extraneous pixel values be added, the picture that obtains that treated.
In embodiments of the present invention, when terminal handles original image, after obtaining current processed picture, if with When family wants modification and executed any processing function in processing function corresponding processing parameter, which can arbitrarily be repaired Change, that is to say, which can not only increase, and also can reduce.After having modified processing parameter, terminal is according still further to It executes processing function and executes sequence, original image successively handled, the picture that obtains that treated reduces answering for operation Miscellaneous degree, and improve the efficiency of picture processing.
It should be understood that picture processing unit provided by the above embodiment picture processing when, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, picture processing unit provided by the above embodiment and image processing method embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (13)

1. a kind of image processing method, which is characterized in that the described method includes:
When receiving the first process instruction to current processed picture, obtain at first process instruction corresponding first Parameter is managed, first process instruction corresponds to the first processing function, and first processing function is to described current processed Any processing function of picture executed in processing function;
It has been executed in the corresponding processing parameter of processing function to the current processed picture, has obtained second processing parameter, institute Second processing parameter is stated corresponding to second processing function, the second processing function is described executed in processing function except described Processing function except first processing function;
According to it is described executed processing function execute sequence, according to first processing parameter and the second processing parameter, Successively the original image of the current processed picture is handled, the picture that obtains that treated.
2. the method as described in claim 1, which is characterized in that described according to first processing parameter and the second processing Parameter is successively handled the original image of the current processed picture, the picture that obtains that treated, comprising:
For any processing parameter in first processing parameter and the second processing parameter, based in the execution sequence The first intermediate treatment picture that preceding single treatment obtains, according to the processing parameter, in the first intermediate treatment picture The corresponding pixel value of each pixel carries out parallel processing.
3. method according to claim 2, which is characterized in that it is described according to the processing parameter, to first middle The corresponding pixel value of each pixel managed in picture carries out parallel processing, comprising:
When the Processing Algorithm of the corresponding processing function of the processing parameter is the convolution algorithm that can symmetrically divide, according to the processing Parameter, according to first direction Processing Algorithm, to each pixel pair on the first direction in the first intermediate treatment picture The pixel value answered carries out parallel processing;
According to the processing parameter, according to second direction Processing Algorithm, to the second direction in the first intermediate treatment picture On the corresponding pixel value of each pixel carry out parallel processing, the first direction Processing Algorithm and second direction processing Algorithm is to split to obtain by Processing Algorithm progress twocouese.
4. the method as described in claim 1-3 any claim, which is characterized in that described according to first processing parameter With the second processing parameter, successively the original image of the current processed picture is handled, the figure that obtains that treated Piece, comprising:
If first processing function is the first specified class processing function, to current processed picture execution place Manage in the corresponding processing parameter of function, obtain third processing parameter, the third processing parameter be for obtain it is described it is current Handle the corresponding processing parameter of first processing function of picture;
Calculate the difference between first processing parameter and the third processing parameter;
When going to first processing function according to the execution sequence for having executed processing function, the second middle is obtained Picture is managed, the second intermediate treatment picture is the upper processing ginseng of the first processing parameter according to the execution sequence Number obtains after having executed corresponding processing function;
According to the difference, the corresponding pixel value of each pixel in the second intermediate treatment picture is handled;
By treated, the corresponding pixel value of each pixel is corresponding with each pixel in the current processed picture Median pixel value is added, the picture that obtains that treated, and the median pixel value obtains the current processed picture It is obtained after executing first processing function in the process.
5. the method as described in claim 1-3 any claim, which is characterized in that described according to first processing parameter With the second processing parameter, successively the original image of the current processed picture is handled, the figure that obtains that treated Piece, comprising:
If first processing function is the second specified class processing function, it is emerging to obtain the corresponding sense of first processing function Interesting region;
When going to first processing function according to the execution sequence for having executed processing function, the second middle is obtained Picture is managed, the second intermediate treatment picture is the upper processing ginseng of the first processing parameter according to the execution sequence Number obtains after having executed corresponding processing function;
According to first processing parameter, to each pixel in the area-of-interest of the second intermediate treatment picture Corresponding pixel value is handled;
When going to the second processing function according to the execution sequence for having executed processing function, at described second Parameter is managed, the corresponding pixel value of each pixel in the area-of-interest is handled, the picture that obtains that treated.
6. the method as described in claim 1-3 any claim, which is characterized in that described to receive to current processed When the first process instruction of picture, before corresponding first processing parameter of acquisition first process instruction, further includes:
For any processing function executed in processing function, execution when from for obtaining the current processed picture In the corresponding pixel value of each pixel obtained after the processing function, the corresponding irrelevant of each pixel is obtained Value, the extraneous pixel values are to have executed corresponding place with the unrelated Processing Algorithm of the processing parameter according in corresponding algorithm It is obtained after reason function;
The corresponding extraneous pixel values of each pixel that will acquire are cached;
Correspondingly, described according to first processing parameter and the second processing parameter, successively to the current processed figure The original image of piece is handled, the picture that obtains that treated, comprising:
For any processing parameter in first processing parameter and the second processing parameter, obtain in the execution sequence The first intermediate treatment picture that preceding single treatment obtains;
According to the processing parameter, according to Processing Algorithm relevant to the processing parameter in corresponding Processing Algorithm, to described The corresponding pixel value of each pixel in first intermediate treatment picture is handled, and the corresponding phase of each pixel is obtained Close pixel value;
The extraneous pixel values of corresponding each pixel in the corresponding correlated pixel value of each pixel and caching are carried out It is added, the picture that obtains that treated.
7. a kind of picture processing unit, which is characterized in that described device includes:
First obtains module, for obtaining at described first when receiving the first process instruction to current processed picture Reason instructs corresponding first processing parameter, and first process instruction corresponds to the first processing function, first processing function For any processing function executed in processing function to the current processed picture;
Second acquisition module is obtained for having executed in the corresponding processing parameter of processing function to the current processed picture Second processing parameter is taken, the second processing parameter corresponds to second processing function, and the second processing function is described held Processing function in row processing function in addition to first processing function;
Processing module, for according to it is described executed processing function execute sequence, according to first processing parameter and described Second processing parameter is successively handled the original image of the current processed picture, the picture that obtains that treated.
8. device as claimed in claim 7, which is characterized in that the processing module includes:
First processing units, for for any processing parameter in first processing parameter and the second processing parameter, Based on the first intermediate treatment picture that preceding single treatment in the execution sequence obtains, according to the processing parameter, to described The corresponding pixel value of each pixel in one intermediate treatment picture carries out parallel processing.
9. device as claimed in claim 8, which is characterized in that the first processing units include:
First parallel processing subelement can symmetrically divide for the Processing Algorithm when the corresponding processing function of the processing parameter When convolution algorithm, according to the processing parameter, according to first direction Processing Algorithm, in the first intermediate treatment picture The corresponding pixel value of each pixel on one direction carries out parallel processing;
Second parallel processing subelement is used for according to the processing parameter, according to second direction Processing Algorithm, in described first Between the corresponding pixel value of each pixel that handles in second direction in picture carry out parallel processing, the first direction processing Algorithm and the second direction Processing Algorithm are to split to obtain by Processing Algorithm progress twocouese.
10. the device as described in claim 7-9 any claim, which is characterized in that the processing module includes:
First acquisition unit, if being the first specified class processing function for first processing function, to described current Processed picture has executed in the corresponding processing parameter of processing function, obtains third processing parameter, and the third processing parameter is For obtaining the corresponding processing parameter of first processing function of the current processed picture;
First computing unit, for calculating the difference between first processing parameter and the third processing parameter;
Second acquisition unit goes to first processing function according to the execution sequence for having executed processing function for working as When, the second intermediate treatment picture is obtained, the second intermediate treatment picture is the first processing according to the execution sequence A upper processing parameter for parameter obtains after having executed corresponding processing function;
The second processing unit is used for according to the difference, corresponding to each pixel in the second intermediate treatment picture Pixel value is handled;
Second computing unit, for will be in treated the corresponding pixel value of each pixel and the current processed picture The corresponding median pixel value of each pixel is added, the picture that obtains that treated, the median pixel value be obtain it is described It is obtained after executing first processing function during current processed picture.
11. the device as described in claim 7-9 any claim, which is characterized in that the processing module includes:
Third acquiring unit obtains described first if being the second specified class processing function for first processing function The corresponding area-of-interest of processing function;
4th acquiring unit goes to first processing function according to the execution sequence for having executed processing function for working as When, the second intermediate treatment picture is obtained, the second intermediate treatment picture is the first processing according to the execution sequence A upper processing parameter for parameter obtains after having executed corresponding processing function;
Third processing unit is used for according to first processing parameter, to the described interested of the second intermediate treatment picture The corresponding pixel value of each pixel in region is handled;
Fourth processing unit goes to the second processing function according to the execution sequence for having executed processing function for working as When, according to the second processing parameter, the corresponding pixel value of each pixel in the area-of-interest is handled, is obtained To treated picture.
12. the device as described in claim 7-9 any claim, which is characterized in that described device further include:
Third obtains module, for for any processing function executed in processing function, from for obtaining described work as It is executed when preceding processed picture in the corresponding pixel value of each pixel obtained after the processing function, obtains each picture The corresponding extraneous pixel values of vegetarian refreshments, the extraneous pixel values are according to processing unrelated with the processing parameter in corresponding algorithm Algorithm obtains after having executed corresponding processing function;
Cache module, the corresponding extraneous pixel values of each pixel for will acquire are cached;
Correspondingly, the processing module includes:
5th acquiring unit, for for any processing parameter in first processing parameter and the second processing parameter, Obtain the first intermediate treatment picture that preceding single treatment in the execution sequence obtains;
5th processing unit is used for according to the processing parameter, according to related to the processing parameter in corresponding Processing Algorithm Processing Algorithm, the corresponding pixel value of each pixel in the first intermediate treatment picture is handled, is obtained described The corresponding correlated pixel value of each pixel;
Third computing unit, for will the corresponding correlated pixel value of each pixel with cache in corresponding each pixel Extraneous pixel values be added, the picture that obtains that treated.
13. a kind of computer readable storage medium, which is characterized in that instruction is stored in the computer readable storage medium, When described instruction is run at the terminal, so that the terminal perform claim requires any image processing method of 1-6.
CN201410320704.7A 2014-07-04 2014-07-04 Image processing method and device Active CN105303508B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410320704.7A CN105303508B (en) 2014-07-04 2014-07-04 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410320704.7A CN105303508B (en) 2014-07-04 2014-07-04 Image processing method and device

Publications (2)

Publication Number Publication Date
CN105303508A CN105303508A (en) 2016-02-03
CN105303508B true CN105303508B (en) 2019-06-14

Family

ID=55200738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410320704.7A Active CN105303508B (en) 2014-07-04 2014-07-04 Image processing method and device

Country Status (1)

Country Link
CN (1) CN105303508B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239293B (en) * 2017-06-29 2020-08-28 努比亚技术有限公司 Picture editing method, terminal and computer readable storage medium
TWI717655B (en) 2018-11-09 2021-02-01 財團法人資訊工業策進會 Feature determination apparatus and method adapted to multiple object sizes

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1210306A (en) * 1997-09-01 1999-03-10 松下电器产业株式会社 Microcontroller, data processing system and task switching control method
CN1487737A (en) * 2002-08-08 2004-04-07 佳能株式会社 Image processing method and apparatus, colour change list generating method and apparatus
JP2005267259A (en) * 2004-03-18 2005-09-29 Seiko Epson Corp Image correcting device and method and computer program
CN1707521A (en) * 2004-06-10 2005-12-14 索尼株式会社 Image processing device and method, recording medium, and program
CN102473440A (en) * 2009-08-07 2012-05-23 高通股份有限公司 Apparatus and method of processing images

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1210306A (en) * 1997-09-01 1999-03-10 松下电器产业株式会社 Microcontroller, data processing system and task switching control method
CN1487737A (en) * 2002-08-08 2004-04-07 佳能株式会社 Image processing method and apparatus, colour change list generating method and apparatus
JP2005267259A (en) * 2004-03-18 2005-09-29 Seiko Epson Corp Image correcting device and method and computer program
CN1707521A (en) * 2004-06-10 2005-12-14 索尼株式会社 Image processing device and method, recording medium, and program
CN102473440A (en) * 2009-08-07 2012-05-23 高通股份有限公司 Apparatus and method of processing images

Also Published As

Publication number Publication date
CN105303508A (en) 2016-02-03

Similar Documents

Publication Publication Date Title
Guo et al. LIME: Low-light image enhancement via illumination map estimation
Guo LIME: A method for low-light image enhancement
CN104517265B (en) Intelligent grinding skin method and apparatus
CN105243371A (en) Human face beauty degree detection method and system and shooting terminal
CN104331858B (en) Accelerated method a kind of while that image procossing is carried out using CPU and GPU
CN107194869B (en) Image processing method and terminal, computer storage medium and computer equipment
CN112712546A (en) Target tracking method based on twin neural network
CN106683110A (en) User terminal and object tracking method and device thereof
CN113505768A (en) Model training method, face recognition method, electronic device and storage medium
CN108399599A (en) Image processing method, device and electronic equipment
Su et al. De-emphasis of distracting image regions using texture power maps
US20160240006A1 (en) Evaluation of augmented reality skins
CN105303508B (en) Image processing method and device
CN107851309A (en) A kind of image enchancing method and device
CN107564085B (en) Image warping processing method and device, computing equipment and computer storage medium
CN112819767A (en) Image processing method, apparatus, device, storage medium, and program product
Wei et al. Uhd underwater image enhancement via frequency-spatial domain aware network
CN103871014A (en) Image color changing method and device
CN104952093B (en) Virtual hair colouring methods and device
CN104991695B (en) A kind of information processing method and electronic equipment
CN107450717A (en) A kind of information processing method and Wearable
CN107808372A (en) Image penetration management method, apparatus, computing device and computer-readable storage medium
Schwonberg et al. Augmentation-based Domain Generalization for Semantic Segmentation
CN107357424B (en) Gesture operation recognition method and device and computer readable storage medium
CN110473281A (en) Threedimensional model retouches side processing method, device, processor and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant