Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Referring to Fig. 1, the embodiment of the invention provides a kind of method of obtaining expression meanings, comprising:
101: obtain the expression data in the picture to be detected, perhaps obtain corresponding expression data according to the expressive features of user's input;
102: the expression data in the expression data that will obtain and the little expression storehouse are compared, and this little expression storehouse is set up in advance and comprised at least two expressions, and wherein, each expression has corresponding expression data;
103: if there are the expression data of coupling in little expression storehouse, then obtain and present expression corresponding to the expression data of coupling and the implication of this expression.
Expression data in the embodiment of the invention refer to shape and the size of each organ on people's the face.The angle that presents such as eyebrow, the size of eyeball radius, the angle that eyes open, the size that face opens, angle that the corners of the mouth raises up etc.Expression in the embodiment of the invention has multiple, includes but not limited to: happy, smile, thinking, terrified, despise, ridicule etc.
The said method that the embodiment of the invention provides can be applied to different scenes, for example, utilizes existing equipment can photograph human face's picture, obtains the scene of expression according to this picture; Perhaps, can't take, determine scene of corresponding expression etc. according to the expressive features of input.The below specifies respectively.
Referring to Fig. 2, the embodiment of the invention also provides a kind of method of obtaining expression meanings, is applied to obtain the scene of the personage's expression in the picture, specifically comprises:
201: people's face is divided into a plurality of zones, i.e. at least two zones;
What relate in the embodiment of the invention is a plurality of, except special declaration, all refers at least two, refers at least two zones such as a plurality of zones, and a plurality of expressions refer at least two expressions, and a plurality of expression pictures refer at least two expression pictures, etc., no longer one by one statement.
The regional number that the embodiment of the invention is divided people's face is not specifically limited, and usually, the regional number of division is more, and the accuracy of obtaining expression is higher.For example, people's face is divided into angle that the size of the shape of eyebrow, degree that eyes open, eyeball, degree that face opens and the corners of the mouth raise up totally five zones, perhaps is divided into six zones, eight zones etc.
202: collect a plurality of expression pictures, and be divided into a plurality of expressions, each expression comprises at least one expression picture;
Usually, collect the picture that comprises typical case's expression, preferably, collect a large amount of expression pictures, better set up little expression storehouse.A plurality of expression pictures of collecting are divided into a plurality of expressions, refer to expression picture is sorted out, the corresponding classification of each expression, each classification comprises at least one expression picture.For example, collected 90 expression pictures, wherein, 15 belong to happy, 10 belong to despise, 20 belong to thinking, 8 belong to terrified, 12 belong to smile, 5 and belong to ridicule, 20 and belong to excitement etc.
203: in each expression, all expression pictures that comprise according to this expression, and a plurality of zone are determined the expression data area in interior each zone of this expression;
For each expression in a plurality of expressions after the above-mentioned division, all determine the expression data area in each zone in this expression.Particularly, all expression pictures that this expression comprises are analyzed, obtained the expression data in each zone in each expression picture, for each zone, add up the expression data of this zone in different expression pictures, obtain the expression data area in this zone.For example, expression is smiled and to be comprised 3 expression pictures, and it is the angle that the corners of the mouth raises up that a zone is wherein arranged, and this angle is respectively 3 °, 5 ° and 8 ° in these 3 expression pictures, and expression data area that then should the zone is defined as 3 °~8 °.
204: for each expression is specified one or more expression pictures in the expression picture that it comprises;
Usually, less expression picture can be specified, thereby the space in little expression storehouse can be saved, preferably, for each expression is specified an expression picture.
205: store each expression and be the expression picture of its appointment, and store the expression data area in each zone in a plurality of zones of each expression, obtain little expression storehouse;
Comprise following content in little expression storehouse of building up: expression, expression picture, zone expression data area.Wherein, each expression has its corresponding expression picture, and each expression comprises a plurality of zones, and there is the expression data area of oneself in each zone.
206: utilize camera to take pictures, perhaps in video recording, intercept picture, this photo or picture as picture to be detected, are obtained the expression data in the picture to be detected;
Particularly, can adopt the camera on the mobile phone to take pictures, perhaps video recording and intercept picture in the content in video recording, thus obtain picture to be detected.Obtain the expression data in the picture to be detected, refer to obtain the expression data of regional in this expression picture.For example, getting access to the angle that eyes open in the picture to be detected is 50 °, and the angle that eyebrow presents is 2 °, and the size that face opens is 30 ° etc.
207: the expression data of All Ranges in the picture to be detected that will obtain, respectively with little expression storehouse in the expression data area of All Ranges of each expression compare one by one, and judge whether coupling, if complete coupling then carries out 208; Such as the fruit part coupling, then carry out 209; Otherwise, finish;
Particularly, comparison refers to the expression picture in picture to be detected and the little expression storehouse is compared successively according to the zone one by one.For example, the eyeball size in the expression picture in the eyeball in the picture to be detected size and little expression storehouse is compared, the face in the picture to be detected is opened face in the expression picture in size and little expression storehouse and open size and compare etc.
208: if there is an expression in little expression storehouse, and the expression data of the All Ranges in the picture to be detected drop on respectively in the expression data area of respective regions of this expression one by one, and then the match is successful, obtains this expression in little expression storehouse, thereby obtain the expression of picture to be detected, finish;
Wherein, the expression data of the All Ranges in the picture to be detected drop on respectively in the expression data area of respective regions of this expression one by one, the match is successful to refer to the expression data in each zone in the picture to be detected, do not exceed the expression data area of this expression respective regions in little expression storehouse.For example, the zone of dividing in advance is three, this Three regions in the picture to be detected, its expression data are respectively 5 °, 10 ° and 8 °, an expression is arranged in little expression storehouse, and its trizonal expression data area is respectively 3 °~10 °, 10 °~20 ° and 5 °~10 °, then owing to these three expression data all drop in each self-corresponding expression data area, therefore, the match is successful.
209: if having current expression in little expression storehouse, and in the expression data of the All Ranges of picture to be detected, there are the expression data of subregion to drop in the expression data area of respective regions of current expression, then the match is successful in the subregion, calculates expression to be obtained and the degree of conformity of current expression;
Above-mentioned current expression can be one or more expressions, namely picture to be detected can with little expression storehouse in an expression the match is successful in the subregion, also can with little expression storehouse in the match is successful in a plurality of expressions subregion.For example, picture to be detected only with little expression storehouse in the match is successful in happy subregion, perhaps, picture to be detected respectively with little expression storehouse in the match is successful happy and smile subregion.
The match is successful in above-mentioned subregion, and the match is successful to refer in the picture to be detected expression in some zone and the little expression storehouse, and some Region Matching is unsuccessful.Wherein, mating unsuccessful zone can be one, also can be for a plurality of.For example, the match is successful for the thinking subregion in picture to be detected and the little expression storehouse, and default zone has five, and then unmatched zone can be one, two, three or four.
Particularly, above-mentioned expression to be obtained and the degree of conformity of current expression calculated specifically comprises:
If the number in default a plurality of zones is N, N 〉=2, the number in unmatched zone is M in the N of the picture to be detected zone, M and N are natural number, and M<N, respectively as current region, calculate degree of conformity corresponding to current region according to following formula with each zone in M the zone:
Degree of conformity=(1-(1/N) * (X/Y)) * 100%;
Wherein, X is the expression data of current region, Y is the interior standard expression data of the expression data area of corresponding region, this corresponding region refers in current expression and the zone corresponding with described current region, and these standard expression data refer to expression data of appointment in the expression data area of described corresponding region.The expression data of this appointment can calculate according to higher limit and the lower limit of this data area of expressing one's feelings, as calculating intermediate value as the standard expression data of appointment according to higher limit and lower limit.
If M=1 then calculates a degree of conformity according to above-mentioned formula, with this degree of conformity as expression to be obtained and the degree of conformity of described current expression;
If then calculate according to above-mentioned formula each zone in M the zone M>1, can obtain M degree of conformity, calculate a degree of conformity by this M degree of conformity, as expression to be obtained and the degree of conformity of described current expression.Wherein, calculate a degree of conformity by M degree of conformity and can adopt existing formula, such as averaged etc.
210: according to the expression to be obtained that calculates and the degree of conformity of current expression, provide corresponding expression picture to the user, behind the expression picture that user selection needs, obtain and present the implication of expression corresponding to this expression picture and this expression, finish.
Wherein, according to the expression to be obtained that calculates and the degree of conformity of current expression, provide corresponding expression picture to the user, specifically comprise:
If current expression is an expression, the expression picture that then directly this expression is comprised offers the user, for user selection;
If current expression is K expression, K is the natural number greater than 1, the expression to be obtained that then calculates and the degree of conformity of current expression are K, therefore, provide default a plurality of precision to the user, after precision of user selection, in the K that a calculates degree of conformity, select all degrees of conformity of the precision that meets user selection, the expression picture that the expression that these all degrees of conformity are corresponding comprises offers the user.
For example, current expression has 2 expressions, and all the match is successful with picture to be detected subregion, calculates these 2 each self-corresponding degree of conformity of expression, obtains 2 degrees of conformity, is respectively: 75% and 88%; Default precision has two-stage: more than 70% and more than 80%, offer user selection, if the precision of user selection more than 80%, then a display symbol is right is the expression picture that 88% expression comprises, if the precision of user selection more than 70%, then both display symbol was right is the expression picture that 88% expression comprises, and display symbol is right again is the expression picture that 75% expression comprises.
The said method that present embodiment provides by setting up in advance little expression storehouse, is compared expression data and little expression storehouse of picture to be detected, the expression data that obtain mating, thus obtain expression and the implication thereof of picture to be detected.By taking pictures and record a video sectional drawing, be easy to obtain picture to be detected, simple and convenient, realize easily.Compared with prior art, less demanding to operating personnel, popularize easily, and need not to be equipped with the specialized equipment of cost costliness, as long as have the equipment of taking pictures with camera function, such as mobile phone terminal etc., provide cost savings, give and obtain expression meanings a kind of simple, practical, effective way is provided.
Referring to Fig. 3, the embodiment of the invention also provides a kind of method of obtaining expression meanings, is applied to determine according to the expressive features of user selection the scene of expression, specifically comprises:
301: set up in advance the little expression storehouse that comprises a plurality of expressions, each expression has corresponding expression data, and detailed process is with 201~205:
302: determine corresponding expressive features for the expression data in each zone in little expression storehouse, all expressive features that obtain are offered the user;
Described expressive features refers to the natural language description that obtains by the expression data-switching.For example, the expression data: the angle that eyebrow presents is-5 ° and 5 °, and corresponding expressive features is respectively the eyebrow of splay eyebrow and herringbone; The expression data: the angle that the corners of the mouth raises up is 3 ° and 8 °, and corresponding expressive features is respectively the corners of the mouth and slightly raises up and raise up etc. more greatly with the corners of the mouth.
The mode that offers the user has multiple, as is presented on the screen of terminal, checks and selects for the user.Particularly, can show according to default zone, be subdivided into one or more expressive features under each zone, the user can check and select with text searching function the expressive features of needs.Application scenarios in the present embodiment is that the user can't photograph photo or be truncated to the scene of picture, but the user can see the other side's facial expression, therefore, the user can select corresponding expressive features according to the size and shape of facial each organ of the other side of seeing etc.
303: when the user selects corresponding expressive features in the above-mentioned content that provides after, determine corresponding expression data according to the expressive features of user selection;
The expressive features of user selection can for one or more, be generally a plurality of.If people's face is divided into N zone, N is natural number, and the expressive features of user selection is M, and corresponding M is regional, M≤N then, and M also is natural number.When the non-selected expressive features of regional user that has, the value that can be set to give tacit consent to.Correspondingly, according to M expressive features of user selection, can obtain M expression data.
304: with the expression data in obtain M zone, respectively with little expression storehouse in the expression data area in a plurality of zones of each expression compare, and judge whether coupling, if the match is successful, then carry out 305, if the match is successful in the subregion, then carry out 306, otherwise, finish;
305: if there is an expression in little expression storehouse, and the expression data in the M that obtains zone drop on respectively in the expression data area in a plurality of zones of this expression one by one, and then the match is successful, obtains this expression in little expression storehouse, end;
306: if having current expression in little expression storehouse, and in the expression data in the M that obtains zone, there are the expression data of subregion to drop in the expression data area of respective regions of current expression, then the match is successful in the subregion, calculate expression to be obtained and the degree of conformity of current expression, described current expression can be one or more expressions;
307: provide corresponding expression picture to the user according to the degree of conformity that calculates, behind the expression picture that user selection needs, obtain and present the implication of expression corresponding to this expression picture and this expression, finish.
In the present embodiment, calculate formula and the detailed process of degree of conformity, and provide the process of expression picture to the user according to degree of conformity, all with the description in 209~210, repeat no more herein.
The said method that present embodiment provides by setting up in advance little expression storehouse, is determined corresponding expression data according to the expressive features of user selection, compares with little expression storehouse, and the expression data that obtain mating, thus obtain expression to be obtained and implication thereof.Under the user can't take pictures or record a video the situation of sectional drawing, provide expressive features for user selection, simple and convenient, realize easily.Compared with prior art, less demanding to operating personnel popularized easily, and be need not to be equipped with the specialized equipment of cost costliness, provides cost savings, and gives to obtain expression meanings a kind of simple, practical, effective way is provided.
Referring to Fig. 4, the embodiment of the invention also provides a kind of device that obtains expression meanings, comprising:
Expression data acquisition module 401 for the expression data of obtaining picture to be detected, perhaps obtains corresponding expression data according to the expressive features of user's input;
Expression acquisition module 402, the expression data that the data acquisition module 401 that is used for expressing one's feelings obtains, compare with the expression data in little expression storehouse of setting up in advance, if there are the expression data of coupling in little expression storehouse, then obtain and present the i.e. implication of this expression of expression corresponding to the expression data of coupling, this little expression storehouse comprises at least two expressions, and wherein each expression has corresponding expression data.
Further, said apparatus also comprises:
Set up module, be used for collecting at least two expression pictures, and be divided at least two expressions, each expression comprises at least one expression picture, in each expression, all expression pictures that comprise according to this expression, and at least two zones of people's face division, determine the expression data area in each zone in this expression, store the expression picture of each expression and appointment in the expression picture that it comprises, and store the expression data area in each zone at least two zones of each expression, obtain little expression storehouse.
In the present embodiment, expression data acquisition module 401 can specifically comprise:
Collecting unit is used for utilizing camera to take pictures, and perhaps intercepts picture in video recording;
The expression data capture unit is used for photo that collecting unit is obtained or picture as picture to be detected, obtains the expression data in the picture to be detected.
Perhaps, expression data acquisition module 401 specifically comprises:
Output unit is used to the expression data in each zone in little expression storehouse of setting up module foundation to determine corresponding expressive features, and all expressive features that obtain are offered the user;
Expression data determining unit is used for after the content choice expressive features that the user provides according to output unit, determines corresponding expression data according to the expressive features of user selection.
In the present embodiment, expression acquisition module 402 specifically comprises:
Comparing unit, the expression data in a plurality of zones that the data acquisition module 401 that is used for express one's feelings obtains, respectively with little expression storehouse of setting up module foundation in the expression data area at least two zones of each expression compare;
The first acquiring unit, there is an expression if be used for little expression storehouse, and the expression data at least two zones that obtain drop on respectively in the expression data area in two zones of this expression one by one at least, and then the match is successful, obtain and present this expression and implication thereof;
Second acquisition unit, there is current expression if be used for little expression storehouse, and in the expression data at least two zones that obtain, there are the expression data at least one zone to drop in the expression data area of respective regions of current expression, then this at least one Region Matching success, calculate expression to be obtained and the degree of conformity of current expression, and provide corresponding expression picture to the user according to degree of conformity, current expression is one or at least two expressions; Behind the expression picture that user selection needs, obtain and present expression corresponding to this expression picture and implication thereof.
In the present embodiment, second acquisition unit specifically comprises:
The first computation subunit, there is current expression if be used for little expression storehouse, and in the expression data at least two zones that obtain, there are the expression data at least one zone to drop in the expression data area of respective regions of current expression, calculate in the following manner expression to be obtained and the degree of conformity of current expression:
If the number at least two default zones is N, the number in unmatched zone is M at least two zones that obtain, and M and N are natural number, and N 〉=2, M<N, respectively as current region, calculate degree of conformity corresponding to current region according to following formula with each zone in M the zone:
Degree of conformity=(1-(1/N) * (X/Y)) * 100%;
Wherein, X is the expression data of current region, Y is the interior standard expression data of the expression data area of corresponding region, and the corresponding region is in current expression and the zone corresponding with current region, and standard expression data are expression data of appointment in the expression data area of corresponding region;
If M=1, then with the degree of conformity that obtains as expression to be obtained and the degree of conformity of current expression;
If M>1 then calculates a degree of conformity according to M the degree of conformity that obtains, as expression to be obtained and the degree of conformity of current expression;
First obtains subelement, and the degree of conformity for calculating according to the first computation subunit provides corresponding expression picture to the user, and described current expression is one or at least two expressions; Behind the expression picture that user selection needs, obtain and present expression corresponding to this expression picture and implication thereof.
In the present embodiment, second acquisition unit specifically comprises:
The second computation subunit, there is current expression if be used for little expression storehouse, and in the expression data at least two zones that obtain, there are the expression data at least one zone to drop in the expression data area of respective regions of current expression, calculate expression to be obtained and the degree of conformity of current expression;
Second obtains subelement, is used for the degree of conformity that calculates according to the second computation subunit, if current expression is K expression, then provides default at least two precision to the user, and K is the natural number greater than 1; After the user selection precision, in K degree of conformity of the expression to be obtained that calculates and current expression, select all degrees of conformity of the precision that meets user selection, the expression picture that the expression that these all degrees of conformity are corresponding comprises offers the user, and current expression is one or at least two expressions; Behind the expression picture that user selection needs, obtain and present expression corresponding to this expression picture and implication thereof.
The device that obtains expression that present embodiment provides can be portable terminal, and is simple and convenient such as mobile phone etc., carries easily, also provides abundanter service content for the cellphone subscriber.Take pictures and the mobile phone of recording function for having, can adopt to gather the mode that picture to be detected obtains expression, also can adopt the text searching function of mobile phone, obtain the mode of expression according to expressive features, the present invention is not specifically limited.For the camera higher mobile phone of element mutually, can obtain more accurately expression.
The said apparatus that present embodiment provides by setting up in advance little expression storehouse, is compared the expression data and the little expression storehouse that obtain, the expression data that obtain mating, thus obtain expression to be obtained and implication thereof.Compared with prior art, less demanding to operating personnel popularized easily, and be need not to be equipped with the specialized equipment of cost costliness, provides cost savings.By taking pictures and record a video sectional drawing, be easy to obtain picture to be detected; Under the user can't take pictures or record a video the situation of sectional drawing, provide expressive features for user selection, simple and convenient, realize easily.Provide a kind of simple, practical, effective way to obtaining expression meanings.
Among the arbitrary embodiment of the present invention, the implication of the expression data representative that human face's regional is corresponding can arrange as required, and the present invention is not specifically limited.The angle of opening such as eyes, can be defined as angle as shown in Figure 5, wherein, ellipse is considered as the shape of eyes, when obtaining the angle that eyes open, can obtain first this oval-shaped long limit and minor face, then calculate this angle according to existing geometric algorithm, thereby obtain the angle that eyes open.Implication about expression data representative corresponding to other zone can define according to psychologist's experience, just not one by one explanation of the embodiment of the invention.
The all or part of of the technique scheme that the embodiment of the invention provides can be finished by the relevant hardware of programmed instruction, described program can be stored in the storage medium that can read, and this storage medium comprises: the various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.