WO2022142388A1 - Special effect display method and electronic device - Google Patents

Special effect display method and electronic device Download PDF

Info

Publication number
WO2022142388A1
WO2022142388A1 PCT/CN2021/113631 CN2021113631W WO2022142388A1 WO 2022142388 A1 WO2022142388 A1 WO 2022142388A1 CN 2021113631 W CN2021113631 W CN 2021113631W WO 2022142388 A1 WO2022142388 A1 WO 2022142388A1
Authority
WO
WIPO (PCT)
Prior art keywords
special effect
display
effect object
target
target special
Prior art date
Application number
PCT/CN2021/113631
Other languages
French (fr)
Chinese (zh)
Inventor
刘雨晗
Original Assignee
北京达佳互联信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022142388A1 publication Critical patent/WO2022142388A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2621Cameras specially adapted for the electronic generation of special effects during image pickup, e.g. digital cameras, camcorders, video cameras having integrated special effects capability

Definitions

  • the present disclosure relates to the field of information display, and in particular, to a special effect display method and an electronic device.
  • the activation and display of special effects are usually realized by means of timing triggering or expression triggering.
  • the next special effect object is automatically displayed after the current special effect object is displayed for 3 seconds.
  • a special effect display method including:
  • the target special effect object determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
  • the picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  • a special effect display device including:
  • an information acquisition unit configured to acquire the spatial position information of the image acquisition device at the current moment
  • a parameter determination unit configured to determine display parameters of a target special effect object based on the spatial position information, where the target special effect object is used to process the picture captured by the image capture device;
  • a picture rendering unit configured to render the picture based on the display parameters, and display a special effect picture obtained by rendering, and the special effect picture includes the target special effect object.
  • an electronic device including:
  • a memory for storing the processor-executable instructions
  • the processor is configured to execute the instructions to achieve the following steps:
  • the target special effect object determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
  • the picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  • a storage medium is provided.
  • the electronic device can perform the following steps:
  • the target special effect object determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
  • the picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  • a computer program product comprising a computer program and/or instructions, the computer program and/or instructions implement the following steps when executed by a processor:
  • the target special effect object determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
  • the picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  • the user controls the display effect of the special effect by manipulating the spatial posture of the image capturing device.
  • the display parameters of the target special effect object are determined by acquiring the spatial position information of the image acquisition device at the current moment, so that the captured picture is rendered based on the display parameters to obtain the special effect picture, so that the special effect picture can be displayed when displayed.
  • the above-mentioned special effect object is displayed, thereby presenting a special effect display effect corresponding to the spatial position information of the image acquisition device.
  • this solution allows the user to change the spatial position information of the image capture device by manipulating the image capture device, and then adjust and control the special effects such as magic expressions displayed by the image capture device; and this solution does not need to use the user's face key Points and other biological information can be realized, which not only ensures the control accuracy of the display effect, but also ensures the user's information security.
  • FIG. 1 is a schematic diagram of a special effect display scene provided by an exemplary embodiment
  • FIG. 2 is a flowchart of a method for displaying special effects provided by an exemplary embodiment
  • FIG. 3 is a flowchart of another special effect display method provided by an exemplary embodiment
  • FIG. 4 is a schematic diagram of a magic expression display effect shown in an exemplary embodiment
  • FIG. 5 is a schematic diagram of another magic expression display effect shown in an exemplary embodiment
  • FIG. 6 is a schematic diagram of another magic expression display effect shown in an exemplary embodiment
  • FIG. 7 is a schematic block diagram of a special effect display device according to an exemplary embodiment
  • FIG. 8 is a structural diagram of an electronic device according to an exemplary embodiment.
  • the terms “at least one”, “plurality”, “each”, at least one includes one, two or more, multiple includes two or more, and each refers to the corresponding each of the multiple.
  • the user information involved in this disclosure is the information authorized by the user or fully authorized by all parties.
  • the activation and display of special effects are usually realized by means of timing triggering or expression triggering.
  • timing triggering For example, under the timing trigger mechanism, the next special effect object is automatically displayed after the current special effect object is displayed for 3 seconds. At this time, it is often difficult for the user to control the special effect display state; while under the expression trigger mechanism, the user can control the special effect display through facial expressions.
  • this method has a strong dependence on the user's face key point data and other biological information, so there may be problems such as inaccurate control or information security.
  • the special effects provided by the mobile phone are turned on, so that the real-time data captured by the camera is displayed on the mobile phone display.
  • the corresponding special effects objects are superimposed and displayed, such as the magic expression in the shape of a rabbit ear in Figure 1 (hereinafter referred to as the rabbit ear).
  • the user can control the magic expression through a timing trigger mechanism or by making a specific facial expression.
  • the present disclosure proposes a new way of playing the special effect function, that is, through the spatial position information of the image capture device, the display effect of the target special effect object displayed by the image capture device is controlled, so that the user using the image capture device can control the posture of the image capture device by controlling the image capture device. , to realize self-adjustment and control of the display effect of the target special effect object, which is displayed in the picture collected by the image acquisition device.
  • FIG. 2 is a flowchart of a special effect display method according to an exemplary embodiment. As shown in Figure 2, the method is performed by an image acquisition device, and includes the following steps:
  • Step 202 Obtain the spatial position information of the image acquisition device at the current moment.
  • the image acquisition device periodically acquires spatial position information in the process of acquiring images.
  • the image acquisition device is equipped with image acquisition components such as a camera module, and is also equipped with image display components such as a display screen.
  • the image acquisition device is a smartphone
  • the image acquisition component assembled on the smartphone is the front and/or rear camera
  • the image display component of the smartphone is a liquid crystal display panel or a light emitting diode (Light Emitting Diode, LED) display panel.
  • image acquisition devices are tablet devices, notebook computers, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.)
  • PDAs Personal Digital Assistants
  • wearable devices such as smart glasses, smart watches, etc.
  • the image acquisition device acquires its own spatial position information during the process of acquiring images, such as in the image preview stage before the image is captured, the image preview stage before the video is captured, or in the process of capturing the video.
  • the position information is used to process the captured picture, so as to display the target special effect object corresponding to the spatial position information in the preview picture or the shooting picture.
  • the image acquisition device perceives its own spatial posture through a sensor, so that in the process of acquiring a picture, the sensor is used to obtain its own spatial position information at the current moment, wherein the sensor is assembled in the image acquisition device, as shown in this
  • the sensor is a gyroscope assembled by the image acquisition device itself; or the sensor is connected to
  • the image acquisition device for example, the sensor is a laser rangefinder connected to the image acquisition device, etc., will not be described in detail.
  • the image acquisition device acquires the spatial position information acquired by the sensor in different ways.
  • the above-mentioned sensor is an integrated sensor assembled in an image capture device.
  • the “image capture device” should be understood as not including the software and hardware parts of the sensor.
  • a control component such as a central processing unit (CPU) in the image acquisition device sends an acquisition request to the sensor, and the acquisition request is used to acquire the spatial position information of the image acquisition device collected by the sensor.
  • the collected spatial position information of the image device is sent to the image capture device (or the CPU of the image capture device).
  • the sensor periodically provides the spatial position information collected by the sensor to the image collection device.
  • the sensor assembled by the image capture device itself is used to collect the spatial position information of the image capture device, so that the user can adjust the special effects displayed by the image capture device by manipulating the spatial posture of the image capture device.
  • the sensor is assembled in a fixed position inside the mobile phone.
  • the sensor involved in this solution includes at least one of the following: an acceleration sensor (G-Sensor, which outputs acceleration values in three directions) for sensing acceleration in three directions of x, y, and z. , Gyro sensor (Gyro-sensor, referred to as gyroscope, outputs the acceleration values in the three directions of x, y, and z), the direction sensor for sensing the angle (O-Sensor, outputs the three directions of x, y, and z) angle), a linear acceleration sensor (LA-Sensor, which outputs the acceleration value after removing the influence of gravity), a linear acceleration sensor (LA-Sensor, which outputs the acceleration value after removing the influence of gravity), a rotation vector sensor (RV-Sensor, which is used to perceive the rotation angle, and the output is calculated by mixing the coordinate axis and the angle) The quaternion and other data), the gravity sensor (GV-Sensor, output gravitational acceleration
  • the spatial position information is used to indicate the spatial posture of the image acquisition device at the current moment, which includes at least one of acceleration, rotation angle, quaternion, etc.
  • the embodiments of the present disclosure do not limit this.
  • the spatial position information collected by the image capture device through the sensor may include multiple types, and only some of them are required for the target special effect object to be displayed, so the image capture device determines the spatial position information to be acquired.
  • the step of acquiring the spatial position information of the image acquisition device at the current moment by the image acquisition device includes: the image acquisition device determines a target type, and the target type is the type of spatial position information required to display the target special effect object; based on the target type , to determine the spatial location information.
  • the step of determining the target type by the image acquisition device includes: the image acquisition device determines the target type by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type, wherein any one of Several spatial position information of the target type corresponding to the special effect object is used to determine the display parameters of any special effect object.
  • the preset relationship table is recorded in the Magic Watch SDK (Software Development Kit, software development kit), so that the target type can be determined by calling the Magic Watch SDK.
  • the image acquisition device can not only determine the target type accurately and efficiently by looking up the table, but also obtain the required spatial position information from the various (or at least one) spatial information of the image acquisition device at the current moment, In addition, it is not necessary to obtain all the spatial information of the image acquisition device, but only the part required to display the target special effect object, which helps to reduce the amount of data to be processed, speed up the display speed of the target special effect object, and avoid the special effect display being stuck, which is helpful for Improve the display effect.
  • the image capture device before the image capture device determines the target type by querying the preset relationship table, the image capture device needs to determine the target special effect object to be displayed.
  • the image acquisition device determines the target special effect object to be displayed in various ways.
  • the image capture device identifies the display object in the captured picture, and determines the candidate special effect object that matches the display object as the target special effect object to be displayed, so that the target special effect object is the same as that contained in the captured picture.
  • the corresponding display objects enhance the sense of coordination of the screen, and can automatically display suitable special effects objects for users. For example, in the case of recognizing a female face, the image acquisition device determines the cat face special effect as the matching target special effect object; and in the case of detecting the night sky, determines the fireworks special effect as the matching target special effect object, etc.
  • the image capturing device provides the user with a variety of candidate special effect objects, so that the user can select a suitable candidate special effect object for display.
  • the image acquisition device determines the selected candidate special effect object as the target special effect object to be displayed. In this way, the user can select the target special effect object according to his own wishes, so as to fully respect the user's choice.
  • the target special effect object is a static or dynamic magic expression displayed on the top of the screen.
  • the magic expression is the rabbit ear displayed on the head of the portrait.
  • the solution adjusts the display position, display color, rabbit ear size, rabbit ear size, rabbit ear, etc. At least one display attribute such as ear shape, rabbit ear motion, etc.
  • the image capture device provides the user with a variety of special effects objects for the user to choose, for example, in addition to the rabbit ears, it also provides other forms of cat face, dog head, red green blue (RGB) color separation, etc.
  • the special effect object also provides virtual special effects that can be controlled by the user through interactive actions, such as a dynamic three-dimensional (Three Dimensions, 3D) display model, which is not limited in the embodiments of the present disclosure.
  • the target special effect object and the image captured by the image capture device are displayed in the same display interface. For example, if the image captured by the camera is received on the screen of the image capture device, the image captured by the camera will be refreshed according to a preset refresh frequency (usually the image captured by the camera). Refresh frequency) to display, and when the target special effect object is displayed in the current frame image, the image acquisition device collects various spatial information through the sensor, and then determines the display parameters of the next frame image according to the spatial position information (such as the target The pixel value of each pixel point corresponding to the special effect object), so that the target special effect object (for example, a magic expression) corresponding to the spatial position of the mobile phone is displayed in the next frame of image.
  • a preset refresh frequency usually the image captured by the camera. Refresh frequency
  • the image acquisition device acquires multiple (at least one) types of spatial position information at the current moment collected by the sensor, and then, based on the target type, determines from the multiple (at least one) types of spatial position information where the target special effect object is displayed.
  • the required spatial position information, the target type is the type of spatial position information required to display the target special effect object, and the process is:
  • the sensor provides the collected various (or at least one) spatial position information of the image acquisition device at the current moment to the image acquisition device in real time or periodically, so that the image acquisition device receives various spatial position information provided by the sensor. Then, based on the special effect object to be displayed at the current moment, query the preset relationship table to determine the target type, and based on the target type, determine the spatial position from the multiple (or at least one) spatial position information of the image acquisition device at the current moment
  • the spatial position information is the spatial position information required to display the target special effect object, so that the image acquisition device only needs to determine the part of the information to be used from all the received spatial position information.
  • the image acquisition device instructs the sensor to acquire the spatial location information required to display the target special effect object.
  • the sensor does not acquire the spatial location information in real time, but the image acquisition device sends an acquisition request to the sensor after determining the target type,
  • the obtaining request carries a target type, and the target type is the type of spatial position information required to display the target special effect object.
  • the sensor receives the acquisition request (ie calls the sensor), collects the spatial location information of the target type based on the target type, sends the spatial location information to the image acquisition device, and the image acquisition device receives the spatial location information.
  • This method calls the sensor to collect spatial position information only when the image acquisition device needs it, thereby helping to reduce the frequency of use of the sensor to reduce power consumption.
  • Step 204 Determine the display parameters of the target special effect object based on the spatial position information, where the target special effect object is used to process the picture captured by the image capture device.
  • the above-mentioned spatial position information includes quaternions.
  • the image acquisition device constructs a three-dimensional rotation matrix, converts the quaternions into Euler angles based on the three-dimensional rotation matrix, and then determines the target special effect based on the Euler angles. Display parameters of the object, to achieve quick determination of display parameters. For example, the image acquisition device determines the Euler angle as a display parameter of the target special effect object.
  • the image acquisition device determines the display parameters of the target special effect object based on the result of the product of the Euler angle and the preset multiple. For example, the image acquisition device determines the product of the Euler angle and the preset multiple as the display parameter of the target special effect object.
  • the preset multiple is a positive number not equal to 1, so as to prevent the Euler angle from being too large or too small, resulting in poor display of the final target special effect object. Wherein, when the Euler angle is too small, the preset multiple should be greater than 1; and when the Euler angle is too large, the preset multiple should be less than 1, so as to realize the optimal adjustment of the display effect .
  • the Euler angle when the Euler angle is less than the first preset angle, it is determined that the Euler angle is too small; and/or when the Euler angle is greater than the second preset angle, it is determined that the Euler angle is too large, and the first
  • the specific values of the preset angle and the second preset angle are preset according to the actual situation such as the device type, the size of the display interface, the type of the target special effect object, etc.
  • the first preset angle is set to 0.5°
  • the second preset angle is set to 80°. etc., the embodiments of the present disclosure do not limit this.
  • the display parameters of the target special effect object are determined periodically, and in any period of determining the display parameters of the target special effect object, the Euler angle used is a fixed value; then in the current period, the After the quaternion is converted into Euler angles, the image acquisition device does not use the above Euler angles or their preset multiples as display parameters, but further determines by the following methods: obtaining at least one historical product result determined in adjacent historical periods, The adjacent historical period includes at least one continuous period before the current period, then determine the maximum value or average value of the product result in the current period and the above-mentioned at least one historical product result, and determine the maximum value or average value as the target special effect Object's display parameters.
  • the image acquisition device further determines the display parameters by obtaining at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that within the current period
  • the maximum value or average value of the Euler angle and the above at least one historical Euler angle, and the maximum value or average value is determined as the display parameter of the target special effect object.
  • the image acquisition device determines the maximum value or average value of the current Euler angle and the historical Euler angle as the display parameter of the target special effect object, or determines the maximum value or average value of the current product result and the historical product result as the target Display parameters of the effect object.
  • the above average value or maximum value is an absolute value.
  • using the above average value as the display parameter of the target special effect object can ensure that the display effect of the target special effect object between adjacent image frames displayed in the display interface of the image acquisition device will not change abruptly, thereby avoiding sudden changes in the display effect of the target special effect object.
  • the target special effect object undergoes a screen jump.
  • Using the above maximum value as the display parameter of the target special effect object can ensure that the target special effect object is dynamically displayed as much as possible, and enhance the display interest of the target special effect object.
  • the above-mentioned spatial position information includes acceleration.
  • the image acquisition device first determines a special effect display area, and the special effect display area is used to display the target special effect object, and then determines the pixel characteristic value in the special effect display area according to the above acceleration, and sets the The pixel feature value is determined as the display parameter of the target special effect object.
  • the pixel feature value is used to represent the feature of the corresponding pixel point; for example, the pixel feature value includes at least one of the following: color value, color gradient, transparency, and contrast.
  • the above-mentioned color gradient value is positively correlated with acceleration, that is, the greater the acceleration, the greater the color gradient value, and the smaller the acceleration, the smaller the color gradient value;
  • the display parameters of the target special effect object can fully reflect the acceleration of the image acquisition device at the current moment, so that the display effect of the target special effect object corresponds to the acceleration, and the display of the target special effect object can be realized by controlling the spatial position of the image acquisition device. The purpose of adjusting the effect.
  • the above-mentioned spatial position information includes a rotation angle
  • the target special effect object has a preset standard display angle.
  • the image acquisition device determines the deflection angle of the target special effect object based on the rotation angle.
  • the display angle is rotated and transformed, and the angle after the rotation transformation is determined as the display parameter of the target special effect object. For example, when the standard display angle of the rabbit ear is 0°, the rabbit ear will show a vertical display state of the center line of the two ears under normal state, but when the user changes the spatial position of the mobile phone, the mobile phone rotates (the rotation angle is generated), The component of the rotation angle along the central axis of the mobile phone screen also changes, that is, a deflection angle is generated.
  • the mobile phone is equivalent to rotating the deflection angle (such as 30°) along the central axis of the mobile phone screen. Also rotated 30° relative to the phone.
  • the image acquisition device rotates and transforms the standard display angle according to the rotation angle, that is, the angle is added by 30 degrees, so that the rotated angle of the rabbit ears is 30 degrees, so that the rabbit ears are still displayed on the face of the human, and the The relative positional relationship between faces remains unchanged. It can be seen that this method can ensure that the display effect of the target special effect object matches the relative positional relationship between the picture content in the picture captured by the image acquisition device, and the display of the target special effect object will not be chaotic due to the rotation of the mobile phone.
  • the display parameters of the target special effect object include blur intensity and/or color saturation, and also include at least one of feathering, contrast, brightness, etc., which are not limited in the embodiments of the present disclosure.
  • the processing logic of the above embodiments is recorded in a pre-generated special effect SDK, so that the special effect SDK can be called to determine the display parameters of the target special effect object based on the spatial position information.
  • the special effect SDK is the aforementioned magic watch SDK, that is, the magic watch SDK not only records the corresponding relationship between the special effect object and the target type, but also records the processing logic and specific algorithm for solving the display parameters of the target special effect object through the spatial position information.
  • the image capture device After acquiring the spatial position information, the image capture device provides it to the preset special effects SDK, so that the special effects SDK determines the display parameters of the target special effect object according to the processing logic and specific algorithm recorded therein, and then the image capture device Get this display parameter to display the target special effect object.
  • the above-mentioned process of determining the display parameters of the target special effect object through the Magic Watch SDK is the CPU of the image acquisition device, and the spatial location information is determined according to the above-mentioned corresponding relationship recorded by the Magic Watch SDK, and then according to the processing logic and the processing logic recorded in the Magic Watch SDK.
  • the specific algorithm is the process of solving the display parameters of the target special effect object.
  • Step 206 Render the picture based on the display parameters, and display the special effect picture obtained by rendering, where the special effect picture includes the target special effect object.
  • the image acquisition device provides them to an image processor (Graphic Processing Unit, GPU) corresponding to the display component, so that the GPU performs corresponding rendering processing based on the display parameters, and obtains The special effect picture of the target special effect object, and then the special effect picture is displayed, and the target special effect object in the special effect picture presents a display effect corresponding to the spatial position information.
  • an image processor Graphic Processing Unit, GPU
  • the user controls the display effect of the special effect by manipulating the spatial posture of the image capturing device.
  • the display parameters of the target special effect object are determined by acquiring the spatial position information of the image acquisition device at the current moment, so that the captured picture is rendered based on the display parameters to obtain the special effect picture, so that the special effect picture can be displayed when displayed.
  • the above-mentioned special effect object is displayed, thereby presenting a special effect display effect corresponding to the spatial position information of the image acquisition device.
  • this solution allows the user to change the spatial position information of the image capture device by manipulating the image capture device, and then adjust and control the special effects such as magic expressions displayed by the image capture device; and this solution does not need to use the user's face key Points and other biological information can be realized, which not only ensures the control accuracy of the display effect, but also ensures the user's information security.
  • FIG. 3 The following is a flow chart of another special effect display method shown in FIG. 3 .
  • the specific process of controlling the display effect of the magic expression during the shooting process by the mobile phone by obtaining the spatial position information collected by the gyroscope equipped with itself will be described in detail below with reference to FIGS. 3 to 6 .
  • the process includes the following steps 301-307.
  • Step 301 The current frame image corresponding to the object to be photographed collected in real time is displayed on the screen of the mobile phone.
  • the user uses the front or rear camera mounted on the mobile phone to shoot the object to be shot, such as using the front camera to take a selfie, or using the rear camera to shoot other people or objects.
  • the mobile phone calls the camera to collect the optical information of the object to be photographed, and displays the corresponding preview image on the screen.
  • the magic expression function is enabled by default on the mobile phone or the user turns on the magic expression function when the preview image is displayed on the mobile phone. , the corresponding magic emoji will be displayed in the preview screen of the mobile phone screen.
  • the special effect expression will be correspondingly displayed on the head position of the human face in the preview screen.
  • the user can capture the image by triggering the shooting function (eg, click the "shoot" control) to obtain a photo.
  • the mobile phone After the user turns on the video recording function of the mobile phone and starts recording, if the mobile phone has the magic expression function enabled by default or the user enables the magic expression function when displaying the preview screen on the mobile phone, the preview screen of the mobile phone screen will display the corresponding Magical emoji. Furthermore, the mobile phone records the display effect and dynamic change process of the magic expression in the recorded video.
  • the image containing the magic expression displayed on the screen of the mobile phone is displayed frame by frame. Therefore, the process of displaying the magic expression in this solution is also displayed frame by frame.
  • the mobile phone determines the display parameters of the magic expression in the next frame by performing the following steps 302-305, and then the GPU shader renders the magic expression according to the display parameters to obtain the magic expression.
  • the next frame of the expression is used for display.
  • Step 302 Determine the magic expression to be displayed.
  • the mobile phone determines the magic expression displayed in the current picture, and then determines the magic expression to be displayed. For example, in the case where it is determined that the currently selected and displayed magic expression among the candidate magic expressions is the rabbit ear, the mobile phone determines the rabbit ear as the magic expression to be displayed, that is, the rabbit needs to be displayed in the next frame of image. Ears (only the specific display parameters need to be determined through the following steps, so that the rabbit ears displayed in the next frame of image can correspond to the spatial location information of the mobile phone at the current moment).
  • Step 303 Obtain the quaternion collected and output by the gyroscope.
  • the user changes the posture of the mobile phone by manipulating hand movements during the process of shooting with the mobile phone, such as controlling the mobile phone to pan, tilt, rotate, etc., so that the mobile phone collects its own spatial position information through the gyroscope assembled by itself.
  • the display effect of the magic expression is controlled by using the spatial position information, which includes a quaternion.
  • a magic watch SDK is pre-stored in the mobile phone, and the magic watch SDK not only records the target type corresponding to any magic expression used by the mobile phone to realize, but also records the corresponding records calculated by the above-mentioned at least one kind of spatial position information
  • the corresponding algorithm required to realize any of the magic expressions is recorded with the preset relation table in the embodiment shown in FIG. 2 .
  • the mobile phone displays the magic expression through its own application with the camera calling function (such as mobile phone native shooting application, third-party shooting application, third-party multimedia application, etc.)
  • the above magic watch SDK or the corresponding relationship is pre-stored in the In the server corresponding to the application, the mobile phone obtains the above magic watch SDK or the preset relationship table from the server, and then executes the subsequent steps.
  • the mobile phone after determining the magic expression to be displayed, calls the magic watch SDK or determines the spatial location information corresponding to the magic expression to be displayed according to the preset relationship table. It is worth noting that the "several spatial position information corresponding to any magic expression used for realization" recorded in the magic watch SDK is only the name of the spatial position information, not its specific value, that is, the aforementioned target type.
  • the "quaternion" needs to be used for the realization of the rabbit ear special effect, so after the mobile phone determines that the target special effect object is the rabbit ear, it determines the need to obtain the current quaternion of the mobile phone by querying the magic watch SDK, and then from the mobile phone's gyro The instrument obtains the specific value of the quaternion it has collected.
  • the mobile phone determines the spatial position information, such as a quaternion, corresponding to the RGB separation effect according to the above preset relationship table.
  • the spatial position information corresponding to the RGB separation effect is determined to be a quaternion by the above method, it indicates that the separation color block corresponding to the RGB separation effect needs to be displayed in the next frame of picture, and then the quaternion needs to be used.
  • the mobile phone (specifically, the CPU of the mobile phone, the same below) extracts the quaternion from the spatial position information collected by the gyroscope equipped with itself; or, the mobile phone requests the gyroscope for the quaternion collected by the acquirer arity.
  • Step 304 Determine the rotation angle corresponding to the quaternion.
  • Euler angles are used to represent actions such as movement or rotation in the process of changing the spatial position of the mobile phone.
  • the quaternion is directly converted into Euler angles in the Cartesian coordinate system, or a rotation matrix for characterizing the orientation change of the mobile phone is constructed, and the quaternion is converted into the corresponding Euler based on the rotation matrix horn.
  • the timing of constructing the rotation matrix is not specifically limited; for example, it is constructed when the rotation angle corresponding to the quaternion is determined, or it is constructed in advance and stored in the mobile phone, and when the rotation angle corresponding to the quaternion is determined, you can directly obtain the stored rotation matrix.
  • the rotation angle corresponding to the change in the attitude of the mobile phone is determined in various ways according to the above Euler angles.
  • the above-mentioned Euler angle obtained by calculation is directly determined as the rotation angle, so as to simplify the way of determining the rotation angle and speed up the calculation speed of the display parameters.
  • the calculated Euler angles are cached in a parameter queue, and the parameter queue also caches several historical Euler angles corresponding to several historical frames before the current frame, so that the queue The average value of each Euler angle is determined as the rotation angle, so as to avoid jumps in the display process of the magic expression, thereby presenting a relatively stable display effect of the magic expression.
  • the historical Euler angle in the above parameter queue is the Euler angle corresponding to the continuous picture frame.
  • the pull angle constitutes a parameter queue, and accordingly, the average value of the n Euler angles in the queue is determined as the rotation angle corresponding to the current frame. It can be understood that the larger the above n is, the smoother the target special effect object in the picture is. Of course, in the case that the above n is sufficiently small (for example, n ⁇ 10), the maximum value among the n Euler angles in the parameter queue is determined as the rotation angle. Alternatively, the average or maximum value of the preset multiple of the current Euler angle and the preset multiples of the respective historical Euler angles is used as the rotation angle, and details are not repeated here.
  • Step 305 Determine the display parameters of the magic expression in the next frame of picture.
  • the presentation parameters can be determined in a number of ways based on the above-mentioned rotation angles.
  • the mobile phone calculates display parameters such as blur intensity according to the above rotation angle according to the preset algorithm recorded in the Magic Watch SDK.
  • the mobile phone calculates the corresponding display parameters after multiplying the above-mentioned rotation angle by a coefficient x1 greater than 1, so as to ensure that the corresponding display parameters can still be calculated even when the rotation angle is small, so as to ensure the correct display parameters. Sensitivity of phone control and magic emoji display.
  • the corresponding display parameters are calculated to ensure that when the rotation angle is large, the display parameters are too large to prevent the target special effect object from jumping in the screen.
  • the above-mentioned coefficients x1 and x2 are empirical values preset and verified according to actual conditions such as the type of image acquisition device, the size of the display screen, and the type of the target special effect object, which are not limited in this embodiment of the present disclosure.
  • the above-mentioned spatial position information includes the rotation angle
  • the target special effect object has a preset standard display angle.
  • the mobile phone determines the deflection angle of the target special effect object based on the rotation angle, and based on the deflection angle, the standard display angle is determined. Rotation transformation is performed, and the rotated angle obtained by transformation is determined as the display parameter of the target special effect object. As shown in Figure 4, assuming that the standard display angle of the rabbit's ear is 0°, the rabbit's ear will appear as shown in Figure 4(a) in a normal state with a vertical center line (parallel to the longitudinal center axis of the mobile phone screen). Display state.
  • the component of the rotation angle along the central axis of the mobile phone screen also changes, that is, the deflection angle (assumed to be 30°) is generated.
  • the mobile phone is equivalent to It rotates 30° to the left along the longitudinal center axis of the mobile phone screen, and then the user's selfie avatar on the mobile phone screen is rotated 30° to the right relative to the mobile phone screen.
  • the mobile phone rotates and transforms the standard display angle according to the rotation angle, that is, adding 30° to the standard display angle, so that the rotated angle of the rabbit ear (relative to the rotation angle of the mobile phone screen) is 30° to the right, so that after the mobile phone is rotated
  • the rabbit ears are still displayed above the face, keeping the relative positional relationship with the face unchanged, as shown in Figure 4(b). It can be seen that this method can ensure that the display effect of the target special effect object matches the relative positional relationship between the screen content in the screen captured by the mobile phone, and the display of the target special effect object will not be chaotic due to the rotation of the mobile phone.
  • Step 306 The CPU provides the display parameters to the GPU shader for image rendering to obtain the next frame of image.
  • Step 307 Display the next frame of image containing the magic expression.
  • the display parameters are determined, they are provided to the GPU shader corresponding to the screen of the mobile phone to render the next frame of picture, and then the screen of the mobile phone displays the next frame of picture after rendering, and the picture contains according to The magic expression rendered by the above display parameters, the display effect of the magic expression corresponds to the spatial posture of the mobile phone at the current moment.
  • the specific process of rendering and displaying the next frame of picture can refer to the description in the related art, and details are not repeated here.
  • Figure 5(a) shows a schematic diagram of the preview screen effect of the mobile phone shooting interface.
  • the corresponding RGB separation effect is shown in Figure 5(b).
  • a plurality of separate color blocks such as 501 and 502 are displayed.
  • the display parameters corresponding to the separate color blocks are the number of separate color blocks, and also the width, blur intensity, RGB channel color value, and color saturation of each separate color block. degree, etc., which is not limited in the present disclosure.
  • Figure 6(a) when the user controls the mobile phone to rotate from top to bottom along its horizontal central axis, the corresponding RGB separation effect is shown in Figure 6(b), which will not be repeated.
  • the present disclosure also proposes an embodiment of a special effect display device.
  • FIG. 7 is a schematic block diagram of a special effect display device according to an embodiment of the present disclosure.
  • the special effect display device shown in this embodiment is suitable for image acquisition equipment, the image acquisition equipment has the functions of image acquisition and special effect object display, and the image acquisition equipment includes but is not limited to mobile phones, tablet computers, wearable devices, personal computers, etc. Electronic equipment.
  • the special effect display device includes:
  • the information acquisition unit 701 is configured to acquire the spatial position information of the image acquisition device at the current moment
  • a parameter determination unit 702 configured to determine display parameters of a target special effect object based on the spatial position information, where the target special effect object is used to process a picture captured by the image capture device;
  • the picture rendering unit 703 is configured to render the picture based on the display parameters, and display a special effect picture obtained by rendering, and the special effect picture includes the target special effect object.
  • the spatial position information includes at least one of the following: acceleration, rotation angle, and quaternion.
  • the information obtaining unit 701 is further configured to:
  • the target type is the type of spatial position information required to display the target special effect object
  • the spatial location information is determined.
  • the information obtaining unit 701 is further configured to:
  • the target type is determined by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type.
  • the information obtaining unit 701 is further configured to:
  • the selected target effect object is determined.
  • the spatial location information includes a quaternion
  • the parameter determination unit 702 is further configured to:
  • the display parameters of the target special effect object are determined periodically, and the apparatus further includes:
  • the first history determination unit 704 is configured to obtain at least one historical product result determined in an adjacent historical period, the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that the product result is the same as the The maximum value or average value of at least one historical product result, and the maximum value or average value is determined as the display parameter of the target special effect object.
  • the display parameters of the target special effect object are determined periodically, and the apparatus further includes:
  • the second history determination unit 705 is configured to acquire at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one continuous period before the current period, and determine that the Euler angle is the same as the The maximum value or average value of the at least one historical Euler angle, and the maximum value or average value is determined as the display parameter of the target special effect object.
  • the spatial position information includes acceleration
  • the parameter determination unit 702 is further configured to:
  • a pixel characteristic value in the special effect display area is determined, the pixel characteristic value is determined as a display parameter of the target special effect object, and the pixel characteristic value is used to represent the characteristic of the corresponding pixel point.
  • the pixel feature value includes at least one of the following:
  • Color value color gradient, transparency, contrast.
  • the spatial position information includes a rotation angle
  • the target special effect object has a preset standard display angle
  • the parameter determination unit 702 is further configured to:
  • the standard display angle is rotated and transformed, and the rotated and transformed angle is determined as the display parameter of the target special effect object.
  • the display parameters of the target special effect object include blur strength and/or color saturation.
  • Embodiments of the present disclosure also provide an electronic device, including:
  • a memory for storing the processor-executable instructions
  • the processor is configured to execute the instruction to implement the special effect display method according to any one of the above embodiments.
  • Embodiments of the present disclosure further provide a storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the special effect display method described in any of the foregoing embodiments.
  • Embodiments of the present disclosure further provide a computer program product, the computer program product being configured to execute the special effect display method described in any of the foregoing embodiments.
  • FIG. 8 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure.
  • electronic device 800 is a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
  • an electronic device 800 includes one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communication component 818.
  • a processing component 802 a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communication component 818.
  • the processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 includes one or more processors 820 to execute the instructions to complete all or part of the steps of the above-mentioned special effect display method.
  • processing component 802 includes one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 includes a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 is implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 806 provides power to various components of electronic device 800 .
  • Power components 806 include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
  • Multimedia component 808 includes a screen that provides an output interface between electronic device 800 and the user.
  • the screen includes a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen is implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor not only senses the boundaries of a touch or swipe action, but also detects the duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera are used to receive external multimedia data. Each front and rear camera is a fixed optical lens system or has focal length and optical zoom capability.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal is further stored in memory 804 or transmitted via communication component 818 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 .
  • the sensor assembly 814 is used to detect the open/closed state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 is also used to detect the electronic device 800 or the electronic device Changes in the position of a component 800 , presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 .
  • Sensor assembly 814 includes a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 also includes a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor assembly 814 also includes an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • the image acquisition component 816 is used to acquire image data of the subject to form an image about the subject, and then perform necessary processing on the image.
  • the image acquisition component 816 includes a camera module, and the image sensor (Sensor) in the camera module senses the light from the subject through the lens, and provides the obtained photosensitive data to an image signal processor (ISP, Image Signal Processing), which is composed of The latter generates an image corresponding to the subject based on the photosensitive data.
  • ISP Image Signal Processing
  • the above-mentioned image sensor is a CMOS sensor or a CCD sensor, of course, it is also an infrared sensor, a depth sensor, etc.;
  • the camera module is built in the electronic device 800, or the camera module is used as an external module of the electronic device 800;
  • the above-mentioned The ISP is built into the camera module, or as a plug-in in the above electronic device (not in the camera module).
  • Communication component 818 is configured to facilitate wired or wireless communication between electronic device 800 and other devices.
  • Electronic device 800 is capable of accessing wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 4G, or 5G), or a combination thereof.
  • the communication component 818 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 818 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 800 is implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for implementing the above-mentioned special effect display method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmed gate array
  • controller a controller
  • microcontroller a microcontroller
  • microprocessor or other electronic components are implemented for implementing the above-mentioned special effect display method.
  • a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the electronic device 800 to complete the above-mentioned special effect display method.
  • the non-transitory computer-readable storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
  • the spatial position information includes at least one of the following: acceleration, rotation angle, and quaternion.
  • the pixel feature value includes at least one of the following:
  • Color value color gradient, transparency, contrast.
  • the display parameters of the target special effect object include blur strength and/or color saturation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present disclosure relates to the field of information display, and relates to a special effect display method and an electronic device. The method comprises: obtaining spatial position information of an image acquisition device at the current moment; determining a display parameter of a target special effect object on the basis of the spatial position information, the target special effect object being used for processing a picture acquired by the image acquisition device; and rendering the picture on the basis of the display parameter, and displaying a special effect picture obtained by the rendering, the special effect picture comprising the target special effect object.

Description

特效显示方法及电子设备Special effect display method and electronic device
本公开基于申请号为202011599632.6、申请日为2020年12月29日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on the Chinese patent application with the application number of 202011599632.6 and the filing date of December 29, 2020, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is incorporated herein by reference.
技术领域technical field
本公开涉及信息显示领域,尤其涉及特效显示方法及电子设备。The present disclosure relates to the field of information display, and in particular, to a special effect display method and an electronic device.
背景技术Background technique
现阶段,在手机等具备拍摄功能的图像采集设备中,原生相机或第三方拍摄应用通常会为用户提供魔法表情等特效,以便用户在拍摄过程中能够调用上述特效实现丰富多样的拍摄效果。At this stage, in image capture devices with shooting functions such as mobile phones, native cameras or third-party shooting applications usually provide users with special effects such as magic expressions, so that users can invoke these special effects during the shooting process to achieve a variety of shooting effects.
然而,相关技术中通常采用定时触发或表情触发的方式实现特效的激活及显示。例如,在定时触发机制下,当前特效对象显示3秒钟后自动显示下一特效对象。However, in the related art, the activation and display of special effects are usually realized by means of timing triggering or expression triggering. For example, under the timing trigger mechanism, the next special effect object is automatically displayed after the current special effect object is displayed for 3 seconds.
发明内容SUMMARY OF THE INVENTION
根据本公开实施例的一方面,提出一种特效显示方法,包括:According to an aspect of the embodiments of the present disclosure, a special effect display method is provided, including:
获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
根据本公开实施例的另一方面,提出一种特效显示装置,包括:According to another aspect of the embodiments of the present disclosure, a special effect display device is provided, including:
信息获取单元,被配置为获取图像采集设备在当前时刻的空间位置信息;an information acquisition unit, configured to acquire the spatial position information of the image acquisition device at the current moment;
参数确定单元,被配置为基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的所述画面;a parameter determination unit, configured to determine display parameters of a target special effect object based on the spatial position information, where the target special effect object is used to process the picture captured by the image capture device;
画面渲染单元,被配置为基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。A picture rendering unit, configured to render the picture based on the display parameters, and display a special effect picture obtained by rendering, and the special effect picture includes the target special effect object.
根据本公开实施例的另一方面,提出一种电子设备,包括:According to another aspect of the embodiments of the present disclosure, an electronic device is provided, including:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
其中,所述处理器被配置为执行所述指令,以实现如下步骤:Wherein, the processor is configured to execute the instructions to achieve the following steps:
获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
根据本公开实施例的另一方面,提出一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如下步骤:According to another aspect of the embodiments of the present disclosure, a storage medium is provided. When an instruction in the storage medium is executed by a processor of an electronic device, the electronic device can perform the following steps:
获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
根据本公开实施例的另一方面,提供一种计算机程序产品,包括计算机程序和/或指令,所述计算机程序和/或指令被处理器执行时实现如下步骤:According to another aspect of the embodiments of the present disclosure, a computer program product is provided, comprising a computer program and/or instructions, the computer program and/or instructions implement the following steps when executed by a processor:
获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
根据本公开的实施例,用户通过操控图像采集设备的空间姿态,控制特效的显示效果。在一些实施例中,通过获取图像采集设备在当前时刻的空间位置信息,确定目标特效对象的显示参数,从而基于该显示参数渲染所采集的画面以得到特效画面,使得该特效画面被展示时能够显示出上述特效对象,从而呈现出对应于图像采集设备的空间位置信息的特效显示效果。可见,该方案允许用户通过操纵图像采集设备,从而改变图像采集设备的空间位置信息,进而对图像采集设备所显示的魔法表情等特效进行自行调整与控制;而且该方案无需使用用户的人脸关键点等生物信息即可实现,在保证显示效果控制准确度的同时也保证了用户的信息安全。According to the embodiment of the present disclosure, the user controls the display effect of the special effect by manipulating the spatial posture of the image capturing device. In some embodiments, the display parameters of the target special effect object are determined by acquiring the spatial position information of the image acquisition device at the current moment, so that the captured picture is rendered based on the display parameters to obtain the special effect picture, so that the special effect picture can be displayed when displayed. The above-mentioned special effect object is displayed, thereby presenting a special effect display effect corresponding to the spatial position information of the image acquisition device. It can be seen that this solution allows the user to change the spatial position information of the image capture device by manipulating the image capture device, and then adjust and control the special effects such as magic expressions displayed by the image capture device; and this solution does not need to use the user's face key Points and other biological information can be realized, which not only ensures the control accuracy of the display effect, but also ensures the user's information security.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure and do not unduly limit the present disclosure.
图1是一示例性实施例提供的一种特效显示场景示意图;1 is a schematic diagram of a special effect display scene provided by an exemplary embodiment;
图2是一示例性实施例提供的一种特效显示方法的流程图;2 is a flowchart of a method for displaying special effects provided by an exemplary embodiment;
图3是一示例性实施例提供的另一种特效显示方法的流程图;3 is a flowchart of another special effect display method provided by an exemplary embodiment;
图4是一示例性实施例示出的一种魔法表情显示效果的示意图;4 is a schematic diagram of a magic expression display effect shown in an exemplary embodiment;
图5是一示例性实施例示出的另一种魔法表情显示效果的示意图;5 is a schematic diagram of another magic expression display effect shown in an exemplary embodiment;
图6是一示例性实施例示出的又一种魔法表情显示效果的示意图;FIG. 6 is a schematic diagram of another magic expression display effect shown in an exemplary embodiment;
图7是一示例性实施例示出的一种特效显示装置的示意框图;7 is a schematic block diagram of a special effect display device according to an exemplary embodiment;
图8是一示例性实施例示出的一种电子设备的结构图。FIG. 8 is a structural diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下能够互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second" and the like in the description and claims of the present disclosure and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.
本公开所使用的术语“至少一个”、“多个”、“每个”,至少一个包括一个、两个或两个以上,多个包括两个或两个以上,而每个是指对应的多个中的每一个。本公开所涉及的用户信息为经用户授权或者经过各方充分授权的信息。As used in this disclosure, the terms "at least one", "plurality", "each", at least one includes one, two or more, multiple includes two or more, and each refers to the corresponding each of the multiple. The user information involved in this disclosure is the information authorized by the user or fully authorized by all parties.
现阶段,在手机等具备拍摄功能的图像采集设备中,原生相机或第三方拍摄应用通常会为用户提供魔法表情等特效,以便用户在拍摄过程中能够调用上述特效实现丰富多样的拍摄效果。At this stage, in image capture devices with shooting functions such as mobile phones, native cameras or third-party shooting applications usually provide users with special effects such as magic expressions, so that users can invoke these special effects during the shooting process to achieve a variety of shooting effects.
然而,相关技术中通常采用定时触发或表情触发的方式实现特效的激活及显示。例如,在定时触发机制下,当前特效对象显示3秒钟后自动显示下一特效对象,此时用户往往难以自行控制特效显示状态;而在表情触发机制下,用户虽能够通过面部表情控制特效显示 状态,但该方式对用户的人脸关键点数据等生物信息具有较强的依赖性,从而可能存在控制不准确或信息安全等问题。However, in the related art, the activation and display of special effects are usually realized by means of timing triggering or expression triggering. For example, under the timing trigger mechanism, the next special effect object is automatically displayed after the current special effect object is displayed for 3 seconds. At this time, it is often difficult for the user to control the special effect display state; while under the expression trigger mechanism, the user can control the special effect display through facial expressions. However, this method has a strong dependence on the user's face key point data and other biological information, so there may be problems such as inaccurate control or information security.
如图1所示,用户在使用具有图像采集功能(如装配有摄像头)的图像采集设备(如手机)进行拍摄的过程中,开启手机提供的特效,从而在手机显示屏中显示摄像头实时采集到的待拍摄画面的同时,叠加显示相应的特效对象,如图1中兔耳形状的魔法表情(下称兔耳)。此时,用户通过定时触发机制或作出特定的面部表情实现对该魔法表情的控制。As shown in Figure 1, when the user uses an image acquisition device (such as a mobile phone) with an image acquisition function (such as a mobile phone) to shoot, the special effects provided by the mobile phone are turned on, so that the real-time data captured by the camera is displayed on the mobile phone display. At the same time as the picture to be shot is displayed, the corresponding special effects objects are superimposed and displayed, such as the magic expression in the shape of a rabbit ear in Figure 1 (hereinafter referred to as the rabbit ear). At this time, the user can control the magic expression through a timing trigger mechanism or by making a specific facial expression.
为此,本公开提出一种特效功能的新玩法,即通过图像采集设备的空间位置信息,控制其所显示目标特效对象的显示效果,从而使用图像采集设备的用户能够通过控制图像采集设备的姿态,实现对目标特效对象的显示效果的自行调整与控制,该目标特效对象为图像采集设备所采集画面中展示的。To this end, the present disclosure proposes a new way of playing the special effect function, that is, through the spatial position information of the image capture device, the display effect of the target special effect object displayed by the image capture device is controlled, so that the user using the image capture device can control the posture of the image capture device by controlling the image capture device. , to realize self-adjustment and control of the display effect of the target special effect object, which is displayed in the picture collected by the image acquisition device.
图2是一示例性实施例示出的一种特效显示方法的流程图。如图2所示,该方法由图像采集设备执行,包括以下步骤:FIG. 2 is a flowchart of a special effect display method according to an exemplary embodiment. As shown in Figure 2, the method is performed by an image acquisition device, and includes the following steps:
步骤202,获取图像采集设备在当前时刻的空间位置信息。Step 202: Obtain the spatial position information of the image acquisition device at the current moment.
图像采集设备在采集画面的过程中周期性获取空间位置信息。在本实施例中,图像采集设备中装配有摄像模组等图像采集组件,还装配有显示屏等图像显示组件,例如图像采集设备为智能手机等,且该智能手机装配的图像采集组件为前置和/或后置摄像头,该智能手机的图像显示组件为液晶显示面板或发光二极管(Light Emitting Diode,LED)显示面板。当然,除手机外,图像采集设备为具有图像采集功能和画面显示功能的平板设备、笔记本电脑、掌上电脑(PDAs,Personal Digital Assistants)、可穿戴设备(如智能眼镜、智能手表等)等,本说明书一个或多个实施例并不对此进行限制。The image acquisition device periodically acquires spatial position information in the process of acquiring images. In this embodiment, the image acquisition device is equipped with image acquisition components such as a camera module, and is also equipped with image display components such as a display screen. For example, the image acquisition device is a smartphone, and the image acquisition component assembled on the smartphone is the front and/or rear camera, and the image display component of the smartphone is a liquid crystal display panel or a light emitting diode (Light Emitting Diode, LED) display panel. Of course, in addition to mobile phones, image acquisition devices are tablet devices, notebook computers, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.) The description of one or more embodiments is not limiting in this regard.
在本实施例中,图像采集设备在采集图像的过程中获取自身的空间位置信息,如在拍摄图像之前的画面预览阶段、拍摄视频之前的画面预览阶段或者拍摄视频的过程中,获取自身的空间位置信息用于处理被采集的画面,以在预览画面或拍摄画面中显示与空间位置信息相对应的目标特效对象。In this embodiment, the image acquisition device acquires its own spatial position information during the process of acquiring images, such as in the image preview stage before the image is captured, the image preview stage before the video is captured, or in the process of capturing the video. The position information is used to process the captured picture, so as to display the target special effect object corresponding to the spatial position information in the preview picture or the shooting picture.
在本实施例中,图像采集设备通过传感器感知自身的空间姿态,从而在采集画面的过程中,利用传感器获取当前时刻自身的空间位置信息,其中,该传感器被装配在图像采集设备中,如该传感器为图像采集设备自身装配的陀螺仪等;或者该传感器通过有线连接或无线连接(蓝牙、无线保真(Wireless Fidelity,Wifi)、近距离无线通信(Near Field Communication,NFC)等)方式连接至图像采集设备,如该传感器为图像采集设备外接的激光测距仪等,不再一一赘述。In this embodiment, the image acquisition device perceives its own spatial posture through a sensor, so that in the process of acquiring a picture, the sensor is used to obtain its own spatial position information at the current moment, wherein the sensor is assembled in the image acquisition device, as shown in this The sensor is a gyroscope assembled by the image acquisition device itself; or the sensor is connected to The image acquisition device, for example, the sensor is a laser rangefinder connected to the image acquisition device, etc., will not be described in detail.
在一些实施例中,上述传感器与图像采集设备之间的连接关系有多种,相应的,图像采集设备获取传感器采集的空间位置信息的方式也有所不同。在一些实施例中,上述传感器为装配在图像采集设备中的一体式传感器,此时,该“图像采集设备”应当被理解为不包括传感器的软硬件部分。相应的,图像采集设备中的中央处理器(Central Processing Unit,CPU)等控制组件向该传感器发送获取请求,该获取请求用于获取该传感器采集到的图像采集设备的空间位置信息,该传感器将采集到的图像设备的空间位置信息发送给该图像采集设备(或者是图像采集设备的CPU)。或者该传感器将其采集到的空间位置信息周期性提供至图像采集设备。此时,利用图像采集设备自身装配的传感器实现对图像采集设备的空间位置信息的采集,从而用户通过操控图像采集设备的空间姿态,实现对图像采集设备自身所显示特效显示效果进行调整。如图1所示,传感器被装配在手机内部的固定位置处。In some embodiments, there are various connection relationships between the above sensors and the image acquisition device, and accordingly, the image acquisition device acquires the spatial position information acquired by the sensor in different ways. In some embodiments, the above-mentioned sensor is an integrated sensor assembled in an image capture device. In this case, the “image capture device” should be understood as not including the software and hardware parts of the sensor. Correspondingly, a control component such as a central processing unit (CPU) in the image acquisition device sends an acquisition request to the sensor, and the acquisition request is used to acquire the spatial position information of the image acquisition device collected by the sensor. The collected spatial position information of the image device is sent to the image capture device (or the CPU of the image capture device). Or the sensor periodically provides the spatial position information collected by the sensor to the image collection device. At this time, the sensor assembled by the image capture device itself is used to collect the spatial position information of the image capture device, so that the user can adjust the special effects displayed by the image capture device by manipulating the spatial posture of the image capture device. As shown in Figure 1, the sensor is assembled in a fixed position inside the mobile phone.
在一些实施例中,本方案涉及到的传感器包括下述至少一种:用于感知x、y、z三个方向上的加速度的加速度传感器(G-Sensor,输出三个方向上的加速度值)、陀螺仪传感器(Gyro-sensor,简称陀螺仪,输出x、y、z三个方向上的加速度值)、用于感知角度的方向传感器(O-Sensor,输出x、y、z三个方向上的角度)、用于感知加速度的线性加速度传感器(LA-Sensor,输出除去重力影响后的加速度值)、用于感知旋转角度的旋转矢量传感器(RV-Sensor,输出将坐标轴和角度混合计算得到的四元数等数据)、用于感知所在位置处重力的重力传感器(GV-Sensor,输出重力加速度值)、用于感知所在位置处环境磁场的传感器(M-sensor,输出x、y、z三轴的环境磁场强度)。其中,LA-Sensor、RV-Sensor和GV-Sensor的输出数值通过G-sensor、O-sensor和Gyro-sensor经过预设算法计算后得出,本公开对于上述传感器的具体使用过程及数据计算方法并不进行限制。In some embodiments, the sensor involved in this solution includes at least one of the following: an acceleration sensor (G-Sensor, which outputs acceleration values in three directions) for sensing acceleration in three directions of x, y, and z. , Gyro sensor (Gyro-sensor, referred to as gyroscope, outputs the acceleration values in the three directions of x, y, and z), the direction sensor for sensing the angle (O-Sensor, outputs the three directions of x, y, and z) angle), a linear acceleration sensor (LA-Sensor, which outputs the acceleration value after removing the influence of gravity), a linear acceleration sensor (LA-Sensor, which outputs the acceleration value after removing the influence of gravity), a rotation vector sensor (RV-Sensor, which is used to perceive the rotation angle, and the output is calculated by mixing the coordinate axis and the angle) The quaternion and other data), the gravity sensor (GV-Sensor, output gravitational acceleration value) for sensing the gravity at the location, the sensor (M-sensor, output x, y, z) for sensing the environmental magnetic field at the location The three-axis ambient magnetic field strength). Among them, the output values of LA-Sensor, RV-Sensor and GV-Sensor are calculated by G-sensor, O-sensor and Gyro-sensor through preset algorithms. No restrictions are imposed.
在一些实施例中,该空间位置信息用于表明图像采集设备在当前时刻的空间姿态,其包括加速度、自转角、四元数等的至少一个,当然,根据实际展示效果的要求,还包括其他信息,本公开实施例并不对此进行限制。In some embodiments, the spatial position information is used to indicate the spatial posture of the image acquisition device at the current moment, which includes at least one of acceleration, rotation angle, quaternion, etc. Of course, according to the requirements of the actual display effect, it also includes other information, the embodiments of the present disclosure do not limit this.
在一些实施例中,图像采集设备通过传感器采集到的空间位置信息可能包括多种,而对于待显示的目标特效对象则仅需要其中的部分,因此图像采集设备确定需要获取的空间位置信息。相应的,图像采集设备获取图像采集设备在当前时刻的空间位置信息的步骤,包括:图像采集设备确定目标类型,该目标类型为显示目标特效对象所需的空间位置信息的类型;基于该目标类型,确定该空间位置信息。In some embodiments, the spatial position information collected by the image capture device through the sensor may include multiple types, and only some of them are required for the target special effect object to be displayed, so the image capture device determines the spatial position information to be acquired. Correspondingly, the step of acquiring the spatial position information of the image acquisition device at the current moment by the image acquisition device includes: the image acquisition device determines a target type, and the target type is the type of spatial position information required to display the target special effect object; based on the target type , to determine the spatial location information.
其中,图像采集设备确定目标类型的步骤,包括:图像采集设备通过查询预设关系表, 确定目标类型,该预设关系表用于记录特效对象与目标类型之间的对应关系,其中,任一特效对象对应的目标类型的若干空间位置信息用于确定该任一特效对象的显示参数。Wherein, the step of determining the target type by the image acquisition device includes: the image acquisition device determines the target type by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type, wherein any one of Several spatial position information of the target type corresponding to the special effect object is used to determine the display parameters of any special effect object.
预设关系表被记录在魔表SDK(Software Development Kit,软件开发工具包)中,从而通过调用该魔表SDK实现对目标类型的确定。通过该方式,图像采集设备不仅能够通过查表的方式,准确高效的确定目标类型,进而从图像采集设备在当前时刻的多种(或至少一种)空间信息中获取所需的空间位置信息,而且无需获取图像采集设备的全部空间信息,而只获取显示目标特效对象所需的部分,有助于减少待处理的数据量,加快目标特效对象的显示速度,避免特效显示卡顿,有助于提升显示效果。The preset relationship table is recorded in the Magic Watch SDK (Software Development Kit, software development kit), so that the target type can be determined by calling the Magic Watch SDK. In this way, the image acquisition device can not only determine the target type accurately and efficiently by looking up the table, but also obtain the required spatial position information from the various (or at least one) spatial information of the image acquisition device at the current moment, In addition, it is not necessary to obtain all the spatial information of the image acquisition device, but only the part required to display the target special effect object, which helps to reduce the amount of data to be processed, speed up the display speed of the target special effect object, and avoid the special effect display being stuck, which is helpful for Improve the display effect.
在一些实施例中,图像采集设备在通过查询预设关系表,确定目标类型之前,图像采集设备需要确定待显示的目标特效对象。图像采集设备通过多种方式确定待显示的目标特效对象。在一些实施例中,图像采集设备识别采集的画面中的显示对象,将匹配于显示对象的备选特效对象确定为待显示的目标特效对象,以使得目标特效对象与采集到的画面中所包含的显示对象相对应,增强画面的协调感,能够为用户自动展示合适的特效对象。例如,图像采集设备在识别出女性人脸的情况下,确定猫脸特效作为与之匹配的目标特效对象;而在检测到夜空的情况下,确定烟花特效作为与之匹配的目标特效对象等。In some embodiments, before the image capture device determines the target type by querying the preset relationship table, the image capture device needs to determine the target special effect object to be displayed. The image acquisition device determines the target special effect object to be displayed in various ways. In some embodiments, the image capture device identifies the display object in the captured picture, and determines the candidate special effect object that matches the display object as the target special effect object to be displayed, so that the target special effect object is the same as that contained in the captured picture. The corresponding display objects, enhance the sense of coordination of the screen, and can automatically display suitable special effects objects for users. For example, in the case of recognizing a female face, the image acquisition device determines the cat face special effect as the matching target special effect object; and in the case of detecting the night sky, determines the fireworks special effect as the matching target special effect object, etc.
在一些实施例中,图像采集设备为用户提供多种备选特效对象,以便用户选取其中合适的备选特效对象进行显示。相应的,图像采集设备响应于针对备选特效对象的特效选取指令,确定被选取备选的特效对象,确定为待显示的目标特效对象。从而实现由用户根据自己的意愿,选择目标特效对象,以充分尊重用户选择。In some embodiments, the image capturing device provides the user with a variety of candidate special effect objects, so that the user can select a suitable candidate special effect object for display. Correspondingly, in response to the special effect selection instruction for the candidate special effect object, the image acquisition device determines the selected candidate special effect object as the target special effect object to be displayed. In this way, the user can select the target special effect object according to his own wishes, so as to fully respect the user's choice.
其中,目标特效对象为显示在画面上方的静态或动态的魔法表情。如图1所示,魔法表情为展示在人像头部的兔耳,此时该方案在检测到手机姿态变化的情况下,相应的调整该兔耳的展示位置、展示颜色、兔耳大小、兔耳形状、兔耳动作等至少一种展示属性。在一些实施例中,图像采集设备为用户提供多种特效对象以供用户选择,如除兔耳外,还提供猫脸、狗头、红绿蓝(Red Green Blue,RGB)颜色分离等其他形式的特效对象,还提供能够由用户通过实施交互动作控制的虚拟特效,如动态的三维(Three Dimensions,3D)显示模型等,本公开实施例并不对此进行限制。The target special effect object is a static or dynamic magic expression displayed on the top of the screen. As shown in Figure 1, the magic expression is the rabbit ear displayed on the head of the portrait. At this time, the solution adjusts the display position, display color, rabbit ear size, rabbit ear size, rabbit ear, etc. At least one display attribute such as ear shape, rabbit ear motion, etc. In some embodiments, the image capture device provides the user with a variety of special effects objects for the user to choose, for example, in addition to the rabbit ears, it also provides other forms of cat face, dog head, red green blue (RGB) color separation, etc. The special effect object also provides virtual special effects that can be controlled by the user through interactive actions, such as a dynamic three-dimensional (Three Dimensions, 3D) display model, which is not limited in the embodiments of the present disclosure.
在一些实施例中,目标特效对象与图像采集设备采集的画面展示在同一展示界面中,如在图像采集设备的屏幕接收到摄像头采集的画面,按照预设刷新频率(通常即为摄像头采集画面的刷新频率)进行展示,并且在当前帧图像中展示有目标特效对象的情况下,图像采集设备通过传感器采集多种空间信息,进而根据其中的空间位置信息确定下一帧图像 的显示参数(如目标特效对象对应的各个像素点的像素值),从而在下一帧图像中展示对应于手机的空间位置的目标特效对象(例如,魔法表情)。In some embodiments, the target special effect object and the image captured by the image capture device are displayed in the same display interface. For example, if the image captured by the camera is received on the screen of the image capture device, the image captured by the camera will be refreshed according to a preset refresh frequency (usually the image captured by the camera). Refresh frequency) to display, and when the target special effect object is displayed in the current frame image, the image acquisition device collects various spatial information through the sensor, and then determines the display parameters of the next frame image according to the spatial position information (such as the target The pixel value of each pixel point corresponding to the special effect object), so that the target special effect object (for example, a magic expression) corresponding to the spatial position of the mobile phone is displayed in the next frame of image.
在一些实施例中,图像采集设备获取传感器采集的当前时刻的多种(至少一种)空间位置信息,然后基于目标类型,从多种(至少一种)空间位置信息中确定显示目标特效对象所需的空间位置信息,该目标类型为显示目标特效对象所需的空间位置信息的类型,该过程为:In some embodiments, the image acquisition device acquires multiple (at least one) types of spatial position information at the current moment collected by the sensor, and then, based on the target type, determines from the multiple (at least one) types of spatial position information where the target special effect object is displayed. The required spatial position information, the target type is the type of spatial position information required to display the target special effect object, and the process is:
传感器将采集到的图像采集设备在当前时刻的多种(或至少一种)空间位置信息,实时或周期性的提供至图像采集设备,从而图像采集设备在接收到传感器提供的多种空间位置信息后,基于当前时刻待展示的特效对象,查询预设关系表,确定目标类型,基于目标类型,从图像采集设备在当前时刻的多种(或至少一种)空间位置信息中,确定该空间位置信息,该空间位置信息为显示目标特效对象所需的空间位置信息,从而实现图像采集设备只需要从接收到的全部空间位置信息中确定需要使用的部分信息即可。The sensor provides the collected various (or at least one) spatial position information of the image acquisition device at the current moment to the image acquisition device in real time or periodically, so that the image acquisition device receives various spatial position information provided by the sensor. Then, based on the special effect object to be displayed at the current moment, query the preset relationship table to determine the target type, and based on the target type, determine the spatial position from the multiple (or at least one) spatial position information of the image acquisition device at the current moment The spatial position information is the spatial position information required to display the target special effect object, so that the image acquisition device only needs to determine the part of the information to be used from all the received spatial position information.
在一些实施例,图像采集设备指示传感器采集显示目标特效对象所需的空间位置信息,此时,传感器不实时采集空间位置信息,而由图像采集设备在确定目标类型后,向传感器发送获取请求,该获取请求携带目标类型,该目标类型为显示目标特效对象所需的空间位置信息的类型。传感器接收该获取请求(即调用传感器),基于该目标类型采集目标类型的空间位置信息,向图像采集设备发送该空间位置信息,图像采集设备接收该空间位置信息。该方式仅在图像采集设备需要时才会调用传感器采集空间位置信息,从而有助于降低传感器的使用频率以减少电量消耗。In some embodiments, the image acquisition device instructs the sensor to acquire the spatial location information required to display the target special effect object. In this case, the sensor does not acquire the spatial location information in real time, but the image acquisition device sends an acquisition request to the sensor after determining the target type, The obtaining request carries a target type, and the target type is the type of spatial position information required to display the target special effect object. The sensor receives the acquisition request (ie calls the sensor), collects the spatial location information of the target type based on the target type, sends the spatial location information to the image acquisition device, and the image acquisition device receives the spatial location information. This method calls the sensor to collect spatial position information only when the image acquisition device needs it, thereby helping to reduce the frequency of use of the sensor to reduce power consumption.
步骤204,基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被图像采集设备采集的画面。Step 204: Determine the display parameters of the target special effect object based on the spatial position information, where the target special effect object is used to process the picture captured by the image capture device.
在一些实施例中,上述空间位置信息包括四元数,此时图像采集设备构建三维旋转矩阵,基于该三维旋转矩阵,将四元数转换为欧拉角,然后基于该欧拉角确定目标特效对象的显示参数,以实现显示参数的快速确定。例如,图像采集设备将该欧拉角确定为目标特效对象的显示参数。In some embodiments, the above-mentioned spatial position information includes quaternions. At this time, the image acquisition device constructs a three-dimensional rotation matrix, converts the quaternions into Euler angles based on the three-dimensional rotation matrix, and then determines the target special effect based on the Euler angles. Display parameters of the object, to achieve quick determination of display parameters. For example, the image acquisition device determines the Euler angle as a display parameter of the target special effect object.
或者,图像采集设备基于欧拉角与预设倍数的乘积结果,确定目标特效对象的显示参数。例如,图像采集设备将欧拉角与预设倍数的乘积结果确定为目标特效对象的显示参数。该预设倍数为不等于1的正数,从而避免欧拉角过大或过小导致最终的目标特效对象显示效果不佳。其中,在上述欧拉角过小的情况下,上述预设倍数应当大于1;而在上述欧拉角过大的情况下,上述预设倍数应当小于1,从而实现对显示效果的最优化调节。其中, 在欧拉角小于第一预设角度的情况下,判定欧拉角过小;和/或在欧拉角大于第二预设角度的情况下,判定欧拉角过大,上述第一预设角度和第二预设角度的具体值根据设备类型、显示界面大小、目标特效对象类型等实际情况预先设置,如设置第一预设角度为0.5°,设置第二预设角度为80°等,本公开实施例并不对此进行限制。Or, the image acquisition device determines the display parameters of the target special effect object based on the result of the product of the Euler angle and the preset multiple. For example, the image acquisition device determines the product of the Euler angle and the preset multiple as the display parameter of the target special effect object. The preset multiple is a positive number not equal to 1, so as to prevent the Euler angle from being too large or too small, resulting in poor display of the final target special effect object. Wherein, when the Euler angle is too small, the preset multiple should be greater than 1; and when the Euler angle is too large, the preset multiple should be less than 1, so as to realize the optimal adjustment of the display effect . Wherein, when the Euler angle is less than the first preset angle, it is determined that the Euler angle is too small; and/or when the Euler angle is greater than the second preset angle, it is determined that the Euler angle is too large, and the first The specific values of the preset angle and the second preset angle are preset according to the actual situation such as the device type, the size of the display interface, the type of the target special effect object, etc. For example, the first preset angle is set to 0.5°, and the second preset angle is set to 80°. etc., the embodiments of the present disclosure do not limit this.
在一些实施例中,上述目标特效对象的显示参数以被周期性确定,并且在确定目标特效对象的显示参数的任一周期内,所使用的欧拉角为定值;则在当前周期内将四元数转换为欧拉角之后,图像采集设备不将上述欧拉角或其预设倍数作为显示参数,而通过下述方式进一步确定:获取相邻历史周期内确定的至少一个历史乘积结果,该相邻历史周期包括位于当前周期之前且连续的至少一个周期,然后确定当前周期内的乘积结果与上述至少一个历史乘积结果的最大值或平均值,将该最大值或平均值确定为目标特效对象的显示参数。In some embodiments, the display parameters of the target special effect object are determined periodically, and in any period of determining the display parameters of the target special effect object, the Euler angle used is a fixed value; then in the current period, the After the quaternion is converted into Euler angles, the image acquisition device does not use the above Euler angles or their preset multiples as display parameters, but further determines by the following methods: obtaining at least one historical product result determined in adjacent historical periods, The adjacent historical period includes at least one continuous period before the current period, then determine the maximum value or average value of the product result in the current period and the above-mentioned at least one historical product result, and determine the maximum value or average value as the target special effect Object's display parameters.
或者,图像采集设备通过下述方式进一步确定显示参数:获取相邻历史周期内确定的至少一个历史欧拉角,该相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定当前周期内的欧拉角与上述至少一个历史欧拉角的最大值或平均值,将该最大值或平均值确定为目标特效对象的显示参数。通过上述方式,图像采集设备确定出当前欧拉角与历史欧拉角的最大值或平均值作为目标特效对象的显示参数,或者确定出当前乘积结果与历史乘积结果的最大值或平均值作为目标特效对象的显示参数。其中,上述平均值或最大值为绝对值。在本公开实施例中,使用上述平均值作为目标特效对象的显示参数,能够保证图像采集设备展示界面中显示出的相邻图像帧之间的目标特效对象的显示效果不会发生突变,从而避免目标特效对象发生画面跳变。而使用上述最大值作为目标特效对象的显示参数,能够尽量保证目标特效对象被动态展示,提升目标特效对象的展示趣味性。Alternatively, the image acquisition device further determines the display parameters by obtaining at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that within the current period The maximum value or average value of the Euler angle and the above at least one historical Euler angle, and the maximum value or average value is determined as the display parameter of the target special effect object. In the above manner, the image acquisition device determines the maximum value or average value of the current Euler angle and the historical Euler angle as the display parameter of the target special effect object, or determines the maximum value or average value of the current product result and the historical product result as the target Display parameters of the effect object. However, the above average value or maximum value is an absolute value. In the embodiment of the present disclosure, using the above average value as the display parameter of the target special effect object can ensure that the display effect of the target special effect object between adjacent image frames displayed in the display interface of the image acquisition device will not change abruptly, thereby avoiding sudden changes in the display effect of the target special effect object. The target special effect object undergoes a screen jump. Using the above maximum value as the display parameter of the target special effect object can ensure that the target special effect object is dynamically displayed as much as possible, and enhance the display interest of the target special effect object.
在一些实施例中,上述空间位置信息包括加速度,此时图像采集设备先确定特效展示区域,该特效展示区域用于展示目标特效对象,然后根据上述加速度确定特效展示区域中的像素特征值,将该像素特征值确定为目标特效对象的显示参数。其中,像素特征值用于表示对应像素点的特征;例如,像素特征值包括下述至少之一:颜色值、颜色梯度、透明度、对比度。例如,上述颜色梯度值与加速度呈正相关,即加速度越大则颜色梯度值越大,加速度越小则颜色梯度值越小;或者上述对比度与加速度呈正相关,即加速度越大则对比度越大,加速度越小则对比度越小,不再一一赘述。通过该方式能够使得目标特效对象的显示参数充分反映图像采集设备当前时刻的加速度,从而使得目标特效对象的显示效果与该加速度相对应,实现通过控制图像采集设备的空间位置对目标特效对象的显示效果进行 调节的目的。In some embodiments, the above-mentioned spatial position information includes acceleration. In this case, the image acquisition device first determines a special effect display area, and the special effect display area is used to display the target special effect object, and then determines the pixel characteristic value in the special effect display area according to the above acceleration, and sets the The pixel feature value is determined as the display parameter of the target special effect object. The pixel feature value is used to represent the feature of the corresponding pixel point; for example, the pixel feature value includes at least one of the following: color value, color gradient, transparency, and contrast. For example, the above-mentioned color gradient value is positively correlated with acceleration, that is, the greater the acceleration, the greater the color gradient value, and the smaller the acceleration, the smaller the color gradient value; The smaller the contrast, the smaller the contrast, and will not be repeated. In this way, the display parameters of the target special effect object can fully reflect the acceleration of the image acquisition device at the current moment, so that the display effect of the target special effect object corresponds to the acceleration, and the display of the target special effect object can be realized by controlling the spatial position of the image acquisition device. The purpose of adjusting the effect.
在一些实施例中,上述空间位置信息包括自转角,而目标特效对象存在预设的标准显示角度,此时图像采集设备基于该自转角确定目标特效对象的偏转角度,基于该偏转角度,对标准显示角度进行旋转变换,将旋转变换后的角度确定为目标特效对象的显示参数。例如,在兔耳的标准显示角度为0°的情况下,兔耳正常状态下会呈现出两耳中线竖直的显示状态,而在用户改变手机空间位置导致手机旋转(产生自转角)时,该自转角在沿手机屏幕中轴线上的分量也发生变化,即产生偏转角度,此时手机相当于沿手机屏幕中轴线旋转该偏转角度(如30°),则用户在手机屏幕中的自拍头像也相对于手机旋转30°。此时图像采集设备根据该旋转角度对标准显示角度进行旋转变换,即将该角度加30度,从而得到兔耳的旋转后角度为30°,使得兔耳的仍然显示在人脸上方,保持与人脸之间相对位置关系不变。可见,通过该方式能够保证目标特效对象的显示效果与图像采集设备所采集画面中的画面内容之间的相对位置关系相匹配,不会因手机转动导致目标特效对象显示混乱。In some embodiments, the above-mentioned spatial position information includes a rotation angle, and the target special effect object has a preset standard display angle. In this case, the image acquisition device determines the deflection angle of the target special effect object based on the rotation angle. The display angle is rotated and transformed, and the angle after the rotation transformation is determined as the display parameter of the target special effect object. For example, when the standard display angle of the rabbit ear is 0°, the rabbit ear will show a vertical display state of the center line of the two ears under normal state, but when the user changes the spatial position of the mobile phone, the mobile phone rotates (the rotation angle is generated), The component of the rotation angle along the central axis of the mobile phone screen also changes, that is, a deflection angle is generated. At this time, the mobile phone is equivalent to rotating the deflection angle (such as 30°) along the central axis of the mobile phone screen. Also rotated 30° relative to the phone. At this time, the image acquisition device rotates and transforms the standard display angle according to the rotation angle, that is, the angle is added by 30 degrees, so that the rotated angle of the rabbit ears is 30 degrees, so that the rabbit ears are still displayed on the face of the human, and the The relative positional relationship between faces remains unchanged. It can be seen that this method can ensure that the display effect of the target special effect object matches the relative positional relationship between the picture content in the picture captured by the image acquisition device, and the display of the target special effect object will not be chaotic due to the rotation of the mobile phone.
在一些实施例中,目标特效对象的显示参数包括模糊强度和/或颜色饱和度,还包括羽化度、对比度、亮度等中的至少一项,本公开实施例并不对此进行限制。另外,上述各个实施例的处理逻辑记录在预先生成的特效SDK中,从而能够调用该特效SDK,基于空间位置信息确定目标特效对象的显示参数。例如,该特效SDK为前述魔表SDK,即魔表SDK除记录特效对象与目标类型之间的对应关系外,还记录通过空间位置信息求解目标特效对象的显示参数的处理逻辑及具体算法。因此,图像采集设备在获取到空间位置信息后,将其提供至预设的上述特效SDK,以由该特效SDK按照其中记录的处理逻辑及具体算法确定目标特效对象的显示参数,进而图像采集设备获取该显示参数用于显示目标特效对象。In some embodiments, the display parameters of the target special effect object include blur intensity and/or color saturation, and also include at least one of feathering, contrast, brightness, etc., which are not limited in the embodiments of the present disclosure. In addition, the processing logic of the above embodiments is recorded in a pre-generated special effect SDK, so that the special effect SDK can be called to determine the display parameters of the target special effect object based on the spatial position information. For example, the special effect SDK is the aforementioned magic watch SDK, that is, the magic watch SDK not only records the corresponding relationship between the special effect object and the target type, but also records the processing logic and specific algorithm for solving the display parameters of the target special effect object through the spatial position information. Therefore, after acquiring the spatial position information, the image capture device provides it to the preset special effects SDK, so that the special effects SDK determines the display parameters of the target special effect object according to the processing logic and specific algorithm recorded therein, and then the image capture device Get this display parameter to display the target special effect object.
其中,上述通过魔表SDK确定目标特效对象的显示参数的过程,即为图像采集设备的CPU,按照魔表SDK记录的上述对应关系确定空间位置信息,然后根据魔表SDK中记录的处理逻辑及具体算法求解该目标特效对象的显示参数的过程。通过预先设置特效SDK的方式能够规范化空间位置信息的获取过程以及显示参数的确定方式,便于快速高效地确定显示参数,从而保证特效对象的快速渲染与显示,减少特效显示时的用户等待时长以提升用户体验。Among them, the above-mentioned process of determining the display parameters of the target special effect object through the Magic Watch SDK is the CPU of the image acquisition device, and the spatial location information is determined according to the above-mentioned corresponding relationship recorded by the Magic Watch SDK, and then according to the processing logic and the processing logic recorded in the Magic Watch SDK. The specific algorithm is the process of solving the display parameters of the target special effect object. By pre-setting the special effects SDK, the process of obtaining spatial position information and the method of determining display parameters can be standardized, which is convenient for determining display parameters quickly and efficiently, thereby ensuring the rapid rendering and display of special effects objects, and reducing the waiting time of users when special effects are displayed. user experience.
步骤206,基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。Step 206: Render the picture based on the display parameters, and display the special effect picture obtained by rendering, where the special effect picture includes the target special effect object.
在本实施例中,确定出上述显示参数后,图像采集设备将其提供至显示组件对应的图像处理器(Graphic Processing Unit,GPU),以使GPU基于该显示参数进行相应的渲染处理,得到包含目标特效对象的特效画面,进而展示该特效画面,该特效画面中的目标特效对象呈现出与该空间位置信息相对应的显示效果。In this embodiment, after the above-mentioned display parameters are determined, the image acquisition device provides them to an image processor (Graphic Processing Unit, GPU) corresponding to the display component, so that the GPU performs corresponding rendering processing based on the display parameters, and obtains The special effect picture of the target special effect object, and then the special effect picture is displayed, and the target special effect object in the special effect picture presents a display effect corresponding to the spatial position information.
根据本公开的实施例,用户通过操控图像采集设备的空间姿态,控制特效的显示效果。在一些实施例中,通过获取图像采集设备在当前时刻的空间位置信息,确定目标特效对象的显示参数,从而基于该显示参数渲染所采集的画面以得到特效画面,使得该特效画面被展示时能够显示出上述特效对象,从而呈现出对应于图像采集设备的空间位置信息的特效显示效果。可见,该方案允许用户通过操纵图像采集设备,从而改变图像采集设备的空间位置信息,进而对图像采集设备所显示的魔法表情等特效进行自行调整与控制;而且该方案无需使用用户的人脸关键点等生物信息即可实现,在保证显示效果控制准确度的同时也保证了用户的信息安全。According to the embodiment of the present disclosure, the user controls the display effect of the special effect by manipulating the spatial posture of the image capturing device. In some embodiments, the display parameters of the target special effect object are determined by acquiring the spatial position information of the image acquisition device at the current moment, so that the captured picture is rendered based on the display parameters to obtain the special effect picture, so that the special effect picture can be displayed when displayed. The above-mentioned special effect object is displayed, thereby presenting a special effect display effect corresponding to the spatial position information of the image acquisition device. It can be seen that this solution allows the user to change the spatial position information of the image capture device by manipulating the image capture device, and then adjust and control the special effects such as magic expressions displayed by the image capture device; and this solution does not need to use the user's face key Points and other biological information can be realized, which not only ensures the control accuracy of the display effect, but also ensures the user's information security.
下面结合图3所示的另一种特效显示方法的流程图。下面结合图3-图6,对手机通过获取自身所装配陀螺仪采集到的空间位置信息,控制拍摄过程中魔法表情的显示效果的具体过程进行详细描述。如图3所示,该过程包括下述步骤301-307。The following is a flow chart of another special effect display method shown in FIG. 3 . The specific process of controlling the display effect of the magic expression during the shooting process by the mobile phone by obtaining the spatial position information collected by the gyroscope equipped with itself will be described in detail below with reference to FIGS. 3 to 6 . As shown in FIG. 3, the process includes the following steps 301-307.
步骤301:手机屏幕中显示实时采集的待拍摄对象对应的当前帧画面。Step 301 : The current frame image corresponding to the object to be photographed collected in real time is displayed on the screen of the mobile phone.
在本实施例中,用户使用手机自身装配的前置或后置摄像头拍摄待拍摄对象,如使用前置摄像头自拍,或者使用后置摄像头拍别人或物体。在用户开启手机的拍照功能后,手机调用摄像头采集待拍摄对象的光学信息,在屏幕上显示相应的预览画面,在手机默认开启魔法表情功能或者用户在手机展示预览画面时开启魔法表情功能的情况下,则手机屏幕的预览画面中会展示相应的魔法表情。如图1所示,在待拍摄对象为兔耳的情况下,该特效表情会相应的显示在预览画面中的人脸的头部位置。进而,用户在对当前预览画面和魔法表情的整体预览效果满意的情况下,通过触发拍摄功能(如单击“拍摄”控件)实现画面拍摄以得到照片。In this embodiment, the user uses the front or rear camera mounted on the mobile phone to shoot the object to be shot, such as using the front camera to take a selfie, or using the rear camera to shoot other people or objects. After the user turns on the camera function of the mobile phone, the mobile phone calls the camera to collect the optical information of the object to be photographed, and displays the corresponding preview image on the screen. The magic expression function is enabled by default on the mobile phone or the user turns on the magic expression function when the preview image is displayed on the mobile phone. , the corresponding magic emoji will be displayed in the preview screen of the mobile phone screen. As shown in FIG. 1 , when the object to be photographed is a rabbit ear, the special effect expression will be correspondingly displayed on the head position of the human face in the preview screen. Furthermore, when the user is satisfied with the current preview image and the overall preview effect of the magic expression, the user can capture the image by triggering the shooting function (eg, click the "shoot" control) to obtain a photo.
又例如,在用户开启手机的录像功能,且开始录像后,在手机默认开启魔法表情功能或者用户在手机展示预览画面时开启魔法表情功能的情况下,则手机屏幕的预览画面中会展示相应的魔法表情。进而,手机将魔法表情的展示效果及动态变化过程录制在录制视频中。For another example, after the user turns on the video recording function of the mobile phone and starts recording, if the mobile phone has the magic expression function enabled by default or the user enables the magic expression function when displaying the preview screen on the mobile phone, the preview screen of the mobile phone screen will display the corresponding Magical emoji. Furthermore, the mobile phone records the display effect and dynamic change process of the magic expression in the recorded video.
在本实施例中,手机屏幕所显示的包含魔法表情的图像是逐帧显示的,因此,本方案显示魔法表情的过程也是逐帧显示的。在一些实施例中,手机在显示当前帧画面的过程中, 通过执行下述步骤302-305确定出下一帧画面中魔法表情的显示参数,进而由GPU着色器按照该显示参数渲染得到包含魔法表情的下一帧画面用于显示。In this embodiment, the image containing the magic expression displayed on the screen of the mobile phone is displayed frame by frame. Therefore, the process of displaying the magic expression in this solution is also displayed frame by frame. In some embodiments, during the process of displaying the current frame, the mobile phone determines the display parameters of the magic expression in the next frame by performing the following steps 302-305, and then the GPU shader renders the magic expression according to the display parameters to obtain the magic expression. The next frame of the expression is used for display.
步骤302:确定待显示的魔法表情。Step 302: Determine the magic expression to be displayed.
在显示当前帧画面的过程中,手机确定当前画面中被显示的魔法表情,进而确定待显示的魔法表情。例如,在确定出备选魔法表情中当前时刻被选中且处于显示状态的魔法表情为兔耳的情况下,手机将兔耳确定为待展示的魔法表情,即需要在下一帧图像中显示该兔耳(只是具体的显示参数需要通过下述步骤确定,以便下一帧图像中展示出的兔耳能够对应于手机当前时刻的空间位置信息)。In the process of displaying the current frame picture, the mobile phone determines the magic expression displayed in the current picture, and then determines the magic expression to be displayed. For example, in the case where it is determined that the currently selected and displayed magic expression among the candidate magic expressions is the rabbit ear, the mobile phone determines the rabbit ear as the magic expression to be displayed, that is, the rabbit needs to be displayed in the next frame of image. Ears (only the specific display parameters need to be determined through the following steps, so that the rabbit ears displayed in the next frame of image can correspond to the spatial location information of the mobile phone at the current moment).
步骤303:获取陀螺仪采集且输出的四元数。Step 303: Obtain the quaternion collected and output by the gyroscope.
在本实施例中,用户在使用手机拍摄的过程中,通过操控手部动作改变手机的姿态,如控制手机平移、倾斜、转动等,从而手机通过自身装配的陀螺仪采集自身的空间位置信息,使用该空间位置信息对魔法表情的显示效果进行控制,该空间位置信息包括四元数。In this embodiment, the user changes the posture of the mobile phone by manipulating hand movements during the process of shooting with the mobile phone, such as controlling the mobile phone to pan, tilt, rotate, etc., so that the mobile phone collects its own spatial position information through the gyroscope assembled by itself. The display effect of the magic expression is controlled by using the spatial position information, which includes a quaternion.
在一些实施例中,手机中预先存储有魔表SDK,该魔表SDK中不仅记录手机用于实现的任一魔法表情所对应的目标类型,还相应的记录通过上述至少一种空间位置信息计算实现该任一魔法表情所需的相应算法,即记录有前述图2所示实施例中的预设关系表。或者,在手机通过自身所运行的具备摄像头调用功能的应用(如手机原生拍摄应用、第三方拍摄应用、第三方多媒体应用等)展示魔法表情的情况下,上述魔表SDK或者对应关系预先存储在该应用对应的服务端中,从而手机从该服务端获取上述魔表SDK或者预设关系表,进而执行后续步骤。In some embodiments, a magic watch SDK is pre-stored in the mobile phone, and the magic watch SDK not only records the target type corresponding to any magic expression used by the mobile phone to realize, but also records the corresponding records calculated by the above-mentioned at least one kind of spatial position information The corresponding algorithm required to realize any of the magic expressions is recorded with the preset relation table in the embodiment shown in FIG. 2 . Or, in the case where the mobile phone displays the magic expression through its own application with the camera calling function (such as mobile phone native shooting application, third-party shooting application, third-party multimedia application, etc.), the above magic watch SDK or the corresponding relationship is pre-stored in the In the server corresponding to the application, the mobile phone obtains the above magic watch SDK or the preset relationship table from the server, and then executes the subsequent steps.
在一些实施例中,在确定出待显示的魔法表情后,手机调用上述魔表SDK或者根据上述预设关系表确定对应于该待显示的魔法表情的空间位置信息。值得说明的是,该魔表SDK中记录的“用于实现的任一魔法表情所对应的若干空间位置信息”,只是空间位置信息的名称,而并非其具体取值,也即前面所述的目标类型。如记录用于实现兔耳特效需要用到“四元数”,从而手机在确定目标特效对象为兔耳后,通过查询该魔表SDK确定需要获取手机当前的四元数,进而从手机的陀螺仪处获取其采集到的四元数的具体值。In some embodiments, after determining the magic expression to be displayed, the mobile phone calls the magic watch SDK or determines the spatial location information corresponding to the magic expression to be displayed according to the preset relationship table. It is worth noting that the "several spatial position information corresponding to any magic expression used for realization" recorded in the magic watch SDK is only the name of the spatial position information, not its specific value, that is, the aforementioned target type. For example, the "quaternion" needs to be used for the realization of the rabbit ear special effect, so after the mobile phone determines that the target special effect object is the rabbit ear, it determines the need to obtain the current quaternion of the mobile phone by querying the magic watch SDK, and then from the mobile phone's gyro The instrument obtains the specific value of the quaternion it has collected.
在本实施例中,以上述魔法表情为实现RGB分离效果的分离色块为例,手机根据上述预设关系表确定该RGB分离效果对应的空间位置信息,如四元数。在通过上述方式确定出对应于RGB分离效果的空间位置信息为四元数的情况下,则表明需要在下一帧画面中显示出该RGB分离效果对应的分离色块,进而需要使用四元数这一数据求取该分离色块的显示参数。In this embodiment, taking the magic expression as an example of a separation color block for realizing an RGB separation effect, the mobile phone determines the spatial position information, such as a quaternion, corresponding to the RGB separation effect according to the above preset relationship table. In the case where the spatial position information corresponding to the RGB separation effect is determined to be a quaternion by the above method, it indicates that the separation color block corresponding to the RGB separation effect needs to be displayed in the next frame of picture, and then the quaternion needs to be used. A data to obtain the display parameters of the separated color block.
在一些实施例中,手机(具体为手机的CPU,下同)从自身所装配陀螺仪采集到的空间位置信息中提取该四元数;或者,手机向该陀螺仪请求获取器采集到的四元数。In some embodiments, the mobile phone (specifically, the CPU of the mobile phone, the same below) extracts the quaternion from the spatial position information collected by the gyroscope equipped with itself; or, the mobile phone requests the gyroscope for the quaternion collected by the acquirer arity.
步骤304:确定四元数对应的旋转角度。Step 304: Determine the rotation angle corresponding to the quaternion.
在本实施例中,使用欧拉角表征手机空间位置变化过程中的移动或旋转等动作。在一些实施例中,在笛卡尔坐标系下直接将四元数转换为欧拉角,或者构建用于表征手机方位变化的旋转矩阵,基于该旋转矩阵将该四元数转换为相应的欧拉角。本申请实施例中,对构建旋转矩阵的时机不作具体限定;例如,在确定四元数对应的旋转角度时构建,或者事先构建好,存储在手机中,在确定四元数对应的旋转角度时,直接获取已存储的旋转矩阵即可。In this embodiment, Euler angles are used to represent actions such as movement or rotation in the process of changing the spatial position of the mobile phone. In some embodiments, the quaternion is directly converted into Euler angles in the Cartesian coordinate system, or a rotation matrix for characterizing the orientation change of the mobile phone is constructed, and the quaternion is converted into the corresponding Euler based on the rotation matrix horn. In the embodiment of the present application, the timing of constructing the rotation matrix is not specifically limited; for example, it is constructed when the rotation angle corresponding to the quaternion is determined, or it is constructed in advance and stored in the mobile phone, and when the rotation angle corresponding to the quaternion is determined, , you can directly obtain the stored rotation matrix.
在一些实施例中,根据上述欧拉角通过多种方式确定手机姿态改变对应的旋转角度。在一些实施例中,直接将计算得到的上述欧拉角确定为旋转角度,从而简化旋转角度的确定方式,以加快显示参数的计算速度。或者,在一些实施例,将计算出的上述欧拉角缓存至参数队列中,该参数队列中还缓存有当前帧画面之前的若干历史帧画面对应的若干历史欧拉角,从而将该队列中各个欧拉角的平均值确定为旋转角度,以避免魔法表情显示过程中的跳变,进而呈现出较为平稳的魔法表情显示效果。In some embodiments, the rotation angle corresponding to the change in the attitude of the mobile phone is determined in various ways according to the above Euler angles. In some embodiments, the above-mentioned Euler angle obtained by calculation is directly determined as the rotation angle, so as to simplify the way of determining the rotation angle and speed up the calculation speed of the display parameters. Or, in some embodiments, the calculated Euler angles are cached in a parameter queue, and the parameter queue also caches several historical Euler angles corresponding to several historical frames before the current frame, so that the queue The average value of each Euler angle is determined as the rotation angle, so as to avoid jumps in the display process of the magic expression, thereby presenting a relatively stable display effect of the magic expression.
其中,上述参数队列中的历史欧拉角为连续画面帧对应的欧拉角,如将包括当前帧画面对应的当前欧拉角在内的n(n>1)帧画面帧对应的n个欧拉角构成参数队列,相应的,将该队列中的n个欧拉角的平均值确定为当前帧画面对应的旋转角度。能够理解的是,上述n越大,则画面中的目标特效对象越平稳。当然,在上述n足够小(如n≤10)的情况下,将参数队列中的n个欧拉角中的最大值确定为旋转角度。或者,将当前欧拉角的预设倍数与上述各个历史欧拉角的预设倍数的平均值或最大值作为上述旋转角度,不再赘述。Wherein, the historical Euler angle in the above parameter queue is the Euler angle corresponding to the continuous picture frame. The pull angle constitutes a parameter queue, and accordingly, the average value of the n Euler angles in the queue is determined as the rotation angle corresponding to the current frame. It can be understood that the larger the above n is, the smoother the target special effect object in the picture is. Of course, in the case that the above n is sufficiently small (for example, n≤10), the maximum value among the n Euler angles in the parameter queue is determined as the rotation angle. Alternatively, the average or maximum value of the preset multiple of the current Euler angle and the preset multiples of the respective historical Euler angles is used as the rotation angle, and details are not repeated here.
步骤305:确定下一帧画面中魔法表情的展示参数。Step 305: Determine the display parameters of the magic expression in the next frame of picture.
在一些实施例中,基于上述旋转角度能够通过多种方式确定展示参数。在一些实施例中,手机按照魔表SDK中记录的预设算法,根据上述旋转角度计算模糊强度等展示参数。在一些实施例中,手机将上述旋转角度乘以大于1的系数x1后,再计算相应的展示参数,以保证在旋转角度较小的情况下,仍然能够计算出相应的展示参数,从而保证对手机操控以及魔法表情显示的灵敏度。或者,将上述旋转角度乘以小于1的系数x2后,再计算相应的展示参数,以保证在旋转角度较大的情况下,避免展示参数过大导致目标特效对象在画面中发生跳变。上述系数x1和x2为根据图像采集设备类型、展示画面尺寸、目标特效对象的类型等实际情况预先设置并经过验证的经验值,本公开实施例并不对此进行限制。In some embodiments, the presentation parameters can be determined in a number of ways based on the above-mentioned rotation angles. In some embodiments, the mobile phone calculates display parameters such as blur intensity according to the above rotation angle according to the preset algorithm recorded in the Magic Watch SDK. In some embodiments, the mobile phone calculates the corresponding display parameters after multiplying the above-mentioned rotation angle by a coefficient x1 greater than 1, so as to ensure that the corresponding display parameters can still be calculated even when the rotation angle is small, so as to ensure the correct display parameters. Sensitivity of phone control and magic emoji display. Alternatively, after multiplying the above rotation angle by a coefficient x2 less than 1, the corresponding display parameters are calculated to ensure that when the rotation angle is large, the display parameters are too large to prevent the target special effect object from jumping in the screen. The above-mentioned coefficients x1 and x2 are empirical values preset and verified according to actual conditions such as the type of image acquisition device, the size of the display screen, and the type of the target special effect object, which are not limited in this embodiment of the present disclosure.
在一些实施例中,上述空间位置信息包括自转角,而目标特效对象存在预设的标准显示角度,此时手机基于该自转角确定目标特效对象的偏转角度,基于该偏转角度,对标准显示角度进行旋转变换,将变换得到的旋转后角度确定为目标特效对象的显示参数。如图4所示,假设兔耳的标准显示角度为0°,则兔耳正常状态下会呈现出如图4(a)所示两耳中线竖直(平行于手机屏幕的纵向中轴线)的显示状态。而在用户改变手机空间位置导致手机向左旋转(产生自转角)时,该自转角在沿手机屏幕中轴线上的分量也发生变化,即产生偏转角度(假设为30°),此时手机相当于沿手机屏幕纵向中轴线向左旋转30°,进而用户在手机屏幕中的自拍头像相对于手机屏幕向右旋转30°。此时手机根据该旋转角度对标准显示角度进行旋转变换,即将标准显示角度加30°,从而得到兔耳的旋转后角度(相对于手机屏幕的旋转角度)为向右30°,从而手机旋转后的兔耳仍然显示在人脸上方,保持与人脸之间的相对位置关系不变,如图4(b)所示。可见,通过该方式能够保证目标特效对象的显示效果与手机所采集画面中的画面内容之间的相对位置关系相匹配,不会因手机转动导致目标特效对象显示混乱。In some embodiments, the above-mentioned spatial position information includes the rotation angle, and the target special effect object has a preset standard display angle. At this time, the mobile phone determines the deflection angle of the target special effect object based on the rotation angle, and based on the deflection angle, the standard display angle is determined. Rotation transformation is performed, and the rotated angle obtained by transformation is determined as the display parameter of the target special effect object. As shown in Figure 4, assuming that the standard display angle of the rabbit's ear is 0°, the rabbit's ear will appear as shown in Figure 4(a) in a normal state with a vertical center line (parallel to the longitudinal center axis of the mobile phone screen). Display state. When the user changes the spatial position of the mobile phone and causes the mobile phone to rotate to the left (the rotation angle is generated), the component of the rotation angle along the central axis of the mobile phone screen also changes, that is, the deflection angle (assumed to be 30°) is generated. At this time, the mobile phone is equivalent to It rotates 30° to the left along the longitudinal center axis of the mobile phone screen, and then the user's selfie avatar on the mobile phone screen is rotated 30° to the right relative to the mobile phone screen. At this time, the mobile phone rotates and transforms the standard display angle according to the rotation angle, that is, adding 30° to the standard display angle, so that the rotated angle of the rabbit ear (relative to the rotation angle of the mobile phone screen) is 30° to the right, so that after the mobile phone is rotated The rabbit ears are still displayed above the face, keeping the relative positional relationship with the face unchanged, as shown in Figure 4(b). It can be seen that this method can ensure that the display effect of the target special effect object matches the relative positional relationship between the screen content in the screen captured by the mobile phone, and the display of the target special effect object will not be chaotic due to the rotation of the mobile phone.
步骤306:CPU将展示参数提供至GPU着色器进行画面渲染以得到下一帧图像。Step 306: The CPU provides the display parameters to the GPU shader for image rendering to obtain the next frame of image.
步骤307:显示包含魔法表情的下一帧图像。Step 307: Display the next frame of image containing the magic expression.
在本实施例中,确定出上述展示参数后,将其提供至手机屏幕对应的GPU着色器中,以渲染下一帧画面,进而手机屏幕展示渲染完成的下一帧画面,该画面中包含根据上述显示参数渲染得到的魔法表情,该魔法表情的展示效果对应于手机当前时刻的空间姿态。其中,上述渲染和显示下一帧画面的具体过程参见相关技术中的记载,此处不再赘述。In this embodiment, after the above-mentioned display parameters are determined, they are provided to the GPU shader corresponding to the screen of the mobile phone to render the next frame of picture, and then the screen of the mobile phone displays the next frame of picture after rendering, and the picture contains according to The magic expression rendered by the above display parameters, the display effect of the magic expression corresponds to the spatial posture of the mobile phone at the current moment. Wherein, the specific process of rendering and displaying the next frame of picture can refer to the description in the related art, and details are not repeated here.
下面以魔法表情为RGB分离效果对应的分离色块为例进行说明,分离色块的展示效果可参见图5及图6所示。The following description will be given by taking the magic expression as the separation color block corresponding to the RGB separation effect as an example, and the display effect of the separation color block can be referred to as shown in FIG. 5 and FIG. 6 .
图5(a)所示为手机拍摄界面的预览画面效果示意图,在用户在该界面中打开魔法表情功能且选中RGB分离效果作为特效的情况下,则当用户操控手机沿其竖直中轴线从右至左旋转时,其对应的RGB分离效果如图5(b)所示。其中,展示出501、502等多个分离色块,此时分离色块对应的展示参数为分离色块的个数,还为各个分离色块的宽度、模糊强度、RGB通道颜色值、颜色饱和度等,本公开对此并不进行限制。类似的,如图6(a)所示,当用户操控手机沿其水平中轴线从上至下旋转时,其对应的RGB分离效果如图6(b)所示,不再赘述。Figure 5(a) shows a schematic diagram of the preview screen effect of the mobile phone shooting interface. When the user turns on the magic expression function in the interface and selects the RGB separation effect as the special effect, when the user controls the mobile phone to move from When rotated from right to left, the corresponding RGB separation effect is shown in Figure 5(b). Among them, a plurality of separate color blocks such as 501 and 502 are displayed. At this time, the display parameters corresponding to the separate color blocks are the number of separate color blocks, and also the width, blur intensity, RGB channel color value, and color saturation of each separate color block. degree, etc., which is not limited in the present disclosure. Similarly, as shown in Figure 6(a), when the user controls the mobile phone to rotate from top to bottom along its horizontal central axis, the corresponding RGB separation effect is shown in Figure 6(b), which will not be repeated.
由图5(a)-图6(b)可见,当用户通过手部动作控制手机旋转时,相应的控制分离色块的显示效果,进而控制在下一帧画面中显示出RGB分离效果,从而实现通过手机姿 态对控制RGB分离特效的效果。As can be seen from Figure 5(a)-Figure 6(b), when the user controls the rotation of the mobile phone through hand movements, the display effect of the separated color blocks is correspondingly controlled, and then the RGB separation effect is controlled to be displayed in the next frame, thereby realizing Control the effect of RGB separation effects through the gesture pair of the mobile phone.
与前述特效显示方法的实施例相对应地,本公开还提出了特效显示装置的实施例。Corresponding to the foregoing embodiments of the special effect display method, the present disclosure also proposes an embodiment of a special effect display device.
图7是根据本公开的实施例示出的一种特效显示装置的示意框图。本实施例所示的特效显示装置适用于图像采集设备,所述图像采集设备具备图像采集及特效对象显示功能,所述图像采集设备包括但不限于手机、平板电脑、可穿戴设备、个人计算机等电子设备。FIG. 7 is a schematic block diagram of a special effect display device according to an embodiment of the present disclosure. The special effect display device shown in this embodiment is suitable for image acquisition equipment, the image acquisition equipment has the functions of image acquisition and special effect object display, and the image acquisition equipment includes but is not limited to mobile phones, tablet computers, wearable devices, personal computers, etc. Electronic equipment.
如图7所示,所述特效显示装置包括:As shown in Figure 7, the special effect display device includes:
信息获取单元701,被配置为获取图像采集设备在当前时刻的空间位置信息;The information acquisition unit 701 is configured to acquire the spatial position information of the image acquisition device at the current moment;
参数确定单元702,被配置为基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;A parameter determination unit 702, configured to determine display parameters of a target special effect object based on the spatial position information, where the target special effect object is used to process a picture captured by the image capture device;
画面渲染单元703,被配置为基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture rendering unit 703 is configured to render the picture based on the display parameters, and display a special effect picture obtained by rendering, and the special effect picture includes the target special effect object.
在一些实施例中,所述空间位置信息包括下述至少之一:加速度、自转角、四元数。In some embodiments, the spatial position information includes at least one of the following: acceleration, rotation angle, and quaternion.
在一些实施例中,所述信息获取单元701还被配置为:In some embodiments, the information obtaining unit 701 is further configured to:
确定目标类型,所述目标类型为显示所述目标特效对象所需的空间位置信息的类型;determining a target type, where the target type is the type of spatial position information required to display the target special effect object;
基于所述目标类型,确定所述空间位置信息。Based on the target type, the spatial location information is determined.
在一些实施例中,所述信息获取单元701还被配置为:In some embodiments, the information obtaining unit 701 is further configured to:
通过查询预设关系表,确定所述目标类型,所述预设关系表用于记录特效对象与目标类型之间的对应关系。The target type is determined by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type.
在一些实施例中,所述信息获取单元701还被配置为:In some embodiments, the information obtaining unit 701 is further configured to:
识别所述图像采集设备采集到的画面中的显示对象,将匹配于所述显示对象的备选特效对象确定为所述目标特效对象;或者,Identifying the display object in the picture collected by the image acquisition device, and determining the candidate special effect object that matches the display object as the target special effect object; or,
响应于针对备选特效对象的特效选取指令,确定被选取的所述目标特效对象。In response to the effect selection instruction for the candidate effect object, the selected target effect object is determined.
在一些实施例中,所述空间位置信息包括四元数,所述参数确定单元702还被配置为:In some embodiments, the spatial location information includes a quaternion, and the parameter determination unit 702 is further configured to:
基于三维旋转矩阵,将所述四元数转换为欧拉角;converting the quaternion to Euler angles based on a three-dimensional rotation matrix;
基于所述欧拉角,确定所述目标特效对象的显示参数,或者基于所述欧拉角与预设倍数的乘积结果,确定所述目标特效对象的显示参数,所述预设倍数为不等于1的正数。Determine the display parameter of the target special effect object based on the Euler angle, or determine the display parameter of the target special effect object based on the product of the Euler angle and a preset multiple, where the preset multiple is not equal to A positive number of 1.
在一些实施例中,所述目标特效对象的显示参数被周期性确定,所述装置还包括:In some embodiments, the display parameters of the target special effect object are determined periodically, and the apparatus further includes:
第一历史确定单元704,被配置为获取相邻历史周期内确定的至少一个历史乘积结果,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述乘积结果与所述至少一个历史乘积结果的最大值或平均值,将所述最大值或平均值确定为所述目标 特效对象的显示参数。The first history determination unit 704 is configured to obtain at least one historical product result determined in an adjacent historical period, the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that the product result is the same as the The maximum value or average value of at least one historical product result, and the maximum value or average value is determined as the display parameter of the target special effect object.
在一些实施例中,所述目标特效对象的显示参数被周期性确定,所述装置还包括:In some embodiments, the display parameters of the target special effect object are determined periodically, and the apparatus further includes:
第二历史确定单元705,被配置为获取相邻历史周期内确定的至少一个历史欧拉角,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述欧拉角与所述至少一个历史欧拉角的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。The second history determination unit 705 is configured to acquire at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one continuous period before the current period, and determine that the Euler angle is the same as the The maximum value or average value of the at least one historical Euler angle, and the maximum value or average value is determined as the display parameter of the target special effect object.
在一些实施例中,所述空间位置信息包括加速度,所述参数确定单元702还被配置为:In some embodiments, the spatial position information includes acceleration, and the parameter determination unit 702 is further configured to:
确定特效展示区域,所述特效展示区域用于展示所述目标特效对象;determining a special effect display area, where the special effect display area is used to display the target special effect object;
基于所述加速度,确定所述特效展示区域中的像素特征值,将所述像素特征值确定为所述目标特效对象的显示参数,所述像素特征值用于表示对应像素点的特征。Based on the acceleration, a pixel characteristic value in the special effect display area is determined, the pixel characteristic value is determined as a display parameter of the target special effect object, and the pixel characteristic value is used to represent the characteristic of the corresponding pixel point.
在一些实施例中,所述像素特征值包括下述至少之一:In some embodiments, the pixel feature value includes at least one of the following:
颜色值、颜色梯度、透明度、对比度。Color value, color gradient, transparency, contrast.
在一些实施例中,所述空间位置信息包括自转角,所述目标特效对象存在预设的标准显示角度,所述参数确定单元702还被配置为:In some embodiments, the spatial position information includes a rotation angle, the target special effect object has a preset standard display angle, and the parameter determination unit 702 is further configured to:
基于所述自转角,确定所述目标特效对象的偏转角度;determining the deflection angle of the target special effect object based on the rotation angle;
基于所述偏转角度,对所述标准显示角度进行旋转变换,将旋转变换后的角度确定为所述目标特效对象的显示参数。Based on the deflection angle, the standard display angle is rotated and transformed, and the rotated and transformed angle is determined as the display parameter of the target special effect object.
在一些实施例中,所述目标特效对象的显示参数包括模糊强度和/或颜色饱和度。In some embodiments, the display parameters of the target special effect object include blur strength and/or color saturation.
本公开的实施例还提出一种电子设备,包括:Embodiments of the present disclosure also provide an electronic device, including:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
其中,所述处理器被配置为执行所述指令,以实现如上述任一实施例所述的特效显示方法。Wherein, the processor is configured to execute the instruction to implement the special effect display method according to any one of the above embodiments.
本公开的实施例还提出一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行上述任一实施例所述的特效显示方法。Embodiments of the present disclosure further provide a storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the special effect display method described in any of the foregoing embodiments.
本公开的实施例还提出一种计算机程序产品,所述计算机程序产品被配置为执行上述任一实施例所述的特效显示方法。Embodiments of the present disclosure further provide a computer program product, the computer program product being configured to execute the special effect display method described in any of the foregoing embodiments.
图8是根据本公开的实施例示出的一种电子设备的示意框图。例如,电子设备800是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 8 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure. For example, electronic device 800 is a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
参照图8,电子设备800包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件818。8, an electronic device 800 includes one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and communication component 818.
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802包括一个或多个处理器820来执行指令,以完成上述特效显示方法的全部或部分步骤。此外,处理组件802包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 includes one or more processors 820 to execute the instructions to complete all or part of the steps of the above-mentioned special effect display method. Additionally, processing component 802 includes one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 includes a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 is implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。 Power supply assembly 806 provides power to various components of electronic device 800 . Power components 806 include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
多媒体组件808包括在电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头用于接收外部的多媒体数据。每个前置摄像头和后置摄像头是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 808 includes a screen that provides an output interface between electronic device 800 and the user. In some embodiments, the screen includes a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen is implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor not only senses the boundaries of a touch or swipe action, but also detects the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera are used to receive external multimedia data. Each front and rear camera is a fixed optical lens system or has focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号被进一步存储在存储器804或经由通信组件818发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。 Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal is further stored in memory 804 or transmitted via communication component 818 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定 按钮。The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814用于检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还用于检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 . For example, the sensor assembly 814 is used to detect the open/closed state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 is also used to detect the electronic device 800 or the electronic device Changes in the position of a component 800 , presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 . Sensor assembly 814 includes a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 also includes a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 also includes an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
图像采集组件816用于采集被摄对象的图像数据,以形成关于被摄对象的图像,进而对该图像进行必要的处理。该图像采集组件816包括相机模组,相机模组中的图像传感器(Sensor)通过镜头感应来自被摄对象的光线,将得到的感光数据提供给图像信号处理器(ISP,Image Signal Processing),由后者根据感光数据生成对应于被摄对象的图像。其中,上述图像传感器为CMOS传感器或CCD传感器,当然,也为红外传感器、深度传感器等;相机模组被内置在电子设备800中,或者,相机模组被作为电子设备800的外接模组;上述ISP被内置在相机模组中,或者作为外挂在上述电子设备中(不在相机模组内)。The image acquisition component 816 is used to acquire image data of the subject to form an image about the subject, and then perform necessary processing on the image. The image acquisition component 816 includes a camera module, and the image sensor (Sensor) in the camera module senses the light from the subject through the lens, and provides the obtained photosensitive data to an image signal processor (ISP, Image Signal Processing), which is composed of The latter generates an image corresponding to the subject based on the photosensitive data. Wherein, the above-mentioned image sensor is a CMOS sensor or a CCD sensor, of course, it is also an infrared sensor, a depth sensor, etc.; the camera module is built in the electronic device 800, or the camera module is used as an external module of the electronic device 800; the above-mentioned The ISP is built into the camera module, or as a plug-in in the above electronic device (not in the camera module).
通信组件818被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800能够接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、4G或5G),或它们的组合。在一个示例性实施例中,通信组件818经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件818还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 818 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 is capable of accessing wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 818 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 818 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在本公开一实施例中,电子设备800被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述特效显示方法。In one embodiment of the present disclosure, the electronic device 800 is implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for implementing the above-mentioned special effect display method.
在本公开一实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由电子设备800的处理器820执行以完成上述特效显示方法。例如,所述非临时性计算机可读存储介质是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an embodiment of the present disclosure, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the electronic device 800 to complete the above-mentioned special effect display method. For example, the non-transitory computer-readable storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
本公开所有实施例均能够单独被执行,也能够与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.
在一些实施例中,所述空间位置信息包括下述至少之一:加速度、自转角、四元数。In some embodiments, the spatial position information includes at least one of the following: acceleration, rotation angle, and quaternion.
在一些实施例中,所述像素特征值包括下述至少之一:In some embodiments, the pixel feature value includes at least one of the following:
颜色值、颜色梯度、透明度、对比度。Color value, color gradient, transparency, contrast.
在一些实施例中,所述目标特效对象的显示参数包括模糊强度和/或颜色饱和度。In some embodiments, the display parameters of the target special effect object include blur strength and/or color saturation.

Claims (29)

  1. 一种特效显示方法,包括:A special effect display method, comprising:
    获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
    基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
    基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  2. 根据权利要求1所述的方法,其中,所述获取图像采集设备在当前时刻的空间位置信息,包括:The method according to claim 1, wherein the acquiring the spatial position information of the image acquisition device at the current moment comprises:
    确定目标类型,所述目标类型为显示所述目标特效对象所需的空间位置信息的类型;determining a target type, where the target type is the type of spatial position information required to display the target special effect object;
    基于所述目标类型,确定所述空间位置信息。Based on the target type, the spatial location information is determined.
  3. 根据权利要求2所述的方法,其中,所述确定目标类型,包括:The method according to claim 2, wherein the determining the target type comprises:
    通过查询预设关系表,确定所述目标类型,所述预设关系表用于记录特效对象与目标类型之间的对应关系。The target type is determined by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1, wherein the method further comprises:
    识别所述画面中的显示对象,将匹配于所述显示对象的备选特效对象确定为所述目标特效对象;或者,Identifying a display object in the picture, and determining a candidate special effect object that matches the display object as the target special effect object; or,
    响应于针对备选特效对象的特效选取指令,确定被选取的所述目标特效对象。In response to the effect selection instruction for the candidate effect object, the selected target effect object is determined.
  5. 根据权利要求1所述的方法,其中,所述空间位置信息包括四元数,所述基于所述空间位置信息,确定目标特效对象的显示参数,包括:The method according to claim 1, wherein the spatial position information comprises a quaternion, and the determining the display parameters of the target special effect object based on the spatial position information comprises:
    基于三维旋转矩阵,将所述四元数转换为欧拉角;converting the quaternion to Euler angles based on a three-dimensional rotation matrix;
    基于所述欧拉角,确定所述目标特效对象的显示参数,或者基于所述欧拉角与预设倍数的乘积结果,确定所述目标特效对象的显示参数,所述预设倍数为不等于1的正数。Determine the display parameter of the target special effect object based on the Euler angle, or determine the display parameter of the target special effect object based on the product of the Euler angle and a preset multiple, where the preset multiple is not equal to A positive number of 1.
  6. 根据权利要求5所述的方法,其中,所述目标特效对象的显示参数被周期性确定;所述基于所述欧拉角与预设倍数的乘积结果,确定所述目标特效对象的显示参数,包括:The method according to claim 5, wherein the display parameters of the target special effect object are determined periodically; the display parameters of the target special effect object are determined based on a product result of the Euler angle and a preset multiple, include:
    获取相邻历史周期内确定的至少一个历史乘积结果,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述乘积结果与所述至少一个历史乘积结果的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。Obtain at least one historical product result determined in an adjacent historical period, where the adjacent historical period includes at least one continuous period before the current period, and determine the maximum or average value of the product result and the at least one historical product result value, and the maximum value or the average value is determined as the display parameter of the target special effect object.
  7. 根据权利要求5所述的方法,其中,所述目标特效对象的显示参数被周期性确定; 所述基于所述欧拉角,确定所述目标特效对象的显示参数,包括:The method according to claim 5, wherein the display parameters of the target special effect object are determined periodically; the determining the display parameters of the target special effect object based on the Euler angles comprises:
    获取相邻历史周期内确定的至少一个历史欧拉角,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述欧拉角与所述至少一个历史欧拉角的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。Obtain at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one continuous period before the current period, and determine the maximum value between the Euler angle and the at least one historical Euler angle value or average value, and the maximum value or average value is determined as the display parameter of the target special effect object.
  8. 根据权利要求1所述的方法,其中,所述空间位置信息包括加速度,所述基于所述空间位置信息,确定目标特效对象的显示参数,包括:The method according to claim 1, wherein the spatial position information includes acceleration, and the determining a display parameter of the target special effect object based on the spatial position information comprises:
    确定特效展示区域,所述特效展示区域用于展示所述目标特效对象;determining a special effect display area, where the special effect display area is used to display the target special effect object;
    基于所述加速度,确定所述特效展示区域中的像素特征值,将所述像素特征值确定为所述目标特效对象的显示参数,所述像素特征值用于表示对应像素点的特征。Based on the acceleration, a pixel characteristic value in the special effect display area is determined, the pixel characteristic value is determined as a display parameter of the target special effect object, and the pixel characteristic value is used to represent the characteristic of the corresponding pixel point.
  9. 根据权利要求1所述的方法,其中,所述空间位置信息包括自转角,所述目标特效对象存在预设的标准显示角度,所述基于所述空间位置信息,确定目标特效对象的显示参数,包括:The method according to claim 1, wherein the spatial position information includes a rotation angle, the target special effect object has a preset standard display angle, and the display parameters of the target special effect object are determined based on the spatial position information, include:
    基于所述自转角,确定所述目标特效对象的偏转角度;determining the deflection angle of the target special effect object based on the rotation angle;
    基于所述偏转角度,对所述标准显示角度进行旋转变换,将旋转变换后的角度确定为所述目标特效对象的显示参数。Based on the deflection angle, the standard display angle is rotated and transformed, and the rotated and transformed angle is determined as the display parameter of the target special effect object.
  10. 一种特效显示装置,包括:A special effect display device, comprising:
    信息获取单元,被配置为获取图像采集设备在当前时刻的空间位置信息;an information acquisition unit, configured to acquire the spatial position information of the image acquisition device at the current moment;
    参数确定单元,被配置为基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;a parameter determination unit, configured to determine display parameters of a target special effect object based on the spatial position information, where the target special effect object is used to process a picture captured by the image capture device;
    画面渲染单元,被配置为基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。A picture rendering unit, configured to render the picture based on the display parameters, and display a special effect picture obtained by rendering, and the special effect picture includes the target special effect object.
  11. 根据权利要求10所述的装置,其中,所述信息获取单元还被配置为:The apparatus according to claim 10, wherein the information acquisition unit is further configured to:
    确定目标类型,所述目标类型为显示所述目标特效对象所需的空间位置信息的类型;determining a target type, where the target type is the type of spatial position information required to display the target special effect object;
    基于所述目标类型,确定所述空间位置信息。Based on the target type, the spatial location information is determined.
  12. 根据权利要求11所述的装置,其中,所述信息获取单元还被配置为:The apparatus of claim 11, wherein the information acquisition unit is further configured to:
    通过查询预设关系表,确定所述目标类型,所述预设关系表用于记录特效对象与目标类型之间的对应关系。The target type is determined by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type.
  13. 根据权利要求10所述的装置,其中,所述信息获取单元还被配置为:The apparatus according to claim 10, wherein the information acquisition unit is further configured to:
    识别所述画面中的显示对象,将匹配于所述显示对象的备选特效对象确定为所述目标特效对象;或者,Identifying a display object in the picture, and determining a candidate special effect object that matches the display object as the target special effect object; or,
    响应于针对备选特效对象的特效选取指令,确定被选取的所述目标特效对象。In response to the effect selection instruction for the candidate effect object, the selected target effect object is determined.
  14. 根据权利要求10所述的装置,其中,所述空间位置信息包括四元数,所述参数确定单元还被配置为:The apparatus according to claim 10, wherein the spatial position information comprises a quaternion, and the parameter determination unit is further configured to:
    基于三维旋转矩阵,将所述四元数转换为欧拉角;converting the quaternion to Euler angles based on a three-dimensional rotation matrix;
    基于所述欧拉角,确定所述目标特效对象的显示参数,或者基于所述欧拉角与预设倍数的乘积结果,确定所述目标特效对象的显示参数,所述预设倍数为不等于1的正数。Determine the display parameter of the target special effect object based on the Euler angle, or determine the display parameter of the target special effect object based on the product of the Euler angle and a preset multiple, where the preset multiple is not equal to A positive number of 1.
  15. 根据权利要求14所述的装置,其中,所述目标特效对象的显示参数被周期性确定,所述装置还包括:The apparatus according to claim 14, wherein the display parameters of the target special effect object are determined periodically, and the apparatus further comprises:
    第一历史确定单元,被配置为获取相邻历史周期内确定的至少一个历史乘积结果,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述乘积结果与所述至少一个历史乘积结果的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。The first history determination unit is configured to obtain at least one historical product result determined in an adjacent historical period, the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that the product result is the same as the at least one historical period. A maximum value or average value of a historical product result, and the maximum value or average value is determined as the display parameter of the target special effect object.
  16. 根据权利要求14所述的装置,其中,所述目标特效对象的显示参数被周期性确定,所述装置还包括:The apparatus according to claim 14, wherein the display parameters of the target special effect object are determined periodically, and the apparatus further comprises:
    第二历史确定单元,被配置为获取相邻历史周期内确定的至少一个历史欧拉角,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述欧拉角与所述至少一个历史欧拉角的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。The second history determination unit is configured to obtain at least one historical Euler angle determined in an adjacent historical period, the adjacent historical period includes at least one period that is located before the current period and is continuous, and determines that the Euler angle is related to the selected historical period. The maximum value or average value of the at least one historical Euler angle is determined, and the maximum value or average value is determined as the display parameter of the target special effect object.
  17. 根据权利要求10所述的装置,其中,所述空间位置信息包括加速度,所述参数确定单元还被配置为:The apparatus of claim 10, wherein the spatial position information includes acceleration, and the parameter determination unit is further configured to:
    确定特效展示区域,所述特效展示区域用于展示所述目标特效对象;determining a special effect display area, where the special effect display area is used to display the target special effect object;
    基于所述加速度,确定所述特效展示区域中的像素特征值,将所述像素特征值确定为所述目标特效对象的显示参数,所述像素特征值用于表示对应像素点的特征。Based on the acceleration, a pixel characteristic value in the special effect display area is determined, the pixel characteristic value is determined as a display parameter of the target special effect object, and the pixel characteristic value is used to represent the characteristic of the corresponding pixel point.
  18. 根据权利要求11所述的装置,其中,所述空间位置信息包括自转角,所述目标特效对象存在预设的标准显示角度,所述参数确定单元还被配置为:The device according to claim 11, wherein the spatial position information includes a rotation angle, the target special effect object has a preset standard display angle, and the parameter determination unit is further configured to:
    基于所述自转角,确定所述目标特效对象的偏转角度;determining the deflection angle of the target special effect object based on the rotation angle;
    基于所述偏转角度,对所述标准显示角度进行旋转变换,将旋转变换后的角度确定为所述目标特效对象的显示参数。Based on the deflection angle, the standard display angle is rotated and transformed, and the rotated and transformed angle is determined as the display parameter of the target special effect object.
  19. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现如下步骤:Wherein, the processor is configured to execute the instructions to achieve the following steps:
    获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
    基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
    基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  20. 根据权利要求19所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现如下步骤:19. The electronic device of claim 19, wherein the processor is configured to execute the instructions to implement the steps of:
    确定目标类型,所述目标类型为显示所述目标特效对象所需的空间位置信息的类型;determining a target type, where the target type is the type of spatial position information required to display the target special effect object;
    基于所述目标类型,确定所述空间位置信息。Based on the target type, the spatial location information is determined.
  21. 根据权利要求20所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现如下步骤:21. The electronic device of claim 20, wherein the processor is configured to execute the instructions to implement the steps of:
    通过查询预设关系表,确定所述目标类型,所述预设关系表用于记录特效对象与目标类型之间的对应关系。The target type is determined by querying a preset relationship table, and the preset relationship table is used to record the corresponding relationship between the special effect object and the target type.
  22. 根据权利要求19所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现如下步骤:19. The electronic device of claim 19, wherein the processor is configured to execute the instructions to implement the steps of:
    识别所述画面中的显示对象,将匹配于所述显示对象的备选特效对象确定为所述目标特效对象;或者,Identifying a display object in the picture, and determining a candidate special effect object that matches the display object as the target special effect object; or,
    响应于针对备选特效对象的特效选取指令,确定被选取的所述目标特效对象。In response to the effect selection instruction for the candidate effect object, the selected target effect object is determined.
  23. 根据权利要求19所述的电子设备,其中,所述空间位置信息包括四元数,所述处理器被配置为执行所述指令,以实现如下步骤:19. The electronic device of claim 19, wherein the spatial location information includes a quaternion, and the processor is configured to execute the instructions to implement the steps of:
    基于三维旋转矩阵,将所述四元数转换为欧拉角;converting the quaternion to Euler angles based on a three-dimensional rotation matrix;
    基于所述欧拉角,确定所述目标特效对象的显示参数,或者基于所述欧拉角与预设倍数的乘积结果,确定所述目标特效对象的显示参数,所述预设倍数为不等于1的正数。Determine the display parameter of the target special effect object based on the Euler angle, or determine the display parameter of the target special effect object based on the product of the Euler angle and a preset multiple, where the preset multiple is not equal to A positive number of 1.
  24. 根据权利要求23所述的电子设备,其中,所述目标特效对象的显示参数被周期性确定;所述处理器被配置为执行所述指令,以实现如下步骤:The electronic device according to claim 23, wherein the display parameters of the target special effect object are determined periodically; the processor is configured to execute the instructions to achieve the following steps:
    获取相邻历史周期内确定的至少一个历史乘积结果,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述乘积结果与所述至少一个历史乘积结果的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。Obtain at least one historical product result determined in an adjacent historical period, where the adjacent historical period includes at least one period that is located before the current period and is continuous, and determine the maximum or average value of the product result and the at least one historical product result value, and the maximum value or the average value is determined as the display parameter of the target special effect object.
  25. 根据权利要求23所述的电子设备,其中,所述目标特效对象的显示参数被周期性确定;所述处理器被配置为执行所述指令,以实现如下步骤:The electronic device according to claim 23, wherein the display parameters of the target special effect object are determined periodically; the processor is configured to execute the instructions to achieve the following steps:
    获取相邻历史周期内确定的至少一个历史欧拉角,所述相邻历史周期包括位于当前周期之前且连续的至少一个周期,确定所述欧拉角与所述至少一个历史欧拉角的最大值或平均值,将所述最大值或平均值确定为所述目标特效对象的显示参数。Obtain at least one historical Euler angle determined in an adjacent historical period, where the adjacent historical period includes at least one continuous period before the current period, and determine the maximum value between the Euler angle and the at least one historical Euler angle value or average value, and the maximum value or average value is determined as the display parameter of the target special effect object.
  26. 根据权利要求20所述的电子设备,其中,所述空间位置信息包括加速度,所述处理器被配置为执行所述指令,以实现如下步骤:21. The electronic device of claim 20, wherein the spatial position information includes acceleration, and the processor is configured to execute the instructions to:
    确定特效展示区域,所述特效展示区域用于展示所述目标特效对象;determining a special effect display area, where the special effect display area is used to display the target special effect object;
    基于所述加速度,确定所述特效展示区域中的像素特征值,将所述像素特征值确定为所述目标特效对象的显示参数,所述像素特征值用于表示对应像素点的特征。Based on the acceleration, a pixel characteristic value in the special effect display area is determined, the pixel characteristic value is determined as a display parameter of the target special effect object, and the pixel characteristic value is used to represent the characteristic of the corresponding pixel point.
  27. 根据权利要求20所述的电子设备,其中,所述空间位置信息包括自转角,所述处理器被配置为执行所述指令,以实现如下步骤:The electronic device of claim 20, wherein the spatial position information includes a rotation angle, and the processor is configured to execute the instructions to implement the steps of:
    基于所述自转角,确定所述目标特效对象的偏转角度;determining the deflection angle of the target special effect object based on the rotation angle;
    基于所述偏转角度,对所述标准显示角度进行旋转变换,将旋转变换后的角度确定为所述目标特效对象的显示参数。Based on the deflection angle, the standard display angle is rotated and transformed, and the rotated and transformed angle is determined as the display parameter of the target special effect object.
  28. 一种计算机可读存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:A computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps:
    获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
    基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
    基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
  29. 一种计算机程序产品,包括计算机程序/指令,其中,所述计算机程序/指令被处理器执行时实现如下步骤:A computer program product, comprising a computer program/instruction, wherein the computer program/instruction implements the following steps when executed by a processor:
    获取图像采集设备在当前时刻的空间位置信息;Obtain the spatial location information of the image acquisition device at the current moment;
    基于所述空间位置信息,确定目标特效对象的显示参数,所述目标特效对象用于处理被所述图像采集设备采集的画面;determining the display parameters of the target special effect object based on the spatial position information, and the target special effect object is used to process the picture captured by the image capture device;
    基于所述显示参数渲染所述画面,显示渲染得到的特效画面,所述特效画面中包括所述目标特效对象。The picture is rendered based on the display parameters, and the special effect picture obtained by rendering is displayed, and the special effect picture includes the target special effect object.
PCT/CN2021/113631 2020-12-29 2021-08-19 Special effect display method and electronic device WO2022142388A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011599632.6 2020-12-29
CN202011599632.6A CN112738420B (en) 2020-12-29 2020-12-29 Special effect implementation method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022142388A1 true WO2022142388A1 (en) 2022-07-07

Family

ID=75611539

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/113631 WO2022142388A1 (en) 2020-12-29 2021-08-19 Special effect display method and electronic device

Country Status (2)

Country Link
CN (1) CN112738420B (en)
WO (1) WO2022142388A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112738420B (en) * 2020-12-29 2023-04-25 北京达佳互联信息技术有限公司 Special effect implementation method, device, electronic equipment and storage medium
CN113873168A (en) * 2021-10-27 2021-12-31 维沃移动通信有限公司 Shooting method, shooting device, electronic equipment and medium
CN114494556A (en) * 2022-01-30 2022-05-13 北京大甜绵白糖科技有限公司 Special effect rendering method, device and equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190156545A1 (en) * 2017-11-21 2019-05-23 Microsoft Technology Licensing, Llc Animating three-dimensional models using preset combinations of animation features
CN110047126A (en) * 2019-04-25 2019-07-23 北京字节跳动网络技术有限公司 Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110062157A (en) * 2019-04-04 2019-07-26 北京字节跳动网络技术有限公司 Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110751707A (en) * 2019-10-24 2020-02-04 北京达佳互联信息技术有限公司 Animation display method, animation display device, electronic equipment and storage medium
CN111627117A (en) * 2020-06-01 2020-09-04 上海商汤智能科技有限公司 Method and device for adjusting special effect of portrait display, electronic equipment and storage medium
CN112738420A (en) * 2020-12-29 2021-04-30 北京达佳互联信息技术有限公司 Special effect implementation method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8989786B2 (en) * 2011-04-21 2015-03-24 Walking Thumbs, Llc System and method for graphical expression during text messaging communications
CN105396289A (en) * 2014-09-15 2016-03-16 掌赢信息科技(上海)有限公司 Method and device for achieving special effects in process of real-time games and multimedia sessions
CN105578056A (en) * 2016-01-27 2016-05-11 努比亚技术有限公司 Photographing terminal and method
CN106792078A (en) * 2016-07-12 2017-05-31 乐视控股(北京)有限公司 Method for processing video frequency and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190156545A1 (en) * 2017-11-21 2019-05-23 Microsoft Technology Licensing, Llc Animating three-dimensional models using preset combinations of animation features
CN110062157A (en) * 2019-04-04 2019-07-26 北京字节跳动网络技术有限公司 Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110047126A (en) * 2019-04-25 2019-07-23 北京字节跳动网络技术有限公司 Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110751707A (en) * 2019-10-24 2020-02-04 北京达佳互联信息技术有限公司 Animation display method, animation display device, electronic equipment and storage medium
CN111627117A (en) * 2020-06-01 2020-09-04 上海商汤智能科技有限公司 Method and device for adjusting special effect of portrait display, electronic equipment and storage medium
CN112738420A (en) * 2020-12-29 2021-04-30 北京达佳互联信息技术有限公司 Special effect implementation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112738420B (en) 2023-04-25
CN112738420A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
WO2022142388A1 (en) Special effect display method and electronic device
US11636653B2 (en) Method and apparatus for synthesizing virtual and real objects
US11423509B2 (en) Method and apparatus for displaying face of virtual role, computer device, and readable storage medium
JP6328345B2 (en) Image photographing method and apparatus
KR101649596B1 (en) Method, apparatus, program, and recording medium for skin color adjustment
WO2020192458A1 (en) Image processing method and head-mounted display device
WO2018119632A1 (en) Image processing method, device and equipment
WO2019174628A1 (en) Photographing method and mobile terminal
US11030733B2 (en) Method, electronic device and storage medium for processing image
CN108495032B (en) Image processing method, image processing device, storage medium and electronic equipment
EP3754459A1 (en) Method and apparatus for controlling camera, device and storage medium
WO2021043121A1 (en) Image face changing method, apparatus, system, and device, and storage medium
WO2020258258A1 (en) Target tracking method and system, readable storage medium and moving platform
CN111970456B (en) Shooting control method, device, equipment and storage medium
EP3276975A1 (en) Method and device for controlling playing state
WO2020093798A1 (en) Method and apparatus for displaying target image, terminal, and storage medium
RU2635873C2 (en) Method and device for displaying framing information
US20160182860A1 (en) Methods for performing image capture and real-time image display on physically separated or separable devices and apparatus therefor
EP3211879A1 (en) Method and device for automatically capturing photograph, electronic device
EP3799415A2 (en) Method and device for processing videos, and medium
CN108986803B (en) Scene control method and device, electronic equipment and readable storage medium
CN109308740B (en) 3D scene data processing method and device and electronic equipment
US11308702B2 (en) Method and apparatus for displaying an image, electronic device and computer-readable storage medium
JP7339939B2 (en) METHOD, APPARATUS AND STORAGE MEDIUM FOR DISPLAYING CAPTURE PREVIEW IMAGES
US9619016B2 (en) Method and device for displaying wallpaper image on screen

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21913135

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17-10-2023)