Summary of the invention:
Overcome the deficiencies in the prior art, provide a kind of and need not to touch portable terminal and realize that by detecting element and front-facing camera portable terminal is to control method and the device of the portable terminal map view of the position movement of map and scaled operation.
The method of portable terminal map view comprises:
Obtain the angular velocity of the motion of mobile terminals of detecting element detection;
Described angular velocity calculated obtain portable terminal attitude change information;
Obtain the browse operation of coupling according to portable terminal attitude change information;
Obtain the front-facing camera preview image;
Image is identified, obtained variable in distance information between portable terminal and the user's eyes;
Obtain the browse operation of coupling according to portable terminal and user's eye distance change information;
Described portable terminal is carried out described browse operation;
Wherein, before the described angular velocity that obtains the motion of mobile terminals that detecting element detects, comprising:
Judge whether browse operation pins screen by the user and disabled;
Judge whether current browse operation pattern is position movement;
Described detecting element sends to map application with the angular velocity that acquires under not disabled position movement operator scheme.Wherein, obtain before the front-facing camera preview image, comprising:
Judge whether browse operation pins screen by the user and disabled;
Judge whether current browse operation pattern is scaled;
Described camera sends to map application with the preview image that acquires under not disabled scaled operator scheme;
Wherein, image is identified, is obtained between portable terminal and the user's eyes before the variable in distance information, comprising:
Described map application detects in the preview image whether people's face is arranged;
Described map application is obtained people's face length and the width that detects;
Judge people's face length and width that whether the described current people's face length that gets access to and width get access to greater than last time point respectively, indirectly extrapolate variable in distance information between portable terminal and the user's eyes;
Wherein, described described portable terminal is carried out described browse operation, comprising:
Described map application judges whether current map makes the map edge exceed the screen border threshold value with respect to the change in location of mobile terminal screen;
Described map application exceeds in the situation of screen border threshold value the map edge in the movement of current mobile terminal, and map is carried out corresponding browse operation;
Realize that mobile terminal apparatus of the present invention comprises:
Detecting element is for detection of the angular velocity of motion of mobile terminals;
Front-facing camera is used for obtaining preview image;
Map application is for the angular velocity of the motion of mobile terminals that obtains described detecting element detection; Described angular velocity calculated obtain portable terminal attitude change information; Obtain the browse operation of coupling according to portable terminal attitude change information; Obtain the front-facing camera preview image; Image is identified, obtained variable in distance information between portable terminal and the user's eyes; Obtain the browse operation of coupling according to portable terminal and user's eye distance change information; Described portable terminal is carried out described browse operation;
Wherein, described detecting element specifically is used for:
Described detecting element is judged whether browse operation pins screen by the user and is disabled; Described detecting element judges whether current browse operation pattern is position movement; Described detecting element sends to map application with the angular velocity that acquires under not disabled position movement operator scheme;
The invention provides a kind of map application, comprising:
The angular velocity acquisition module is for the angular velocity of the motion of mobile terminals that obtains the detecting element detection;
The angular velocity parsing module obtains portable terminal attitude change information for described angular velocity is calculated;
The preview image acquisition module is used for obtaining the front-facing camera preview image;
The preview image parsing module is used for image is identified, and obtains variable in distance information between portable terminal and the user's eyes;
Matching module is used for obtaining according to portable terminal attitude change information or portable terminal and user's eye distance change information the browse operation of coupling;
Execution module is used for described portable terminal is carried out described browse operation.
Wherein, described preview image parsing module specifically comprises:
Preview image recognin module is used for described preview image is identified, and whether in described preview image have people face, if having, obtain length and the width of people's face in the preview image if judging;
Comparison sub-module is used for length and width that the described length that gets access to current preview image people face and width and a upper time point get access to are contrasted respectively, obtains variable in distance information between portable terminal and the user's eyes.
Wherein, execution module specifically comprises:
Judge submodule, be used for judging whether current map makes the map edge exceed the screen border threshold value with respect to the change in location of mobile terminal screen;
Implementation sub-module, described map application exceeds in the situation of screen border threshold value the map edge in the movement of current mobile terminal, carries out the browse operation of coupling.
Advantage of the present invention is as follows:
Operational stroke is larger: since embodiments of the invention allow the user to the control operation expanded range of portable terminal to whole space that one hand can reach.With respect to the control mode that is confined in the mobile terminal screen, embodiments of the invention are controlled map application and are finished the time of same displacement, zoom operations needs, number of operations still less.The first learning cost that uses is lower, and reuse the memory burden less: the present invention is mapped to the type of service of magnifier in the traditional life in the operating process that the portable terminal map is checked.Because the user has had the use experience of magnifier already, therefore when using embodiments of the invention, substantially need not again learn.Left-hand seat that can be very fast uses.Need not have the contents such as operating gesture of special memory when reusing yet, reduced the memory burden that the user uses.Avoid the limitation of one-handed performance, liberated user's another hand
:The size of existing portable terminal is increasing.But the people is (take the right hand as example) when being hold by one hand mobile device, can implementation and operation only have hand thumb, comfortable opereating specification also only is an arc area (as shown in Figure 3) of terminal screen lower right side.This problem is not considered in considerable application, whether needs adjust to grip posture when causing the user to operate or with the non-productive operation of another hand.Because the portable terminal use scenes is varied, (on the vehicles, in the road) bimanualness form has inconvenience in considerable scene.This application operation format has then effectively been avoided the generation of this problem, has made things convenient for user's operating process, has promoted user's experience.
Embodiment:
A most preferred embodiment of the present invention, as shown in Figure 1, a kind of method of portable terminal map view may further comprise the steps:
Step 101, obtain angular velocity or the front-facing camera preview image of the motion of mobile terminals that detecting element detects;
Step 102, described angular velocity calculated obtain portable terminal attitude change information or image is identified, obtain variable in distance information between portable terminal and the user's eyes;
Step 103, obtain the browse operation of coupling according to portable terminal attitude change information or portable terminal and user's eye distance change information;
Step 104, described portable terminal is carried out described browse operation.
In order to realize technical scheme of the present invention, be provided with detecting element in the portable terminal that the embodiment of the invention provides, be used for catching the angular velocity of terminal self, preferably, the open and close of its measuring ability are set by portable terminal.Preferably, this detecting element is gyroscope.Certainly, this detecting element can also be for other detecting element, such as aspect sensor, magnetic field sensor, gravity sensors etc. are obtaining corresponding angular velocity through subsequent calculations, and every detecting element that can directly or indirectly obtain portable terminal angular velocity all belongs to protection scope of the present invention; Also be provided with front-facing camera in the portable terminal that the embodiment of the invention provides, be used for catching preview image, preferably, the open and close of its preview function are set by portable terminal.The map application that the embodiment of the invention provides has the function that diagonal angle speed is resolved, the angular velocity that obtains is further calculated the angle that obtains the variation of portable terminal attitude, be mapped as the change in location information that map moves relative to screen, then this change in location information be converted into the browse operation to current map; The map application that the embodiment of the invention provides also has the function that preview image is identified, the preview image that captures is identified, judge wherein whether comprise people's face, obtain length and the width of the people's face that recognizes, and the people's face length that gets access to a upper time point and width compare respectively the variable in distance information of judging distance of mobile terminal user eyes, then this variable in distance information is converted into the browse operation to current map.Certainly, the open and close function of measuring ability can be set to portable terminal also, map application was not opened and when receiving the angular velocity of this portable terminal or front-facing camera preview image, was then abandoned voluntarily this moment, was not processed.
Below in conjunction with concrete application scenarios, technical scheme of the present invention is done further detailed elaboration.
As shown in Figure 2, the control method of the portable terminal map application that provides for the embodiment of the invention specifically may further comprise the steps:
Step 201, portable terminal produce motion in the space.
Open when the map application of portable terminal, when the user browsed by portable terminal, the user operated this portable terminal according to demand, and this is operating as minute two classes:
1, in the space before its visual field of user (as shown in Figure 5), keep mobile terminal screen over against own eyes, this portable terminal moves up and down.(according to the ergonomics principle, stable in order to have guaranteed one when the people watches article in operation, visual effect clearly, hand, eye, head can automatic synchronizations, the distance of its relative eyes of article that maintenance is watched and the invariant position in the visual field.Therefore, this type of move operation is very natural).At this moment, variation has occured before with respect to movement in the attitude of portable terminal in the space.(towards, luffing angle, angle of inclination).
2, (as shown in Figure 6) keeps mobile terminal screen over against own eyes in the space of user before its visual field, front and back (relative usage person's eyes) mobile this terminal device.At this moment, variation has occured in the distance of space middle distance user eyes in portable terminal.
Step 202, judge whether browse operation pins screen by the user and disabled.
In the use procedure of this application, for guaranteeing that the user can be at the position of the most comfortable browsing information, this application provides the control operation disable function.Only the screen optional position need be pinned, the mobile zoom function of map view can be temporarily forbidden.At this moment, portable terminal attitude and can not trigger the change of displaying contents with the change of user's distance.Particularly, when mobile terminal screen was pinned, map application still read out length and the width of the facial contour that camera detects by call function, and assignment give the variable that sets for after with the length of a upper time point and Width size.
When finger frames out moment, the set of time that the angular velocity that map application is caught last gyro sensor by call function sends to map application is current time (finger frames out moment), and enters step 203, judges the browse operation pattern.
Step 203, judgement browse operation pattern are convergent-divergent or movement.
Because the present invention utilizes portable terminal front-facing camera and gyroscope jointly to finish browse operation to map, mobile in the space of portable terminal can and carry out respective handling by the two common perception, and then can cause browse operation that portable terminal takes and user to expect the situation about not being inconsistent that operates.
For example, when the user moves up and down this portable terminal as shown in Figure 5 in the space, although trick head meeting automatic synchronization, the user is facial still subtle change can to occur with the portable terminal relative position, and this amplitude of variation is greater than the error tolerance, to draw portable terminal and user's eye distance after people's face length that this obtains and width and the contrast of a upper time point length width and become conclusion large or that diminish, therefore portable terminal might with its up and down the position movement operation judges be that the front and back convergent-divergent moves, when the user wants that map carried out position movement, carried out scaled.
For fear of the generation of this situation, need to judge the move operation of portable terminal the user, carry out again afterwards corresponding operating.
Particularly, map application is to constantly judging the gyroscope reading, if the number of times that the angular velocity that gyroscope is passed back drops in a certain preset range continuously reaches preset value, judge that then portable terminal does not move up and down in the space, if have zoom operations this moment, then carry out zoom operations; In case angular velocity surpasses preset range, then counter is made zero, the judgement portable terminal is the operation that moves up and down, and does not carry out zoom operations.
Step 204, front-facing camera obtain preview image, send to map application.
When the map application of portable terminal is opened, in order to catch the preview image of front-facing camera, in this portable terminal front-facing camera is set in advance, when the map application of portable terminal was opened, front-facing camera was opened and is caught the function of preview image and opens with the unlatching of map application.
In this device, the image information that front-facing camera catches is only used as detecting this portable terminal and user's eyes relative distance, can not be presented among the screen.
The front-facing camera that is installed in portable terminal is used for catching preview image, but can't be directly according to the browse operation of this image realization to map, so the front-facing camera preview image that captures need to be sent to map application, make map application carry out subsequent treatment according to this preview image.
Step 205, whether in preview image, detect people's face.
Because the present invention draws mobile device apart from the change information of user's eye distance by the length of people's face and the size of width in the twice front-facing camera preview image in comparison front and back, therefore will at first determine to have user people's face in the front-facing camera and can be identified.
Particularly, map application judges whether to detect people's face and comprises in following two kinds of situations any in preview graph:
When in preview graph, not detecting people's face, forward step 202 to;
When in preview graph, detecting people's face, forward step 206 to;
Step 206 map application is obtained length and the width that detects face.
When map be applied in detect user people's face in the front-facing camera preview image after, read out length and the width of this facial contour by call function, and assignment give the variable that sets for after with the length of a upper time point and Width.
Step 207, map application are resolved length and width, obtain variable in distance information between portable terminal and the user's eyes
The facial contour length of this time obtaining and width that storage is good are compared with facial contour length and width that a upper time point obtains respectively, if this time length and width then are judged to be the Distance Shortened of portable terminal and user's eyes respectively greater than upper time point length and a width; If this time length and width are respectively less than upper time point length and a width, the distance that then is judged to be portable terminal and user's eyes increases.
Because portable terminal in use, may be owing to user's non-active control produce motion (such as hand-held mobile terminal time naturally shake) in the space, and then cause the portable terminal that gets access to and the range information between user's eyes and user to expect inconsistent.This application has adopted certain algorithm to solve this problem.Concrete scheme is as follows:
Usually in these cases, the mobile range of portable terminal is less.Therefore, in order to weaken the impact that brings of shake, distinguish ACTIVE CONTROL and non-active control to portable terminal, with this length that gets access to or width with on a time point length or width carry out the more costly default factor that is positioned at around 1 that multiply by of size.Preferably, this factor is preset as 0.999 and 1.001.That is: when width last time less than this width multiply by 0.999 and last time length less than this length; Perhaps last time width less than this width and last time length multiply by 0.999 o'clock less than this length, then be judged to be between portable terminal and the user's eyes distance and diminish; When width last time greater than this width multiply by 1.001 and last time length greater than this length; Perhaps last time width greater than this width and last time length multiply by 1.001 o'clock greater than this length, then be judged to be between portable terminal and the user's eyes distance and become large.
After the judging distance change information was finished, the variable that this people's face length of obtaining and width assignment are set to another group was as people's face length and the width storage of a upper time point, for people's face length of obtaining with next time point and Width size.
Because when map application is just opened, four variablees that set (this time length and the width of length and width and a upper time point) initial value is zero, in case user people's face length and width are obtained for the first time, and last time people's face length and width (being initial value zero) will inevitably obtain between portable terminal and the user's eyes apart from the conclusion that diminishes relatively the time.Therefore, occur for fear of this situation, when map is used just unlatching, lineup's face length width data of reading in are directly copied the variable that sets to four simultaneously.
Step 208, obtain the map operation of browsing of coupling.
In map application, there are portable terminal and user's eye distance to become the corresponding relation that diminishes greatly with the different viewing map operation, this corresponding relation for this reason map application sets in advance.
Particularly, map application moves corresponding relation with different viewing operation according to portable terminal to all directions, obtains to move the browse operation that is complementary with portable terminal to all directions and comprise in the following multiple situation any:
If it is large that portable terminal and user's eye distance become, then map is carried out reduction operation centered by the screen display center, be about to the displaying contents length and width and respectively dwindle preset multiple, and will dwindle number of times and add one, amplify number of times and subtract one; If portable terminal and user's eye distance diminish, then map is carried out amplifieroperation centered by screen display, be about to the displaying contents length and width and respectively amplify preset multiple, and will amplify number of times and add one, dwindle number of times and subtract one.
Step 209, judgement are dwindled or whether are amplified number of times less than preset times.
Because portable terminal internal memory and screen size are limited, map might cause the internal memory overflow exception after zooming in or out several times, cause the map application accident to close.Therefore, stop in order to prevent that program is unexpected, optimizing user is experienced, and map application is dwindled number of times to the amplification of current demonstration map and restriction is set to realize that image scaling is set up and down boundary.
Particularly, map application is judged that map dwindles or amplifies number of times and whether is comprised in following two kinds of situations any less than preset times:
When map dwindles or amplify number of times less than preset times, forward step 210 to;
When map dwindles or amplify number of times more than or equal to preset times, forward step to and finish;
The browse operation that is complementary that step 210, execution get access to.
Particularly, for current map, map application is according to the browse operation that its execution is got access to, to realize user's browsing map.
For example: when the browse operation that gets access to when map carried out amplifieroperation, map application is carried out amplifieroperation to current map, makes the user be able to map after the display screen of portable terminal is seen amplification.
Step 211, gyro sensor send to map application with the angular velocity that portable terminal moves.
The gyro sensor that is installed in portable terminal is used for catching the angular velocity on x, two axles of y of portable terminal, but can't directly realize browsing map according to this angular velocity, need to carry out map view according to this angular velocity by map application, so need to the angular velocity map application of the portable terminal that captures, make map application carry out subsequent treatment according to this angular velocity.
Particularly, as shown in Figure 4, portable terminal rotates counterclockwise along its x axle and is positive dirction, obtains angular velocity for just; Portable terminal clockwise rotates along its x axle and obtains angular velocity for negative; Portable terminal clockwise rotates along its y axle and is positive dirction, obtains angular velocity for just; Portable terminal rotates counterclockwise along its y axle and obtains angular velocity for negative.
Step 212, map application are calculated the angular velocity that obtains, and obtain portable terminal attitude change information.
When the user carries out the not disabled move operation of all directions for browsing map to portable terminal, portable terminal is actual to be mobile at a sphere centered by eyes of user, this moves and can cause the portable terminal attitude to change, and namely portable terminal has rotated certain angle along x or y axle.Therefore, for the angular velocity according to this portable terminal obtains the angle that the portable terminal attitude changes, need to resolve the portable terminal x that obtains, the angular velocity on the y axle, obtain the portable terminal angle that attitude changes on x, y axle.
The movement of portable terminal is continuous, it also is continuous that angle changes, therefore, the current angular velocity on x, the y axle multiply by respectively the mobile time (time poor that current time and last gyro sensor send to institute's capture angle speed map application) and can calculate the portable terminal angle that attitude changes on x, y axle respectively.
Particularly, as shown in Figure 7, portable terminal take human eye as the center of circle, when human eye and portable terminal move right as the sphere of radius, portable terminal clockwise rotates a minute angle θ (claiming that angle θ is the angle that the portable terminal attitude changes) along its x axle, therefore constantly 2 angular velocity omega is for negative, and 2 slight gap that institute's capture angle speed sent between time (moment 1) of map application with last gyro sensor are its time dt that moves constantly.
The formula that calculates the angle θ of portable terminal attitude variation is:
θ=ω×dt
As shown in Figure 8, portable terminal take human eye as the center of circle, human eye and portable terminal move up in like manner as the sphere of radius.
Step 213, obtain the map operation of browsing of coupling.
In map application, the portable terminal angle that attitude changes on x, y axle respectively and the corresponding relation of different viewing map operation are arranged, this corresponding relation for this reason map application sets in advance.
Preferably, the corresponding relation of the portable terminal angle that attitude changes on x, y axle respectively and different viewing operation embodies with the form of tabulation, and is as shown in table 1.
The corresponding relation of table 1, the portable terminal angle that attitude changes on x, y axle respectively and different viewing operation
? |
The angle that the portable terminal attitude changes〉0 |
The angle that the portable terminal attitude changes<0 |
The x axle |
Map moves to right |
Map moves to left |
The y axle |
Map moves down |
Move on the map |
Particularly, map application is according to the corresponding relation of the portable terminal angle that attitude changes on x, y axle respectively with the different viewing operation, obtains with the portable terminal browse operation that the angle of attitude variation is complementary on x, y axle respectively to comprise in the following multiple situation any:
When portable terminal take human eye as the center of circle, human eye and portable terminal on the sphere of radius during to left movement, the angle that portable terminal changes in x axle attitude〉0, the browse operation of obtaining is for to carry out right-shift operation to map;
When portable terminal take human eye as the center of circle, when human eye and portable terminal move right as the sphere of radius, the angle that portable terminal changes in x axle attitude<0, the browse operation of obtaining is for to carry out shift left operation to map;
When portable terminal take human eye as the center of circle, when human eye and portable terminal move upward as the sphere of radius, the angle that portable terminal changes in y axle attitude〉0, the browse operation of obtaining is for to move down operation to map;
When portable terminal take human eye as the center of circle, when human eye and portable terminal move downward as the sphere of radius, the angle that portable terminal changes in y axle attitude<0, the browse operation of obtaining is moved operation on map is carried out;
When portable terminal take human eye as the center of circle, human eye and portable terminal during to other directions (upper left, lower-left, upper right, bottom right) motion, then obtain the corresponding browse operation on x, the y diaxon on the sphere of radius.
Map with respect to device screen to the left and right or the distance that moves up and down be that the angle that the portable terminal attitude changes multiply by the wide or high of map.
For example, when portable terminal take human eye as the center of circle, human eye and portable terminal be as the sphere of radius during to upper right motion, if portable terminal is-0.002 in the angle that x axle attitude changes, the angle that changes in y axle attitude is 0.001, obtain the browse operation that matches referring to table 1 according to this portable terminal attitude angle changing, the browse operation of obtaining is moved operation for map is carried out the lower-left, and being moved to the left distance is the wide of 0.002 * map, and moving down distance is the height of 0.001 * map.
Step 214, judge current map for the mobile terminal screen change in location whether less than the screen border threshold value.
The angle calculation map that map application changes according to the portable terminal attitude is with respect to the change information of mobile terminal screen position, thereby realize that the user browses the function of map different piece by mobile this terminal, if portable terminal is always mobile a direction, the rotation of mobile terminal angle constantly increases, as not limited, the map that portable terminal shows can move out screen, affects the user to judgement and the deciphering of current map location, brings harmful effect for user's identification and operation.Preferably, 1/2 place that threshold value makes map boundary line move to screen need be set just can not continue to the opposite direction of equipment moving direction mobile.
Particularly, as shown in Figure 9, when portable terminal take human eye as the center of circle, human eye and portable terminal are to move upward on the sphere of radius, the map content that shows in the screen (grey color part among the figure) opposite direction (downwards) towards this equipment moving direction (making progress) in screen is mobile, if the coboundary that moves to map arrives 1/2 place of screen, the map application judgement exceeds threshold value, continue as upper mobile device this moment, the map content that shows in the screen can't continue mobile in screen downwards, but keep existing invariant position, at this moment, the motion on user's operating equipment other directions of carrying out is unaffected.Reach threshold value if operation causes map to be presented at other directions, processing mode and aforesaid way are in like manner.
The browse operation that is complementary that step 215, execution get access to.
Particularly, for current map, map application is according to the browse operation that its execution is got access to, to realize user's browsing map.
For example: when the browse operation that gets access to when moving right mobile phone operation, map application is mobile to the map content execution opposite direction (left) towards this equipment moving direction (to the right) in screen that shows in the screen, makes the user be seen the content on map right side.