Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
As shown in Figure 1, the present embodiment provides a kind of method of adjusting display frame according to eye, comprises the steps:
S1 identification human eye pupil position;
S2 sets up the position relationship between pupil and the electronic equipment;
S3 adjusts display frame according to described position relationship.
It will be appreciated by those skilled in the art that, when observing the display frame of mobile phone or electronic equipment, when the angle of observing not simultaneously, user's pupil position can change, eyeball can rotate thereupon simultaneously, therefore can judge the angle that the user observes mobile phone or electronic equipment according to the position of user's pupil, adjust display frame according to this angle again, present the stereoscopic picture plane corresponding with this viewing angle, like this, a kind of new 3-D display picture technology not only is provided, has also saved the higher cost that configure hardware spends.
The step of described S1 identification human eye pupil position comprises:
S11 utilizes mobile phone or electronic equipment front-facing camera that user's face is taken, thereby obtains face's picture and face's picture is converted to gray-scale map (Gray Scale Image); Described gray-scale map (Gray Scale Image) refers to the image that represents with gray scale.It will be understood by those skilled in the art that any color in the picture,
All formed by Red Green Blue, if the color of certain point was RGB (R, G, B) originally, so, can pass through following several method, be converted into gray scale: floating-point arithmetic Gray=R*0.3+G*0.59+B*0.11; Integer method Gray=(R*30+G*59+B*11)/100; Displacement method Gray=(R*76+G*151+B*28)〉〉 8; Mean value method Gray=(R+G+B)/3; Only get green Gray=G.After trying to achieve Gray by above-mentioned any method, with the R among the original RGB (R, G, B), G, B is unified to be replaced with Gray, forms new color RGB (Gray, Gray, Gray), and original RGB (R, G, B) has just obtained gray-scale map with its replacement.The process that is converted to gray-scale map owing to face's picture that camera is taken is technological means well known in the art, no longer gives unnecessary details here.
S12 divides the search window in described gray-scale map, calculate the gray-scale value sum of pixels all in each search window; It will be understood by those skilled in the art that described search window is the zone that comprises one or more pixels.
S13 compares the gray-scale value sum of all search boxes, finds out two pixel windows of gray-scale value sum minimum, and the zone of these two pixel windows is identified as pupil position.
It will be appreciated by those skilled in the art that, the gray-scale value sum of all pixels is less in the pixel window, illustrate that the field color of this pixel window is darker, and the color of pupil is the darkest part of face color, as long as thereby find the pixel window with minimum gradation value sum, just determined the position of pupil.
In the step of described S1 identification human eye pupil position, after described S13, also comprise the step that pupil position is confirmed, be specially:
S14 amplifies the area in the zone of determined pixel window among the S13; The quantity of the pixel that the quantity of the pixel that the described pixel window after namely amplifying comprises comprises greater than the described pixel window before amplifying.
The gray-scale value sum of all pixels in the described pixel window after S15 calculating is amplified;
The gray-scale value sum of all pixels compares in the pixel window in the described pixel window before S16 will amplify after the gray-scale value sum of all pixels and the amplification, when the two difference during greater than the threshold value set, judge that the zone of the determined pixel window of S13 is pupil position really; When the difference of the two is less than or equal to the threshold value of setting, judge that the zone of the determined pixel window of S13 is not pupil position, the recognition result of S13 is mistake identification.
It will be appreciated by those skilled in the art that, pupil area is less, if the zone of search window is pupil position, then will search for after the window amplification, the zone of non-pupil can be brought in this search box, but not the gray-scale value difference of pupil region and pupil region is larger, thereby the gray-scale value sum of the search window after causing amplifying has obvious increase before amplifying.Otherwise, if the zone of search window is non-pupil position, then can not cause the obvious increase of gray-scale value sum.It will be understood by those skilled in the art that described threshold value can obtain according to the empirical data of repeated detection and arrange.
Search window after the described amplification is 15 * 15(pixel).
Described S2 sets up the step of the position relationship between pupil and the electronic equipment, comprising:
S21 sets up three-dimensional system of coordinate, and the position coordinates of definite camera in coordinate system;
S22 includes the position of pupil in the described coordinate system in, thereby obtains the position coordinates of pupil;
S23 calculates position relationship between described pupil and the camera according to the position coordinates of the position coordinates of described pupil and described camera.
Described S2 sets up the step of the position relationship between pupil and the electronic equipment, after described S23, also comprises:
S24 is according to the position relationship at camera and display screen center, and the position relationship between pupil and the camera calculates the position relationship at pupil and display screen center.Like this, the effect that desirable display frame is adjusted with the position relationship at pupil and display screen center, 3-D effect is better true to nature.
The step that described S3 adjusts display frame according to described position relationship comprises:
The demonstration data that the S31 inquiry is corresponding with described position relationship; Described demonstration data comprise all or part of in angles of display parameter, display size parameter, hatching effect parameter and the light effects parameter.We take camera can identify perpendicular apart from the eyellipse within the 20cm as example, carry out convergent-divergent and mapping according to certain ratio, here suppose for convenience of description the ratio of 1:10, limit the rotating range of screen-picture in the mobile phone, for example the relative camera of eyes to right rotation 10cm, screen-picture is then to anticlockwise 1cm, and display effect such as Fig. 4 are to shown in Figure 6.
Thereby S32 processes picture according to described demonstration data and obtains the image that is complementary with current described pupil position;
Picture after S33 will process shows.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.