Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, there is provided a kind of font size self-adapting regulation method based on eyes and mobile terminal, the size of energy self-adaptation dynamic conditioning display font, promotes reading experience, alleviate eye fatigue, visually bring good comfort to user.
In order to achieve the above object, the technical solution used in the present invention is a kind of font size self-adapting regulation method based on eyes and mobile terminal, and wherein a kind of font size self-adapting regulation method based on eyes comprises the following steps:
[1] eye image when user uses mobile terminal is gathered;
[2] according to eye image, font size is determined;
[3] display font arranging mobile terminal is true; Fixed font size.
Step [1] collection user uses eye image during mobile terminal
Control camera head acquisition user uses facial image during mobile terminal, then from facial image, detects eye image.
Step [2], according to eye image, determines font size
According to eye image, determine that the method for font size comprises the following steps: calculate the eye image that gathers and comfortable time eye image Sample Storehouse distance, obtain nearest comfortable time font size corresponding to eye image sample.
Eye image Sample Storehouse when being provided with comfortable in the terminal, the sample database that eye image when it refers to people's reading comfort associates with display font size.
Further, according to eye image, determine that the method for font size comprises the following steps: it is characterized in that: according to eye image, determine that the method for font size comprises the following steps: to current eye Images Classification, if be categorized into adjustment classification A+, then tune up current font, recruitment is Ds; If be categorized into adjustment classification A-, then turn current font down, reduction is Ds; If be categorized into adjustment classification A, then do not adjust.
Be provided with three class font adjustment classification sample databases in the terminal, the eye image under different conditions is associated with font size.Adjustment classification A+, the mobile terminal font corresponding to such eye image needs to tune up, and feels comfortably cool when eyes just can be made to read; Adjustment classification A-, the mobile terminal font corresponding to such eye image needs to turn down, feels comfortably cool when eyes just can be made to read; Adjustment classification A, the mobile terminal font corresponding to such eye image does not need adjustment, feels comfortably cool when it has made eyes read.
The method adopts sorter to classify to eye image, obtains font adjustment classification, such as, adopt support vector machine classifier to classify to eye image, obtains font adjustment classification.
The display font that step [3] arranges mobile terminal is the font size determined
A kind of font size self-adapting regulation method based on eyes is further, comprising: when eye image changes, and self-adaptation key whole font display size, the display font arranging mobile terminal is the font size after adjusting.
Based on a font size self-adaptative adjustment mobile terminal for eyes, it is characterized in that, this mobile terminal comprises: man face image acquiring module, eye detection module, eye feature vector constructing module, font size determination module, and display control module.Wherein, man face image acquiring module controls camera head and obtains facial image when user uses mobile terminal; The facial image that eye detection module is sent according to man face image acquiring module detects eye image; The eye image that eye feature vector constructing module sends over according to eye detection module, abstract image feature, structure eye feature vector.The font size value that the eye feature vector calculation that font size determination module sends according to eye feature vector constructing module should be arranged, and this value is sent to display control module; Display control module receives the font size value that font size determination module sends, and controls mobile terminal screen by this font size value display word.
This mobile terminal also comprises further: parameter setting module, font size self-adaptative adjustment module, font adjustment model study module, and wherein parameter setting module is used for arranging all kinds of parameter in the terminal and storing training sample; Font size self-adaptative adjustment module is used for when eyes of user state changes, the display font size of Automatic adjusument mobile terminal.Font adjustment model study module, according to training sample database, obtains disaggregated model, outputs to font size determination module.
beneficial effect
Compared with prior art, the invention has the beneficial effects as follows by obtaining the eyes of user using mobile terminal, the size of energy self-adaptative adjustment display font, promotes reading experience, alleviates eye fatigue, visually bring good comfort can to user.
embodiment
A kind of font size self-adapting regulation method based on eyes that the present invention proposes and mobile terminal, be described as follows in conjunction with the accompanying drawings and embodiments.
Based on a font size self-adapting regulation method for eyes, as shown in Figure 1, comprise the following steps:
S01: collection user uses eye image during mobile terminal
S02: the proper vector of structure eye image
S03: according to eye image proper vector, adjustment font size
S04: the display font that mobile terminal is set.
step S01: gather eyes of user image
The implementation case obtains the still image of face and eyes by the first-class picture catching instrument of shooting, then completes Image semantic classification, comprises the size of image and the normalization of gray scale, the rectification of head pose, the detection etc. of face and eye image.Detection algorithm adopts the cascade classifier algorithm of Viola – Jones, and it is a present more outstanding Face datection algorithm.This algorithm uses the cascade classifier strategy based on Haar feature, can find face and the eye image of many attitude and size fast and effectively.Android OpenCV provides the realization of this algorithm.Android OpenCV is that Intel increases income computer vision storehouse (Computer Version), is made up of, achieves a lot of general-purpose algorithms of image procossing and computer vision aspect a series of C function and a small amount of C++ class.Android OpenCV has the cross-platform middle and high layer API comprising more than 300 C function.Android OpenCV provides the access to hardware, directly can access camera, and thus we utilize collection and the detection of Android OpenCV programming realization eye image, thus obtains eye image.Such as utilize the function CascadeClassifier of OpenCV, load and detecMultiScale, realize the real-time detection of face and eyes.
step S02: the proper vector of structure eye image
The feature that the implementation case extracts eye image has two classes: the 1st class, utilize 2-d discrete wavelet to convert image on the basis of not obvious loss image information, it is vectorial as eye feature that the data representing original image overwhelming majority energy are extracted in recycling discrete cosine transform.2nd class is split eye image, denoising Processing, then does standardization to it, comprises dimension normalization and gray balance.Use the grid of fixed pixel to split further to the image after standardization, Gabor wavelet conversion is carried out to each grid, get the average of the wavelet coefficient module after Gabor transformation, variance as the proper vector of this grid.Finally being connected in series by two category feature vectors is the proper vector of a proper vector as eye image.The proper vector of the api function structure eye image that the implementation case utilizes Android OpenCV to provide.
step S03: according to eye feature vector, adjustment font size
case study on implementation 1
According to eye image, determine that the method for font size comprises the following steps: calculate the eye image that gathers and comfortable time eyes fonts Sample Storehouse in the distance of sample, obtain nearest comfortable time font size corresponding to eyes fonts sample.
Eyes font Sample Storehouse when being provided with comfortable in the terminal, the sample database that eye feature vector when it refers to people's reading comfort associates with display font size.
eyes font Sample Storehouse time comfortable
In table, X1 represents that eyes are when using mobile terminal to feel comfortably cool, and the font size that mobile terminal showed at that time is S1.
case study on implementation 2
According to eye image, determine that the method for font size comprises the following steps: to current eye Images Classification, if be categorized into adjustment classification A+, then tune up current font, recruitment is; If be categorized into adjustment classification A-, then turn current font down, reduction is; If be categorized into adjustment classification A, then do not adjust.
Be provided with three class font adjustment classification sample databases in the terminal, the eye image under different conditions is associated with font size.Adjustment classification A+, the mobile terminal font corresponding to such eye image needs to tune up, and feels comfortably cool when eyes just can be made to read; Adjustment classification A-, the mobile terminal font corresponding to such eye image needs to turn down, feels comfortably cool when eyes just can be made to read; Adjustment classification A, the mobile terminal font corresponding to such eye image does not need adjustment, feels comfortably cool when it has made eyes read.Wherein adopt sorter to classify to eye image, obtain font adjustment classification, such as, adopt support vector machine classifier to classify to eye image, obtain font adjustment classification.
Support vector machine (Support Vector Machine, SVM) is a kind of sorting technique just grown up in recent years, and its structure based principle of minimization risk, has good generalization ability.Given training samplecollection, whereinfor input vector,for the classification of correspondence, SVM finds the optimum boundary lineoid that two class samples correctly can be separated in feature space.For the vector in the input spaceif, userepresent its characteristic of correspondence vector in feature space, then optimum boundary lineoid is expressed as.Corresponding decision-making equation is.Under any circumstance, SVM does not require to know mapping.Introduce kernel function, the dot product in feature space between vector can be expressed as by kernel function in the input space.
Training SVM is equivalent to and solves following optimization problem:
This is the quadratic programming problem of positive definite, and target equation is determined by Lagrange multiplier vector a.Once vectorial a is known, the weight vectors w in decision-making equation and threshold value b easily can be calculated by KKT condition.KKT condition is the sufficient and necessary condition of above-mentioned quadratic programming problem.Definition
Then KKT condition is
Whereinthe sample of non-vanishing correspondence is exactly support vector, and they are the small part in all samples usually.After calculating support vector, just obtain decision function
Wherein S is support vector set.In decision function, conventional kernel function has polynomial kernel, Radial basis kernel function (RBF), Sigmoid kernel function etc.The SVM classifier that the implementation case utilizes Android OpenCV to provide completes face emotional semantic classification, Selection of kernel function Radial basis kernel function RBF, take estimated performance as criterion, with the suitable parameters of 10 times of cross validation way selection SVM classifier, and then obtain corresponding svm classifier model.
SVM needs training sample to train, and obtains svm classifier model.Be provided with three class font adjustment classification sample databases in the terminal, the eye image under different conditions is associated with font size.Adjustment classification A+, the mobile terminal font corresponding to such eye image needs to tune up, and feels comfortably cool when eyes just can be made to read; Adjustment classification A-, the mobile terminal font corresponding to such eye image needs to turn down, feels comfortably cool when eyes just can be made to read; Adjustment classification A, the mobile terminal font corresponding to such eye image does not need adjustment, feels comfortably cool when it has made eyes read.
The acquisition process of svm classifier model comprises following steps:
[1] the font adjustment classification of 900 eye images and correspondence thereof is gathered, each classification 300 samples;
[2] proper vector of each eye image is constructed;
[3] construct training data, with the proper vector of eye image for input, the font adjustment classification of its correspondence is output, composing training sample set;
[4] training sample set is adopted, study svm classifier model;
[5] with the optimal parameter of 10 times of cross validation way selection svm classifier models, and then the svm classifier model of corresponding parameter is obtained.
font adjustment classification sample database
In table, X1 represents that eyes are when using mobile terminal, feel uncomfortable to the font size that mobile terminal showed at that time, finds that font is too little through test, needs font to tune up font by adjustment classification A+; In table, X2 represents that eyes are when using mobile terminal, feel uncomfortable to the font size that mobile terminal showed at that time, finds that font is too large through test, needs to turn font down font by adjustment classification A-; In table, X3 represents that eyes are when using mobile terminal to feel comfortably cool, the font size S3 that mobile terminal showed at that time.
As shown in Fig. 2, for a kind of structural drawing of the font size self-adaptative adjustment mobile terminal case study on implementation 1 based on eyes, it is characterized in that, this mobile terminal comprises: man face image acquiring module 202, eye detection module 203, eye feature vector constructing module 204, font size determination module 206, display control module 207.Wherein, man face image acquiring module 202 controls camera head and obtains facial image when user uses mobile terminal.The facial image that eye detection module 203 is sent according to man face image acquiring module 202 detects eye image.The eye image that eye feature vector constructing module 204 sends over according to eye detection module 203, abstract image feature, structure eye feature vector.The font size value that the eye feature vector calculation that font size determination module 206 sends according to eye feature vector constructing module 204 should be arranged, and this value is sent to display control module 207; Display control module 207 receives the font size value that font size determination module sends, and then controls mobile terminal screen by this font size value display word.
Mobile terminal described in one step, it is characterized in that comprising: parameter setting module 208, font size self-adaptative adjustment module 201, font adjustment model study module 205, wherein parameter setting module 208 is for arranging all kinds of parameter and training sample in the terminal; Font size self-adaptative adjustment module 301, for when eyes of user state changes, calling module 202 successively, 203,204,206,207 modules, complete the Automatic adjusument of mobile terminal display font size.Font adjustment model study module 205 is according to training sample database, and Training Support Vector Machines, obtains support vector cassification model, output to font size determination module 206.Font adjustment model study module 205, to given training sample database, only runs once.
As shown in Fig. 3, for a kind of structural drawing of the font size self-adaptative adjustment mobile terminal case study on implementation 2 based on eyes, it is characterized in that, this mobile terminal comprises: man face image acquiring module 302, eye detection module 303, eye feature vector constructing module 304, font size determination module 306, display control module 307.Wherein, man face image acquiring module 302 controls camera head and obtains facial image when user uses mobile terminal.The facial image that eye detection module 303 is sent according to man face image acquiring module 302 detects eye image.The eye image that eye feature vector constructing module 304 sends over according to eye detection module 303, abstract image feature, structure eye feature vector.The font size value that the eye feature vector calculation that font size determination module 306 sends according to eye feature vector constructing module 304 should be arranged, and this value is sent to display control module 307; Display control module 307 receives the font size value that font size determination module sends, and then controls mobile terminal screen by this font size value display word.
Mobile terminal described further, is characterized in that comprising: parameter setting module 308, font size self-adaptative adjustment module 301.Wherein parameter setting module 308 is for arranging all kinds of parameter and training sample in the terminal; Font size self-adaptative adjustment module 301, for when eyes of user state changes, calling module 302 successively, 303,304,306,307 modules, complete the Automatic adjusument of mobile terminal display font size.There is no font adjustment model study module in the implementation case, because font size determination module 306 does not adopt sorter to realize, but adopt distance directly to adjust.
Mobile terminal in case study on implementation described in Fig. 2 and Fig. 3 adopts Android intelligent.Android platform provides application framework, provide all kinds of developing instruments such as sensor, speech recognition, desktop component exploitation, the design of Android game engine, Android optimizing application, provide multimedia supports such as audio frequency, video and pictures, provide the relevant database SQLite3 stored for structural data.Therefore case study on implementation adopts Android OpenCV to realize the collection of facial image, the process, eye detection, sorter etc. of facial image, adopts the data such as SQLite3 management training sample database.
Those of ordinary skill in the art should be appreciated that technical scheme of the present invention can be modified, distortion or equivalents, and does not depart from essence and the scope of technical solution of the present invention, all covers among right of the present invention.