CN111988671A - Image processing method and image processing apparatus - Google Patents

Image processing method and image processing apparatus Download PDF

Info

Publication number
CN111988671A
CN111988671A CN202010928633.4A CN202010928633A CN111988671A CN 111988671 A CN111988671 A CN 111988671A CN 202010928633 A CN202010928633 A CN 202010928633A CN 111988671 A CN111988671 A CN 111988671A
Authority
CN
China
Prior art keywords
image
degrees
rotation angle
target image
clockwise
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.)
Granted
Application number
CN202010928633.4A
Other languages
Chinese (zh)
Other versions
CN111988671B (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010928633.4A priority Critical patent/CN111988671B/en
Publication of CN111988671A publication Critical patent/CN111988671A/en
Application granted granted Critical
Publication of CN111988671B publication Critical patent/CN111988671B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • H04N21/4858End-user interface for client configuration for modifying screen layout parameters, e.g. fonts, size of the windows
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Studio Devices (AREA)

Abstract

The present disclosure relates to an image processing method and an image processing apparatus, the image processing method applied to an electronic device, including: acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device; when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image; and coding the target image, and pushing the coded target image to a server. The live image rotating processing method and the live image rotating processing device can achieve automatic rotating processing of the live image according to the rotating angle of the camera device, automatically push the live image after rotating processing, enable a user who carries out network live to achieve rotating processing of the live image in the live process, and therefore enable operation of the live image when rotating processing to be carried out to the live image to be simpler, and enable efficiency of the live image when rotating processing to be carried out to the live image to be higher.

Description

Image processing method and image processing apparatus
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method and an image processing apparatus.
Background
In recent years, the scale of live webcast users has been greatly increased, and live webcasts are gradually applied to various aspects of daily life, such as product marketing, enterprise meetings or large-scale activities.
A user performing network live broadcasting, i.e., a anchor, sometimes rotates a live image and pushes the rotated live image to a server. In the related art, the anchor usually realizes rotation processing of the live image by means of a third-party application program, and specifically, a user needs to introduce the live image into the third-party application program first and then execute a series of operations on an application interface of the third-party application program, which results in tedious operations when the live image is rotated.
Disclosure of Invention
The present disclosure provides an image processing method and an image processing apparatus, which at least solve the problem of complicated operation when rotating a live image in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided an image processing method applied to an electronic device, including:
acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device;
when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image;
and coding the target image, and pushing the coded target image to a server.
Optionally, after the acquiring an original image acquired by the camera device and the acquiring a rotation angle of the camera device, the image processing method further includes:
and when the rotation angle is not in the first preset angle range, encoding the original image, and pushing the encoded original image to the server.
Optionally, the encoding the target image includes:
and when the rotation angle is within a second preset angle range, adjusting a preset encoding resolution, and encoding the target image according to the adjusted encoding resolution, wherein the first preset angle range comprises the second preset angle range.
Optionally, the encoding the target image includes:
and when the rotation angle is not in a second preset angle range, coding the target image according to a preset coding resolution.
Optionally, the first preset angle range includes at least one of: clockwise 90 degrees +/-A, clockwise 180 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A, anticlockwise 180 degrees +/-A and anticlockwise 270 degrees +/-A;
the A is greater than or equal to 0 degrees and less than 45 degrees.
Optionally, when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image, including:
when the rotation angle is clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A or anticlockwise 270 degrees +/-A, performing horizontal-vertical conversion on the original image through rotation to obtain a target image;
and when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A anticlockwise, rotating the original image by 180 degrees to obtain a target image.
Optionally, the acquiring the rotation angle of the image capturing apparatus includes:
when the image pickup device and the electronic equipment are different equipment, rotation information sent by the image pickup device is received, and the rotation information is used for indicating the rotation angle of the image pickup device.
According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus applied to an electronic device, including:
an acquisition unit configured to perform acquisition of an original image captured by an imaging device and acquisition of a rotation angle of the imaging device;
the rotation unit is configured to rotate the original image according to the rotation angle when the rotation angle is in a first preset angle range to obtain a target image;
a first encoding unit configured to perform encoding of the target image;
a first pushing unit configured to perform pushing of the encoded target image to a server.
Optionally, the image processing apparatus further includes:
a second encoding unit configured to perform encoding of the original image when the rotation angle is not in the first preset angle range;
a first pushing unit configured to perform pushing of the encoded original image to the server.
Optionally, the first encoding unit is configured to perform:
and when the rotation angle is within a second preset angle range, adjusting a preset encoding resolution, and encoding the target image according to the adjusted encoding resolution, wherein the first preset angle range comprises the second preset angle range.
Optionally, the first encoding unit is configured to perform:
and when the rotation angle is not in a second preset angle range, coding the target image according to a preset coding resolution.
Optionally, the first preset angle range includes at least one of: clockwise 90 degrees +/-A, clockwise 180 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A, anticlockwise 180 degrees +/-A and anticlockwise 270 degrees +/-A;
the A is greater than or equal to 0 degrees and less than 45 degrees.
Optionally, the rotation unit is configured to perform:
when the rotation angle is clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A or anticlockwise 270 degrees +/-A, performing horizontal-vertical conversion on the original image through rotation to obtain a target image;
and when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A anticlockwise, rotating the original image by 180 degrees to obtain a target image.
Optionally, the obtaining unit is configured to perform:
when the image pickup device and the electronic equipment are different equipment, rotation information sent by the image pickup device is received, and the rotation information is used for indicating the rotation angle of the image pickup device.
According to a third aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the image processing method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an image processing apparatus, enable the image processing apparatus to perform the image processing method of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising: executable instructions which, when run on a computer, enable the computer to perform the image processing method of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
by acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device, when the rotation angle is within a first preset angle range, the original image is rotated according to the rotation angle to obtain a target image, the target image is encoded, and the encoded target image is pushed to a server, so that the live image can be automatically rotated according to the rotation angle of the camera device, and the live image after the rotation processing can be automatically pushed, so that a user performing network live broadcasting can rotate the live image by rotating the camera device in the live broadcasting process without leading the live image into a third-party application program and then executing a series of operations on an application interface of the third-party application program, therefore, the embodiment of the disclosure can simplify the operation when the live image is rotated, and the efficiency of rotating the live image can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating an image processing method according to an exemplary embodiment.
Fig. 2 is a block diagram illustrating an image processing apparatus according to an exemplary embodiment.
Fig. 3 is a block diagram illustrating an image processing apparatus according to an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1 is a flow diagram illustrating an image processing method according to an exemplary embodiment. The image processing method can be applied to electronic equipment, and here, the electronic equipment can be a notebook computer, a desktop computer, a palm computer, a mobile phone, a netbook, a personal digital assistant, or the like.
As shown in fig. 1, the image processing method may include the steps of:
in step S11, an original image captured by a camera is acquired, and a rotation angle of the camera is acquired.
In this embodiment, the camera device may be a camera, or may be a device equipped with a camera. The camera device may be connected to an interface of the electronic device through a data line, or may be connected to the electronic device through a wireless communication module.
The original image may be a landscape screen image or a portrait screen image. Here, the landscape image may be an image having a length greater than a width, for example, an image having an aspect ratio of 16:9, an image having an aspect ratio of 3:2, or an image having an aspect ratio of 4: 3; the portrait screen image may be an image having a length less than a width, for example, an image having an aspect ratio of 9:16, an image having an aspect ratio of 2:3, or an image having an aspect ratio of 3: 4.
The original image acquired by the image capturing device may be an original image acquired by a real-time image capturing device.
The above-mentioned obtaining the rotation angle of the camera device may be obtaining the rotation angle of the camera device in real time; the rotation angle of the imaging device may be acquired when the imaging device is rotated. It should be noted that, if the above-mentioned obtaining of the rotation angle of the image capturing apparatus is obtaining of the rotation angle of the image capturing apparatus when the image capturing apparatus rotates, during the period from the nth (N is a positive integer) time of rotating the image capturing apparatus to the (N + 1) th time of rotating the image capturing apparatus, the rotation angles corresponding to all the original images collected by the image capturing apparatus may all be the rotation angle during the nth time of rotating the image capturing apparatus, and similarly, during the period from the (N + 1) th time of rotating the image capturing apparatus to the (N + 2) th time of rotating the image capturing apparatus, the rotation angles corresponding to all the original images collected by the image capturing apparatus may all be the rotation angles during the (N + 1) th time.
The rotation angle can be used for indicating the rotation angle of the placing posture of the camera device when the original image is collected relative to the standard placing posture. Here, the standard placement posture may refer to a placement posture when the camera device is used conventionally, that is, the standard placement posture may refer to a placement posture when an original image acquired by the camera device is an erected image.
In step S12, when the rotation angle is within a first preset angle range, the original image is rotated according to the rotation angle to obtain a target image.
In this embodiment, the first preset angle range may include one or more angle ranges.
Specifically, in order to make the switching between the horizontal and vertical screens more sensitive and improve the convenience of the user operation, optionally, the first preset angle range may include at least one of the following: clockwise 90 degrees +/-A, clockwise 180 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A, anticlockwise 180 degrees +/-A and anticlockwise 270 degrees +/-A; the A is greater than or equal to 0 degrees and less than 45 degrees. Here, 90 degrees ± a clockwise may represent greater than or equal to 90-a degrees clockwise and less than or equal to 90+ a degrees clockwise; 180 degrees ± a clockwise may represent greater than or equal to 180-a degrees clockwise and less than or equal to 180+ a degrees clockwise; clockwise 270 degrees ± a may represent greater than or equal to 270-a degrees clockwise and less than or equal to 270+ a degrees clockwise; 90 degrees counterclockwise ± a may represent greater than or equal to 90-a degrees counterclockwise and less than or equal to 90+ a degrees counterclockwise; 180 degrees counterclockwise ± a may represent greater than or equal to 180-a degrees counterclockwise and less than or equal to 180+ a degrees counterclockwise; counterclockwise 270 degrees ± a may represent greater than or equal to counterclockwise 270-a degrees and less than or equal to counterclockwise 270+ a degrees.
The above rotation angle in the first preset angle range can be understood as: the rotation angle belongs to a first preset angle range. For ease of understanding, further exemplified herein:
assuming that the first preset angle range includes 4 angle ranges, the 4 angle ranges are [ 60 degrees clockwise, 120 degrees clockwise ], [ 240 degrees clockwise, 300 degrees clockwise ], [ 60 degrees counterclockwise, 120 degrees counterclockwise ] and [ 240 degrees counterclockwise, 300 degrees counterclockwise ], where [ 60 degrees clockwise, 120 degrees clockwise ] represents greater than or equal to 60 degrees clockwise and less than or equal to 120 degrees clockwise, [ 240 degrees clockwise, 300 degrees clockwise ] represents greater than or equal to 240 degrees clockwise and less than or equal to 300 degrees clockwise, [ 60 degrees counterclockwise, 120 degrees counterclockwise ] represents greater than or equal to 60 degrees counterclockwise and less than or equal to 120 degrees counterclockwise, [ 240 degrees counterclockwise, 300 degrees counterclockwise ] represents greater than or equal to 240 degrees counterclockwise and less than or equal to 300 degrees counterclockwise, respectively;
then, when the rotation angle is 90 degrees clockwise, the rotation angle can be considered to be in an angle range of [ 60 degrees clockwise, 120 degrees clockwise ], and further the rotation angle can be considered to be in a first preset angle range; when the rotation angle is 270 degrees clockwise, the rotation angle can be considered to be in the angle range of [ 240 degrees clockwise and 300 degrees clockwise ], and further the rotation angle can be considered to be in the first preset angle range; when the rotation angle is 90 degrees counterclockwise, the rotation angle can be considered to be in an angle range of [ 60 degrees counterclockwise and 120 degrees counterclockwise ], and further the rotation angle can be considered to be in a first preset angle range; when the rotation angle is 270 degrees counterclockwise, the rotation angle may be considered to be in an angle range of [ 240 degrees counterclockwise, 300 degrees counterclockwise ], and further the rotation angle may be considered to be in a first preset angle range.
Rotating the original image to obtain a target image, wherein the target image can be obtained by performing horizontal-vertical conversion on the original image; the original image is rotated to obtain the target image, or the original image is rotated by 180 degrees to obtain the target image. Here, horizontal-vertical conversion may be understood as horizontal screen to vertical screen or vertical screen to horizontal screen.
In step S13, the target image is encoded, and the encoded target image is pushed to a server.
In this embodiment, the target image may be encoded according to a preset encoding resolution, or the target image may be encoded according to an adjusted encoding resolution by adjusting the preset encoding resolution.
In this embodiment, by acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device, when the rotation angle is within a first preset angle range, the original image is rotated according to the rotation angle to obtain a target image, the target image is encoded, and the encoded target image is pushed to a server, so that the live image can be automatically rotated according to the rotation angle of the camera device, and the live image after the rotation processing can be automatically pushed, so that a user performing network live broadcasting can rotate the live image by rotating the camera device in the live broadcasting process without importing the live image into a third-party application program and then executing a series of operations on an application interface of the third-party application program, and therefore, the operation of the live image during the rotation processing can be simpler in the embodiment of the present disclosure, and the efficiency of rotating the live image can be improved.
Optionally, after the acquiring an original image acquired by the camera device and the acquiring a rotation angle of the camera device, the image processing method further includes:
and when the rotation angle is not in the first preset angle range, encoding the original image, and pushing the encoded original image to the server.
In this embodiment, when the rotation angle of the imaging device is not within the first preset angle range, the original image may be directly encoded without performing rotation processing on the original image, and the encoded original image may be pushed to the server.
The fact that the rotation angle is not within the first preset angle range can be understood as follows: the rotation angle does not belong to the first preset angle range. For ease of understanding, further exemplified herein:
assuming that the first preset angle range set includes 4 angle ranges, the 4 angle ranges are [ 60 degrees clockwise, 120 degrees clockwise ], [ 240 degrees clockwise, 300 degrees clockwise ], [ 60 degrees counterclockwise, 120 degrees counterclockwise ], [ 240 degrees counterclockwise, 300 degrees counterclockwise ], where [ 60 degrees clockwise, [ 120 degrees clockwise ] represents greater than or equal to 60 degrees clockwise and less than or equal to 120 degrees clockwise, [ 240 degrees clockwise, 300 degrees clockwise ] represents greater than or equal to 240 degrees clockwise and less than or equal to 300 degrees clockwise, [ 60 degrees counterclockwise, 120 degrees counterclockwise ] represents greater than or equal to 60 degrees counterclockwise and less than or equal to 120 degrees counterclockwise, [ 240 degrees counterclockwise, 300 degrees counterclockwise ] represents greater than or equal to 240 degrees counterclockwise and less than or equal to 300 degrees counterclockwise;
when the rotation angle is 0 degrees clockwise or 180 degrees clockwise, the rotation angle may not be considered to be in any one of the 4 angular ranges, and further, the rotation angle may not be considered to be in the first preset angular range.
The encoding of the original image may be encoding the original image according to a preset encoding resolution, or adjusting the preset encoding resolution and encoding the original image according to the adjusted encoding resolution.
Because when the rotation angle is not in during the first predetermined angle scope, can be directly right the original image is encoded, and to after the server propelling movement is encoded original image to when need not rotating the live broadcast image, the user only need control the rotation angle not in first predetermined angle scope can, that is to say, make this application embodiment can also be applicable to the scene that need not to rotate the live broadcast image, like this, can make the suitability of this embodiment stronger.
Optionally, the encoding the target image includes:
and when the rotation angle is within a second preset angle range, adjusting a preset encoding resolution, and encoding the target image according to the adjusted encoding resolution, wherein the first preset angle range comprises the second preset angle range.
In this embodiment, when the rotation angle is within the first preset angle range and within the second preset angle range, the preset encoding resolution may be adjusted first, and the target image may be encoded according to the adjusted encoding resolution.
The second preset angle range may include at least one of: clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A and anticlockwise 270 degrees +/-A; the A is greater than or equal to 0 degrees and less than 45 degrees. Here, for the explanation of clockwise 90 degrees ± a, clockwise 270 degrees ± a, counterclockwise 90 degrees ± a and counterclockwise 270 degrees ± a, reference may be made to the explanation of the relevant parts in the foregoing, and thus, the explanation is not repeated here.
The preset encoding resolution may be a horizontal screen resolution adapted to the horizontal screen image or a vertical screen resolution adapted to the vertical screen image, that is, the default encoding resolution may be the horizontal screen resolution or the vertical screen resolution. Specifically, the vertical screen resolution may be set as required, for example, may be set to 768x 1024, 1080x 1920, 2160x 3840, or the like; the foregoing horizontal screen resolution may also be set as required, for example, 1024x 768, 1920x 1080 or 3840x 2160, etc. Under the condition that the target image is a cross-screen image, if the cross-screen resolution is adopted to code the target image, the definition of a picture seen by a user watching live broadcast can be higher; under the condition that the target image is a vertical screen image, if the target image is coded by adopting the vertical screen resolution, the definition of a picture seen by a user watching live broadcast can be higher.
The adjusted encoding resolution may be a resolution different from a preset encoding resolution. For example, when the preset encoding resolution is a horizontal screen resolution, the adjusted encoding resolution may be a vertical screen resolution; when the preset encoding resolution is the vertical screen resolution, the adjusted encoding resolution may be the horizontal screen resolution.
Because when the rotation angle is in the second predetermined angle scope, the adjustment is preset's coding resolution ratio, and is right according to the coding resolution ratio after the adjustment target image encodes, first predetermined angle scope includes the second predetermined angle scope to not only can be according to camera device's rotation angle, automatic rotation processing is carried out to the live broadcast image, but also can be according to camera device's rotation angle, the resolution ratio of self-adaptation output image, like this, not only can make the live broadcast user in the live broadcast in-process, can realize the rotation processing to the live broadcast image through rotating camera device at any time, and can improve spectator's end's picture definition.
Optionally, the encoding the target image includes:
and when the rotation angle is not in a second preset angle range, coding the target image according to a preset coding resolution.
In this embodiment, whether the rotation angle is in the first preset angle range or not, as long as the rotation angle is not in the second preset angle range, the target image may be directly encoded according to a preset encoding resolution.
When the rotation angle is not within the second preset angle range, the target image is coded according to the preset coding resolution, so that the live broadcast image can be automatically rotated according to the rotation angle of the camera device, the resolution of the image can be adaptively output according to the rotation angle of the camera device, a live broadcast user can rotate the live broadcast image at any time in the live broadcast process by rotating the camera device, and the image definition of a viewer end can be improved.
Optionally, when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image, including:
when the rotation angle is clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A or anticlockwise 270 degrees +/-A, performing horizontal-vertical conversion on the original image through rotation to obtain a target image;
and when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A anticlockwise, rotating the original image by 180 degrees to obtain a target image.
In this embodiment, it can be considered that the placement posture of the imaging device when the rotation angle is 90 degrees clockwise is the same as the placement posture of the imaging device when the rotation angle is 270 degrees counterclockwise, and the placement posture of the imaging device when the rotation angle is 270 degrees clockwise is the same as the placement posture of the imaging device when the rotation angle is 90 degrees counterclockwise. It is considered that the image pickup apparatus arrangement posture when the rotation angle is 180 degrees clockwise is the same as the image pickup apparatus arrangement posture when the rotation angle is 180 degrees counterclockwise.
The horizontal-vertical conversion may refer to converting a landscape screen image into a portrait screen image or converting a portrait screen image into a landscape screen image. Specifically, when the original image is a landscape image, the above-mentioned obtaining the target image by performing horizontal-vertical conversion on the original image through rotation may be understood as: and rotating the original image into a vertical screen image, and determining the vertical screen image as a target image. In the case that the original image is a vertical screen image, the above-mentioned obtaining of the target image by performing horizontal-vertical conversion on the original image through rotation may be understood as: the original image is rotated into a landscape image, and the landscape image is determined as a target image.
It should be noted that, after the original image is rotated by 180 degrees, the horizontal and vertical directions of the original image will not change, but the forward and backward directions of the original image will change, that is, if the original image is an upright landscape screen image, the target image obtained after the original image is rotated by 180 degrees is an inverted landscape screen image; if the original image is an inverted cross-screen image, rotating the original image by 180 degrees to obtain a target image which is an upright cross-screen image; if the original image is an upright vertical screen image, rotating the original image by 180 degrees to obtain a target image which is an inverted vertical screen image; and if the original image is an inverted vertical screen image, rotating the original image by 180 degrees to obtain a target image which is an upright vertical screen image.
Because the original image is converted horizontally and vertically through rotation when the rotation angle is 90 degrees +/-A clockwise, 270 degrees +/-A clockwise, 90 degrees +/-A counterclockwise or 270 degrees +/-A counterclockwise to obtain the target image, and the original image is rotated 180 degrees to obtain the target image when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A counterclockwise, the automatic conversion of horizontal and vertical screens can be realized, and the target image output to the streaming media server can be ensured to be a vertical image, so that the user at a viewer end can watch the target image more conveniently.
Optionally, when the rotation angle is clockwise 90 degrees ± a, clockwise 270 degrees ± a, counterclockwise 90 degrees ± a, or counterclockwise 270 degrees ± a, performing horizontal-vertical conversion on the original image through rotation to obtain a target image, including:
when the rotation angle is 90 degrees clockwise, rotating the original image 90 degrees clockwise or 270 degrees anticlockwise to obtain a target image;
when the rotation angle is 270 degrees clockwise, rotating the original image 270 degrees clockwise or rotating the original image 90 degrees counterclockwise to obtain a target image;
when the rotation angle is 90 degrees anticlockwise, rotating the original image 90 degrees anticlockwise or 270 degrees clockwise to obtain a target image;
and when the rotation angle is 270 degrees anticlockwise, rotating the original image 270 degrees anticlockwise or rotating the original image 90 degrees clockwise to obtain a target image.
When the rotation angle is 90 degrees clockwise, the original image is rotated by 90 degrees clockwise or rotated by 270 degrees anticlockwise to obtain a target image; when the rotation angle is 270 degrees clockwise, rotating the original image 270 degrees clockwise or rotating the original image 90 degrees counterclockwise to obtain a target image; when the rotation angle is 90 degrees anticlockwise, rotating the original image 90 degrees anticlockwise or 270 degrees clockwise to obtain a target image; when the rotation angle is 270 degrees counterclockwise, the original image is rotated 270 degrees counterclockwise or 90 degrees clockwise to obtain the target image, so that not only can the automatic conversion of horizontal and vertical screens be realized, but also the target image output to the streaming media server can be ensured to be a vertical image, and thus, the user at the audience can watch the target image more conveniently.
Optionally, when the rotation angle is 180 degrees ± a clockwise or 180 degrees ± a counterclockwise, rotating the original image by 180 degrees to obtain a target image, including:
and when the rotation angle is 180 degrees clockwise or 180 degrees anticlockwise, rotating the original image 180 degrees clockwise or 180 degrees anticlockwise to obtain the target image.
When the rotation angle is 180 degrees clockwise or 180 degrees counterclockwise, the original image is rotated 180 degrees clockwise or 180 degrees counterclockwise to obtain the target image, so that the target image output to the streaming media server can be ensured to be a standing image, and the user at the audience can watch the target image more conveniently.
Optionally, the acquiring the rotation angle of the image capturing apparatus includes:
when the image pickup device and the electronic equipment are different equipment, rotation information sent by the image pickup device is received, and the rotation information is used for indicating the rotation angle of the image pickup device.
In this embodiment, the imaging device may calculate a rotation angle thereof by analyzing information such as gravity, and transmit the rotation angle to the electronic device.
When the image pickup device and the electronic equipment are different devices, the rotation angle of the image pickup device can be directly acquired by receiving the rotation information sent by the image pickup device, so that the workload of the electronic equipment can be further reduced.
The rotation angle of the imaging device may be acquired by other means, for example, by capturing an image by a detection device provided outside the imaging device and analyzing the posture of the imaging device, or by detecting an original image acquired from the imaging device by an electronic device.
In this embodiment, by acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device, when the rotation angle is within a first preset angle range, the original image is rotated according to the rotation angle to obtain a target image, the target image is encoded, and the encoded target image is pushed to a server, so that the live image can be automatically rotated according to the rotation angle of the camera device, and the live image after the rotation processing can be automatically pushed, so that a user performing network live broadcasting can rotate the live image by rotating the camera device in the live broadcasting process without importing the live image into a third-party application program and then executing a series of operations on an application interface of the third-party application program, and therefore, the operation of the live image during the rotation processing can be simpler in the embodiment of the present disclosure, and the efficiency of rotating the live image can be improved.
Fig. 2 is a block diagram illustrating an image processing apparatus, which may be applied to an electronic device, according to an exemplary embodiment. Referring to fig. 2, the image processing apparatus 200 includes:
an acquisition unit 201 configured to perform acquisition of an original image captured by an imaging device and acquisition of a rotation angle of the imaging device;
a rotating unit 202, configured to rotate the original image according to the rotation angle when the rotation angle is within a first preset angle range, so as to obtain a target image;
a first encoding unit 203 configured to perform encoding of the target image;
a first pushing unit 204 configured to perform pushing the encoded target image to a server.
In this embodiment, by acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device, when the rotation angle is within a first preset angle range, the original image is rotated according to the rotation angle to obtain a target image, the target image is encoded, and the encoded target image is pushed to a server, so that the live image can be automatically rotated according to the rotation angle of the camera device, and the live image after the rotation processing can be automatically pushed, so that a user performing network live broadcasting can rotate the live image by rotating the camera device in the live broadcasting process without importing the live image into a third-party application program and then executing a series of operations on an application interface of the third-party application program, and therefore, the operation of the live image during the rotation processing can be simpler in the embodiment of the present disclosure, and the efficiency of rotating the live image can be improved.
Optionally, the image processing apparatus 200 further includes:
a second encoding unit configured to perform encoding of the original image when the rotation angle is not in the first preset angle range;
a first pushing unit configured to perform pushing of the encoded original image to the server.
Optionally, the first encoding unit 203 is configured to perform:
and when the rotation angle is within a second preset angle range, adjusting a preset encoding resolution, and encoding the target image according to the adjusted encoding resolution, wherein the first preset angle range comprises the second preset angle range.
Optionally, the first encoding unit 203 is configured to perform:
and when the rotation angle is not in a second preset angle range, coding the target image according to a preset coding resolution.
Optionally, the first preset angle range includes at least one of: clockwise 90 degrees +/-A, clockwise 180 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A, anticlockwise 180 degrees +/-A and anticlockwise 270 degrees +/-A;
the A is greater than or equal to 0 degrees and less than 45 degrees.
Optionally, the rotation unit 202 is configured to perform:
when the rotation angle is clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A or anticlockwise 270 degrees +/-A, performing horizontal-vertical conversion on the original image through rotation to obtain a target image;
and when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A anticlockwise, rotating the original image by 180 degrees to obtain a target image.
Optionally, the obtaining unit 201 is configured to perform:
when the image pickup device and the electronic equipment are different equipment, rotation information sent by the image pickup device is received, and the rotation information is used for indicating the rotation angle of the image pickup device.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Fig. 3 is a block diagram illustrating an image processing apparatus 300 according to an exemplary embodiment. As shown in fig. 3, the image processing apparatus 300 comprises a processor 301 and a memory 302 for storing instructions executable by the processor 301. The processor 301 is configured to execute the instructions to implement the steps of the image processing method in the embodiment of the method corresponding to fig. 1, and can achieve the same technical effects, and for avoiding repetition, details are not repeated here.
In an exemplary embodiment, a storage medium including instructions is further provided, and when the instructions in the storage medium are executed by a processor of an image processing apparatus, the image processing apparatus is enabled to perform the steps of the image processing method described in the embodiment of the method corresponding to fig. 1, and the same technical effects can be achieved, and details are not repeated here to avoid repetition. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present disclosure also provide a computer program product, including: and an executable instruction, which when executed on a computer, enables the computer to execute the steps of the image processing method in the embodiment of the method corresponding to fig. 1, and achieve the same technical effects, and for avoiding repetition, the description is omitted here.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. An image processing method applied to an electronic device, comprising:
acquiring an original image acquired by a camera device and acquiring a rotation angle of the camera device;
when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image;
and coding the target image, and pushing the coded target image to a server.
2. The image processing method according to claim 1, wherein after the acquiring of the original image captured by the imaging device and the acquiring of the rotation angle of the imaging device, the image processing method further comprises:
and when the rotation angle is not in the first preset angle range, encoding the original image, and pushing the encoded original image to the server.
3. The image processing method according to claim 1, wherein said encoding the target image comprises:
and when the rotation angle is within a second preset angle range, adjusting a preset encoding resolution, and encoding the target image according to the adjusted encoding resolution, wherein the first preset angle range comprises the second preset angle range.
4. The image processing method according to claim 3, wherein said encoding the target image comprises:
and when the rotation angle is not in a second preset angle range, coding the target image according to a preset coding resolution.
5. The image processing method according to any one of claims 1 to 4, wherein the first preset angle range includes at least one of: clockwise 90 degrees +/-A, clockwise 180 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A, anticlockwise 180 degrees +/-A and anticlockwise 270 degrees +/-A;
the A is greater than or equal to 0 degrees and less than 45 degrees.
6. The image processing method according to claim 5, wherein when the rotation angle is within a first preset angle range, rotating the original image according to the rotation angle to obtain a target image, comprises:
when the rotation angle is clockwise 90 degrees +/-A, clockwise 270 degrees +/-A, anticlockwise 90 degrees +/-A or anticlockwise 270 degrees +/-A, performing horizontal-vertical conversion on the original image through rotation to obtain a target image;
and when the rotation angle is 180 degrees +/-A clockwise or 180 degrees +/-A anticlockwise, rotating the original image by 180 degrees to obtain a target image.
7. The image processing method according to claim 1, wherein the acquiring the rotation angle of the imaging device comprises:
when the image pickup device and the electronic equipment are different equipment, rotation information sent by the image pickup device is received, and the rotation information is used for indicating the rotation angle of the image pickup device.
8. An image processing apparatus applied to an electronic device, comprising:
an acquisition unit configured to perform acquisition of an original image captured by an imaging device and acquisition of a rotation angle of the imaging device;
the rotation unit is configured to rotate the original image according to the rotation angle when the rotation angle is in a first preset angle range to obtain a target image;
a first encoding unit configured to perform encoding of the target image;
a first pushing unit configured to perform pushing of the encoded target image to a server.
9. An image processing apparatus characterized by comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the image processing method of any one of claims 1 to 7.
10. A storage medium in which instructions, when executed by a processor of an image processing apparatus, enable the image processing apparatus to perform the image processing method according to any one of claims 1 to 7.
CN202010928633.4A 2020-09-07 2020-09-07 Image processing method and image processing apparatus Active CN111988671B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010928633.4A CN111988671B (en) 2020-09-07 2020-09-07 Image processing method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010928633.4A CN111988671B (en) 2020-09-07 2020-09-07 Image processing method and image processing apparatus

Publications (2)

Publication Number Publication Date
CN111988671A true CN111988671A (en) 2020-11-24
CN111988671B CN111988671B (en) 2022-06-03

Family

ID=73447019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010928633.4A Active CN111988671B (en) 2020-09-07 2020-09-07 Image processing method and image processing apparatus

Country Status (1)

Country Link
CN (1) CN111988671B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243830A (en) * 2014-09-29 2014-12-24 广东欧珀移动通信有限公司 Method and device for controlling camera to rotate
US20160173773A1 (en) * 2014-02-27 2016-06-16 Sony Corporation Device and method for panoramic image processing
CN105933689A (en) * 2015-02-27 2016-09-07 三星电子株式会社 Image processing method and electronic device supporting the same
CN106303661A (en) * 2016-08-29 2017-01-04 武汉斗鱼网络科技有限公司 A kind of live client realizes the method and system of self adaptation screen rotation
CN107592446A (en) * 2016-07-06 2018-01-16 腾讯科技(深圳)有限公司 A kind of method of video image processing, apparatus and system
CN108710877A (en) * 2018-04-28 2018-10-26 北京奇禄管理咨询有限公司 A kind of image-pickup method
EP3550827A1 (en) * 2018-04-04 2019-10-09 Shenzhen Grandsun Electronic Co., Ltd. Method and device for controlling camera shooting, smart device, and storage medium
CN110956106A (en) * 2019-11-20 2020-04-03 广州华多网络科技有限公司 Processing method, device, storage medium and equipment for live broadcast

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160173773A1 (en) * 2014-02-27 2016-06-16 Sony Corporation Device and method for panoramic image processing
CN104243830A (en) * 2014-09-29 2014-12-24 广东欧珀移动通信有限公司 Method and device for controlling camera to rotate
CN105933689A (en) * 2015-02-27 2016-09-07 三星电子株式会社 Image processing method and electronic device supporting the same
CN107592446A (en) * 2016-07-06 2018-01-16 腾讯科技(深圳)有限公司 A kind of method of video image processing, apparatus and system
CN106303661A (en) * 2016-08-29 2017-01-04 武汉斗鱼网络科技有限公司 A kind of live client realizes the method and system of self adaptation screen rotation
EP3550827A1 (en) * 2018-04-04 2019-10-09 Shenzhen Grandsun Electronic Co., Ltd. Method and device for controlling camera shooting, smart device, and storage medium
CN108710877A (en) * 2018-04-28 2018-10-26 北京奇禄管理咨询有限公司 A kind of image-pickup method
CN110956106A (en) * 2019-11-20 2020-04-03 广州华多网络科技有限公司 Processing method, device, storage medium and equipment for live broadcast

Also Published As

Publication number Publication date
CN111988671B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
US10027970B2 (en) Render-orientation information in video bitstream
US10003768B2 (en) Apparatus and methods for frame interpolation based on spatial considerations
EP3456058A1 (en) Bit depth remapping based on viewing parameters
CN107682714B (en) Method and device for acquiring online video screenshot
US20150070458A1 (en) System and method for video call
US8023746B2 (en) Systems and methods for decoding an image to determine a digital identifier
US8803991B2 (en) Snapshot capture in video stream
US20140146877A1 (en) Method for dynamically adapting video image parameters for facilitating subsequent applications
JP5757592B2 (en) Method, apparatus and computer program product for generating super-resolution images
CN106303571B (en) The method and system of adaptive screen rotation are realized in image acquisition process
KR20170116388A (en) Imaging device and operating method thereof
US8934024B2 (en) Efficient, user-friendly system to stream screens inside video using a mobile device
US20070035615A1 (en) Method and apparatus for adjusting output images
CN104869381A (en) Image processing system, method and device
US9052866B2 (en) Method, apparatus and computer-readable medium for image registration and display
EP4254934A1 (en) Image processing method and apparatus, and electronic device
Huai et al. The mobile AR sensor logger for Android and IOS devices
CN112839165B (en) Method and device for realizing face tracking camera shooting, computer equipment and storage medium
CN111988671B (en) Image processing method and image processing apparatus
JP2019149785A (en) Video conversion device and program
CN112969022A (en) Camera adjusting method and system, storage medium and electronic equipment
US20170118528A1 (en) System and method for adaptive video streaming
WO2018184408A1 (en) Video recording method and device
CN112887515B (en) Video generation method and device
CN110913161B (en) Method and device for recording banner video through vertical screen

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant