Movatterモバイル変換


[0]ホーム

URL:


CN113900568B - Picture rotation method, electronic device and storage medium - Google Patents

Picture rotation method, electronic device and storage medium
Download PDF

Info

Publication number
CN113900568B
CN113900568BCN202111369606.9ACN202111369606ACN113900568BCN 113900568 BCN113900568 BCN 113900568BCN 202111369606 ACN202111369606 ACN 202111369606ACN 113900568 BCN113900568 BCN 113900568B
Authority
CN
China
Prior art keywords
picture
rotation
degrees
deflection
degree
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.)
Active
Application number
CN202111369606.9A
Other languages
Chinese (zh)
Other versions
CN113900568A (en
Inventor
邢波
史丙利
颜霄靖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chuangsheng Shilian Digital Technology Beijing Co Ltd
Original Assignee
Chuangsheng Shilian Digital Technology Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chuangsheng Shilian Digital Technology Beijing Co LtdfiledCriticalChuangsheng Shilian Digital Technology Beijing Co Ltd
Priority to CN202111369606.9ApriorityCriticalpatent/CN113900568B/en
Publication of CN113900568ApublicationCriticalpatent/CN113900568A/en
Application grantedgrantedCritical
Publication of CN113900568BpublicationCriticalpatent/CN113900568B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

According to the picture rotating method, the electronic equipment and the storage medium, a current picture is displayed in a picture display area of a user interface, and the picture display area is rectangular in shape; detecting user operation, and acquiring deflection degrees and rotation degrees, wherein the deflection degrees and the rotation degrees are respectively composed of a numerical value and a sign, the numerical value is integral multiple of 90 degrees, the sign is determined in such a way that the degree rotating clockwise is positive, and the degree rotating anticlockwise is negative; adding the deflection degree and the rotation degree to obtain a final deflection value; according to the final deflection value, the size and the angle of the picture to be drawn after the current picture is deflected are stored in a four-dimensional vector matrix; and drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix. By the picture rotation method, the picture angle is adjusted under the condition that hardware equipment is not adjusted, so that the risk of damage caused by adjusting the hardware equipment is reduced, and meanwhile, the picture adjusting efficiency is improved.

Description

Picture rotation method, electronic device and storage medium
Technical Field
The embodiment of the application relates to the technical field of electronic information, in particular to a picture rotation method, electronic equipment and a storage medium thereof.
Background
Currently, live broadcast activities are becoming more and more common in people's daily lives. However, in the existing live broadcast platform, when a user performs live broadcast, all pictures can only be fixed in one direction, if pictures or abnormal angles appear in the pictures in the live broadcast process, the viewing of viewers is affected, however, at this time, the user cannot perform angle adjustment on the content of the pictures, and can only select to adjust the live broadcast equipment, so that the angle of the live broadcast picture becomes the angle required by the user, thus the inconvenience of the user in adjustment is caused, and the problems of equipment damage in the adjustment process, and the like are also likely to occur.
Disclosure of Invention
In view of the above, an embodiment of the present application provides a method for rotating a frame and an electronic device, so as to at least partially solve the above-mentioned problems.
According to a first aspect of an embodiment of the present application, there is provided a picture rotation method, including:
a current picture displayed in a picture display area of the user interface, wherein the picture display area is rectangular in shape; ;
Detecting user operation, and acquiring deflection degrees and rotation degrees, wherein the deflection degrees and the rotation degrees are respectively composed of a numerical value and a sign, the numerical value is integral multiple of 90 degrees, the sign is determined in such a way that the degree rotating clockwise is positive, and the degree rotating anticlockwise is negative;
adding the deflection degree and the rotation degree to obtain a final deflection value;
According to the final deflection value, the size and the angle of the picture to be drawn after the current picture is deflected are stored in a four-dimensional vector matrix;
And drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix.
Optionally, the user interface further comprises a management menu area; detecting a user operation includes detecting a user operation of a user in a screen display area or a management menu area.
Optionally, detecting the user operation includes detecting a user operation on a touch pad corresponding to the screen display area or the management menu area.
Optionally, detecting a user operation, obtaining a deflection degree and a rotation degree, including detecting a user operation; acquiring deflection degrees of a current picture according to user operation, and displaying a menu bar, wherein the menu bar is used for providing options of rotation degrees; the degree of rotation is acquired in response to a selection operation by the user.
Optionally, the menu bar provides options for degrees of rotation including 90 degrees clockwise, 90 degrees counterclockwise, 180 degrees, mirror; and responding to the selection operation of the user in the menu bar, and acquiring the rotation degree in the menu bar corresponding to the selection operation.
According to a second aspect of an embodiment of the present application, there is provided an electronic device including:
the interface display module is used for displaying the current picture and the rotated picture;
The detection module is used for detecting user operation;
the acquisition module is used for acquiring the deflection degree of the current picture and rotating the current picture into the rotation degree of the picture required by the user;
the processing module is used for adding the deflection degree and the rotation degree to obtain a final deflection value, and storing the size and the angle of the picture to be drawn after the deflection of the current picture into a four-dimensional vector matrix according to the final deflection value;
And the output module is used for drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix.
Optionally, the acquiring module is further configured to acquire a deflection degree of the current picture according to the user operation, and display a menu bar, where the menu bar is used for providing an option of a rotation degree; and responding to the selection operation of the user, and acquiring the rotation degree.
Optionally, the interface display module includes a screen display area and a management menu area, and the detecting the user operation includes detecting the user operation of the user in the screen display area or the management menu area.
According to a third aspect of embodiments of the present application, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the picture rotation method as claimed in any one of claims 1 to 5.
According to a fourth aspect of embodiments of the present application, there is provided a computer program product comprising computer instructions that instruct a computing device to perform operations corresponding to the picture rotation method as claimed in any one of claims 1 to 5.
According to the picture rotating method, the electronic equipment and the storage medium, a current picture is displayed in a picture display area of a user interface, and the picture display area is rectangular; detecting user operation, and acquiring deflection degrees and rotation degrees of a current picture, wherein the deflection degrees and the rotation degrees are respectively composed of a numerical value and a sign, the numerical value is integral multiple of 90 degrees, the sign is determined in such a way that the degree of rotation in the clockwise direction is positive, and the degree of rotation in the anticlockwise direction is negative; adding the deflection degree and the rotation degree to obtain a final deflection value; according to the final deflection value, the size and the angle of the picture to be drawn after the current picture is deflected are stored in a four-dimensional vector matrix; and drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix. By the picture rotation method, the picture angle is adjusted under the condition that hardware equipment is not adjusted, so that the risk of damage caused by adjusting the hardware equipment is reduced, and meanwhile, the picture adjusting efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a flowchart of a frame rotation method according to an embodiment of the present application
FIG. 2 is a block diagram of an electronic device according to the present application;
fig. 3 is a schematic diagram of a user interface of an electronic device according to the present application.
Detailed Description
In order to better understand the technical solutions in the embodiments of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the present application, shall fall within the scope of protection of the embodiments of the present application.
The implementation of the embodiments of the present application will be further described below with reference to the accompanying drawings.
Embodiment 1,
An embodiment of the present application provides a method for rotating a frame, referring to fig. 1, the method includes:
S101, displaying a current picture in a picture display area of a user interface.
Specifically, the shape of the screen display area is rectangular, the deflection degree of the current screen is determined according to the current screen displayed by the user interface, and the rotation degree of the current screen to the screen required by the user is determined based on the deflection degree of the current screen. The current picture displayed according to the user interface can determine the deflection degree of the current picture which is deflected clockwise or anticlockwise on the basis of the normal picture, for example, the deflection degree of the current picture is deflected 90 degrees clockwise, and when the current picture needs to be rotated to be the normal picture, the rotation degree of the picture which is rotated to be the user needs to be rotated 90 degrees anticlockwise according to the deflection degree of the current picture.
S102, detecting user operation, and acquiring deflection degrees and rotation degrees of a current picture.
It should be noted that, the deflection degree and the rotation degree are both composed of a number and a symbol, the number is an integer multiple of 90 degrees, for example, the number of the deflection degree and the rotation degree may be 90 degrees, 180 degrees or 270 degrees, and the symbol determining method is as follows: the degree of rotation in the clockwise direction is positive and the degree of rotation in the counterclockwise direction is negative, for example, the degree of deflection is 90 degrees clockwise, i.e., the degree of deflection is 90 degrees, and the degree of rotation is 90 degrees counterclockwise. I.e., the degree of rotation is minus 90 degrees, which can be expressed as-90 degrees.
Optionally, the user interface may further include a management menu area, where the picture display area may display a current picture and a rotated picture, and the management menu area may display options available for user operation, for example, when there are multiple cameras shooting pictures, the user may select different cameras to obtain pictures shot by different cameras, and detect user operations of the user in the picture display area or the management menu area, so that the user operations are more convenient and the operation modes are more diversified. Options for user operation are for example: right-clicking with a mouse at the screen display area or right-clicking with a mouse at a camera option selected in the management menu area.
Alternatively, detecting the user operation may be detecting the operation of the user on the touch panel corresponding to the screen display area or the management menu area. Specifically, the display screen may be a touch screen, and the user may perform an operation by making a touch screen click in a screen display area or a management menu area. The screen rotation operation of the embodiment is suitable for touch screen operation, and user operation can be simpler and more convenient.
Optionally, detecting a user operation, obtaining a deflection degree and a rotation degree, including detecting a user operation; displaying a menu bar according to the acquired deflection degree of the current picture, wherein the menu bar is used for providing options of rotation degree; the degree of rotation is acquired in response to a selection operation by the user.
Specifically, the user operation may be right clicking the camera corresponding to the current picture in the picture display area or the management menu area with the mouse, and obtaining the deflection degree of the current picture according to the obtained handle of the current picture. The menu bar displayed may include a degree of rotation option, such as a 90 degree rotation clockwise, a 90 degree rotation counter-clockwise, a 180 degree rotation, a mirror image, etc., and may include other user operable options, such as a delete option for deleting a current picture, a rename option for changing a name of a current picture, an option for moving a position of a current picture, such as move up, move down, move to the top, move to the bottom, etc., an adaptive screen option for changing a size of a picture, and an attribute option that may change an attribute of a picture. The menu bar is used for providing the option of the rotation degree, so that the user operation is more convenient, and the user operation experience is improved.
In this embodiment, there are various methods for obtaining the handle of the picture, for example, using FindWindow function, using EnumWindows and EnumChildWindows functions and opposite callback functions EnumWindowsProc and EnumChildWindowsProc to obtain the handle of all top-level pictures and the handles of their sub-pictures, and using GetDesktopWindow and GetNextWindow functions to obtain the handle of the picture.
S103, obtaining a final deflection value according to the deflection degrees and the rotation degrees.
Specifically, the calculation method of the final deflection value is as follows: final deflection value=deflection degree+rotation degree, for example, deflection degree is 90 degrees clockwise and rotation degree is 90 degrees counterclockwise, then final deflection value=90 degrees clockwise+90 degrees counterclockwise+90 degrees+ (-90 degrees) =0 degrees, i.e., final deflection value is 0 degrees. The final deflection value is a deflection value with respect to a picture having a deflection degree of 0 degrees, that is, if the final deflection value is 0 degrees, it means that the deflected picture is a picture having a deflection degree of 0 degrees, that is, a normal picture.
And S104, according to the final deflection value, saving the size and the angle of the picture to be drawn after the deflection of the current picture into a four-dimensional vector matrix.
Specifically, the final deflection value is set in the picture attribute, and the size and angle of the current picture to be drawn are saved in a four-dimensional vector Matrix through a Matrix4 interface. Matrix4 is a method library providing 4*4 Matrix operations of WebGL, and the size and angle of the current picture to be drawn can be processed through functions in Matrix4 and the result can be saved. For example, the size and angle to be drawn of the current picture can be initialized to a unit array through SETIDENTITY () function, scaling transformation is performed by setScale (x, y, z) function, translational rotation transformation is performed for a plurality of times by SETTRANSLATE (x, y, z) function and rotation (angle, x, y, z) function, and then the result is stored in Matrix 4.
S105, drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix.
Specifically, the method of drawing a picture according to the size and angle of the picture in the four-dimensional vector matrix may be to use a projection matrix, such as orthogonal projection and perspective projection, wherein the orthogonal projection is a projection perspective projection in which a projection line is perpendicular to a projection plane, belonging to a center projection. A perspective projection view is a graph obtained by projecting an object from a certain projection center onto a single projection surface.
According to the picture rotating method, a current picture is displayed in a picture display area of a user interface, and the picture display area is rectangular; detecting user operation, and acquiring deflection degrees and rotation degrees, wherein the deflection degrees and the rotation degrees are respectively composed of a numerical value and a sign, the numerical value is integral multiple of 90 degrees, the sign is determined in such a way that the degree rotating clockwise is positive, and the degree rotating anticlockwise is negative; adding the deflection degree and the rotation degree to obtain a final deflection value; according to the final deflection value, the size and the angle of the picture to be drawn after the current picture is deflected are stored in a four-dimensional vector matrix; and drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix. By the picture rotation method, the picture angle is adjusted under the condition that hardware equipment is not adjusted, so that the risk of damage caused by adjusting the hardware equipment is reduced, and meanwhile, the picture adjusting efficiency is improved.
Embodiment II,
In combination with the method for rotating a frame described in the above embodiment, a second embodiment of the present application provides an electronic device for executing any one of the methods for rotating a frame described in the first embodiment.
Referring to fig. 2, the data processing apparatus 20 includes:
An interface display module 201 for displaying a current picture and a rotated picture;
a detection module 202 for detecting a user operation;
An obtaining module 203, configured to obtain a deflection degree of a current picture and a rotation degree of a picture required by a user;
The processing module 204 is configured to add the deflection degree and the rotation degree to obtain a final deflection value, and store the size and the angle of the picture to be drawn after the current picture is deflected into a four-dimensional vector matrix according to the final deflection value;
And the output module 205 is used for drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix.
Optionally, the acquiring module is further configured to acquire a deflection degree of the current picture according to the user operation, and display a menu bar, where the menu bar is used for providing an option of a rotation degree; and responding to the selection operation of the user, and acquiring the rotation degree.
Optionally, the interface display module includes a screen display area and a management menu area, and the detecting the user operation includes detecting the user operation of the user in the screen display area or the management menu area.
Alternatively, referring to fig. 3, the interface display module 201 may include a screen display area, a management menu area, a comment display area, a transmission information area, and a multimedia operation area, and a user's rotation screen operation may be performed in any one of the screen display area and the management menu area, the multimedia operation area including microphone and speaker volume adjustment buttons, start/end buttons, and the like.
The application embodiment also provides a computer storage medium having stored thereon a computer program which when executed by a processor implements the above-described screen rotation method.
Embodiments of the present application also provide a computer program product comprising computer instructions that instruct a computing device to perform operations corresponding to the picture rotation method as claimed in any one of claims 1 to 5.
According to the electronic equipment provided by the embodiment of the application, the current picture is displayed in the picture display area of the user interface, and the picture display area is rectangular in shape; detecting user operation, and acquiring deflection degrees and rotation degrees, wherein the deflection degrees and the rotation degrees are respectively composed of a numerical value and a sign, the numerical value is integral multiple of 90 degrees, the sign is determined in such a way that the degree rotating clockwise is positive, and the degree rotating anticlockwise is negative; adding the deflection degree and the rotation degree to obtain a final deflection value; according to the final deflection value, the size and the angle of the picture to be drawn after the current picture is deflected are stored in a four-dimensional vector matrix; and drawing the picture according to the size and the angle of the picture in the four-dimensional vector matrix. By the picture rotation method, the picture angle is adjusted under the condition that hardware equipment is not adjusted, so that the risk of damage caused by adjusting the hardware equipment is reduced, and meanwhile, the picture adjusting efficiency is improved.
It should be noted that, according to implementation requirements, each component/step described in the embodiments of the present application may be split into more components/steps, or two or more components/steps or part of operations of the components/steps may be combined into new components/steps, so as to achieve the objects of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The above embodiments are only for illustrating the embodiments of the present application, but not for limiting the embodiments of the present application, and various changes and modifications may be made by one skilled in the relevant art without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also fall within the scope of the embodiments of the present application, and the scope of the embodiments of the present application should be defined by the claims.

Claims (7)

CN202111369606.9A2021-11-162021-11-16Picture rotation method, electronic device and storage mediumActiveCN113900568B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111369606.9ACN113900568B (en)2021-11-162021-11-16Picture rotation method, electronic device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111369606.9ACN113900568B (en)2021-11-162021-11-16Picture rotation method, electronic device and storage medium

Publications (2)

Publication NumberPublication Date
CN113900568A CN113900568A (en)2022-01-07
CN113900568Btrue CN113900568B (en)2024-09-10

Family

ID=79194794

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111369606.9AActiveCN113900568B (en)2021-11-162021-11-16Picture rotation method, electronic device and storage medium

Country Status (1)

CountryLink
CN (1)CN113900568B (en)

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101815191A (en)*2010-04-242010-08-25中兴通讯股份有限公司Method for regulating display picture by using portable terminal projector and portable terminal
CN102778993A (en)*2011-05-112012-11-14冠捷投资有限公司Remote control scrolling method and system for browsing webpage
CN103176693B (en)*2013-02-182016-02-10联宝(合肥)电子科技有限公司A kind of method of auto-changing terminal screen picture direction and device
WO2014186941A1 (en)*2013-05-202014-11-27华为终端有限公司Screen adjusting method and device based on terminal device
CN106095271A (en)*2013-08-212016-11-09乐视网信息技术(北京)股份有限公司Method of adjustment and the electric terminal of angle play by a kind of file
CN104978116A (en)*2014-04-032015-10-14联想移动通信科技有限公司Video image adjusting method, video image adjusting device and terminal
US10359843B2 (en)*2015-04-012019-07-23Htc CorporationElectronic apparatus and display control method thereof
CN106990897A (en)*2017-03-312017-07-28腾讯科技(深圳)有限公司A kind of interface method of adjustment and device
CN108235090B (en)*2018-01-222021-09-17广州市千钧网络科技有限公司Method and device for adjusting picture angle
CN113573118B (en)*2020-04-282022-04-29海信视像科技股份有限公司Video picture rotating method and display equipment
CN111866275A (en)*2020-07-132020-10-30珠海格力电器股份有限公司Screen adjustment method and device, storage medium and processor
CN112083805A (en)*2020-09-032020-12-15深圳市雷鸟网络传媒有限公司Screen picture self-adaptive adjusting method, device, equipment and storage medium

Also Published As

Publication numberPublication date
CN113900568A (en)2022-01-07

Similar Documents

PublicationPublication DateTitle
US10915998B2 (en)Image processing method and device
US8775953B2 (en)Collage display of image projects
EP2283642B1 (en)Method, apparatus, and computer program product for presenting burst images
CN110012209A (en)Panorama image generation method, device, storage medium and electronic equipment
EP3058451B1 (en)Techniques for navigation among multiple images
US20150110404A1 (en)Automatically suggesting regions for blur kernel estimation
US9615040B2 (en)Determining a maximum inscribed size of a rectangle
EP4287610A1 (en)Focusing method and apparatus, electronic device, and medium
CN114640833B (en)Projection picture adjusting method, device, electronic equipment and storage medium
CN106373139A (en)Image processing method and device
US20150110403A1 (en)Automatically determining the size of a blur kernel
WO2018113339A1 (en)Projection image construction method and device
CN111835972B (en)Shooting method and device and electronic equipment
CN110709813A (en) An image display method, device, PTZ and storage medium
CN114241127B (en) Panoramic image generation method, device, electronic device and medium
CN114092323A (en)Image processing method, image processing device, storage medium and electronic equipment
CN113900568B (en)Picture rotation method, electronic device and storage medium
WO2019196662A1 (en)Local enlargement of image
US20240281186A1 (en)Image display method and apparatus, electronic device, readable storage medium, and chip
CN113905170A (en) Zoom control method, device, storage medium and electronic device
CN112887695A (en)Panorama sharing processing method, system and terminal
CN113271412A (en)Method and equipment for viewing panoramic image
US12273606B2 (en)Device and method for capturing images or video
CN118301285A (en)Image display method, terminal and computer readable storage medium
JP5397245B2 (en) Information processing apparatus and information processing method

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp