Specific embodiment
With reference to the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground description, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.Based on this
Inventive embodiment, the every other enforcement obtained under the premise of creative work is not made by those of ordinary skill in the art
Example, belongs to protection scope of the present invention.
In the embodiment of the present invention, can be by way of the view data to gathering when shooting be modified, it is ensured that adopt
The corresponding video of view data of collection or picture can remain correct view direction when playing or browse.
The processing method of a kind of collection view data provided in an embodiment of the present invention, as shown in Fig. 2 can include:
Step 21, the view data of acquisition collection, and image capture device gather the inclination angle during view data, phase
The view data answered can be video or picture;
Step 22, according to view data travel direction adjustment of the inclination angle to gathering, the view data after adjustment exists
Direction during output display is vertical positive;
In this step, the processing mode for adjusting to the view data travel direction of the collection can be using following any
A kind of processing mode:
Mode one:According to the inclination angle for obtaining, the view data to gathering carries out rotation processing, so as to by picture number
According to the direction for rotating to vertical forward direction, that is, after rotating, ensure that the corresponding video pictures of view data for exporting or picture are vertically
It is positive;Afterwards, size cutting process is carried out to postrotational view data also, meets predetermined in order to corresponding view data
Show size requirements;
Mode two:According to the inclination angle for obtaining, using computer graphicss polygon clipping technology, along inclination angle
Direction to gather view data carry out size cutting process, it is assumed that inclination angle be a degree, then it is polygon using computer graphicss
Shape tailoring technique, carries out cutting to the view data for gathering along the direction for inclining a degree;Wherein, corresponding computer graphicss
Polygon clipping technology includes:The process of the view data rearrangement after processing to size cutting, by the image after cutting
Data assignment is vertical positive view data, i.e., carry out chi to view data using computer graphicss polygon clipping technology
After very little cutting is processed, the vertical positive view data after cutting just can be obtained.
Specifically, corresponding size cutting processes the size determination of view data that both can be predetermined according to collection
View data carries out the size of cutting, or, it is also possible to according to the size at the most narrow place of the corresponding image of view data of collection
It is determined that the view data to gathering carries out the size of cutting, or, can be to determine in the way of predetermined to collection according to other
View data carries out the size of cutting, to process the picture number that desired size can be obtained on the premise of performing in guarantee cutting
According to.
Further, the view data after adjustment can also be preserved.
View data after the process of above-mentioned steps 22 will be shown with vertical positive direction during output display
In display screen, so as to facilitate user to watch;And, the adjustment processing procedure of whole image data is to be automatically performed, without the need for people
Work is participated in, and facilitates user's application image collecting device, improves the application experience of user.
Alternatively, the embodiment of the present invention can also include during concrete application:View data travel direction is being adjusted
Before whole, judge whether adjustment function in direction opens, and only just touch described to picture number when direction adjustment function is opened
According to the process that travel direction is adjusted.I.e. when user wishes to adjust view data travel direction according to the inclination angle, then open
The direction adjusts function, otherwise, closes direction adjustment function.
Further, for ease of the view data of user's preview collection during collection view data, then the method
Can also can include including the processing procedure of the view data gathered described in preview, the process:
(1)According to inclination angle residing during image capture device collection respective image data, will obtain through step 22 process
View data after the adjustment for obtaining carries out rightabout rotation processing, that is, reversely rotate the number of degrees value at the inclination angle, it is assumed that
Inclination angle is a degree, then reversely rotate a degree(Or rotation-a degree);
(2)According to the size of the display screen of image capture device, size adjusting is carried out to the view data after rotation processing,
Can match with the size of the effective display area domain in display screen in order to corresponding view data, it is ensured that optimal preview shows
Show effect;
Specifically the catercorner length of view data corresponding picture can be adjusted to less than or equal to image capture device
Display screen the most narrow place in viewing area size;
(3)Show through step(2)Size adjusting after view data.
The technical scheme provided by the embodiments of the present invention, can solve when electronic equipment shoots because inclining or being inverted
Cause the video for shooting or photo that the problem for inclining even reversion is produced when playing or browse.I.e. by shoot video or
The view data such as photo are modified process, to ensure that the view data such as video or photo can be protected all the time when playing or browse
The direction of vertical forward direction is held, is easy to user to face corresponding video or photo.And, in the shooting preview stage, by above-mentioned side
The process of case can also be shown with same effect.
Electronic equipment in the embodiment of the present invention(That is image capture device)Can be, but not limited to for mobile phone, panel computer,
Camera or video camera, etc..
For ease of understand, below in conjunction with accompanying drawing, using mobile phone as image capture device as a example by, to the embodiment of the present invention make
Further describe in detail.
The application scenarios of the embodiment as shown in the dotted line above section in Fig. 3, i.e. catch by mobile phone photographic head in inclination angle a
The view data of an image frame is obtained, the display of view data view data in the case of unprocessed in Fig. 3, is given
Effect, and display effect during mobile phone preview.
In this embodiment, the process processed to the view data for gathering by mobile phone is still as shown in figure 3, can specifically wrap
Include following steps:
Step 31, opens gravity synchronizing function(I.e. direction adjusts function), in order to be able to triggering performs follow-up image
The direction adjustment processing procedure of data;
During shooting, corresponding gravity synchronizing function can be turned on and off, and control whether to perform subsequently to facilitate
Processing procedure is adjusted to corresponding view data, i.e., the embodiment of the present invention can be used as a selectable functions(Open
Or close), to facilitate user flexibility to choose whether application, with very strong practicality;
That is, user can selectively turn on according to the needs of oneself or close gravity synchronizing function:User is such as
Fruit opens gravity synchronizing function and is shot, and such as shoots concert or claps when walking in the street, then without having to worry about regarding for shooting
Frequently inclined problem, when online friend's viewing is uploaded in online video, also will not to incline indefinite and left and right even askew because of video
Head goes to appreciate;If user wishes to shoot personalized inclined image, can select to close the gravity synchronizing function, this
Sample, for the view data of collection, just will not go to be modified process again;
Step 32, detection mobile phone inclination angle in shooting process;
Specifically, the gravity optimized algorithm that can be arranged in adopting mobile phone(Gravity sensing function)Gravitational cue is obtained, with
Ensure precision and the sensitivity of gravitational cue, then calculated when relative mobile phone is just put on gravity direction according to gravitational cue
Mobile phone inclines deflecting angle(I.e. image capture device is relative to the positive inclination angle of gravity)A, namely detection determination photographic head and original
Deflecting angle a for having gravity positive;
Specifically, the inclination angle of mobile phone, example can be calculated according to the output detection of the gravity sensor being arranged in mobile phone
Such as, the acceleration caused due to gravity is measured by gravity sensor, just can calculates and be provided with setting for the gravity sensor
Standby angle of inclination with respect to the horizontal plane.
Step 33, shooting the corresponding image frame of view data for obtaining to mobile phone carries out cutting process;
Specifically, the cutting processing mode in the step can include:
First, on the basis of the mobile phone that detection is obtained inclines deflecting angle a, according to set preview the ratio of width to height, catching
The picture data for obtaining(That is view data)Area forms an inclined rectangular area, and the portrait on the right side of step 33 in such as Fig. 3 shows
Show shown in picture;During cutting rectangular area is calculated, rectangular area catercorner length is at least less than view data pair
The image answered(Picture)Most narrow place, rotated in order to mobile phone at any angle, can be carried out correct to view data
Carry out cutting process;
Then, using the inclined rectangular area of Polygon clipping technical basis in computer graphicss to collection
View data carries out trimming operation, and updates the feature and attribute of the view data after cutting, the i.e. data of more new image data
The marks such as Format Type, size and time or information, are that the view data after cutting determines corresponding feature and attribute;
Include to inclined square during cutting being carried out to the view data for gathering using computer graphicss polygon clipping technology
The rearrangement of the view data in shape region is processed, to obtain the view data of vertical forward direction, i.e.,:Obtain inclined rectangle region
Data in domain rearrangement are to new buffer(Caching)In(The process of rearrangement is equivalent to revolving to view data
The processing procedure for turning, to obtain the view data of vertical forward direction, the i.e. positive image frame of gravity), and after updating rearrangement
The feature and attribute of view data(I.e. the mark such as the type of data format of more new image data, size and time or information, attach most importance to
View data after new arrangement determines corresponding feature and attribute), so as to obtain when playing or browse it is required
Positive image frame on gravity direction;
In above-mentioned processing procedure, corresponding rearrangement is processed can specifically be included:According to the inclination angle for calculating, and
Inclined rectangular region, by the view data of rectangular area by as being mutually mapped in new data field, i.e., with each pixel one by one
Data are that unit the position calculation of procession accesses corresponding pixel data to the respective offsets in new buffer one by one
Place, so as to each pixel in inclined rectangular region is respectively arranged in vertical positive rectangular area, and rearrangement is obtained
View data in the vertical positive rectangular area for obtaining rotates above-mentioned inclination angle equivalent to the view data in inclined rectangular region
Number of degrees value after the view data that obtains.
Step 34, stores the view data after cutting is processed;
Directly the view data and characteristic attribute information after the cutting obtained in step 33 is carried out and normally storage side
Method identical mode is stored.
Further, in order to be able to the preview effect that the realization in mobile phone is synchronous with the view data for being stored, the embodiment
In also need to perform following process, including:
Step 35, the positive image frame of the gravity for obtaining before is rotated, and the anglec of rotation is-a, to obtain during preview
The positive image frame on gravity direction;
Step 36, zooms in and out adjustment in proportion, to adapt to the size of display screen;
I.e. the step is the adaptation processing for carrying out with display screen by image frame positive on above-mentioned gravity direction, for example, one
The picture for opening 1920X1080 is if desired completely displayed on the display screen of 800X480, then need to be scaled accordingly(Fit
Match somebody with somebody)Process;
Specifically, the foundation for adjusting in the step can be, on the premise of proportional, to make picture catercorner length little
In or equal to the most narrow place of mobile phone screen effective display area domain, arbitrarily rotated in order to mobile phone, image all can be in mobile phone
Display image preview effect that can be correctly complete on screen
Step 37, the image frame after scaling adjustment and processing is shown on display screen, to realize drawing for a frame
The preview in face is processed.
By the process of the embodiment, for the video or photo of mobile phone shooting is when playing or browse, no matter shooting
Whether Shi Shouji is positive on gravity direction to be placed, can be when showing, it is ensured that corresponding video or photographic scale and picture
All in the positive state of gravity.For example, referring to shown in Fig. 4, Fig. 4 be when mobile phone be initially it is horizontal proceed by shooting when,
Midway carries out effect diagram when video tilting or that rotation is captured is played on computers, the small arrow in Fig. 4 to mobile phone
The left side is mobile phone captured in real-time, is the corresponding picture on computer monitor during broadcasting on the right of small arrow, and big arrow is then handss
The process that machine direction changes is indicated.And, by the embodiment can also ensure store view data show when with
Display effect during the preview view data is consistent.
It should be noted that in the Shi Lizhong, both can be clapped using existing gravity sensing function in mobile phone and photographic head
According to or camera function, it is also possible in advance specially corresponding gravity sensing function is set in mobile phone and photographic head is taken pictures or images work(
Can, to apply in the embodiment of the present invention.According to former mode, then the software work(that the embodiment of the present invention can only to mobile phone
Can be expanded, to reduce realizing the cost of the embodiment of the present invention.
The process that is applied to of the embodiment of the present invention is illustrated only by taking mobile phone as an example, but this is not constituted to this later
Bright restriction.The embodiment of the present invention can also be applied to other electronic equipments comprising shoot function.
One of ordinary skill in the art will appreciate that all or part of flow process in realizing above-described embodiment method, can be
Instruct related hardware to complete by computer program, described program can be stored in a computer read/write memory medium
In, the program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic
Dish, CD, read-only memory(Read-Only Memory, ROM)Or random access memory(Random Access
Memory, RAM)Deng.
The embodiment of the present invention additionally provides a kind of processing meanss of collection view data, and which implements structure such as Fig. 5 institutes
Show, can include with lower module:
Image data acquisition module 51, for obtaining the view data of collection;
Inclination angle detection module 52, gathers the inclination angle during view data for detection image collecting device;
View data direction adjusting module 53, for detecting the inclination angle pair for obtaining according to the inclination angle detection module 52
The view data travel direction adjustment of the collection that described image data acquisition module 51 is obtained, the view data after adjustment is in output
Direction during display is vertical positive.
Alternatively, memory module 54 can also be included in the apparatus, for preserving described image data direction adjustment mould
View data after the adjustment of block 53.
Specifically, corresponding inclination angle detection module 52 can include:
Gravitational cue acquisition module 521, obtains gravitational cue for the gravity sensing function by arranging;
Tilt angle calculation module 522, the gravitational cue for being obtained according to the gravitational cue acquisition module 521 are calculated
Image capture device is relative to the positive inclination angle of gravity.
Alternatively, the device can also include gravity sensor, and the gravitational cue acquisition module 521 by described heavy
Force transducer obtains gravitational cue.
Further, it is whether the view data direction adjusting module controlled in the device is adjusted to view data travel direction
It is whole, can also include with lower module in the apparatus:
Whether direction adjusts functional control module 55, open for setting direction adjustment function, set in order to image acquisition
Standby user can easily choose whether the view data using the view data direction adjusting module in the device to collection
Travel direction adjustment is processed;
Judge module 56, for before to the adjustment of view data travel direction, judging the direction adjustment function control
Whether the direction adjustment function that module 55 is arranged opens, and only just triggers described image when direction adjustment function is opened
The process that data direction adjusting module is adjusted to view data travel direction.
Wherein, the processing mode adopted by corresponding view data direction adjusting module 53 can include following any one
Kind:
Mode one:According to the inclination angle for obtaining, the view data to gathering carries out rotation processing, and to postrotational
View data carries out size cutting process;
Mode two:According to the inclination angle for obtaining, using computer graphicss polygon clipping technology, along inclination angle
Direction to gather view data carry out size cutting process, the computer graphicss polygon clipping technology is included to chi
The arrangement of the view data after very little cutting process is adjusted, to obtain the view data of vertical forward direction.
Further, the size cutting for adopting in the view data direction adjusting module 53 processes and can be, but not limited to include:
Determined according to the size of predetermined view data carries out the size of cutting to the view data for gathering, or, according to the figure of collection
As the size at the most narrow place of the corresponding image of data determines the size that cutting is carried out to the view data for gathering.
Furthermore, preview is carried out to the view data for gathering for the ease of user, then the device can also include:
Preview image rotary module 57, for detecting the inclination angle for obtaining according to inclination angle detection module 52, direction is adjusted
Rightabout of the view data after the adjustment of whole functional control module 53 along inclination angle rotates the number of degrees value at the inclination angle, so as to
In the corresponding picture of view data that vertical forward direction is shown in inclined display screen;
Zoom module 58, for the size of the display screen according to image capture device, to the preview image rotary module
View data after 57 rotation processing carries out size adjusting, can be with effective display of display screen in order to corresponding view data
The size matching in region;The Zoom module 58 can specifically include screen size determining module 581 and size adjustment module
582, wherein, corresponding screen size determining module 581, for determine the display screen of image capture device viewing area most
The size at narrow place;Corresponding size adjustment module 582, for the catercorner length of view data corresponding picture is adjusted to little
In or the viewing area most narrow place of the display screen of image capture device that determines equal to the screen size determining module 581
Size;
Display module 59, for showing that the Zoom module 58 carries out the view data after size adjusting.
By the device embodiment, the view data such as the video shot for electronic equipment or photo is being played or is being browsed
When, no matter when shooting, whether electronic equipment is positive on gravity direction places, can be when showing, it is ensured that corresponding video
With the ratio and picture of photo all in the positive state of gravity.And, can also ensure what is stored by the device embodiment
View data show when with the preview view data when display effect it is consistent.
It should be noted that the specific implementation of function realized by each processing unit included in said apparatus exists
Have a detailed description in each embodiment above, therefore repeated no more here.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each function
The division of module is illustrated, and in practical application, can distribute above-mentioned functions by different function moulds as desired
Block is completed, will the internal structure of device be divided into different functional modules, to complete all or part of work(described above
Energy.The specific work process of the device and module of foregoing description, may be referred to the corresponding process in preceding method embodiment, here
Repeat no more.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, which can be passed through
Its mode is realized.For example, device embodiment described above is only schematically, for example division of the module, only
Only a kind of division of logic function, can have other dividing mode when actually realizing, such as multiple module or components can be tied
Close or be desirably integrated into another system, or some features can be ignored, or do not perform.It is another, it is shown or discussed
Coupling each other or direct-coupling or communication connection can be the INDIRECT COUPLINGs by some interfaces, device or module or logical
Letter connection, can be electrical, mechanical or other forms.
The module as separating component explanation can be or may not be it is physically separate, it is aobvious as module
The part for showing can be or may not be physical location, you can local to be located at one, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional module in each embodiment of the invention can with it is integrated in a processor, or
Modules are individually physically present, it is also possible to which two or more modules are integrated in a processor.Above-mentioned integrated place
Reason device both can be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized;Corresponding processor can
Thinking CPU, and the processor needs the function of completing for performing the modules that said apparatus are included.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto,
Any those familiar with the art in the technical scope of present disclosure, the change or replacement that can be readily occurred in,
Should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with the protection model of claims
Enclose and be defined.