CN105791981A - Method capable of realizing rotation of video frame by preset angle - Google Patents
Method capable of realizing rotation of video frame by preset angle Download PDFInfo
- Publication number
- CN105791981A CN105791981A CN201610128148.2A CN201610128148A CN105791981A CN 105791981 A CN105791981 A CN 105791981A CN 201610128148 A CN201610128148 A CN 201610128148A CN 105791981 A CN105791981 A CN 105791981A
- Authority
- CN
- China
- Prior art keywords
- angle
- rotation
- video
- video data
- playing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 19
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 5
- 230000005484 gravity Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 235000013350 formula milk Nutrition 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440263—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
- H04N21/440272—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA for performing aspect ratio conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/2628—Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The invention discloses a method capable of realizing rotation of a video frame by a preset angle. The method comprises the steps of creating an object SetPlayDirection(angle), wherein the angle represents the rotation angle of the video frame; creating a player object; setting a playing file path; setting a rotation angle, and afterwards starting to play; decoding and acquiring video data; performing data rotation processing on the video data according formulae: x=cos(theta)*x'-sin(theta)*y', y=sin(theta)*x'-cos(theta)*y'; returning video data after rotation; playing the video content after rotation until the user until a user cancels current playing or the video is finished, destroying occupied decoding and memory, and withdrawing playing. The method can realize video frame rotation and video frame playing on condition that the position of playing equipment is unchanged.
Description
Technical field
The present invention relates to video data handling procedure, particularly relate to a kind of method realizing video pictures rotation predetermined angle.
Background technology
In life, it is frequently necessary to shooting videos such as camera, video camera, mobile phones, capture apparatus do not has any mistake during viewing, the most incoming computer, just it is frequently seen video and overturns 90 or 180 degree, its reason is that handheld device itself exists flip-flop mechanism, the direction of rotation of screen is i.e. monitored by gravity sensing device, and then the direction of video playback is set, such as shake-hands grip is clapped with perpendicular, do not see problem in handheld device, but then owing to lacking gravity sensing device after incoming computer, then cannot normally show.
Summary of the invention
The technical problem to be solved in the present invention is, for the deficiencies in the prior art, it is provided that a kind of method realizing video pictures rotation predetermined angle, and then in the case of keeping playback equipment invariant position, it is achieved video pictures is play after rotating.
For solving above-mentioned technical problem, the present invention adopts the following technical scheme that.
A kind of realizing the method that video pictures rotates predetermined angle, it comprises the following steps that step S1, creates an object SetPlayDirection (angle), and wherein, angle represents the angle that video pictures rotates;Step S2, creates player object;Step S3, arranges played file path;Step S4, arranges the anglec of rotation, commences play out afterwards;Step S5, decodes and obtains video data;Step S6, does data rotation by video data according to equation below and processes: x=cos (θ) * x '-sin (θ) * y ';Y=sin (θ) * x '-cos (θ) * y ';Wherein, x and y is the coordinate in the coordinate system before video data conversion, and x ' and y ' is the coordinate in the coordinate system after video data conversion;Step S7, returns the video data after rotation processing;Step S8, plays postrotational video content, until user exits currently playing or video and terminates, destroys decoding, the internal memory taken, exits broadcasting.
Preferably, the angle represented by angle is 0,90,180 or 270.
In the method realizing video pictures rotation predetermined angle disclosed by the invention, by creating object SetPlayDirection (angle), and the anglec of rotation is set, processes formula in conjunction with data rotation, obtain the video data after rotation processing, and this video data is played out.The present invention having the beneficial effects that compared to existing technologies, the present invention is without gravity sensing device, and hardware cost is low, and the present invention can obtain rotating the video pictures play in the case of keeping equipment motionless as required.
Detailed description of the invention
Below in conjunction with embodiment, the present invention is described in more detail.
The invention discloses a kind of method realizing video pictures rotation predetermined angle, it comprises the following steps that
Step S1, creates an object SetPlayDirection (angle), and wherein, angle represents the angle that video pictures rotates;
Step S2, creates player object;
Step S3, arranges played file path;
Step S4, arranges the anglec of rotation, commences play out afterwards;
Step S5, decodes and obtains video data;
Step S6, does data rotation by video data according to equation below and processes:
X=cos (θ) * x '-sin (θ) * y ';
Y=sin (θ) * x '-cos (θ) * y ';
Wherein, x and y is the coordinate in the coordinate system before video data conversion, and x ' and y ' is the coordinate in the coordinate system after video data conversion;
Step S7, returns the video data after rotation processing;
Step S8, plays postrotational video content, until user exits currently playing or video and terminates, destroys decoding, the internal memory taken, exits broadcasting.
As a kind of preferred embodiment, the angle represented by angle is 0,90,180 or 270, and then meets the different demands of user.
In above-mentioned steps S6, as follows to the handling principle of picture spinfunction:
With the central point of picture as the origin of coordinates, it is first the position in coordinate system pixel change in location in the target image, does rotation transformation and obtain the coordinate in a coordinate system before conversion, then the position in picture after being transformed to rotate.Assume the most all to rotate counterclockwise on image θ degree around initial point, then transformation for mula is as follows:
X=x ' cos θ-y ' sin θ
Y=x ' sin θ+y ' cos θ
Wherein (x, y) is original image pixels coordinate, for postrotational coordinate, is then inversely transformed into:
X '=xcos θ+ysin θ
Y '=-xsin θ+ycos θ
It is expressed as follows with matrix:
Wherein, x and y is the coordinate in the coordinate system before video data conversion, and x ' and y ' is the coordinate in the coordinate system after video data conversion, and angle is the angle number rotated counterclockwise.
In the method realizing video pictures rotation predetermined angle disclosed by the invention, by creating object SetPlayDirection (angle), and the anglec of rotation is set, processes formula in conjunction with data rotation, obtain the video data after rotation processing, and this video data is played out.The present invention having the beneficial effects that compared to existing technologies, the present invention is without gravity sensing device, and hardware cost is low, and the present invention can obtain rotating the video pictures play in the case of keeping equipment motionless as required.
The above is preferred embodiment of the present invention, is not limited to the present invention, all amendment, equivalent or improvement etc. made in the technical scope of the present invention, should be included in the range of the present invention protected.
Claims (2)
1. one kind can realize the method that video pictures rotates predetermined angle, it is characterised in that include following step
Rapid:
Step S1, creates an object SetPlayDirection (angle), and wherein, angle represents video pictures
The angle rotated;
Step S2, creates player object;
Step S3, arranges played file path;
Step S4, arranges the anglec of rotation, commences play out afterwards;
Step S5, decodes and obtains video data;
Step S6, does data rotation by video data according to equation below and processes:
X=cos (θ) * x '-sin (θ) * y ';
Y=sin (θ) * x '-cos (θ) * y ';
Wherein, x and y is the coordinate in the coordinate system before video data conversion, and x ' and y ' is that video data becomes
The coordinate in coordinate system after alternatively;
Step S7, returns the video data after rotation processing;
Step S8, plays postrotational video content, until user exits currently playing or video and terminates,
Destroy decoding, the internal memory taken, exit broadcasting.
The method that video pictures rotates predetermined angle can be realized the most as claimed in claim 1, it is characterised in that
Angle represented by angle is 0,90,180 or 270.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610128148.2A CN105791981A (en) | 2016-03-07 | 2016-03-07 | Method capable of realizing rotation of video frame by preset angle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610128148.2A CN105791981A (en) | 2016-03-07 | 2016-03-07 | Method capable of realizing rotation of video frame by preset angle |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105791981A true CN105791981A (en) | 2016-07-20 |
Family
ID=56387142
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610128148.2A Pending CN105791981A (en) | 2016-03-07 | 2016-03-07 | Method capable of realizing rotation of video frame by preset angle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105791981A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10831314B2 (en) | 2016-12-16 | 2020-11-10 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and electronic device for preventing touch button from being false triggered |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101527795A (en) * | 2009-04-13 | 2009-09-09 | 腾讯科技(深圳)有限公司 | Processing method for rotating video in broadcasting, device and system thereof |
US20120218311A1 (en) * | 2000-07-17 | 2012-08-30 | Sony Computer Entertainment Inc. | Program execution system, program execution device and recording medium and computer executable program therefor |
US20130169630A1 (en) * | 2010-09-09 | 2013-07-04 | Sony Corporation | Information processing device, information processing method, and program |
CN103220485A (en) * | 2012-01-18 | 2013-07-24 | 腾讯科技(深圳)有限公司 | Displayed video picture rotating method and system |
CN103377030A (en) * | 2012-04-26 | 2013-10-30 | 华为技术有限公司 | Image rotation control method and device |
-
2016
- 2016-03-07 CN CN201610128148.2A patent/CN105791981A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120218311A1 (en) * | 2000-07-17 | 2012-08-30 | Sony Computer Entertainment Inc. | Program execution system, program execution device and recording medium and computer executable program therefor |
CN101527795A (en) * | 2009-04-13 | 2009-09-09 | 腾讯科技(深圳)有限公司 | Processing method for rotating video in broadcasting, device and system thereof |
US20130169630A1 (en) * | 2010-09-09 | 2013-07-04 | Sony Corporation | Information processing device, information processing method, and program |
CN103220485A (en) * | 2012-01-18 | 2013-07-24 | 腾讯科技(深圳)有限公司 | Displayed video picture rotating method and system |
CN103377030A (en) * | 2012-04-26 | 2013-10-30 | 华为技术有限公司 | Image rotation control method and device |
Non-Patent Citations (1)
Title |
---|
徐飞: "基于FPGA的视频图像旋转的设计与实现", 《信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10831314B2 (en) | 2016-12-16 | 2020-11-10 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and electronic device for preventing touch button from being false triggered |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9973722B2 (en) | Systems, devices and methods for displaying pictures in a picture | |
US9600723B1 (en) | Systems and methods for attention localization using a first-person point-of-view device | |
US20210067758A1 (en) | Method and apparatus for processing virtual reality image | |
US11303814B2 (en) | Systems and methods for controlling a field of view | |
CN107734244B (en) | Panorama movie playback method and playing device | |
US10846535B2 (en) | Virtual reality causal summary content | |
JP2016525317A5 (en) | ||
TW201520827A (en) | System and method of providing augmented reality effect for multi-media data | |
US20080291488A1 (en) | Image processing apparatus | |
CN105791981A (en) | Method capable of realizing rotation of video frame by preset angle | |
JP2019503612A (en) | Method and apparatus for controlling the aiming direction of dissociated cameras | |
CN104331241A (en) | Panoramic interaction mobile terminal displaying system and method | |
US20180109723A1 (en) | Information processing device, information processing method, and program | |
US10778891B2 (en) | Panoramic portals for connecting remote spaces | |
WO2017092261A1 (en) | Camera module, mobile terminal, and image shooting method and apparatus therefor | |
US9904355B2 (en) | Display method, image capturing method and electronic device | |
US10692172B2 (en) | Method of plane tracking | |
CN113630624B (en) | Panoramic video scrambling and descrambling method, device, system and storage medium | |
CN113223185B (en) | Image processing method and device, electronic equipment and storage medium | |
US10419666B1 (en) | Multiple camera panoramic images | |
US8553986B2 (en) | Method for processing image and system processing the same | |
TWM439186U (en) | Automatic tracking and focus spherical lens device | |
CN106791785A (en) | A kind of camera head and mobile terminal | |
TWI726577B (en) | Electronic device | |
US8238668B2 (en) | Method for controlling electronic device and electronic device thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160720 |