Multimedia data display method, device, computer equipment and storage medium
By detecting the face area in the image and determining the deformation area, and deforming according to the pixel position and intensity information, the problem of uneven edges in face deformation is solved, and the display effect and user experience of multimedia data are improved.
Patent Information
- Application Number
- CN202011139508.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-22
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-10-22
AI Technical Summary
In the existing technology, during the face deformation process, the edges are not smooth due to the position deviation of pixels, which affects the display effect of the image or video, thereby reducing the user experience.
By detecting the face area in the image, the deformation area that meets the target shape conditions is determined, and the deformation is performed based on the position information and deformation intensity information of the pixels to ensure that the deformed pixel position is within the deformation area and avoid the problem of uneven edges.
It improves the display effect of multimedia data and improves the user experience. By limiting the deformation range of pixels, it ensures that the offset of edge pixels does not exceed the deformation area, avoids edge unevenness, and enhances the display quality of images and videos.
Smart Images

Figure CN112257594B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for displaying multimedia data. Background Art
[0002] With the continuous development of various social applications, photography applications, and image processing applications, new photography functions such as filters, stickers, beauty and makeup, face slimming, and face deformation are emerging in an endless stream. Among them, the face deformation function is widely welcomed by users due to its fun and funny effects.
[0003] Currently, when deforming a face in an image or video, it is mainly achieved through pixel-based deformation. Relevant technicians pre-set the deformation intensity of the entire face area, and the computer device deforms the face based on the pre-set deformation degree, and then displays the deformed image or video.
[0004] In the above implementation process, since approximate processing is usually adopted when determining the position of the pixel after deformation, the pixel position will be biased. For edge pixels, the position deviation will cause very obvious edge unevenness. Displaying based on such images or videos will result in poor display effects of multimedia data such as images or videos, and thus lead to poor user experience. Summary of the invention
[0005] The embodiments of the present application provide a method, device, computer equipment and storage medium for displaying multimedia data, which can improve the display effect of multimedia data and thus improve the user experience. The technical solution is as follows:
[0006] In one aspect, a method for displaying multimedia data is provided, the method comprising:
[0007] Detecting the first image to be displayed, and determining a face area in the first image;
[0008] Based on the face region, determining a deformation region that meets a target shape condition;
[0009] In the deformation region, based on the position information of the pixel points in the deformation region and the deformation strength information of the deformation region, the deformation region is deformed to obtain a second image;
[0010] The second image is displayed.
[0011] In a possible implementation manner, in the deformation region, based on position information of pixels in the deformation region and deformation strength information of the deformation region, deforming the deformation region includes:
[0012] Based on the position information of each pixel point in the deformation area, determining the position information of the center point of the deformation area;
[0013] For any pixel point in the deformation area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformation area, wherein one piece of distance information corresponds to one piece of deformation intensity information;
[0014] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0015] In a possible implementation, the deformation strength information is deformation strength information in an orthogonal direction;
[0016] In the deformation region, based on the position information of the pixel points in the deformation region and the deformation strength information of the deformation region, deforming the deformation region includes:
[0017] Based on the position information of each pixel point in the deformation area, determining the position information of the center point of the deformation area;
[0018] For any pixel point in the deformed area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformed area;
[0019] If the position information indicates that the any pixel point is located in an orthogonal direction, the any pixel point is offset according to the deformation intensity information in the orthogonal direction corresponding to the distance information;
[0020] If the position information indicates that any pixel point is located in a non-orthogonal direction, the any pixel point is offset according to the deformation strength information determined based on the distance information.
[0021] In a possible implementation manner, the offsetting of any pixel point according to the deformation strength information determined based on the distance information includes:
[0022] Determine, according to the distance information, first distance information and second distance information of the distance information in orthogonal directions;
[0023] Determine the deformation strength information corresponding to the distance information according to the deformation strength information in the orthogonal directions respectively corresponding to the first distance information and the second distance information;
[0024] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0025] In a possible implementation manner, after determining the deformation region that meets the target shape condition based on the face region, the method further includes:
[0026] Displaying the border of the deformation area;
[0027] In response to the adjustment operation on the frame of the deformation region, the adjusted deformation region is determined as the deformation region to be deformed.
[0028] In a possible implementation, the process of determining the deformation area includes:
[0029] Input the first image into a face detection model, and output a positioning frame of the face area through the face detection model;
[0030] In the positioning frame of the face region, the deformation region tangent to the positioning frame is determined.
[0031] In a possible implementation manner, in the deformation region, based on position information of pixels in the deformation region and deformation strength information of the deformation region, after deforming the deformation region to obtain the second image, the method further includes:
[0032] Determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points;
[0033] Determine, according to the target number of pixel points and the target number of corresponding pixel points, affine transformation information of the deformation area, the affine transformation information is used to indicate an offset and a scaling factor of the deformation area;
[0034] In the deformation region, based on the affine transformation information, the deformation region is deformed to obtain a third image;
[0035] The third image is displayed.
[0036] In a possible implementation manner, after determining the deformation region that meets the target shape condition based on the face region, the method further includes at least one of the following:
[0037] In the deformation region, based on position information of pixels in the deformation region, deformation intensity information of the deformation region, and rotation angle information of the deformation region, the deformation region is deformed to obtain a second image;
[0038] In the deformation area, based on the position information of the pixels in the deformation area, the deformation strength information of the deformation area, and the aspect ratio information of the first image, the deformation area is deformed to obtain a second image.
[0039] In a possible implementation manner, the deformation strength information of the deformation region satisfies a deformation strength limit value, and the deformation strength limit value is used to indicate maximum deformation strength information and minimum deformation strength information of the deformation region.
[0040] In one aspect, a device for displaying multimedia data is provided, the device comprising:
[0041] A detection module, used to detect the first image to be displayed and determine the face area in the first image;
[0042] A region determination module, used for determining a deformation region satisfying a target shape condition based on the face region;
[0043] A deformation module, configured to deform the deformation region based on position information of pixels in the deformation region and deformation strength information of the deformation region, so as to obtain a second image;
[0044] The display module is used to display the second image.
[0045] In a possible implementation, the deformation module is used to:
[0046] Based on the position information of the pixel points in the deformed area, determining the position information of the center point of the deformed area;
[0047] For any pixel point in the deformation area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformation area, wherein one distance information corresponds to one deformation intensity information;
[0048] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0049] In a possible implementation, the deformation strength information is deformation strength information in an orthogonal direction;
[0050] The deformation module includes a determination submodule and a shift submodule;
[0051] The determination submodule is used to determine the position information of the center point of the deformation area based on the position information of the pixel points in the deformation area;
[0052] The determination submodule is further used to determine, for any pixel point in the deformation area, the distance information between the any pixel point and the center point of the deformation area based on the position information of the any pixel point and the position information of the center point;
[0053] The offset submodule is used to offset any pixel point according to the deformation intensity information in the orthogonal direction corresponding to the distance information if the position information indicates that the any pixel point is located in the orthogonal direction;
[0054] The offset submodule is further used to offset any pixel point according to deformation intensity information determined based on the distance information if the position information indicates that the any pixel point is located in a non-orthogonal direction.
[0055] In a possible implementation, the offset submodule is used to:
[0056] Determine, according to the distance information, first distance information and second distance information of the distance information in orthogonal directions;
[0057] Determine the deformation strength information corresponding to the distance information according to the deformation strength information in the orthogonal directions respectively corresponding to the first distance information and the second distance information;
[0058] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0059] In a possible implementation, the display module is further used to display a frame of the deformed area;
[0060] The determination module is further configured to determine, in response to an adjustment operation on the border of the deformation region, an adjusted deformation region as the deformation region to be deformed.
[0061] In a possible implementation, the process of determining the deformation area includes:
[0062] Input the first image into a face detection model, and output a positioning frame of the face area through the face detection model;
[0063] In the positioning frame of the face region, the deformation region tangent to the positioning frame is determined.
[0064] In a possible implementation, the device further includes:
[0065] A pixel point determination module, used to determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points;
[0066] An information determination module, used to determine affine transformation information of the deformation area according to the target number of pixel points and the target number of corresponding pixel points, the affine transformation information is used to indicate the offset and scaling factor of the deformation area;
[0067] The deformation module is further used to deform the deformation area based on the affine transformation information in the deformation area to obtain a third image;
[0068] The display module is also used to display the third image.
[0069] In a possible implementation, the deformation module is further configured to deform the deformation region based on position information of pixels in the deformation region, deformation intensity information of the deformation region, and rotation angle information of the deformation region, so as to obtain a second image.
[0070] The deformation module is also used to deform the deformation area based on the position information of the pixels in the deformation area, the deformation strength information of the deformation area, and the aspect ratio information of the first image to obtain the second image.
[0071] In a possible implementation manner, the deformation strength information of the deformation region satisfies a deformation strength limit value, and the deformation strength limit value is used to indicate maximum deformation strength information and minimum deformation strength information of the deformation region.
[0072] On the one hand, a computer device is provided, which includes one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the program code is loaded and executed by the one or more processors to implement the operations performed by the multimedia data display method.
[0073] On the one hand, a computer-readable storage medium is provided, in which at least one program code is stored, and the program code is loaded and executed by a processor to implement the operations performed by the multimedia data display method.
[0074] In one aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising a computer program code, the computer program code being stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code to implement the operations performed by the method for displaying multimedia data.
[0075] The solution provided by the present application determines a deformation area that meets the target shape condition after determining the face area in the first image to be displayed, and then limits the deformation of the pixels in the deformation area. The deformation area is deformed according to the deformation strength information of the deformation area. Due to the limitation of the deformation area, the pixels on the edge will not exceed the deformation area after being offset, thereby avoiding the problem of uneven edges. Displaying the second image obtained based on such deformation can improve the image display effect in the multimedia data, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0077] Figure 1 It is a schematic diagram of an implementation environment of a multimedia data display method provided in an embodiment of the present application;
[0078] Figure 2 is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application;
[0079] Figure 3 is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application;
[0080] Figure 4 is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application;
[0081] Figure 5 is a structural schematic diagram of a multimedia data display device provided in an embodiment of the present application;
[0082] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0084] Figure 1 is a schematic diagram of an implementation environment of a multimedia data display method provided in an embodiment of the present application, see Figure 1 , the implementation environment includes: a terminal 101 and a server 102.
[0085] Terminal 101 may be at least one of a smart phone, a tablet computer, a smart watch, a laptop, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, and a laptop computer. Optionally, terminal 101 and server 102 communicate via a wired network or a wireless network, which is not limited in this application. Terminal 101 obtains shooting templates with a variety of funny deformation effects from server 102, and then obtains images through a camera component, deforms the face in the image based on the obtained shooting template, and obtains a deformed image or video. Optionally, the camera component is built-in or external to terminal 101, which is not limited in this application. Terminal 101 sends the deformed image or video to server 102, so that terminal 101 can share the deformed image or video through server 102.
[0086] Terminal 101 may generally refer to one of multiple terminals. This embodiment is only illustrated by terminal 101. Those skilled in the art may know that the number of the above terminals may be more or less. For example, the above terminals may be only a few, or the above terminals may be dozens or hundreds, or more. The embodiment of the present application does not limit the number of terminals and device types.
[0087] The server 102 can be at least one of a single server, multiple servers, a cloud server, a cloud computing platform, and a virtualization center. Optionally, the server 102 and the terminal 101 communicate via a wired network or a wireless network, which is not limited in this application. The server 102 is associated with a template database for storing multiple shooting templates. The server 102 obtains multiple shooting templates from the template database, and then sends the obtained shooting templates to the terminal 101, and receives the deformed image sent by the terminal 101, stores the received image or video, or sends the received image or video to the terminal corresponding to other users. Optionally, the number of the above servers can be more or less, which is not limited in this embodiment of the present application. Of course, the server 102 can also include other functional servers to provide more comprehensive and diversified services.
[0088] Figure 2 is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application, see Figure 2 , the method comprising:
[0089] 201. A computer device detects a first image to be displayed, and determines a face region in the first image.
[0090] 202. The computer device determines a deformation region that meets a target shape condition based on the face region.
[0091] 203. The computer device deforms the deformation area based on the position information of the pixels in the deformation area and the deformation strength information of the deformation area to obtain a second image.
[0092] 204. The computer device displays the second image.
[0093] The solution provided by the embodiment of the present application determines a deformation area that meets the target shape condition after determining the face area in the first image to be displayed, and then limits the deformation of the pixels in the deformation area. The deformation area is deformed according to the deformation strength information of the deformation area. Due to the limitation of the deformation area, the pixels on the edge will not exceed the deformation area after being offset, thereby avoiding the problem of uneven edges. Displaying the second image obtained based on such deformation can improve the image display effect in the multimedia data, thereby improving the user experience.
[0094] In a possible implementation manner, in the deformation region, based on position information of pixels in the deformation region and deformation strength information of the deformation region, deforming the deformation region includes:
[0095] Based on the position information of the pixel points in the deformed area, determining the position information of the center point of the deformed area;
[0096] For any pixel point in the deformation area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformation area, wherein one piece of distance information corresponds to one piece of deformation intensity information;
[0097] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0098] In a possible implementation, the deformation strength information is deformation strength information in an orthogonal direction;
[0099] In the deformation region, based on the position information of the pixel points in the deformation region and the deformation strength information of the deformation region, deforming the deformation region includes:
[0100] Based on the position information of the pixel points in the deformed area, determining the position information of the center point of the deformed area;
[0101] For any pixel point in the deformed area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformed area;
[0102] If the position information indicates that the any pixel point is located in an orthogonal direction, the any pixel point is offset according to the deformation intensity information in the orthogonal direction corresponding to the distance information;
[0103] If the position information indicates that any pixel point is located in a non-orthogonal direction, the any pixel point is offset according to the deformation strength information determined based on the distance information.
[0104] In a possible implementation manner, the offsetting of any pixel point according to the deformation strength information determined based on the distance information includes:
[0105] Determine, according to the distance information, first distance information and second distance information of the distance information in orthogonal directions;
[0106] Determine the deformation strength information corresponding to the distance information according to the deformation strength information in the orthogonal directions respectively corresponding to the first distance information and the second distance information;
[0107] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0108] In a possible implementation manner, after determining the deformation region that meets the target shape condition based on the face region, the method further includes:
[0109] Displaying the border of the deformation area;
[0110] In response to the adjustment operation on the frame of the deformation region, the adjusted deformation region is determined as the deformation region to be deformed.
[0111] In a possible implementation, the process of determining the deformation area includes:
[0112] Input the first image into a face detection model, and output a positioning frame of the face area through the face detection model;
[0113] In the positioning frame of the face region, the deformation region tangent to the positioning frame is determined.
[0114] In a possible implementation manner, in the deformation region, based on position information of pixels in the deformation region and deformation strength information of the deformation region, after deforming the deformation region to obtain the second image, the method further includes:
[0115] Determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points;
[0116] Determine, according to the target number of pixel points and the target number of corresponding pixel points, affine transformation information of the deformation area, the affine transformation information is used to indicate an offset and a scaling factor of the deformation area;
[0117] In the deformation region, based on the affine transformation information, the deformation region is deformed to obtain a third image;
[0118] The third image is displayed.
[0119] In a possible implementation manner, after determining the deformation region that meets the target shape condition based on the face region, the method further includes at least one of the following:
[0120] In the deformation region, based on position information of pixels in the deformation region, deformation intensity information of the deformation region, and rotation angle information of the deformation region, the deformation region is deformed to obtain a second image;
[0121] In the deformation area, based on the position information of the pixels in the deformation area, the deformation strength information of the deformation area, and the aspect ratio information of the first image, the deformation area is deformed to obtain a second image.
[0122] In a possible implementation manner, the deformation strength information of the deformation region satisfies a deformation strength limit value, and the deformation strength limit value is used to indicate maximum deformation strength information and minimum deformation strength information of the deformation region.
[0123] Figure 3 is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application, see Figure 3 , the method comprising:
[0124] 301. The terminal detects a first image to be displayed and determines a face region in the first image.
[0125] It should be noted that the visual interface of the terminal includes a shooting function entry, and the user can use the shooting function provided by the terminal by triggering the shooting function entry. In response to the user's triggering operation on the shooting function entry, the terminal acquires the first image within the shooting range through the camera component.
[0126] In a possible implementation, the terminal inputs the acquired first image into a face detection model, and outputs a positioning frame of the face area through the face detection model.
[0127] The face detection model is a multi-task convolutional neural network (MTCNN), which includes three cascaded convolutional neural networks (CNN), namely, the proposal network, the refine network, and the output network. Among them, the proposal network includes three convolutional layers, the refine network includes three convolutional layers and one fully connected layer, and the output network includes four convolutional layers and one fully connected layer. The processing process of each network is as follows:
[0128] The terminal inputs the first image into the first convolution layer of the Proposal Network, extracts the image features of the first image through the first convolution layer, and then inputs the image features into the next convolution layer, and so on, until the last convolution layer outputs multiple candidate face windows in the first image. The terminal then inputs the multiple candidate face windows into the first convolution layer of the Refine Network, extracts the image features of the candidate face windows through the first convolution layer, and then inputs the image features into the next convolution layer for feature extraction, and so on, until the last convolution layer outputs the final extracted image features, and then outputs the face window in the first image through the fully connected layer. Finally, the face window is input into the first convolution layer of the Output Network, extracts the image features of the face window through the first convolution layer, and then inputs the image features into the next convolution layer for feature extraction, and so on, until the last convolution layer outputs the final extracted face feature points, and then the fully connected layer outputs the face feature points and the positioning frame of the face area determined based on the face feature points.
[0129] It should be noted that the face detection module is obtained by the server through training the initial model, and the structure of the initial model is the same as that of the face detection model. After the model training is completed, the server sends the trained model, that is, the face detection model, to the terminal so that the terminal can detect the face in the image through the face detection model. The training process of the face detection model is as follows:
[0130] The server obtains multiple sample images and facial feature points and facial region positioning frames in the sample images, and then inputs the obtained sample images into the initial model, processes the sample images through various networks in the initial model, and the specific process is the same as the above process, which will not be repeated here, and finally obtains the facial feature points in the sample images and the facial region positioning frames determined based on the facial feature points, and then determines the loss function value of the initial model according to the facial feature points and facial region positioning frames in the obtained sample images and the facial feature points and facial region positioning frames in the sample images obtained by model recognition, and adjusts the parameters of the initial model according to the loss function value through the gradient descent method, and then continues to process the next sample image in the same way as the above process, until the adjusted initial model meets the preset conditions, and the initial model that meets the preset conditions is used as the trained face detection model.
[0131] Among them, the preset condition can be that the accuracy of the prediction result meets the iteration cutoff condition, or that the loss function value meets the iteration cutoff condition, or that the number of iterations reaches a preset number. The embodiment of the present application does not limit which specific condition is used as the preset condition.
[0132] It should be noted that the above process is only an exemplary face detection method. In more possible implementations, the terminal uses other methods to detect the first image to determine the face area in the first image. The embodiment of the present application does not limit the specific method used.
[0133] 302. The terminal determines a deformation region that meets a target shape condition based on the face region.
[0134] It should be noted that the positioning frame of the face area determined in the above step 301 is a rectangular frame, and the terminal can determine the deformation area that meets the target shape condition based on the positioning frame of the face area.
[0135] In a possible implementation manner, the terminal determines the deformation area tangent to the positioning frame within the positioning frame of the face area.
[0136] Optionally, the target shape condition is an arbitrary shape, for example, the target shape condition is a triangle, a perfect circle, an ellipse, etc., which is not limited in the embodiment of the present application.
[0137] It should be noted that after the terminal determines the shape area that meets the target conditions, the frame of the deformation area is displayed on the visual interface. The frame includes movable key points. The user can adjust the deformation area by sliding the key points. The terminal responds to the adjustment operation of the frame of the deformation area and determines the adjusted deformation area as the deformation area to be deformed. By setting movable key points on the frame of the deformation area, the user can adjust the size, shape, etc. of the deformation area, increase the interactive operation and fun in the deformation process, and improve the user experience.
[0138] 303. The terminal determines the position information of the center point of the deformed area based on the position information of the pixel points in the deformed area.
[0139] It should be noted that, since the above step 302 has determined the deformation area that meets the target shape, in step 303, the pixel point located at the center point of the deformation area can be determined from all the pixel points of the deformation area as the center point of the deformation area, and then the center point is used as the coordinate origin to construct a coordinate system, so that the position information of the center point and each pixel point in the deformation area, that is, the coordinates, can be obtained. Optionally, the coordinate origin is other pixel points, which is not limited in the embodiment of the present application.
[0140] 304. For any pixel point in the deformed area, the terminal determines distance information between the any pixel point and the center point of the deformed area based on the position information of the any pixel point and the center point position information, wherein one distance information corresponds to one deformation strength information.
[0141] In one possible implementation, for any pixel point in the deformed area, the terminal obtains the position information of the any pixel point, that is, the coordinates, and then determines the distance information between the any pixel point and the center point based on the coordinates of the any pixel point and the coordinates of the center point, that is, the distance between the any pixel point and the center point.
[0142] It should be noted that different distance information corresponds to different deformation strength information, that is, a deformation area includes multiple deformation strength information, and the multiple deformation strength information is pre-set by relevant technical personnel. For example, relevant technical personnel only set the deformation strength information of the pixel points where the border of the deformation area intersects with the two coordinate axes in the orthogonal direction, that is, the deformation strength information in the orthogonal direction, so that the terminal can determine the deformation strength information of other pixel points in the deformation area based on the distance between the pixel points where the border of the deformation area intersects with the two coordinate axes in the orthogonal direction and the center point, and the deformation strength information of these pixel points, or the relevant technical personnel set the corresponding deformation strength information for each distance information, or the relevant technical personnel set the deformation strength information of the unit distance, so that the terminal can determine the deformation strength information based on the determined distance information, and the embodiments of the present application are not limited to this.
[0143] The orthogonal directions are two directions perpendicular to each other, such as a horizontal direction and a vertical direction. Optionally, there are many other possible forms of the orthogonal directions, which are not limited in the embodiments of the present application.
[0144] By setting different deformation strength information for different distance information, the deformation degree of pixels at the same distance from the center point is ensured to be the same, thereby ensuring that the deformation degree of edge pixels is the same, avoiding the problem of uneven edges, improving the deformation effect of the image, and then improving the image display effect and user experience.
[0145] Optionally, when setting the deformation strength information, the relevant technicians set the deformation strength limit value, which is used to indicate the maximum deformation strength information and the minimum deformation strength information of the deformation area, and the deformation strength information of the deformation area meets the deformation strength limit value. By setting the deformation strength limit value, it is avoided that the deformation degree of the edge of the deformation area is large, the difference between the pixels outside the deformation area is large, and the problem of faults on the edge is avoided, thereby improving the deformation effect of the image, thereby improving the display effect of the image and improving the user experience.
[0146] 305. The terminal shifts any pixel point according to the deformation strength information corresponding to the distance information until all pixel points in the deformation area are processed to obtain a second image.
[0147] In a possible implementation, the terminal determines the deformation strength information of the unit distance based on the deformation strength information of the deformation area, and then determines the deformation strength information of any pixel point based on the distance information between any pixel point and the center point combined with the deformation strength information of the unit distance. That is, the product of the distance value corresponding to the distance information and the deformation strength value corresponding to the deformation strength information of the unit distance is determined as the deformation strength value corresponding to the deformation strength information of any pixel point, so as to obtain the deformation strength information of any pixel point, and then offset the any pixel point based on the deformation strength information, and so on, to process each pixel point in the deformation area, so as to obtain a second image.
[0148] In another possible implementation, the terminal determines the deformation intensity information of any pixel point based on the distance information between any pixel point and the center point and the deformation intensity information corresponding to the distance information, and then offsets the any pixel point based on the deformation intensity information, and so on, to process each pixel point in the deformed area, thereby obtaining a second image.
[0149] In another possible implementation, the terminal determines the deformation strength information of any pixel point based on the distance information between any pixel point and the center point combined with the deformation strength information of the unit distance, that is, the product of the distance value corresponding to the distance information and the deformation strength value corresponding to the deformation strength information of the unit distance is determined as the deformation strength value corresponding to the deformation strength information of any pixel point, so as to obtain the deformation strength information of any pixel point, and then offset the any pixel point based on the deformation strength information, and so on, to process each pixel point in the deformed area, so as to obtain a second image.
[0150] Optionally, when deforming the deformation area, the terminal obtains rotation angle information of the deformation area, aspect ratio information of the first image, etc., and then deforms the deformation area based on this information and deformation strength information.
[0151] In a possible implementation, the terminal deforms the deformation area based on position information of each pixel in the deformation area, deformation strength information of the deformation area, and rotation angle information of the deformation area to obtain a second image.
[0152] That is, the terminal determines the deformation strength information of any pixel point based on the distance information between any pixel point and the center point and the deformation strength information corresponding to the distance information, and then offsets the any pixel point based on the deformation strength information and the rotation angle information of the deformation area, and so on, to process each pixel point in the deformation area, thereby obtaining a second image.
[0153] In another possible implementation, the terminal deforms the deformed area based on position information of each pixel in the deformed area, deformation strength information of the deformed area, and aspect ratio information of the first image to obtain a second image.
[0154] That is, the terminal determines the deformation strength information of any pixel point based on the distance information between any pixel point and the center point and the deformation strength information corresponding to the distance information, and then offsets the any pixel point based on the deformation strength information, and so on, to process each pixel point in the deformation area, and then multiply the deformed image by the aspect ratio information of the first image to obtain the second image.
[0155] In more possible implementations, the terminal deforms the deformed area based on the position information of each pixel in the deformed area, the deformation intensity information of the deformed area, the rotation angle information of the deformed area, and the aspect ratio information of the first image to obtain a second image. The specific process is the same as the above process and will not be repeated here.
[0156] It should be noted that the process of step 305 is implemented through the Open Graphics Library (OpenGL). The image stretching deformation can be achieved through the pixel linear interpolation of OpenGL. For example, the pixel sampling offset can be achieved by offsetting the texture coordinates of OpenGL, that is, setting an offset for the texture coordinates can offset the pixel color sampling. Moreover, because OpenGL can automatically perform pixel interpolation, the misplaced pixels will be displayed in the image in a stretched form, thereby achieving the image stretching deformation. In addition, OpenGL can process multiple pixels in parallel at the same time, thereby improving the image processing efficiency. By processing multiple pixels in parallel, multiple pixels can be offset simultaneously to achieve a deformation effect that meets the target shape conditions.
[0157] 306. The terminal displays the second image.
[0158] It should be noted that the deformation effect can move with the movement of the face to ensure real-time display. For example, when shooting a video, the second image is used as any frame image in the video data, and the terminal can move, rotate or scale the deformation area in the next frame image based on the second image to ensure that the deformation effect moves with the movement of the face.
[0159] In a possible implementation, the terminal determines a target number of pixels and a target number of corresponding pixels from the second image and the next frame image corresponding to the second image in the video data, respectively. The pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points. Based on the target number of pixels and the target number of corresponding pixels, the affine transformation information of the deformed area is determined. The affine transformation information is used to indicate the offset and scaling factor of the deformed area. In the deformed area, based on the affine transformation information, the deformed area is deformed to obtain a third image, and the third image is displayed. The target number is an arbitrary integer value greater than or equal to 3, and the embodiment of the present application does not limit the specific value of the target number.
[0160] Among them, the affine transformation information is represented in the form of an affine transformation matrix. Through the affine transformation matrix, the deformed area can be associated with the facial feature points obtained by face detection. By applying the affine transformation matrix to the deformed area, the deformed area can be rotated, moved and scaled accordingly with the rotation, movement and scaling of the face, thereby ensuring the real-time deformation effect and improving the user experience.
[0161] It should be noted that the above steps 301 to 306 are explained by taking the example of the terminal acquiring the image by itself and detecting and deforming the image. In more possible implementation methods, after acquiring the first image, the terminal sends the first image to the server, and the server detects and deforms the first image. The specific process is the same as the above steps 301 to 305 and will not be repeated here. The server sends the second image obtained after the first image is deformed to the terminal, and the terminal displays the second image. The embodiment of the present application does not limit this.
[0162] The solution provided in the embodiment of the present application can be used in various fields such as image shooting, video shooting, and live broadcasting. By displaying the deformed image of the anchor in real time during the live broadcast, it can increase the interactivity between the anchor and the audience, provide rich and colorful gameplay and creativity, attract users, increase user stickiness, and improve user experience.
[0163] The solution provided by the embodiment of the present application determines a deformation area that meets the target shape condition after determining the face area in the first image to be displayed, and then limits the deformation of the pixels in the deformation area. The deformation area is deformed according to the deformation strength information of the deformation area. Due to the limitation of the deformation area, the pixels on the edge will not exceed the deformation area after being offset, thereby avoiding the problem of uneven edges. Displaying the second image obtained based on such deformation can improve the image display effect in the multimedia data, thereby improving the user experience.
[0164] The above steps 301 to 306 are explained by taking the same distance information corresponding to the same deformation strength information as an example. In more possible implementations, the same distance information corresponds to different deformation strength information. For example, for a deformation region that satisfies the target shape condition of an ellipse, the orthogonal directions are the major axis direction and the minor axis direction, and the deformation strength information in the orthogonal directions is set to different values to achieve deformation of the deformation region based on the ellipse shape, see Figure 4 , Figure 4 : is a flowchart of a method for displaying multimedia data provided by an embodiment of the present application, the method comprising:
[0165] 401. The terminal detects a first image to be displayed and determines a face region in the first image.
[0166] It should be noted that this step is the same as the above step 301 and will not be repeated here.
[0167] 402. The terminal determines a deformation region that meets a target shape condition based on the face region.
[0168] It should be noted that this step is the same as the above step 302 and will not be repeated here.
[0169] 403. The terminal determines the position information of the center point of the deformed area based on the position information of the pixel points in the deformed area.
[0170] It should be noted that this step is the same as the above step 303 and will not be repeated here.
[0171] 404. For any pixel point in the deformed area, the terminal determines distance information between the any pixel point and the center point of the deformed area based on the position information of the any pixel point and the position information of the center point.
[0172] In one possible implementation, for any pixel point in the deformed area, the terminal obtains the position information of the any pixel point, that is, the coordinates, and then determines the distance information between the any pixel point and the center point based on the coordinates of the any pixel point and the coordinates of the center point, that is, the distance between the any pixel point and the center point.
[0173] 405. If the position information indicates that any pixel point is located in an orthogonal direction, the terminal offsets any pixel point according to the deformation intensity information in the orthogonal direction corresponding to the distance information until all pixel points in the deformation area are processed to obtain a second image, and execute step 409.
[0174] It should be noted that a deformation area includes multiple deformation strength information, which is pre-set by relevant technical personnel. For example, relevant technical personnel only set the deformation strength information of the pixel points where the border of the deformation area intersects with the two coordinate axes in the orthogonal direction, that is, the deformation strength information in the orthogonal direction, so that the terminal can determine the deformation strength information of other pixel points in the deformation area based on the distance between the pixel points where the border of the deformation area intersects with the two coordinate axes in the orthogonal direction and the center point, and the deformation strength information of these pixel points, or the relevant technical personnel set the deformation strength information of the unit distance in the two orthogonal directions, so that the terminal can determine the deformation strength information based on the determined distance information, and the embodiments of the present application are not limited to this.
[0175] In one possible implementation, if the position information indicates that any pixel point is located in an orthogonal direction, the terminal determines the deformation strength information of the unit distance in the two orthogonal directions according to the deformation strength information in the orthogonal direction, and then determines the deformation strength information of the any pixel point according to the position of the any pixel point and the distance information between the any pixel point and the center point, combined with the deformation strength information of the unit distance corresponding to the direction in which the position of the any pixel point is located. That is, the product of the distance value corresponding to the distance information and the deformation strength value corresponding to the deformation strength information of the unit distance in the direction in which the position of the any pixel point is located is determined as the deformation strength value corresponding to the deformation strength information of the any pixel point, so as to obtain the deformation strength information of the any pixel point, and then offset the any pixel point based on the deformation strength information, and so on, to process each pixel point in the deformed area, thereby obtaining a second image.
[0176] In another possible implementation, if the position information indicates that any pixel point is located in an orthogonal direction, the terminal determines in which of the two orthogonal directions the any pixel point is located based on the position information of the any pixel point, and then determines the deformation strength information of the any pixel point based on the deformation strength information of the unit distance corresponding to the direction in which the any coordinate point is located, and the distance information between the any pixel point and the center point, that is, the product of the distance value corresponding to the distance information and the deformation strength value corresponding to the deformation strength information of the unit distance in the direction in which the position of the any pixel point is located is determined as the deformation strength value corresponding to the deformation strength information of the any pixel point, so as to obtain the deformation strength information of the any pixel point, and then offset the any pixel point based on the deformation strength information, and so on, to process each pixel point in the deformed area, thereby obtaining a second image.
[0177] Optionally, when setting the deformation strength information, the relevant technicians set the deformation strength limit value, which is used to indicate the maximum deformation strength information and the minimum deformation strength information of the deformation area, and the deformation strength information of the deformation area in the orthogonal direction meets the deformation strength limit value. By setting the deformation strength limit value, it is avoided that the deformation degree of the edge of the deformation area is large, the difference between the pixels outside the deformation area is large, and the problem of faults on the edge is avoided, thereby improving the deformation effect of the image, thereby improving the display effect of the image and improving the user experience.
[0178] 406. If the position information indicates that any pixel point is located in a non-orthogonal direction, the terminal determines first distance information and second distance information of the distance information in the orthogonal direction according to the distance information.
[0179] In a possible implementation, if the position information indicates that any pixel point is located in a non-orthogonal direction, the terminal determines the distance information between the any pixel point and the center point of the deformation area according to the position information of the any pixel point, and then determines the first distance information and the second distance information of the distance information in the orthogonal direction. For example, the orthogonal directions are the horizontal direction and the vertical direction, the coordinates corresponding to the center point position information are (0,0), and the coordinates corresponding to the position information of the any pixel point are (1,1). The terminal determines that the angle between the line between the any pixel point and the center point and the horizontal direction is 45 degrees, and the distance corresponding to the distance information of the any pixel point and the center point is 1.414. The first distance information of the distance information of the any pixel point and the center point in the horizontal direction is 1, and the first distance information in the vertical direction is 1.
[0180] In another possible implementation, if the position information indicates that any pixel point is located in a non-orthogonal direction, the terminal directly determines the first distance information and the second distance information of the distance information of any pixel point and the center point in the orthogonal direction according to the position information of any pixel point. For example, if the coordinates corresponding to the center point position information are (0,0), and the coordinates corresponding to the position information of any pixel point are (1,1), then the first distance information of the distance information of any pixel point and the center point in the horizontal direction is 1, and the first distance information in the vertical direction is 1.
[0181] 407. The terminal determines deformation strength information corresponding to the distance information according to the deformation strength information in orthogonal directions corresponding to the first distance information and the second distance information respectively.
[0182] In a possible implementation, the terminal determines the deformation strength information of the unit distance in the two orthogonal directions based on the deformation strength information in the orthogonal directions and the distance between the pixel point where the border of the deformation area intersects the two coordinate axes in the orthogonal directions and the center point, and then determines the deformation strength information of any pixel point based on the first distance information and the second distance information in combination with the deformation strength information of the unit distance in the two orthogonal directions. That is, the deformation strength information in the horizontal direction is determined as the deformation strength information per unit distance in the horizontal direction by the ratio of the distance between the pixel point where the border of the deformation area intersects the coordinate axis in the horizontal direction and the center point, and the distance value corresponding to the deformation strength information per unit distance in the horizontal direction is multiplied by the distance value corresponding to the first distance information and the deformation strength value corresponding to the deformation strength information per unit distance in the horizontal direction as the deformation strength value indicated by the deformation strength information corresponding to the first distance information. The deformation strength information in the vertical direction is determined as the deformation strength information per unit distance in the vertical direction by the ratio of the distance between the pixel point where the border of the deformation area intersects the coordinate axis in the vertical direction and the center point, and the distance value corresponding to the second distance information is multiplied by the distance value corresponding to the deformation strength information per unit distance in the vertical direction as the deformation strength value indicated by the deformation strength information corresponding to the second distance information. Then, the vector sum of the deformation strength value indicated by the deformation strength information corresponding to the first distance information and the deformation strength value indicated by the deformation strength information corresponding to the second distance information is determined to obtain the deformation strength information of any pixel point.
[0183] For example, still taking the coordinate corresponding to the center point position information as (0,0) and the coordinate corresponding to the position information of any pixel point as (1,1), the coordinate corresponding to the position information of the pixel point where the border of the deformation area intersects the horizontal coordinate axis is (2,0), and the coordinate corresponding to the position information of the pixel point where the border of the deformation area intersects the vertical coordinate axis is (0,3). The deformation strength value corresponding to the deformation strength information of these two pixel points is 6, and the deformation strength value per unit distance in the horizontal direction is 3, and the deformation strength value per unit distance in the vertical direction is 2. The deformation strength value corresponding to the first distance information is 3, and the deformation strength value corresponding to the second distance information is 2. The deformation strength value corresponding to the deformation strength information of any pixel point is 3.6.
[0184] In another possible implementation, when relevant technicians directly set the deformation strength information of a unit distance in two orthogonal directions, the process of determining the deformation strength information of any pixel point is the same as the above process and will not be repeated here.
[0185] 408. The terminal shifts any pixel point according to the deformation strength information corresponding to the distance information until all pixel points in the deformation area are processed to obtain a second image.
[0186] It should be noted that the terminal shifts any pixel point based on the deformation strength information, and processes each pixel point in the deformation area in a similar manner to obtain a second image.
[0187] 409. The terminal displays the second image.
[0188] It should be noted that the deformation effect can move with the movement of the face to ensure real-time display. For example, when shooting a video, the second image is used as any frame image in the video data, and the terminal can move, rotate or scale the deformation area in the next frame image based on the second image to ensure that the deformation effect moves with the movement of the face.
[0189] In a possible implementation, the terminal determines a target number of pixels and a target number of corresponding pixels from the second image and the next frame image corresponding to the second image in the video data, respectively. The pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points. Based on the target number of pixels and the target number of corresponding pixels, the affine transformation information of the deformed area is determined. The affine transformation information is used to indicate the offset and scaling factor of the deformed area. In the deformed area, based on the affine transformation information, the deformed area is deformed to obtain a third image, and the third image is displayed. The target number is an arbitrary integer value greater than or equal to 3, and the embodiment of the present application does not limit the specific value of the target number.
[0190] Among them, the affine transformation information is represented in the form of an affine transformation matrix. Through the affine transformation matrix, the deformed area can be associated with the facial feature points obtained by face detection. By applying the affine transformation matrix to the deformed area, the deformed area can be rotated, moved and scaled accordingly with the rotation, movement and scaling of the face, thereby ensuring the real-time deformation effect and improving the user experience.
[0191] Among them, the above steps 401 to 409 are explained by taking the example of the terminal acquiring the image by itself and detecting and deforming the image. In more possible implementation methods, after acquiring the first image, the terminal sends the first image to the server, and the server detects and deforms the first image. The specific process is the same as the above steps 401 to 408, and will not be repeated here. The server sends the second image obtained after the first image is deformed to the terminal, and the terminal displays the second image. The embodiment of the present application does not limit this.
[0192] The solution provided in the embodiment of the present application can be used in various fields such as image shooting, video shooting, and live broadcasting. By displaying the deformed image of the anchor in real time during the live broadcast, it can increase the interactivity between the anchor and the audience, provide rich and colorful gameplay and creativity, attract users, increase user stickiness, and improve user experience.
[0193] The solution provided by the embodiment of the present application determines the deformation area that meets the target shape condition after determining the face area in the first image to be displayed, and then limits the deformation of the pixel points to the deformation area. According to the deformation strength information of the deformation area, the deformation area is deformed. Due to the limitation of the deformation area, the pixel points on the edge will not exceed the deformation area after offset, so that the problem of uneven edges can be avoided. The second image obtained based on such deformation is displayed, which can improve the image display effect in multimedia data and thus improve the user experience. By deforming the deformation area based on an elliptical shape, a more funny and comical effect can be produced, which improves the fun of multimedia data display such as images and videos, attracts users, and increases user stickiness.
[0194] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0195] Figure 5 is a schematic diagram of a multimedia data display device provided in an embodiment of the present application, see Figure 5 , the device comprises:
[0196] A detection module 501, configured to detect a first image to be displayed and determine a face region in the first image;
[0197] A region determination module 502, configured to determine a deformation region that satisfies a target shape condition based on the face region;
[0198] A deformation module 503, configured to deform the deformation region based on position information of pixels in the deformation region and deformation strength information of the deformation region to obtain a second image;
[0199] The display module 504 is configured to display the second image.
[0200] The device provided by the embodiment of the present application determines a deformation area that meets the target shape condition after determining the face area in the first image to be displayed, and then limits the deformation of the pixels in the deformation area. The deformation area is deformed according to the deformation strength information of the deformation area. Due to the limitation of the deformation area, the pixels on the edge will not exceed the deformation area after being offset, thereby avoiding the problem of uneven edges. The second image obtained based on such deformation is displayed, which can improve the image display effect in the multimedia data and thus improve the user experience.
[0201] In a possible implementation, the deformation module 503 is used to:
[0202] Based on the position information of the pixel points in the deformed area, determining the position information of the center point of the deformed area;
[0203] For any pixel point in the deformation area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformation area, wherein one distance information corresponds to one deformation intensity information;
[0204] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0205] In a possible implementation, the deformation strength information is deformation strength information in an orthogonal direction;
[0206] The deformation module 503 includes a determination submodule and a shift submodule;
[0207] The determination submodule is used to determine the position information of the center point of the deformation area based on the position information of the pixel points in the deformation area;
[0208] The determination submodule is further used to determine, for any pixel point in the deformation area, the distance information between the any pixel point and the center point of the deformation area based on the position information of the any pixel point and the position information of the center point;
[0209] The offset submodule is used to offset any pixel point according to the deformation intensity information in the orthogonal direction corresponding to the distance information if the position information indicates that the any pixel point is located in the orthogonal direction;
[0210] The offset submodule is further used to offset any pixel point according to deformation intensity information determined based on the distance information if the position information indicates that the any pixel point is located in a non-orthogonal direction.
[0211] In a possible implementation, the offset submodule is used to:
[0212] Determine, according to the distance information, first distance information and second distance information of the distance information in orthogonal directions;
[0213] Determine the deformation strength information corresponding to the distance information according to the deformation strength information in the orthogonal directions respectively corresponding to the first distance information and the second distance information;
[0214] The arbitrary pixel point is offset according to the deformation intensity information corresponding to the distance information.
[0215] In a possible implementation, the display module 504 is further configured to display a frame of the deformed area;
[0216] The determination module is further configured to determine, in response to an adjustment operation on the border of the deformation region, an adjusted deformation region as the deformation region to be deformed.
[0217] In a possible implementation, the process of determining the deformation area includes:
[0218] Input the first image into a face detection model, and output a positioning frame of the face area through the face detection model;
[0219] In the positioning frame of the face region, the deformation region tangent to the positioning frame is determined.
[0220] In a possible implementation, the device further includes:
[0221] A pixel point determination module, used to determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points;
[0222] An information determination module, used to determine affine transformation information of the deformation area according to the target number of pixel points and the target number of corresponding pixel points, the affine transformation information is used to indicate the offset and scaling factor of the deformation area;
[0223] The deformation module 503 is further configured to deform the deformation region based on the affine transformation information in the deformation region to obtain a third image;
[0224] The display module 504 is also used to display the third image.
[0225] In a possible implementation, the deformation module 503 is further configured to deform the deformation region based on position information of pixels in the deformation region, deformation intensity information of the deformation region, and rotation angle information of the deformation region to obtain a second image.
[0226] The deformation module 503 is further used to deform the deformation area based on the position information of the pixels in the deformation area, the deformation strength information of the deformation area, and the aspect ratio information of the first image to obtain the second image.
[0227] In a possible implementation manner, the deformation strength information of the deformation region satisfies a deformation strength limit value, and the deformation strength limit value is used to indicate maximum deformation strength information and minimum deformation strength information of the deformation region.
[0228] It should be noted that: the display device for multimedia data provided in the above embodiment only uses the division of the above functional modules as an example when displaying multimedia data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the display device for multimedia data provided in the above embodiment and the embodiment of the method for displaying multimedia data belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0229] Figure 6 600 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The computer device 600 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0230] Typically, the computer device 600 includes: one or more processors 601 and one or more memories 602 .
[0231] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0232] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one program code, which is used to be executed by the processor 601 to implement the display method of multimedia data provided in the method embodiment of the present application.
[0233] In some embodiments, the computer device 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608 and a power supply 609.
[0234] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0235] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other computer devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0236] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, set on the front panel of the computer device 600; in other embodiments, the display screen 605 can be at least two, respectively set on different surfaces of the computer device 600 or in a folding design; in other embodiments, the display screen 605 can be a flexible display screen, set on the curved surface or folding surface of the computer device 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0237] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the computer device, and the rear camera is arranged on the back of the computer device. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0238] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the computer device 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
[0239] The positioning component 608 is used to locate the current geographical location of the computer device 600 to implement navigation or LBS (Location Based Service). The positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0240] The power supply 609 is used to power various components in the computer device 600. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0241] In some embodiments, the computer device 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
[0242] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the computer device 600. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used to collect game or user motion data.
[0243] The gyro sensor 612 can detect the body direction and rotation angle of the computer device 600, and the gyro sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the computer device 600. The processor 601 can implement the following functions based on the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0244] The pressure sensor 613 can be set on the side frame of the computer device 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is set on the side frame of the computer device 600, it can detect the user's grip signal of the computer device 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0245] The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the computer device 600. When a physical button or a manufacturer logo is set on the computer device 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
[0246] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
[0247] The proximity sensor 616, also called a distance sensor, is usually disposed on the front panel of the computer device 600. The proximity sensor 616 is used to collect the distance between the user and the front of the computer device 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the computer device 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the computer device 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from the screen-off state to the screen-on state.
[0248] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the computer device 600, and the computer device 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different arrangement of components.
[0249] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including a program code, and the program code can be executed by a processor to complete the display method of multimedia data in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0250] In an exemplary embodiment, a computer program product or a computer program is also provided, which includes a computer program code, and the computer program code is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the method steps of the method for displaying multimedia data provided in the above-mentioned embodiment.
[0251] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0252] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for displaying multimedia data, It is characterized in that The method comprises: Inputting the first image to be displayed into the face detection model for detection, and determining a positioning frame of the face area in the first image; Based on the positioning frame of the face region, determining a deformation region that meets a target shape condition, wherein within the positioning frame of the face region, the deformation region is tangent to the positioning frame; Displaying a frame of the deformation area; In response to the adjustment operation on the border of the deformation area, determining the adjusted deformation area as the deformation area to be deformed; In the deformation region, based on position information of pixels in the deformation region and deformation strength information of the deformation region, deforming the deformation region to obtain a second image; displaying the second image, Determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points; Determining affine transformation information of the deformation area according to the target number of pixel points and the target number of corresponding pixel points, wherein the affine transformation information is used to indicate an offset and a scaling factor of the deformation area; In the deformation region, based on the affine transformation information, deforming the deformation region to obtain a third image; The third image is displayed.
2. The method according to claim 1, It is characterized in that In the deformation region, based on the position information of the pixel points in the deformation region and the deformation strength information of the deformation region, deforming the deformation region comprises: Determining the center point position information of the deformation area based on the position information of the pixel points in the deformation area; For any pixel point in the deformation area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformation area, wherein one piece of distance information corresponds to one piece of deformation strength information; The any pixel point is offset according to the deformation strength information corresponding to the distance information.
3. The method according to claim 1, It is characterized in that The deformation strength information is deformation strength information in an orthogonal direction; In the deformation region, based on the position information of the pixel points in the deformation region and the deformation strength information of the deformation region, deforming the deformation region comprises: Determining the center point position information of the deformation area based on the position information of the pixel points in the deformation area; For any pixel point in the deformed area, based on the position information of the any pixel point and the position information of the center point, determine the distance information between the any pixel point and the center point of the deformed area; If the position information indicates that any pixel point is located in an orthogonal direction, the any pixel point is offset according to the deformation intensity information in the orthogonal direction corresponding to the distance information; If the position information indicates that any pixel point is located in a non-orthogonal direction, the any pixel point is offset according to deformation strength information determined based on the distance information.
4. The method according to claim 3, It is characterized in that The shifting of any pixel point according to the deformation strength information determined based on the distance information comprises: Determine, according to the distance information, first distance information and second distance information of the distance information in orthogonal directions; Determine the deformation strength information corresponding to the distance information according to the deformation strength information in the orthogonal directions respectively corresponding to the first distance information and the second distance information; The any pixel point is offset according to the deformation strength information corresponding to the distance information.
5. The method according to claim 1, It is characterized in that After determining the deformation region that meets the target shape condition based on the face region, the method further includes at least one of the following: In the deformation region, based on position information of pixels in the deformation region, deformation strength information of the deformation region, and rotation angle information of the deformation region, the deformation region is deformed to obtain a second image; In the deformation area, based on the position information of the pixels in the deformation area, the deformation strength information of the deformation area, and the aspect ratio information of the first image, the deformation area is deformed to obtain a second image.
6. The method according to any one of claims 1 to 5, It is characterized in that The deformation strength information of the deformation region satisfies a deformation strength limit value, and the deformation strength limit value is used to indicate maximum deformation strength information and minimum deformation strength information of the deformation region.
7. A display device for multimedia data, It is characterized in that The device comprises: A detection module, used for inputting a first image to be displayed into a face detection model for detection, and determining a positioning frame of a face area in the first image; A region determination module, configured to determine, based on the face region, a deformation region that meets a target shape condition, wherein within a positioning frame of the face region, the deformation region is tangent to the positioning frame; A deformation module, configured to deform the deformation region based on position information of pixels in the deformation region and deformation strength information of the deformation region, so as to obtain a second image; A display module is used to display the second image. The display module is further used to display the frame of the deformed area; The region determination module is further configured to determine, in response to an adjustment operation on the border of the deformation region, an adjusted deformation region as the deformation region to be deformed; The device also includes: a pixel point determination module, used to determine a target number of pixels and a target number of corresponding pixels from the second image and a next frame image corresponding to the second image in the video data, respectively, wherein the pixels in the second image and the corresponding pixels in the next frame image correspond to the same facial feature points; An information determination module, used to determine affine transformation information of the deformation area according to the target number of pixel points and the target number of corresponding pixel points, wherein the affine transformation information is used to indicate an offset and a scaling factor of the deformation area; The deformation module is further configured to deform the deformation area based on the affine transformation information in the deformation area to obtain a third image; The display module is further used to display the third image.
8. A computer device, It is characterized in that The computer device includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the program code is loaded and executed by the one or more processors to implement the operations performed by the multimedia data display method according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one program code, and the program code is loaded and executed by a processor to implement the operations performed by the multimedia data display method according to any one of claims 1 to 6.
