Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram of an application environment of an information processing method provided in an embodiment, as shown in fig. 1, in the application environment, a sendingterminal 110, acomputer device 120, and areceiving terminal 130 are included. When the sendingterminal 110 needs to send video data to thereceiving terminal 130, sending a video sending request to thecomputer device 120, where the video sending request carries the video data and the receiving terminal identifier, and thecomputer device 120 receives the video sending request sent by thesending terminal 110, obtains a target image in the video data and an image angle of the target image, then adjusts an angle of the target image according to the image angle of the target image and a preset image angle standard, obtains a processed image, and sends the processed image to thereceiving terminal 130 corresponding to the receiving terminal identifier.
Thecomputer device 120 may be an independent physical server or terminal, may also be a server cluster formed by a plurality of physical servers, and may be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN. The sendingterminal 110 and thereceiving terminal 120 may be, but are not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like.
As shown in fig. 2, in an embodiment, an information processing method is provided, which may be applied to thecomputer device 120 described above, and specifically may include the following steps:
step S202, a video sending request sent by a sending terminal is received, and the video sending request carries video data and a receiving terminal identification.
Specifically, the video data may be a video obtained in real time or a video that has been shot in advance. For example, in the WeChat application, a video shooting button in the WeChat can be clicked to shoot a video in real time. And the video shot in advance can be acquired from the mobile phone photo album. In the social application, when a sending terminal needs to send information to a receiving terminal, a video sending request is sent to computer equipment, the computer equipment receives the video sending request, and the video sending request carries video data and a receiving terminal identifier.
The Social application may be an instant messaging application, an SNS (Social Network Services) application, a bar application, and the like. Instant messaging applications may include WeChat, circle of friends, QQ space, MSN, and the like. SNS applications may include, but are not limited to, personal networks, Facebook, and the like.
Step S204, a target image in the video data is acquired.
Specifically, the target image may be one or more, and the acquisition rule of the target image may be set according to actual needs. For example, the target image may be selected from the video data according to a preset image selection rule, or may be acquired according to image selection information transmitted by the transmitting terminal or the receiving terminal. The preset image selection rule may be to randomly select an image or to select an image by default, for example, the first image of video data. An image acquisition tool, such as an FFMPG tool, may be invoked via the program interface to acquire the target image.
Step S206, acquiring the image angle of the target image.
Specifically, the image angle of the target image may be carried in the transmission of the video transmission request by the transmitting terminal. The target image angle can also be obtained by other image angle obtaining methods, for example, the image angle can be trained in advance to obtain a neural network model, and the target image is input into the image angle obtaining neural network model after the target image is obtained, so that the image angle of the target image is obtained.
In one embodiment, the angle of the target image is obtained from a gravity sensor of the photographing apparatus, such as a gyroscope, when the video is photographed. The video transmission request may carry angle information of a photographing apparatus that photographs video data.
And S208, carrying out angle adjustment on the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image.
Specifically, the image angle criterion is set in advance, and the image angle criterion may be a specific angle, for example, 0 °. In one embodiment, the image angle criterion may be that the angle of the processed image is the same as the angle of the receiving terminal. Therefore, before angle adjustment, the current angle of the receiving terminal can be acquired, and then angle adjustment is carried out on the target image according to the current angle of the receiving terminal, so that the image angle is matched with the angle of the receiving terminal.
In one embodiment, the angle amount of each adjustment when the angle of the target image is adjusted may be a preset value. For example, the angular value of each adjustment may be 90 degrees.
And step S210, sending the processed image to a receiving terminal corresponding to the receiving terminal identification.
Specifically, after the processed image is obtained, the processed image is sent to the receiving terminal corresponding to the receiving terminal identifier. In one embodiment, when there are a plurality of target images, the display time and the display sequence of each target image may be set, so that the receiving terminal displays the target images according to the display sequence and the display time after receiving the target images.
According to the information processing method, after a video sending request which is sent by a sending terminal and carries video data and a receiving terminal identification is received, a target image in the video data and an image angle of the target image are obtained, then angle adjustment is carried out on the target image according to the image angle of the target image and a preset image angle standard, a processed image is obtained, and the processed image is sent to a receiving terminal corresponding to the receiving terminal identification. The angle adjustment is carried out on the target image according to the image angle of the target image and the preset image angle standard when the image of the video data is sent to the receiving terminal, so that the user can conveniently check the image, the time of the user is saved, and the communication efficiency between the users is improved.
In one embodiment, as shown in FIG. 3, the information processing method may further include a step S302 of receiving image selection information transmitted by the transmitting terminal. Step S204, acquiring a target image in the video data, includes: and acquiring a target image in the video data according to the image selection information.
Specifically, the image selection information may be carried in the transmission of the video transmission request, or may be transmitted before the transmission of the video transmission request. The image selection information may be defined as desired. For example, at least one of the sequence number of the image frames in the video, the playing time, the reflected scene, such as a dining scene map, and the like. And after receiving the image selection information, acquiring a target image according to the image selection information. For example, images corresponding to the sequence numbers in the video data are obtained according to the sequence numbers of the image frames, images corresponding to the playing time are obtained according to the playing time, image recognition is performed according to the reflected scenes, and images matched with the scenes are recognized as target images.
In one embodiment, as shown in fig. 4, when the target image includes a human face, the step S206 of acquiring an image angle of the target image includes:
step S402, acquiring a face angle in a target image and a face angle in a reference image of the target image, wherein the reference image comprises a previous image of the target image and/or a subsequent image of the target image in the video data.
Specifically, the preceding image refers to an image in the video data that plays at a time before the target image, and the following image refers to an image in the video data that plays at a time after the target image. The preceding image may refer to n consecutive images before the target image, and the following image may refer to m images after the target image. Wherein n and m are positive integers, and the specific numerical value can be set according to the requirement. For example 2 and 3. The previous image may also be an image randomly extracted or extracted at preset intervals from the previous n images of the target image, and the subsequent image may also be an image randomly extracted or extracted at preset intervals from the subsequent m images of the target image. It is understood that when there are a plurality of target images, the first n images of one target image may include other target images, and the last n images of one target image may also include other target images. For example, if the target images are the 6 th and 7 th images in the video data, the first 2 images of the 7 th image include the 6 th image. The reference picture may include a previous picture or a subsequent picture, or may include both the previous picture and the subsequent picture.
Step S404, calculating the difference value of the face angle of the target image and the face angle of the reference image.
Specifically, the method for representing the difference between the face angle of the target image and the face angle of the reference image may be set according to the requirement, and for example, the difference between the angles may be represented by a ratio. The difference value refers to the difference between the face angle of the target image and the face angle of the reference image. The ratio may be a ratio of a face angle of the target image to a face angle of the reference image, or a ratio of a difference between the face angle of the target image and the face angle of the reference image to the face angle of the target image, or a ratio of a difference between the face angle of the target image and the face angle of the reference image to the face angle of the reference image. The disparity value may include a plurality of values, and in one embodiment, the disparity value of an angle between two images may be calculated in the order of the playing time of the images.
And step S406, when the difference value is within the preset threshold value, acquiring the image angle of the target image according to the face angle of the target image.
Specifically, the preset threshold may be set by itself as needed. For example 10 degrees. If the disparity value is outside the preset threshold, that is, greater than the preset threshold, it may be caused by a person in the video skewing in a certain image, and therefore, the image angle may be obtained by other methods or by combining other methods. And if the difference value is within a preset threshold value, acquiring the image angle of the target image according to the face angle of the target image. For example, the face angle of the target image may be used as the image angle of the target image. The image angle of the target image may also be obtained by combining the image angle information carried by the video data and the face angle of the target image, for example, taking the average value of the image angle carried by the video data and the face angle of the target image as the image angle of the target image. In some embodiments, when there are a plurality of target images, since the angle of the photographing apparatus does not generally change when the images are photographed, the average angle of the target images may be taken as the image angle of each target image.
According to the method for obtaining the image angle, the image angle of the target image is obtained through the face angle of the target image, the accuracy of obtaining the image angle can be improved, meanwhile, the difference value of the face angle of the target image and the face angle of the reference image is calculated, when the difference value is within the preset threshold value, the image angle of the target image is obtained according to the face angle of the target image, the situation that the judgment of the image angle is wrong due to the fact that a person in the image intentionally tilts the head can be reduced, and the accuracy of obtaining the image angle is further improved.
In one embodiment, as shown in fig. 5, the information processing method may further include step S502: the image size of the target image is acquired. Step S208, performing angle adjustment on the target image according to the image angle of the target image and a preset image angle standard, and obtaining a processed image includes: zooming the target image according to the image size of the target image and a preset image size standard, and adjusting the angle of the target image according to the image angle of the target image and the preset image angle standard to obtain a processed image.
Specifically, the image size criterion is preset, and may be a specific image size, for example, the image size criterion is 480 pixels × 320 pixels. It may also refer to an adjustment criterion for the image size, e.g. scaling the image to 0.5 times. And when the size and the angle of the target image are acquired, adjusting the size and the angle of the target image to obtain a processed image. It can be understood that the target image may be zoomed first, or the angle adjustment may be performed first and then the zooming is performed, and the order of the image zooming and the image angle adjustment is not limited in the embodiment of the present invention. For example, when the acquired target image is 960 × 640 pixels, the image angle is 25 °, the image size criterion is 480 pixels × 320 pixels, and the image angle criterion is 0 °, the target image may be reduced by 0.5 times to obtain an image with a size of 480 pixels × 320 pixels, and then the image angle may be adjusted to 0 °.
In one embodiment, as shown in fig. 6, the step of sending the processed image to the receiving terminal corresponding to the receiving terminal identifier may further include the following steps:
step S602, receiving a video playing request sent by the receiving terminal, where the video playing request carries video selection information.
Specifically, the video selection information may be specifically set as needed. For example, it may be a playing time, a video scene, or a video size, for example, 22MB or the like. The receiving terminal can receive video selection information input by a user, receive a video playing request to the computer equipment, and the computer equipment receives the video playing request.
Step S604, acquiring video selection content corresponding to the video data according to the video selection information.
Specifically, after a video playing request is received, video selection information in the video playing request is acquired, and corresponding video selection content in video data is acquired according to the video selection information. For example, when the video selection information includes the playing time from 0 th minute to 5 th minute, the video data of 0 th minute to fifth minute is acquired, and the video selection content is obtained. When the video selection information comprises a video scene, identifying the video data comprising the scene in the video data to obtain the video selection content. When the video selection information includes video data having a video size of 22MB, video data having a size of 22MB is acquired from the video data, resulting in video selection content.
Step S606, the video selection content is sent to the receiving terminal.
Specifically, after the video selection content is acquired, the video selection content is sent to the receiving terminal, so that the receiving terminal can play the video selection content.
In an embodiment, a corresponding relationship between the receiving terminal attribute information and the video format may also be set, where the terminal attribute may be, for example, hardware device information or operating system information of the terminal, and when video data is received, the terminal attribute information of the receiving terminal is obtained, and conversion is performed according to the corresponding relationship between the terminal attribute information and the video format, so that the video can be better played on the receiving terminal. For example, if the receiving terminal is a computer installed with a windows system, the video may be converted into an MPEG format.
In one embodiment, as shown in fig. 7, the information processing method may further include the steps of:
step S702, an image information adding rule is obtained, where the image information adding rule includes an adding content and a layout mode. Step S208, performing angle adjustment on the target image according to the image angle of the target image and a preset image angle standard, and obtaining a processed image includes: adding information on the target image according to the image information adding rule, and adjusting the angle of the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image.
Specifically, the added content refers to information to be added on the image, and the layout manner refers to a position of the added information in the image. The added content may include, for example, one or more of playing time corresponding to the target image, user information corresponding to the receiving terminal or the sending terminal, an identifier corresponding to the social application, a character generated according to a device identifier of the sending terminal and a preset character encoding rule, a video shooting address, video shooting time, and other information. The layout mode may include a specific position such as the lower left of the image, or may include layout rules such as adding information at the background of the picture. In some embodiments, the image information adding rule further includes a style of adding the content, such as a breath style or the like. It can be understood that information may be added to the target image first, or the angle adjustment may be performed first and then the information addition is performed, and the order of the image information addition and the image angle adjustment is not limited in the embodiment of the present invention.
In one embodiment, as shown in fig. 8, there is provided an information processing apparatus, which may be integrated in thecomputer device 120 described above, including:
a sendingrequest receiving module 802, configured to receive a video sending request sent by a sending terminal, where the video sending request carries video data and a receiving terminal identifier;
a targetimage obtaining module 804, configured to obtain a target image in the video data;
an imageangle obtaining module 806, configured to obtain an image angle of the target image;
theprocessing module 808 is configured to perform angle adjustment on the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image;
and animage sending module 810, configured to send the processed image to a receiving terminal corresponding to the receiving terminal identifier.
In one embodiment, as shown in fig. 9, the information processing apparatus further includes: a selectioninformation receiving module 902, configured to receive image selection information sent by a sending terminal;
the targetimage acquisition module 804 is configured to: and acquiring a target image in the video data according to the image selection information.
In one embodiment, as shown in fig. 10, when the target image includes a human face, the imageangle obtaining module 806 includes:
a faceangle obtaining unit 1002, configured to obtain a face angle in a target image and a face angle in a reference image of the target image, where the reference image includes a previous image of the target image and/or a subsequent image of the target image in the video data;
a differencevalue calculating unit 1004 for calculating a difference value between the face angle of the target image and the face angle of the reference image;
an imageangle obtaining unit 1006, configured to obtain an image angle of the target image according to the face angle of the target image when the difference value is within a preset threshold.
In one embodiment, as shown in fig. 11, the information processing apparatus further includes:
an imagesize obtaining module 1102, configured to obtain an image size of a target image;
theprocessing module 808 is configured to: zooming the target image according to the image size of the target image and a preset image size standard, and adjusting the angle of the target image according to the image angle of the target image and the preset image angle standard to obtain a processed image.
In one embodiment, as shown in fig. 12, the information processing apparatus further includes:
a playrequest receiving module 1202, configured to receive a video play request sent by a receiving terminal, where the video play request carries video selection information;
avideo selection module 1204, configured to obtain corresponding video selection content in the video data according to the video selection information;
and the videocontent sending module 1206 is configured to send the video selection content to the receiving terminal.
In one embodiment, as shown in fig. 13, the information processing apparatus may further include an additionrule obtaining module 1302 for obtaining an image information addition rule, the image information addition rule including an addition content and a layout manner. Theprocessing module 808 includes: adding information on the target image according to the image information adding rule, and adjusting the angle of the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image.
Fig. 14 is a diagram showing an internal structure of a computer device in one embodiment, and the computer device is connected to a processor, a nonvolatile storage medium, an internal memory, and a network interface through a system connection bus. Wherein the non-volatile storage medium of the computer device may store an operating system and a computer program that, when executed, may cause the processor to perform an information processing method. The processor of the computer device is used for providing calculation and control capability and supporting the operation of the whole computer device. The internal memory may store a computer program that, when executed by the processor, causes the processor to perform an information processing method. The network interface of the computer device is used for performing network communication, such as receiving a video transmission request, transmitting a processed image, and the like. Those skilled in the art will appreciate that the architecture shown in fig. 14 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the information processing apparatus provided in the present application may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 14, and a nonvolatile storage medium of the computer device may store various program modules constituting the information processing apparatus, such as a transmissionrequest receiving module 802, an objectimage acquiring module 804, an imageangle acquiring module 806, aprocessing module 808, and animage transmitting module 810 in fig. 8. Computer programs are included in the respective program modules for causing a computer device to execute the steps in the information processing methods of the embodiments of the present application described in the present specification, for example, the computer device may receive a video transmission request sent by a sending terminal through a transmissionrequest receiving module 802 in the information processing apparatus as shown in fig. 8, where the video transmission request carries video data and a receiving terminal identifier, the target image in the video data is acquired by the targetimage acquisition module 804, the image angle of the target image is acquired by the imageangle acquisition module 806, the angle of the target image is adjusted by theprocessing module 808 according to the image angle of the target image and a preset image angle standard to obtain a processed image, and the processed image is sent to the receiving terminal corresponding to the receiving terminal identifier by theimage sending module 810.
In one embodiment, a computer device is proposed, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: receiving a video sending request sent by a sending terminal, wherein the video sending request carries video data and a receiving terminal identifier; acquiring a target image in video data; acquiring an image angle of a target image; carrying out angle adjustment on the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image; and sending the processed image to a receiving terminal corresponding to the receiving terminal identification.
In one embodiment, the processor executes the computer program to further perform the following steps: receiving image selection information sent by a sending terminal; the step of acquiring a target image in the video data comprises: and acquiring a target image in the video data according to the image selection information.
In one embodiment, when the target image includes a human face, the step of obtaining the image angle of the target image includes: acquiring a face angle in a target image and a face angle in a reference image of the target image, wherein the reference image comprises a previous image of the target image and/or a subsequent image of the target image in video data; calculating the difference value of the face angle of the target image and the face angle of the reference image; and when the difference value is within a preset threshold value, acquiring the image angle of the target image according to the face angle of the target image.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the image size of a target image; the method comprises the following steps of adjusting the angle of a target image according to the image angle of the target image and a preset image angle standard to obtain a processed image: zooming the target image according to the image size of the target image and a preset image size standard, and adjusting the angle of the target image according to the image angle of the target image and the preset image angle standard to obtain a processed image.
In one embodiment, the step of sending the processed image to the receiving terminal corresponding to the receiving terminal identifier further includes: receiving a video playing request sent by a receiving terminal, wherein the video playing request carries video selection information; acquiring corresponding video selection content in the video data according to the video selection information; and transmitting the video selection content to the receiving terminal.
In one embodiment, there is provided a computer-readable storage medium, the computer-readable storage medium being configured on a server, the computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of: receiving a video sending request sent by a sending terminal, wherein the video sending request carries video data and a receiving terminal identifier; acquiring a target image in video data; acquiring an image angle of a target image; carrying out angle adjustment on the target image according to the image angle of the target image and a preset image angle standard to obtain a processed image; and sending the processed image to a receiving terminal corresponding to the receiving terminal identification.
In one embodiment, the processor executes the computer program to further perform the following steps: receiving image selection information sent by a sending terminal; the step of acquiring a target image in the video data comprises: and acquiring a target image in the video data according to the image selection information.
In one embodiment, when the target image includes a human face, the step of obtaining the image angle of the target image includes: acquiring a face angle in a target image and a face angle in a reference image of the target image, wherein the reference image comprises a previous image of the target image and/or a subsequent image of the target image in video data; calculating the difference value of the face angle of the target image and the face angle of the reference image; and when the difference value is within a preset threshold value, acquiring the image angle of the target image according to the face angle of the target image.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring the image size of a target image; the method comprises the following steps of adjusting the angle of a target image according to the image angle of the target image and a preset image angle standard to obtain a processed image: zooming the target image according to the image size of the target image and a preset image size standard, and adjusting the angle of the target image according to the image angle of the target image and the preset image angle standard to obtain a processed image.
In one embodiment, the step of sending the processed image to the receiving terminal corresponding to the receiving terminal identifier further includes the following steps: receiving a video playing request sent by a receiving terminal, wherein the video playing request carries video selection information; acquiring corresponding video selection content in the video data according to the video selection information; and transmitting the video selection content to the receiving terminal.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, or a Read-Only Memory (ROM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.