WO2021218694A1 - Video processing method and mobile terminal - Google Patents

Video processing method and mobile terminal Download PDF

Info

Publication number
WO2021218694A1
WO2021218694A1 PCT/CN2021/088267 CN2021088267W WO2021218694A1 WO 2021218694 A1 WO2021218694 A1 WO 2021218694A1 CN 2021088267 W CN2021088267 W CN 2021088267W WO 2021218694 A1 WO2021218694 A1 WO 2021218694A1
Authority
WO
WIPO (PCT)
Prior art keywords
video frame
processor
video
mobile terminal
motion
Prior art date
Application number
PCT/CN2021/088267
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 WO2021218694A1 publication Critical patent/WO2021218694A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation

Definitions

  • This application relates to the field of video technology, and in particular to a video processing method and mobile terminal.
  • the electronic image stabilization (EIS) algorithm calculates the motion vector of each pixel in the video frame imaging process through the motion information such as the gyroscope, and calculates the input image established by the homography matrix and the output image pixel after image stabilization The mapping relationship between the calculation of the motion vector and the smoothness of the motion path.
  • EIS electronic image stabilization
  • EIS relies on the cropping of the image, but in the existing EIS algorithm, since the cropping ratio is fixed, the amount of jitter that the EIS algorithm can remove is limited. For large motion scenes, insufficient cropping area means that the pixel information required by the output image exceeds the range of the input image.
  • the embodiments of the present application provide a video processing method and a mobile terminal, which can dynamically adjust the EIS video frame cropping ratio according to changes in exercise intensity, improve the stability of the picture during video shooting, and enhance the user's video recording experience.
  • an embodiment of the present application provides a mobile terminal, which includes a camera, a display screen, a motion sensor, and a processor;
  • the camera is used to record video; the screen is used to display the video recording interface;
  • the motion sensor is used to continuously collect motion data when the camera is recording video
  • the video recording interface is used to display the prompt to start dynamic anti-shake
  • the display screen is used to receive the touch operation of clicking the prompt, and the processor is used to perform dynamic anti-shake.
  • the mobile terminal when the user is recording a video, if the mobile terminal is in a scene of large movement, the mobile terminal can pop up a prompt whether to perform dynamic anti-shake, so as to remind the user whether to enable dynamic anti-shake, that is, to prompt the user whether to enable dynamic anti-shake Adjust the cutting ratio of EIS.
  • This kind of scheme gives users the right to choose, allowing them to choose whether to use the dynamic anti-shake function, because some users may not like the constant change of the cutting ratio.
  • motion sensors include inertial sensors, acceleration sensors, and gyroscopes.
  • the prompt to activate dynamic anti-shake includes: the description part of dynamic anti-shake and the switch control part.
  • the camera generates a video frame when recording a video; aligns the motion data with the video frame by time stamping, and the time stamp alignment is to establish the corresponding relationship between the motion data and the video frame according to time; Image anti-shake processing, the electronic image anti-shake is to cut the video frame, and warp the cut video frame; calculate the rotation vector of the video frame; perform path smoothing according to the motion data; path smoothing is optimized A curve composed of the motion data; determine the motion state of the mobile terminal; count the number of cross-borders of the warped video frame; if the number of cross-borders is greater than the first threshold, increase the cropping ratio; if the number of cross-borders is less than or equal to the first Threshold, then maintain the cutting ratio.
  • the out-of-bounds means that some pixels of the video frame before the warping are not defined in the video frame after the warping.
  • this embodiment provides a video processing method, including a camera of a mobile terminal collecting video frames;
  • the motion sensor of the mobile terminal collects motion data
  • the processor of the mobile terminal aligns the video frame and the motion data with time stamps
  • the processor performs electronic image stabilization on the video frame.
  • the electronic image stabilization is to cut the video frame and distort the cut video frame;
  • the processor recognizes the movement state of the mobile terminal
  • the processor performs cutting processing on the video frame, and counts the number of cross-border times of the video frame after the cutting processing;
  • the processor determines whether to adjust the cutting ratio according to the number of cross-borders
  • the processor calculates the H matrix corresponding to the video frame; and performs image distortion processing according to the H matrix;
  • the processor calculates a new cropping ratio of the video frame, and generates an initial video frame at the new cropping ratio
  • the processor determines the cropping ratio of each of the video frames according to the change in the motion intensity of the mobile terminal
  • the processor calculates the H matrix corresponding to the video frame
  • the video frames collected by the camera of the mobile terminal are stored in the buffer of the memory.
  • the motion data includes: acceleration and angular velocity of the mobile terminal.
  • the time stamp alignment is that the processor uses spline interpolation to change the motion data from discrete values to continuous curves; the processor performs nonlinear optimization on the continuous curve to obtain the time difference between different continuous curves; processing The loop performs nonlinear optimization, and when the time difference meets certain conditions, the loop ends.
  • the processor performs path smoothing on the video frame according to the rotation vector.
  • the motion path smoothing is that the processor calculates the vector of every two adjacent data points in the motion data, and traverses all the data points; the processor removes the two adjacent data points with the same vector The processor removes the inflection point in the data curve composed of motion data; the processor removes all the data points between the two data points that can be directly passed.
  • the out-of-bounds is that some pixels of the video frame before the cropping process are not defined in the video frame after the cropping process.
  • the display screen of the mobile terminal displays an interface that prompts the user to enable dynamic anti-shake.
  • the display screen receives the user's touch operation and turns on dynamic anti-shake.
  • dynamic anti-shake is that the processor adjusts the cropping ratio according to changes in exercise intensity.
  • this embodiment provides a computer-readable storage medium, including instructions, which when executed on a mobile terminal, cause the mobile terminal to perform the above-mentioned video processing method.
  • Figure 1 is a schematic diagram of gyroscope data processed by path smoothing algorithm
  • Figure 2A is a schematic diagram of a video cropping ratio in a jittery scene
  • Figure 2B is another schematic diagram of the video cropping ratio in that scene
  • Figure 3 is a schematic diagram of the steps of a video processing method
  • Figure 4A is a schematic diagram of a motion state determined by a motion sensor
  • Figure 4B is a schematic diagram of gyroscope data in different motion states
  • Fig. 4C is a schematic diagram of a movement state transition under different movement states
  • Figure 5 is a schematic diagram of the steps of a method for adjusting the video cropping ratio
  • Figure 6 is a schematic diagram of a UI interface for enabling dynamic FOV
  • Fig. 7A is a schematic diagram of processing video jitter
  • Fig. 7B is another schematic diagram of processing video jitter
  • Fig. 8A is a schematic diagram of gyroscope data without path smoothing processing
  • Fig. 8B is a schematic diagram of gyroscope data after path smoothing processing
  • Fig. 9 is a schematic diagram of a method for determining the size change of the cutting scale according to the movement trend
  • Fig. 10A is a schematic diagram of a video frame collected by a terminal device
  • FIG. 10B is a schematic diagram showing changes in exercise intensity and cutting ratio
  • Figure 11 is another schematic diagram showing changes in exercise intensity and cutting ratio
  • FIG. 12 is a schematic diagram of the steps of a method for adjusting the video cropping ratio
  • Figure 13A is a schematic diagram of the hardware structure of an electronic device
  • Figure 13B is a schematic diagram of the structure of an application framework.
  • references described in this specification to "one embodiment” or “some embodiments”, etc. mean that one or more embodiments of the present application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless it is specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized.
  • the curve 101 is a curve of the data collected by the gyroscope of the terminal changing with time when the video shooter holds the terminal to shoot a video.
  • the vertical axis in FIG. 1 represents gyroscope data, and the horizontal axis represents time data.
  • the curve 102 is a curve of the gyroscope data processed by the path smoothing algorithm over time.
  • the function of the path smoothing algorithm is that when the viewing angle is changed in different frames, the appearance of noise will not cause a large change in the picture and affect the viewing.
  • the realization of the EIS anti-shake algorithm depends on the cropping of the image, and the cropping ratio of the image is generally preset, which needs to be based on the resolution of the complementary metal oxide semiconductor (CMOS) sensor and the image signal processor ( The image signal processor (ISP) processing capability, image texture preservation and other factors are used for setting.
  • the fixed cropping ratio will cause the amplitude of jitter that can be removed by the EIS anti-shake algorithm to be limited by the cropping ratio. For scenes with violent motion, insufficient cropping area will cause the pixel information required by the video output image to exceed the range of the video input image.
  • the existing EIS anti-shake algorithm adopts a solution to increase the cropping area.
  • the disadvantage of this solution is that it will result in reduced compensation motion amplitude and weakened anti-shake effect.
  • the image 201 is a video frame that is cropped with a smaller cropping ratio
  • the arrow 203 indicates the ratio of the video frame that needs to be cropped in FIG. 2A. It can be seen from Figure 2A that in this case, the amplitude of the jitter that the EIS anti-shake algorithm can correct is small. As shown in FIG.
  • the image 202 is a video frame that is cropped with a larger cropping ratio
  • the arrow 204 indicates the ratio of the video frame that needs to be cropped in FIG. 2B. It can be seen from Fig. 2B that in this case, the amplitude of the jitter that the EIS anti-shake algorithm can correct is relatively large. Therefore, as the cropping ratio of the image increases, the amplitude of jitter that can be corrected by the EIS anti-shake algorithm increases, and it is more suitable for use in severe sports scenarios.
  • the cropping ratio can be dynamically adjusted according to different motion amplitudes to adapt to different sports scenes.
  • the EIS algorithm uses a lower crop ratio.
  • the movement amplitude increases, it automatically enters the dynamic adjustment mode, automatically controls the crop ratio, and better balances the video stability, definition, and field of view. ,FOV).
  • FOV field of view.
  • it is a method of dynamically adjusting the cutting ratio.
  • the video frame metadata collected by the terminal is first time stamp aligned. Because the metadata of the video frame comes from different hardware devices, the data collected by different hardware devices is different in time.
  • Some metadata comes from the gyroscope data that has undergone optical image stabilization (OIS), some metadata comes from the angular velocity and acceleration data of the inertial measurement unit (IMU), and some metadata comes from Video frames captured by the image capture unit.
  • OIS optical image stabilization
  • IMU inertial measurement unit
  • Video frames captured by the image capture unit There are multiple algorithms for aligning timestamps of different metadata. The following uses a search algorithm as an example, but the algorithm for aligning timestamps is not limited to this.
  • the time stamp and the trajectory are recorded discretely, and the optimization method cannot be used directly to obtain the time difference.
  • the trajectory can be transformed into a continuous curve through spline interpolation, so that the approximate continuous amount of time and pose is obtained, and then the nonlinear optimization method is used to obtain the time difference. Time difference.
  • the step length It will end after searching with 0.001 second as the step length. It is essentially a hierarchical search algorithm. In order to improve the search accuracy, you can also fit a quadratic curve near the time difference that minimizes the absolute error, where the independent variable is the time difference and the dependent variable is the absolute error, and the time difference at the minimum of the quadratic curve is taken as the final result.
  • the accuracy of the time search depends on the fitting accuracy of the two trajectories, and the algorithm can be optimized using the idea of alternate optimization.
  • the video frame is time stamp aligned with the data collected by the OIS and IMU, that is, the data collected by the OIS and IMU is established in a one-to-one correspondence with the video frame according to the time stamp.
  • step S302 EIS processing is performed on the above-mentioned video frame according to the video frame aligned by the time stamp of the previous step.
  • the rotation vector of the terminal is calculated and recorded to obtain the motion path.
  • the angular velocity of frequency ⁇ rotates counterclockwise around point O on the plane, and the vector made in this way is called the rotation vector.
  • step S303 path smoothing is performed on the motion path obtained in the previous step.
  • the following takes the Floyd path smoothing algorithm as an example, but it is not limited to this algorithm.
  • First use the Freud algorithm to remove the adjacent collinear points in the above motion path, traverse all the data points, and calculate whether the directions of the two adjacent vectors are the same. Then, remove the redundant inflection points, traverse all the data points, and remove the points between the two points that can be passed directly. After the above two steps, a smooth motion path can be obtained.
  • step S304 the motion state of the terminal is identified.
  • step S305 according to different motion states, count the number of times the cropped screen crosses the boundary. As shown in FIG. 7A, the above-mentioned cross-border is that after the cropped video frame undergoes a warping operation, part of the picture will exceed the original frame of the uncropped video frame. This phenomenon is called "cross-border".
  • step S306 it is judged whether to adjust the cutting ratio according to different cross-border times. If there is no need to adjust the cutting ratio, step S307 is entered.
  • step S307 the H matrix corresponding to each video frame is calculated, and rolling shutter correction is performed.
  • the H matrix can be calculated by Rodrigo's formula, but it is not limited to this method.
  • the rotation matrix is calculated by Rodrigo's formula, and then combined with the internal parameter matrix and the translation of OIS, the homography matrix H corresponding to each pixel of the input image is calculated.
  • the CMOS terminal adopts a progressive scan method when shooting video
  • the high-frequency jitter terminal that is, the jitter frequency is faster than the refresh time of one frame, which will cause the scene in the same frame to appear distorted, which is called the rolling door effect.
  • the method of correcting the rolling door effect is to first divide the image into M strips, then smooth the R matrix of the first image between frames, and finally align the other R matrices in the video frame to the first strip uniformly.
  • step S314 the processing of the H matrix is completed.
  • image warping WARP
  • step S308 the display interface of the terminal prompts the user to enter the dynamic adjustment anti-shake mode, and the specific situation is described in detail below.
  • step S309 the user chooses whether to enter the dynamic adjustment anti-shake mode, and if it chooses to enter the dynamic adjustment anti-shake mode, proceed to the next step. If the user chooses not to enter the dynamic adjustment anti-shake mode, step S307 is entered.
  • step S310 the initial frame is determined, and the cropping ratio of the initial frame is calculated.
  • step S311 the trend of the movement of the terminal is calculated, and the cropping ratio of the frames other than the initial frame that has been collected is determined according to the trend of the movement.
  • step S312 a motion path smoothing is performed on the image cropped in step S305.
  • step S313 cut boundary protection is performed on each video frame processed in step S312 to avoid unretrievable pixels in the image, and then go to step S307, calculate the H matrix of the re-cut image, and make a rolling shutter Effect correction. Finally, proceed to step S314 to complete the image warping and output the image.
  • the image warping described above can be an affine transformation of the H matrix.
  • the affine transformation is a transformation from two-dimensional coordinates (x, y) to two-dimensional coordinates (u, v). ) Linear transformation.
  • the characteristic of affine transformation is that the straight line is still a straight line after affine transformation; the relative position relationship between the straight lines remains unchanged, and the parallel line is still parallel after affine transformation, and the position order of the points on the straight line does not occur. Change; The three pairs of non-collinear corresponding points determine a unique affine transformation, that is, a two-dimensional coordinate is multiplied by a matrix, and the eigenvector of the matrix determines the direction of the image transformation.
  • some steps are not necessary, and may not be required, such as step S303, step S308, step S309, step S312, and step S313.
  • the terminal may perform motion state recognition based on the IMU.
  • the terminal performs root-mean-square and absolute integral calculations on these data based on the angular velocity and acceleration data collected by the IMU and the data collected by the gyroscope.
  • the data can also be imported into the machine learning pre-training model for learning , Get the processed data information.
  • the terminal classifies and counts the above information, and can identify different exercise intensities or exercise types.
  • the exercise state is divided into a few levels according to exercise intensity.
  • Level 0 the terminal is in a static state. Set up a motion state counter to count the number of motion states.
  • FIG. 4B it is an example of different motion states.
  • the vertical axis is the gyroscope data
  • the horizontal axis is the time. It can be seen from the figure that the left part of the figure has a smaller exercise intensity and is identified as walking, and the right part has a stronger exercise and is identified as running. Status (running). As shown in Figure 4C, it is the transition between different motion states. Step S401 is to maintain the same exercise state, step S402 is to switch from a low-intensity exercise state to a high-intensity exercise state, and step S403 is to switch from a high-intensity exercise state to a low-intensity exercise state.
  • the terminal will pop up on the display screen to prompt the user whether to enter the mode of dynamically adjusting the anti-shake, that is, the above step S308. If the user chooses to enter the dynamic adjustment anti-shake mode, the cropping ratio needs to be re-determined. And for each video frame whose cropping ratio has been re-determined, the path smoothing process is performed to keep the video display smooth without violent shaking.
  • the terminal needs to adjust the cutting ratio according to the change of the motion state.
  • the method steps for adjusting the cropping ratio of the video frame In step S500, the terminal aligns the time stamp of the IMU data with the video frame.
  • Step S501 Determine the current motion state of the terminal.
  • step S511 if the exercise intensity of the terminal remains unchanged, that is, the above step S401, then step S512 is entered.
  • step S512 the cropping ratio of the video frame is kept unchanged.
  • step S521 if the exercise intensity of the terminal increases, that is, the above step S402, proceed to step S522.
  • step S522 the initial number of cross-border cutout images is counted.
  • Out-of-bounds means that after the cropped image is subjected to anti-shake correction, that is, after the image is distorted, the cropped image exceeds the boundary of the current display interface. That is, the currently displayed interface retrieves undefined pixels.
  • step S523 it is determined whether the initial statistical number of times the cropped image crosses the boundary is greater than a first threshold.
  • step S524 if the statistical number of times that the initial cropped image crosses the boundary is not greater than the first threshold, the initial cropping ratio is maintained.
  • step S525 if the initial counted number of times the cropped image crosses the boundary is greater than the first threshold, the cropping ratio is increased.
  • step S531 if the exercise intensity decreases, that is, the above step 3, go to step S532.
  • step S532 the initial cutting scale is first reduced.
  • step S533 count the number of times that the image crosses the boundary after the cropping ratio is reduced.
  • step S534 it is determined whether the number of times the image crosses the boundary after the cropping ratio is reduced is less than a second threshold.
  • step S535 if the number of crossovers of the image after the cropping ratio is reduced is not less than the second threshold, the current cropping ratio is maintained.
  • step S536 if the number of times the image cross-border is smaller than the second threshold after the cropping ratio is reduced, the cropping ratio is reduced.
  • the display interface of the terminal may display to prompt the user whether to enter the dynamic anti-shake mode.
  • a prompt of "dynamic anti-shake" on/off will pop up on the video recording interface.
  • the interface 601 is a recording screen of the terminal for video recording, and the interface 601 displays an output image processed by the EIS anti-shake algorithm.
  • the area 602 of the interface 601 automatically pops up a prompt whether to enable "dynamic anti-shake".
  • the area 602 can be located at any position of the interface 601, which is not limited in this application.
  • the area 602 is located in the lower middle area of the interface 601.
  • the text part of the prompt can be located anywhere in the area 602, which is not limited in this application, and the text part of the prompt is located above the area 602 in this embodiment.
  • the text part of the prompt may be various words that have a similar meaning to "dynamic anti-shake". This application does not limit the type of language and the way of expression. This embodiment uses the combination of Chinese and English "dynamic anti-shake" as an example for description.
  • Below the text prompt there are prompts for opening and closing. This application does not limit the language types and expressions of opening and closing, as long as they can express the same meaning.
  • the opening and closing prompts can use any font size that does not exceed the area 602, and this application is not limited.
  • the opening and closing prompt font size is smaller than the text prompt part as an example.
  • the user can perform a touch or click operation.
  • the user can touch the text prompt part in the area 602, and can also touch to turn on and off the prompt part.
  • This application is not limited.
  • the user touches any part of the area 602 as an example.
  • the open and close prompt part will switch states. If it is open, the display color of the open part is different from the color of the closed part. If it is closed, the display color of the original open part Display to the closed part, and the display color of the original closed part is displayed to the open part. It is understandable that the user can also directly touch the opening and closing parts. If the user clicks the opening part, the “dynamic anti-shake” related functions are turned on, and if the user clicks the closed part, the “dynamic anti-shake” related functions are turned off.
  • the terminal can iteratively find a suitable trimming size according to a certain step size.
  • the trimming ratio is increased.
  • the terminal predicts the movement trend based on the data collected by the IMU, and calculates the current exercise intensity of the terminal.
  • the ultimate goal of the terminal to re-determine the cutting ratio is to find the largest segment within the buffer length window according to its movement trend and exercise intensity, which can cause the cut to cross the boundary.
  • the terminal can increase the cutting ratio stepping, and stepping refers to increasing the cutting ratio regularly.
  • the terminal calculates the position of the boundary point of the output image in the input image according to the rotation vector of each video frame. From the calculation result, it can count which video frames are out of bounds, and can count the number of out of bounds video frames. By calculating the position of the boundary point of the output image in the input image, it is also possible to calculate the out-of-bounds size of each video frame and the number of adjustments required for each video frame to adjust the out-of-bounds part of the image to the display area. As shown in FIG.
  • the terminal stops stepping to adjust the cropping ratio.
  • the cutting ratio is increased, although the FOV will be reduced, it can ensure that fewer trigger cross-border situations (crop more, FOV shrink) are ensured. If you increase the cropping ratio and still cannot reduce the cross-border situations, you need to reduce the smoothness of the path. As shown in Figure 8A and Figure 8B, reduce the degree of path smoothness.
  • the path smoothness is reduced to meet certain conditions, such as less than a preset threshold, and the number of cross-borders still cannot meet the requirements, continue to increase the cutting ratio, and Perform the above process alternately and iterate.
  • the out-of-bounds size and the number of times each video frame needs to be adjusted to the display area can be used as feedback information and added to the iteration to adaptively speed up the iterative process until a video frame that meets the conditions is found. Cut proportions.
  • the terminal may determine whether to adjust the cropping ratio according to the movement trend. As shown in FIG. 9, in step S900, the terminal determines whether to trigger the trimming ratio adjustment. If the trimming scale adjustment is triggered, step S910 is entered, where the input image and the output image of the video frame match the trimming dynamic model. In step S911, the cropping ratio of each video frame is calculated according to the cropping ratio dynamic model. In step S912, path smoothing and boundary maintaining processing is performed on the output map processed by the new cropping scale, that is, the iterative process in the above-mentioned embodiment is performed. In step S913, image warp is performed on the video frame cropped by the cropping ratio determined by the iterative process.
  • step S900 if the terminal determines that the trimming ratio adjustment has not been triggered, it proceeds to step S920 to maintain the current trimming ratio.
  • step S921 path smoothing and boundary maintaining processing are performed on the video frame image maintaining the current cropping ratio.
  • step S922 image warping (warp) is performed on the processed video frame.
  • 2N+1 frames are stored in the buffer of the current terminal, where N is the distance from the current frame to the latest frame.
  • Frame No. 1 in Figure 10A is the current frame, starting from 2N
  • the image distortion begins at frame +1.
  • the abscissa in the figure is time, and the ordinate is the number of times the boundary has been triggered.
  • the curve 101 in the second quadrant of FIG. 10B represents a situation where the cropped video frame triggers an out-of-bounds when the cropping ratio is 20%.
  • the curve 102 in the first quadrant of FIG. 10B represents a situation where the cropped video frame triggers an out-of-bounds when the cropping ratio is adjusted to 30%.
  • the curve 103 in FIG. 10B is the change curve of the video frame after path smoothing. Furthermore, as shown in FIG. 11, the terminal adjusts the speed of the change of the cropping ratio according to the rate of change of the exercise intensity, so that the change of the viewing angle is smoother.
  • 11 can be used to indicate the change of the viewing angle, but this application is not limited, and straight lines, line segments, and piecewise functions can also be used for direct mapping. Frequent changes in the viewing angle will cause discomfort to the user, and the following strategies can be used to limit it. For example, in the process of video shooting, only one-way adjustment of the angle of view is allowed, and the crop ratio is not allowed to increase and then decrease or decrease and then increase. For another example, during the video shooting process, only a limited number of adjustments of the angle of view are allowed, such as N times, where N is a preset limited number.
  • the angle of view is allowed to be adjusted.
  • the above adjustment of the viewing angle is the adjustment of the cutting ratio of the viewing angle.
  • the mapping relationship between exercise intensity and re-determination of the crop ratio can be established according to the deep learning model.
  • the terminal collects a certain amount of video frames, performs video segmentation in unit time, and collects IMU and gyroscope data, performs root-mean-square and absolute-value integrals on these data, or integrates these data The data is fed into the training model of machine learning.
  • the terminal motion intensity in each video segment is classified and counted according to the data collected by the above-mentioned sensor.
  • step S1203 in the above-mentioned video clip set, count the number of triggering cross-border times when each video clip is cut with different cutting ratios, and record them.
  • step S1204 it is determined whether the number of times of triggering the out-of-bounds is less than a preset specific value, such as an X threshold, according to the cropping ratio used by different recorded video clips. If the number of triggering out-of-bounds is not less than the preset specific value, return to step S1203 to continue counting. If the number of triggering out-of-bounds is less than the preset specific value, step S1205 is entered. In step S1205, a neural network or a machine learning model is used to train the collected sensor data to obtain the corresponding relationship between the exercise intensity and the optimal cutting ratio.
  • a preset specific value such as an X threshold
  • step S1206 when it is detected for the first time that the cropping ratio needs to be changed according to the exercise state or exercise intensity, the terminal automatically prompts the user whether to enable the dynamic FOV adjustment mode, as shown in FIG. 6 specifically. If the user chooses to turn on the dynamic FOV adjustment mode, the cutting ratio will be dynamically adjusted according to the results calculated by the deep learning model.
  • the terminal may be an electronic device.
  • FIG. 13A a schematic structural diagram of the electronic device 100 is shown.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter/receiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100.
  • Both I2S interface and PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive materials.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers, and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers is through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer.
  • the camera 193 captures still images or videos.

Abstract

Provided by the present application are a video processing method and a mobile terminal, which may dynamically adjust the EIS video frame cropping ratio according to changes in exercise intensity, thus improving the stability of the picture during video capture, and improving the video recording experience of a user. The mobile terminal provided by the present application comprises a camera, a display screen, a motion sensor, and a processor; the camera is used to record a video; the display screen is used to display a video recording interface; the motion sensor is used to continuously collect exercise data when the camera is recording the video; it is determined whether the exercise intensity changes according to the exercise data; if the exercise intensity changes, the video recording interface is used to display a prompt to start dynamic anti-shake; the display screen is used to receive a touch operation of clicking the prompt; and the processor is used to perform dynamic anti-shake.

Description

一种视频处理方法及移动终端Video processing method and mobile terminal
本申请要求在2020年4月27日提交中国国家知识产权局、申请号为202010345609.8的中国专利申请的优先权,发明名称为“一种视频处理方法及移动终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office of China with an application number of 202010345609.8 on April 27, 2020, and the priority of a Chinese patent application with the title of "a video processing method and mobile terminal". The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及视频技术领域,尤其涉及一种视频处理的方法及移动终端。This application relates to the field of video technology, and in particular to a video processing method and mobile terminal.
背景技术Background technique
在视频拍摄者手持终端设备进行视频拍摄时,由于拍摄者手持不问、在运动中拍摄导致终端设备发生抖动。电子图像防抖(electronic image stabilization,EIS)算法通过陀螺仪等运动信息,计算出视频帧成像过程中每个像素的运动矢量,求出单应矩阵建立的输入图与稳像后的输出图像素之间的映射关系,计算运动矢量并对运动路径做平滑性处理。When a video shooter holds a terminal device for video shooting, the terminal device shakes due to the shooter holding it without asking and shooting while in motion. The electronic image stabilization (EIS) algorithm calculates the motion vector of each pixel in the video frame imaging process through the motion information such as the gyroscope, and calculates the input image established by the homography matrix and the output image pixel after image stabilization The mapping relationship between the calculation of the motion vector and the smoothness of the motion path.
EIS的实现依赖于对图像的裁剪,但是现有的EIS算法中,由于裁剪比例固定,所以EIS算法能够去除的抖动幅度有限。对于大运动场景来说,裁剪面积不足意味着输出图所需要的像素信息超出了输入图的范围。The realization of EIS relies on the cropping of the image, but in the existing EIS algorithm, since the cropping ratio is fixed, the amount of jitter that the EIS algorithm can remove is limited. For large motion scenes, insufficient cropping area means that the pixel information required by the output image exceeds the range of the input image.
发明内容Summary of the invention
本申请实施例提供一种视频处理方法及移动终端,能够根据运动强度的变化,动态调整EIS的视频帧裁切比例,提高视频拍摄时画面的稳定性,提升用户的录像体验。The embodiments of the present application provide a video processing method and a mobile terminal, which can dynamically adjust the EIS video frame cropping ratio according to changes in exercise intensity, improve the stability of the picture during video shooting, and enhance the user's video recording experience.
为达上述目的,本申请实施例采用如下方案:In order to achieve the above objectives, the following solutions are adopted in the embodiments of this application:
一方面,本申请实施例提供了一种移动终端,该移动终端包括摄像头、显示屏、运动传感器、处理器;On the one hand, an embodiment of the present application provides a mobile terminal, which includes a camera, a display screen, a motion sensor, and a processor;
摄像头用于录制视频;显示屏用于显示视频录制界面;The camera is used to record video; the screen is used to display the video recording interface;
运动传感器用于在摄像头录制视频时持续采集运动数据;The motion sensor is used to continuously collect motion data when the camera is recording video;
根据运动数据,确定运动强度是否变化;According to the exercise data, determine whether the exercise intensity changes;
若运动强度发生变化,视频录制界面用于显示启动动态防抖的提示;If the exercise intensity changes, the video recording interface is used to display the prompt to start dynamic anti-shake;
显示屏用于接收点击所述提示的触摸操作,处理器用于执行动态防抖。The display screen is used to receive the touch operation of clicking the prompt, and the processor is used to perform dynamic anti-shake.
在该方案中,用户在录制视频时,如果在大幅度运动的场景下,移动终端可以弹出是否执行动态防抖的提示,以此来提示用户是否开启动态防抖,也即提示用户是否开启动态调整EIS的裁切比例。此种方案给了用户选择权,让用户拥有选择是否使用动态防抖的功能,因为有的用户可能不喜欢裁切比例不断的变化。In this solution, when the user is recording a video, if the mobile terminal is in a scene of large movement, the mobile terminal can pop up a prompt whether to perform dynamic anti-shake, so as to remind the user whether to enable dynamic anti-shake, that is, to prompt the user whether to enable dynamic anti-shake Adjust the cutting ratio of EIS. This kind of scheme gives users the right to choose, allowing them to choose whether to use the dynamic anti-shake function, because some users may not like the constant change of the cutting ratio.
在一种可能的设计中,运动传感器包括惯性传感器、加速度传感器、陀螺仪。In one possible design, motion sensors include inertial sensors, acceleration sensors, and gyroscopes.
在另一种可能的设计中,启动动态防抖的提示包括:动态防抖的说明部分和 开关控制部分。In another possible design, the prompt to activate dynamic anti-shake includes: the description part of dynamic anti-shake and the switch control part.
在另一种可能的设计中,摄像头录制视频时会生成视频帧;将运动数据与视频帧进行时间戳对齐,时间戳对齐为根据时间建立运动数据与视频帧的对应关系;对视频帧进行电子图像防抖处理,所述电子图像防抖为对视频帧进行裁切,将经过裁切的所述视频帧进行扭曲;计算视频帧的旋转矢量;根据运动数据,进行路径平滑;路径平滑为优化由所述运动数据组成的曲线;确定移动终端的运动状态;统计经过扭曲的所述视频帧的越界次数;若越界次数大于第一阈值,则增大裁切比例;若越界次数小于等于第一阈值,则保持所述裁切比例。In another possible design, the camera generates a video frame when recording a video; aligns the motion data with the video frame by time stamping, and the time stamp alignment is to establish the corresponding relationship between the motion data and the video frame according to time; Image anti-shake processing, the electronic image anti-shake is to cut the video frame, and warp the cut video frame; calculate the rotation vector of the video frame; perform path smoothing according to the motion data; path smoothing is optimized A curve composed of the motion data; determine the motion state of the mobile terminal; count the number of cross-borders of the warped video frame; if the number of cross-borders is greater than the first threshold, increase the cropping ratio; if the number of cross-borders is less than or equal to the first Threshold, then maintain the cutting ratio.
在另一种可能的设计中,越界为进行所述扭曲前的所述视频帧的部分像素在进行所述扭曲后的所述视频帧中没有定义。In another possible design, the out-of-bounds means that some pixels of the video frame before the warping are not defined in the video frame after the warping.
另一方面,本实施例提供一种视频处理方法,包括移动终端的摄像头采集视频帧;On the other hand, this embodiment provides a video processing method, including a camera of a mobile terminal collecting video frames;
移动终端的运动传感器采集运动数据;The motion sensor of the mobile terminal collects motion data;
移动终端的处理器将视频帧和运动数据进行时间戳对齐;The processor of the mobile terminal aligns the video frame and the motion data with time stamps;
处理器对视频帧进行电子图像防抖,电子图像防抖为对视频帧进行裁切,将经过裁切的视频帧进行扭曲;The processor performs electronic image stabilization on the video frame. The electronic image stabilization is to cut the video frame and distort the cut video frame;
根据运动数据计算视频帧的旋转矢量;Calculate the rotation vector of the video frame according to the motion data;
处理器识别移动终端的运动状态;The processor recognizes the movement state of the mobile terminal;
处理器对视频帧进行裁切处理,统计经过裁切处理后的视频帧的越界次数;The processor performs cutting processing on the video frame, and counts the number of cross-border times of the video frame after the cutting processing;
处理器根据越界次数确定是否调整裁切比例;The processor determines whether to adjust the cutting ratio according to the number of cross-borders;
若越界次数小于等于第一阈值,则保持裁切比例,处理器计算视频帧对应的H矩阵;根据H矩阵进行图像扭曲处理;If the number of crossings is less than or equal to the first threshold, the cropping ratio is maintained, and the processor calculates the H matrix corresponding to the video frame; and performs image distortion processing according to the H matrix;
若越界次数大于所述第一阈值,处理器计算视频帧新的裁切比例,生成新的裁切比例下的初始视频帧;If the number of cross-border times is greater than the first threshold, the processor calculates a new cropping ratio of the video frame, and generates an initial video frame at the new cropping ratio;
处理器根据移动终端的运动强度变化确定各个所述视频帧的裁切比例;The processor determines the cropping ratio of each of the video frames according to the change in the motion intensity of the mobile terminal;
处理器计算视频帧对应的H矩阵;The processor calculates the H matrix corresponding to the video frame;
根据H矩阵进行图像扭曲处理。Perform image distortion processing according to the H matrix.
在一种可能的设计中,移动终端的摄像头采集的视频帧存储在存储器的缓存中。In a possible design, the video frames collected by the camera of the mobile terminal are stored in the buffer of the memory.
在另一种可能的设计中,运动数据包括:移动终端的加速度、角速度。In another possible design, the motion data includes: acceleration and angular velocity of the mobile terminal.
在另一种可能的设计中,时间戳对齐为处理器使用样条插值将运动数据由离散值变为连续曲线;处理器对连续曲线进行非线性优化,得到不同连续曲线之间的时间差;处理器循环执行非线性优化,当时间差符合特定条件,循环结束。In another possible design, the time stamp alignment is that the processor uses spline interpolation to change the motion data from discrete values to continuous curves; the processor performs nonlinear optimization on the continuous curve to obtain the time difference between different continuous curves; processing The loop performs nonlinear optimization, and when the time difference meets certain conditions, the loop ends.
在另一种可能的设计中,处理器根据旋转矢量对视频帧进行路径平滑。In another possible design, the processor performs path smoothing on the video frame according to the rotation vector.
在另一种可能的设计中,运动路径平滑为处理器计算运动数据中每两个相邻数据点的向量,并对所有数据点进行遍历;处理器去掉向量相同的两个相邻数据点中的一个;处理器去掉由运动数据组成的数据曲线中的拐点;处理器去掉所有数据点中两个可以直接通过的数据点之间的数据点。In another possible design, the motion path smoothing is that the processor calculates the vector of every two adjacent data points in the motion data, and traverses all the data points; the processor removes the two adjacent data points with the same vector The processor removes the inflection point in the data curve composed of motion data; the processor removes all the data points between the two data points that can be directly passed.
在另一种可能的设计中,越界为经过裁切处理前的视频帧的部分像素在经过裁切处理后的视频帧中没有定义。In another possible design, the out-of-bounds is that some pixels of the video frame before the cropping process are not defined in the video frame after the cropping process.
在另一种可能的设计中,若越界次数大于第一阈值,移动终端的显示屏显示提示用户开启动态防抖的界面。显示屏接收用户的触摸操作,开启动态防抖。In another possible design, if the number of crossings is greater than the first threshold, the display screen of the mobile terminal displays an interface that prompts the user to enable dynamic anti-shake. The display screen receives the user's touch operation and turns on dynamic anti-shake.
在另一种可能的设计中,动态防抖为处理器根据运动强度的变化,调整裁切比例。In another possible design, dynamic anti-shake is that the processor adjusts the cropping ratio according to changes in exercise intensity.
又一方面,本实施例提供一种计算机可读存储介质,包括指令,当指令在移动终端上运行时,使得移动终端执行上述视频处理的方法。In another aspect, this embodiment provides a computer-readable storage medium, including instructions, which when executed on a mobile terminal, cause the mobile terminal to perform the above-mentioned video processing method.
附图说明Description of the drawings
图1是一种经过路径平滑算法处理的陀螺仪数据示意图;Figure 1 is a schematic diagram of gyroscope data processed by path smoothing algorithm;
图2A是一种在抖动场景下视频裁切比例的示意图;Figure 2A is a schematic diagram of a video cropping ratio in a jittery scene;
图2B是另一种在那个场景下视频裁切比例的示意图;Figure 2B is another schematic diagram of the video cropping ratio in that scene;
图3是一种视频处理的方法步骤示意图;Figure 3 is a schematic diagram of the steps of a video processing method;
图4A是一种运动传感器确定的运动状态示意图;Figure 4A is a schematic diagram of a motion state determined by a motion sensor;
图4B是一种不同运动状态下的陀螺仪数据示意图;Figure 4B is a schematic diagram of gyroscope data in different motion states;
图4C是一种不同运动状态下进行运动状态转移的示意图;Fig. 4C is a schematic diagram of a movement state transition under different movement states;
图5是一种调整视频裁切比例的方法步骤示意图;Figure 5 is a schematic diagram of the steps of a method for adjusting the video cropping ratio;
图6是一种开启动态FOV的UI界面示意图;Figure 6 is a schematic diagram of a UI interface for enabling dynamic FOV;
图7A是一种处理视频抖动的示意图;Fig. 7A is a schematic diagram of processing video jitter;
图7B是另一种处理视频抖动的示意图;Fig. 7B is another schematic diagram of processing video jitter;
图8A是一种没有经过路径平滑处理的陀螺仪数据示意图;Fig. 8A is a schematic diagram of gyroscope data without path smoothing processing;
图8B是一种经过路径平滑处理的陀螺仪数据示意图;Fig. 8B is a schematic diagram of gyroscope data after path smoothing processing;
图9是一种根据运动趋势确定裁切比例尺寸变化的方法步骤示意图;Fig. 9 is a schematic diagram of a method for determining the size change of the cutting scale according to the movement trend;
图10A是一种终端设备采集到的视频帧的示意图;Fig. 10A is a schematic diagram of a video frame collected by a terminal device;
图10B是一种表示运动强度变化和裁切比例变化的示意图;FIG. 10B is a schematic diagram showing changes in exercise intensity and cutting ratio;
图11是另一种表示运动强度变化和裁切比例变化的示意图;Figure 11 is another schematic diagram showing changes in exercise intensity and cutting ratio;
图12是一种调整视频裁切比例的方法步骤示意图;FIG. 12 is a schematic diagram of the steps of a method for adjusting the video cropping ratio;
图13A是一种电子设备的硬件结构示意图;Figure 13A is a schematic diagram of the hardware structure of an electronic device;
图13B是一种应用程序框架的结构示意图。Figure 13B is a schematic diagram of the structure of an application framework.
具体实施方式Detailed ways
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个、两个或两个以上。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种 关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also This includes expressions such as "one or more" unless the context clearly indicates to the contrary. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" refer to one, two, or more than two. The term "and/or" is used to describe the association relationship of associated objects, indicating that there can be three types of relationships; for example, A and/or B can mean: A alone exists, A and B exist at the same time, and B exists alone. Among them, A and B can be singular or plural. The character "/" generally indicates that the associated objects before and after are in an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References described in this specification to "one embodiment" or "some embodiments", etc. mean that one or more embodiments of the present application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
下面结合本申请实施例中的附图对本申请实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
现有的EIS算法在计算运动矢量的过程中,需要考虑一段时间窗口内,帧与帧之间的视角变换的平滑性,即运动矢量序列、运动路径需保持一定的平滑性。如图1所示,曲线101为视频拍摄者手持终端拍摄视频时,终端的陀螺仪采集到的数据随时间变化的曲线。图1中的纵轴表示陀螺仪的数据,横轴表示时间数据。曲线102为经过路径平滑算法处理后的陀螺仪数据随时间变化的曲线。路径平滑算法启到的作用是,在不同的帧进行视角变化时,不会由于噪点的出现导致画面出现大幅度的变化而影响观看。EIS防抖算法的实现依赖于对图像的裁剪,而图像的裁剪比例一般是预先设定好的,需要根据互补金属氧化物半导体(complementary metal oxide semiconductor,CMOS)sensor分辨率、图像信号处理器(image signal processor,ISP)处理能力、图像材质(texture)保持等因素来进行设定。而固定的裁剪比例,会导致EIS防抖算法能够去除的抖动幅度受到该裁剪比例的限制。对于剧烈运动的场景,裁剪面积不足会导致视频输出图所需要的像素信息超出了视频输入图的范围。所以为了避免索引到不存在的像素位置,现有的EIS防抖算法采用了增大裁剪面积的方案。但这种方案的缺点是,会导致补偿运动幅度减小、防抖效果减弱的结果。如图2A所示,图像201为采用较小裁剪比例裁剪的视频帧视频帧,箭头203表示图2A中视频帧需要裁切的比例。由图2A可知,在这种情况下,EIS防抖算法能够校正的抖动幅度较小。如图2B所示,图像202为采用较大裁剪比例裁剪的视频帧视频帧,箭头204表示图2B中视频帧需要裁切的比例。由图2B可知,在这种情况下,EIS防抖算法能够校正的抖动幅度较大。所以,随着对图像的裁剪比例的增加,EIS防抖算法能够校正的抖动幅度增大,更加适应于剧烈运动的使用场景。In the process of calculating the motion vector of the existing EIS algorithm, it is necessary to consider the smoothness of the view angle transformation between frames within a period of time, that is, the motion vector sequence and the motion path need to maintain a certain degree of smoothness. As shown in FIG. 1, the curve 101 is a curve of the data collected by the gyroscope of the terminal changing with time when the video shooter holds the terminal to shoot a video. The vertical axis in FIG. 1 represents gyroscope data, and the horizontal axis represents time data. The curve 102 is a curve of the gyroscope data processed by the path smoothing algorithm over time. The function of the path smoothing algorithm is that when the viewing angle is changed in different frames, the appearance of noise will not cause a large change in the picture and affect the viewing. The realization of the EIS anti-shake algorithm depends on the cropping of the image, and the cropping ratio of the image is generally preset, which needs to be based on the resolution of the complementary metal oxide semiconductor (CMOS) sensor and the image signal processor ( The image signal processor (ISP) processing capability, image texture preservation and other factors are used for setting. The fixed cropping ratio will cause the amplitude of jitter that can be removed by the EIS anti-shake algorithm to be limited by the cropping ratio. For scenes with violent motion, insufficient cropping area will cause the pixel information required by the video output image to exceed the range of the video input image. Therefore, in order to avoid indexing to non-existent pixel positions, the existing EIS anti-shake algorithm adopts a solution to increase the cropping area. However, the disadvantage of this solution is that it will result in reduced compensation motion amplitude and weakened anti-shake effect. As shown in FIG. 2A, the image 201 is a video frame that is cropped with a smaller cropping ratio, and the arrow 203 indicates the ratio of the video frame that needs to be cropped in FIG. 2A. It can be seen from Figure 2A that in this case, the amplitude of the jitter that the EIS anti-shake algorithm can correct is small. As shown in FIG. 2B, the image 202 is a video frame that is cropped with a larger cropping ratio, and the arrow 204 indicates the ratio of the video frame that needs to be cropped in FIG. 2B. It can be seen from Fig. 2B that in this case, the amplitude of the jitter that the EIS anti-shake algorithm can correct is relatively large. Therefore, as the cropping ratio of the image increases, the amplitude of jitter that can be corrected by the EIS anti-shake algorithm increases, and it is more suitable for use in severe sports scenarios.
本申请一实施例,可以根据运动幅度的不同,动态调整裁切比例,以适应不同的运动场景。在小幅运动下,EIS算法使用较低裁切比例,运动幅度增大时,自动进入动态调整模式,自动控制裁切比例,更好地平衡视频稳定性、清晰度和视场角(field of view,FOV)。如图3所示,为一种动态调整裁切比例的方法步骤。在步骤S301中,首先将终端采集到的视频帧元数据进行时间戳对齐。因为视频帧的元数据来源于不同的硬件设备,不同的硬件设备采集的数据在时间上不同。 有的元数据来自于经过光学防抖(optical image stabilization,OIS)的陀螺仪数据,有的元数据来自于惯性测量单元(inertial measurement unit,IMU)的角速度和加速度数据,有的元数据来自于图像捕捉单元采集的视频帧。对齐不同的元数据的时间戳有多种算法,以下以一种搜索算法为例,但对齐时间戳的算法并不限于此。时间戳和轨迹是离散记录的,无法直接使用优化方法得到时间差,可以将轨迹通过样条插值变为连续曲线,这样就得到了时间和位姿的近似连续量,然后使用非线性优化的方式求时间差。首先假设两个轨迹的时间差在±10秒以内,以某条轨迹作为reference,选择帧率较高的一个,改变另外一条轨迹的时间戳,从-10秒到+10秒,步长为1秒。这样就得到20条修改时间戳后的轨迹,每一条轨迹都和reference通过时间戳找对应帧即时间戳相差最小的帧,使用求解算法拟合两条轨迹,并计算绝对误差,取误差最小的轨迹对应的时间差,比如-5秒。然后在-5秒±0.1秒的区间内以0.1秒的步长再次做上述操作。直到以0.001秒作为步长搜索后结束。本质上是一种分层次搜索算法。为了提高搜索精度,还可以在使绝对误差最小的时间差附近拟合一条二次曲线,其中自变量是时间差,因变量是绝对误差,取二次曲线的最小值处的时间差作为最终结果。时间搜索的精度依赖于两条轨迹的拟合精度,可以使用交替优化的思想对算法进行优化。将视频帧与OIS和IMU采集的数据进行时间戳对齐,也即把OIS和IMU采集的数据,按照时间戳建立与视频帧一一对应的关系。在步骤S302中,根据经上一步骤时间戳对齐的视频帧,对上述视频帧进行EIS处理。经过EIS处理后,对终端的旋转矢量进行计算,并记录,得出运动路径。上述旋转矢量为,一种描述简谐振动较为直观的几何方法。从坐标原点O(平衡位置)画一矢量,使它的模等于谐振动的振幅A,并令t=0时A与x轴的夹角等于谐振动的初相位φ0,然后使A以等于角频率ω的角速度在平面上绕O点作逆时针转动,这样作出的矢量称为旋转矢量。显然,旋转矢量任一时刻在x轴上的投影x=Acos(ωt+φ0)就描述了一个简谐振动。在步骤S303中,对上一步骤中得到的运动路径进行路径平滑。以下以佛洛依德(Floyd)路径平滑算法为例,但不限于此算法。首先,使用佛洛依德算法把上述运动路径中相邻的共线的点去掉,对所有的数据点进行遍历,并计算相邻的两个向量的方向是否相同。然后,去掉多余的拐点,遍历所有的数据点,去掉其中两个可以直接通过的点之间的点。经过上述两步以后,就可以得到一条平滑的运动路径。在步骤S304中,对终端的运动状态进行识别。具体的识别方法在下文中进行详述。在步骤S305中,根据不同的运动状态,对裁切的画面越界的次数进行统计。如图7A所示,上述越界为,当经过裁切的视频帧进行扭曲操作后,会有部分画面超过未经裁切视频帧的原画幅,此种现象称为“越界”。在步骤S306中,根据不同的越界次数判断是否对裁切比例进行调整。如果不需要调整裁切比例,则进入步骤S307。在步骤S307中,计算各视频帧对应的H矩阵,并进行卷帘门效应(rolling shutter)校正。可以通过罗德里戈公式计算H矩阵,但并不限于此方法。通过罗德里戈公式计算出旋转矩阵,再结合内参矩阵、OIS的平移量,计算出输入图每个像素对应的单应矩阵H。因为CMOS终端在拍摄视频时采取逐 行扫描的方式,所以高频率抖动终端即抖动的频率快于一帧刷新的时间,会使得同一帧内的景物出现扭曲的效应,称为卷帘门效应。校正卷帘门效应的方法,首先将图像分成M条,然后在各帧之间平滑第一条图像的R矩阵,最后将视频帧内的其他R矩阵统一对齐到第一条。为了得到平滑的结果,不致使一帧内的各条之间过度太过生硬,使用高斯平滑算法对各视频帧进行路径平滑处理。最后在步骤S314完成对H矩阵的处理,经过对H矩阵的计算,进行图像扭曲(WARP)并输出图像。在步骤S308中,在终端的显示界面提示用户进入动态调整防抖模式,具体情况在下文中详述。在步骤S309中,由用户选择是否进入动态调整防抖模式,如果选择进入动态调整防抖模式则进入下一步骤。如果用户选择不进入动态调整防抖模式,则进入步骤S307。在步骤S310中,确定初始帧,并计算初始帧的裁切比例。在步骤S311中,计算终端运动的趋势,并根据运动的趋势确定现在已经采集的除初始帧外其余各帧的裁切比例。在步骤S312中,对经过步骤S305裁切过的图像做一次运动路径平滑。在步骤S313中,对经过步骤S312处理的各视频帧进行裁切边界保护,避免图像中出现检索不到的像素点,然后进入步骤S307,对重新裁切的图像计算器H矩阵,并做卷帘门效应校正。最后进入步骤S314,完成图像扭曲,并输出图像,上述图像扭曲可以是对H矩阵做仿射变换,仿射变换是一种将二维坐标(x,y)变换到二维坐标(u,v)的线性变换。仿射变换的特点是直线经过仿射变换后依然为直线;直线之间的相对位置关系保持不变,平行线经仿射变换后依然为平行线,且直线上的点的位置顺序不会发生变化;非共线的三对对应点确定一个唯一的仿射变换,也即将一种二维坐标乘了一个矩阵,其中矩阵的特征向量决定了图像变换的方向。上述步骤中,有一些步骤不是必需的,也可以不需要,例如步骤S303、步骤S308、步骤S309、步骤S312、步骤S313。According to an embodiment of the present application, the cropping ratio can be dynamically adjusted according to different motion amplitudes to adapt to different sports scenes. In small movements, the EIS algorithm uses a lower crop ratio. When the movement amplitude increases, it automatically enters the dynamic adjustment mode, automatically controls the crop ratio, and better balances the video stability, definition, and field of view. ,FOV). As shown in Figure 3, it is a method of dynamically adjusting the cutting ratio. In step S301, the video frame metadata collected by the terminal is first time stamp aligned. Because the metadata of the video frame comes from different hardware devices, the data collected by different hardware devices is different in time. Some metadata comes from the gyroscope data that has undergone optical image stabilization (OIS), some metadata comes from the angular velocity and acceleration data of the inertial measurement unit (IMU), and some metadata comes from Video frames captured by the image capture unit. There are multiple algorithms for aligning timestamps of different metadata. The following uses a search algorithm as an example, but the algorithm for aligning timestamps is not limited to this. The time stamp and the trajectory are recorded discretely, and the optimization method cannot be used directly to obtain the time difference. The trajectory can be transformed into a continuous curve through spline interpolation, so that the approximate continuous amount of time and pose is obtained, and then the nonlinear optimization method is used to obtain the time difference. Time difference. First, assume that the time difference between the two trajectories is within ±10 seconds, take a certain trajectory as a reference, choose the one with the higher frame rate, and change the time stamp of the other trajectory from -10 seconds to +10 seconds, with a step size of 1 second . In this way, 20 trajectories with modified timestamps are obtained, and each trajectory finds the corresponding frame through the timestamp from the reference, that is, the frame with the smallest time stamp difference, uses the solving algorithm to fit the two trajectories, calculates the absolute error, and takes the smallest error The time difference corresponding to the trajectory, such as -5 seconds. Then do the above operation again in the interval of -5 seconds ± 0.1 seconds in steps of 0.1 seconds. It will end after searching with 0.001 second as the step length. It is essentially a hierarchical search algorithm. In order to improve the search accuracy, you can also fit a quadratic curve near the time difference that minimizes the absolute error, where the independent variable is the time difference and the dependent variable is the absolute error, and the time difference at the minimum of the quadratic curve is taken as the final result. The accuracy of the time search depends on the fitting accuracy of the two trajectories, and the algorithm can be optimized using the idea of alternate optimization. The video frame is time stamp aligned with the data collected by the OIS and IMU, that is, the data collected by the OIS and IMU is established in a one-to-one correspondence with the video frame according to the time stamp. In step S302, EIS processing is performed on the above-mentioned video frame according to the video frame aligned by the time stamp of the previous step. After EIS processing, the rotation vector of the terminal is calculated and recorded to obtain the motion path. The above-mentioned rotation vector is a more intuitive geometric method for describing simple harmonic motion. Draw a vector from the coordinate origin O (balanced position), make its mode equal to the amplitude A of the harmonic motion, and set the angle between A and the x axis at t=0 to be equal to the initial phase φ0 of the harmonic motion, and then make A equal to the angle The angular velocity of frequency ω rotates counterclockwise around point O on the plane, and the vector made in this way is called the rotation vector. Obviously, the projection x=Acos(ωt+φ0) of the rotation vector on the x-axis at any time describes a simple harmonic motion. In step S303, path smoothing is performed on the motion path obtained in the previous step. The following takes the Floyd path smoothing algorithm as an example, but it is not limited to this algorithm. First, use the Freud algorithm to remove the adjacent collinear points in the above motion path, traverse all the data points, and calculate whether the directions of the two adjacent vectors are the same. Then, remove the redundant inflection points, traverse all the data points, and remove the points between the two points that can be passed directly. After the above two steps, a smooth motion path can be obtained. In step S304, the motion state of the terminal is identified. The specific identification method is described in detail below. In step S305, according to different motion states, count the number of times the cropped screen crosses the boundary. As shown in FIG. 7A, the above-mentioned cross-border is that after the cropped video frame undergoes a warping operation, part of the picture will exceed the original frame of the uncropped video frame. This phenomenon is called "cross-border". In step S306, it is judged whether to adjust the cutting ratio according to different cross-border times. If there is no need to adjust the cutting ratio, step S307 is entered. In step S307, the H matrix corresponding to each video frame is calculated, and rolling shutter correction is performed. The H matrix can be calculated by Rodrigo's formula, but it is not limited to this method. The rotation matrix is calculated by Rodrigo's formula, and then combined with the internal parameter matrix and the translation of OIS, the homography matrix H corresponding to each pixel of the input image is calculated. Because the CMOS terminal adopts a progressive scan method when shooting video, the high-frequency jitter terminal, that is, the jitter frequency is faster than the refresh time of one frame, which will cause the scene in the same frame to appear distorted, which is called the rolling door effect. The method of correcting the rolling door effect is to first divide the image into M strips, then smooth the R matrix of the first image between frames, and finally align the other R matrices in the video frame to the first strip uniformly. In order to obtain a smooth result, without causing the transitions between the individual bars in a frame to be too blunt, a Gaussian smoothing algorithm is used to perform path smoothing processing on each video frame. Finally, in step S314, the processing of the H matrix is completed. After the calculation of the H matrix, image warping (WARP) is performed and the image is output. In step S308, the display interface of the terminal prompts the user to enter the dynamic adjustment anti-shake mode, and the specific situation is described in detail below. In step S309, the user chooses whether to enter the dynamic adjustment anti-shake mode, and if it chooses to enter the dynamic adjustment anti-shake mode, proceed to the next step. If the user chooses not to enter the dynamic adjustment anti-shake mode, step S307 is entered. In step S310, the initial frame is determined, and the cropping ratio of the initial frame is calculated. In step S311, the trend of the movement of the terminal is calculated, and the cropping ratio of the frames other than the initial frame that has been collected is determined according to the trend of the movement. In step S312, a motion path smoothing is performed on the image cropped in step S305. In step S313, cut boundary protection is performed on each video frame processed in step S312 to avoid unretrievable pixels in the image, and then go to step S307, calculate the H matrix of the re-cut image, and make a rolling shutter Effect correction. Finally, proceed to step S314 to complete the image warping and output the image. The image warping described above can be an affine transformation of the H matrix. The affine transformation is a transformation from two-dimensional coordinates (x, y) to two-dimensional coordinates (u, v). ) Linear transformation. The characteristic of affine transformation is that the straight line is still a straight line after affine transformation; the relative position relationship between the straight lines remains unchanged, and the parallel line is still parallel after affine transformation, and the position order of the points on the straight line does not occur. Change; The three pairs of non-collinear corresponding points determine a unique affine transformation, that is, a two-dimensional coordinate is multiplied by a matrix, and the eigenvector of the matrix determines the direction of the image transformation. Among the above steps, some steps are not necessary, and may not be required, such as step S303, step S308, step S309, step S312, and step S313.
在一些实施例中,对应上述步骤S304,终端可以基于IMU进行运动状态识别。如图4A所示,终端根据IMU采集的角速度和加速度数据与陀螺仪采集到的数据,对这些数据进行均方根、绝对值积分计算,也可以将数据导入到机器学习预先训练模型中进行学习,得到处理过的数据信息。终端对上述信息进行分类和统计,可以识别不同的运动强度或运动类型。图4A中,将运动状态根据运动强度分了不多的级别,在Level 0中,终端处于静止(static)状态。设置一个运动状态计数器,用来计算运动状态的个数。如图4B所示,为一个不同运动状态的示例。图4B表格中纵轴为陀螺仪的数据,横轴为时间,由图可知,图中左边的部分运动强度较小,识别为走路状态(walking),右边的部分运动强大较大,识别为跑步状态(running)。如图4C所示,为不同运动状态之间的转移。步骤S401为保持相同的运动状态,步骤S402为从低强度的运动状态转换到高强度的运动状态,步骤S403为从高强度的运动状态转换到低强度的运动状态。不同的运动状态转换,终端会在显示屏上弹出提示用户是否进入动态调整防抖的模式,也即上述步骤S308。如果用户选择进入动态调整防抖模式,则需要重新确定裁切的比例。并且对经过重新确定裁切比例的各视频帧,做路径平滑的处理,让视频的 显示保持平滑,不出现剧烈的晃动。In some embodiments, corresponding to the above step S304, the terminal may perform motion state recognition based on the IMU. As shown in Figure 4A, the terminal performs root-mean-square and absolute integral calculations on these data based on the angular velocity and acceleration data collected by the IMU and the data collected by the gyroscope. The data can also be imported into the machine learning pre-training model for learning , Get the processed data information. The terminal classifies and counts the above information, and can identify different exercise intensities or exercise types. In FIG. 4A, the exercise state is divided into a few levels according to exercise intensity. In Level 0, the terminal is in a static state. Set up a motion state counter to count the number of motion states. As shown in Figure 4B, it is an example of different motion states. In the table in Figure 4B, the vertical axis is the gyroscope data, and the horizontal axis is the time. It can be seen from the figure that the left part of the figure has a smaller exercise intensity and is identified as walking, and the right part has a stronger exercise and is identified as running. Status (running). As shown in Figure 4C, it is the transition between different motion states. Step S401 is to maintain the same exercise state, step S402 is to switch from a low-intensity exercise state to a high-intensity exercise state, and step S403 is to switch from a high-intensity exercise state to a low-intensity exercise state. In different motion state transitions, the terminal will pop up on the display screen to prompt the user whether to enter the mode of dynamically adjusting the anti-shake, that is, the above step S308. If the user chooses to enter the dynamic adjustment anti-shake mode, the cropping ratio needs to be re-determined. And for each video frame whose cropping ratio has been re-determined, the path smoothing process is performed to keep the video display smooth without violent shaking.
在另外一些实施例中,对应上述步骤S304、步骤S305、步骤S306,终端需要根据运动状态的变化,对裁切比例进行调整。如图5所示,为视频帧的裁切比例调整的方法步骤。在步骤S500中,终端将IMU数据与视频帧进行时间戳对齐。步骤S501,判断终端目前的运动状态。在步骤S511中,如果终端的运动强度保持,没有变化,也即上述步骤S401,则进入步骤S512。在步骤S512中,保持视频帧视频帧的裁切比例不变。在步骤S521中,如果终端的运动强度增大,也即上述步骤S402,则进入步骤S522。在步骤S522中,对初始的裁切图像越界次数进行统计。越界是指,裁切后的图像进行防抖校正后,也即进行图像扭曲后,裁切后的图像超过当前显示界面的边界。也即当前显示的界面检索到了没有定义的像素点。在步骤S523中,判断初始的裁切图像越界的统计次数是否大于第一阈值。在步骤S524中,如果初始的裁切图像越界的统计次数没有大于第一阈值,则保持初始的裁切比例。在步骤S525中,如果初始的裁切图像越界的统计次数大于第一阈值,则增大裁切的比例。在步骤S531中,如果运动强度减小,也即上述步骤3,则进入步骤S532。在步骤S532中,先对初始的裁切比例进行缩小。在步骤S533中,统计缩小裁切比例后图像越界的次数。在步骤S534中,判断缩小裁切比例后图像越界的次数是否小于第二阈值。在步骤S535中,如果缩小裁切比例后图像越界次数不小于第二阈值,则保持当前裁切比例。在步骤S536中,如果缩小裁切比例后图像越界次数小于第二阈值,则减小裁切的比例。In some other embodiments, corresponding to the above steps S304, S305, and S306, the terminal needs to adjust the cutting ratio according to the change of the motion state. As shown in Figure 5, the method steps for adjusting the cropping ratio of the video frame. In step S500, the terminal aligns the time stamp of the IMU data with the video frame. Step S501: Determine the current motion state of the terminal. In step S511, if the exercise intensity of the terminal remains unchanged, that is, the above step S401, then step S512 is entered. In step S512, the cropping ratio of the video frame is kept unchanged. In step S521, if the exercise intensity of the terminal increases, that is, the above step S402, proceed to step S522. In step S522, the initial number of cross-border cutout images is counted. Out-of-bounds means that after the cropped image is subjected to anti-shake correction, that is, after the image is distorted, the cropped image exceeds the boundary of the current display interface. That is, the currently displayed interface retrieves undefined pixels. In step S523, it is determined whether the initial statistical number of times the cropped image crosses the boundary is greater than a first threshold. In step S524, if the statistical number of times that the initial cropped image crosses the boundary is not greater than the first threshold, the initial cropping ratio is maintained. In step S525, if the initial counted number of times the cropped image crosses the boundary is greater than the first threshold, the cropping ratio is increased. In step S531, if the exercise intensity decreases, that is, the above step 3, go to step S532. In step S532, the initial cutting scale is first reduced. In step S533, count the number of times that the image crosses the boundary after the cropping ratio is reduced. In step S534, it is determined whether the number of times the image crosses the boundary after the cropping ratio is reduced is less than a second threshold. In step S535, if the number of crossovers of the image after the cropping ratio is reduced is not less than the second threshold, the current cropping ratio is maintained. In step S536, if the number of times the image cross-border is smaller than the second threshold after the cropping ratio is reduced, the cropping ratio is reduced.
在一些实施例中,终端的显示界面可以显示提示用户是否进入动态防抖模式。如图6所示,用户在录制视频的过程中,如果终端判断需要进行裁切比例调整,在视频录制的界面弹出“动态防抖”开启/关闭的提示。界面601为终端进行视频录制的录制画面,界面601上显示经过EIS防抖算法处理过的输出图。当终端在上述步骤S308时,判断需要调整当前裁切比例,则在界面601的区域602自动弹出是否开启“动态防抖”的提示。区域602可位于界面601的任何位置,本申请不做限定。在本实施例中,区域602位于界面601的中间靠下方区域。在区域602中,提示的文字部分可以位于区域602的任何位置,本申请不做限定,本实施例中提示的文字部分位于区域602的上方。提示的文字部分可以为与“动态防抖”意思相近的各种文字,本申请不限制语言的种类以及表达的方式,本实施例以中英文结合的“动态防抖”为例进行说明。在文字提示的下方,有开启和关闭的提示,本申请中不限制开启关闭的语言种类以及表达方式,只要能表达相同的意思即可。开启和关闭的提示可以使用不超过区域602的任意大小字体,本申请不做限制,本实施例以开启和关闭的提示字体字号小于文字提示部分为例。当区域602弹出提示时,用户可以进行触摸或点击操作。用户可以触摸区域602中的文字提示部分,也可以触摸开启和关闭提示部分,本申请不做限制,本实施例以用户触摸区域602的任意部分为例。在用户触摸区域602的任意部分后,开启和关闭提示部分会切换状态,如果是开启状态,则开启部分的显示颜色与关闭部分显示的颜色不同,如果是关闭状态,则原开启部分的显示颜色显示到关闭部 分,原关闭部分的显示颜色显示到开启部分。可以理解的是,用户也可以直接触摸开启和关闭部分,如果用户点击开启部分,则开启“动态防抖”相关功能,如果用户点击关闭部分,则关闭“动态防抖”相关功能。In some embodiments, the display interface of the terminal may display to prompt the user whether to enter the dynamic anti-shake mode. As shown in Figure 6, when the user is recording a video, if the terminal determines that the cropping ratio needs to be adjusted, a prompt of "dynamic anti-shake" on/off will pop up on the video recording interface. The interface 601 is a recording screen of the terminal for video recording, and the interface 601 displays an output image processed by the EIS anti-shake algorithm. When the terminal determines that the current cropping ratio needs to be adjusted in the above step S308, the area 602 of the interface 601 automatically pops up a prompt whether to enable "dynamic anti-shake". The area 602 can be located at any position of the interface 601, which is not limited in this application. In this embodiment, the area 602 is located in the lower middle area of the interface 601. In the area 602, the text part of the prompt can be located anywhere in the area 602, which is not limited in this application, and the text part of the prompt is located above the area 602 in this embodiment. The text part of the prompt may be various words that have a similar meaning to "dynamic anti-shake". This application does not limit the type of language and the way of expression. This embodiment uses the combination of Chinese and English "dynamic anti-shake" as an example for description. Below the text prompt, there are prompts for opening and closing. This application does not limit the language types and expressions of opening and closing, as long as they can express the same meaning. The opening and closing prompts can use any font size that does not exceed the area 602, and this application is not limited. In this embodiment, the opening and closing prompt font size is smaller than the text prompt part as an example. When a prompt pops up in the area 602, the user can perform a touch or click operation. The user can touch the text prompt part in the area 602, and can also touch to turn on and off the prompt part. This application is not limited. In this embodiment, the user touches any part of the area 602 as an example. After the user touches any part of the area 602, the open and close prompt part will switch states. If it is open, the display color of the open part is different from the color of the closed part. If it is closed, the display color of the original open part Display to the closed part, and the display color of the original closed part is displayed to the open part. It is understandable that the user can also directly touch the opening and closing parts. If the user clicks the opening part, the “dynamic anti-shake” related functions are turned on, and if the user clicks the closed part, the “dynamic anti-shake” related functions are turned off.
在另外一些实施例中,可以根据当前路径平滑程度、运动强度、触发越界裁切次数等情况,重新确定裁切比例生效的帧和裁切尺寸。当视频帧缓存(buffer)内数据所代表的运动强度达到一定阈值,触发裁切比例调整后,终端可以根据一定步长,循环迭代找到合适的裁切尺寸,本实施例以裁切比例增大为例进行说明。终端根据IMU采集的数据对运动趋势进行预测,并计算当前终端的运动强度。终端重新确定裁切比例的最终目标是根据其运动趋势和运动强度寻找buffer的长度窗口内,可以引起裁切越界的最大的片段。终端可以步进(stepping)地增大裁切比例,步进指的是规律性地增大裁切比例。终端根据每一视频帧的旋转矢量计算输出图的边界点在输入图中的位置,由计算结果可以统计越界的视频帧是哪些,并且可以统计越界的视频帧的数量。通过计算输出图的边界点在输入图中的位置,还可以计算各视频帧的越界尺寸以及各视频帧将越界的部分图像调整到显示区域所需要的调整次数。如图7A所示,如果经计算输出图发生越界的情况,根据初始计算的运动矢量进行调整,发现输出图的部分像素在输入图中无定义。如图7A所示的,左边的视频帧为输入帧,经过计算和图像扭曲后得到右边的图像,也即得到输出图。图7A中所示的情况,即为输出图越界(hit boundary),也即输入图的部分像素在输出图中无定义。终端步进地调整裁切比例,每次步进都计算越界的裁切帧数、计算各越界的裁切帧的尺寸、各越界的裁切帧调整到显示区域内所需要的次数。当上述条件满足一定条件时,如各越界的裁切帧调整到显示区域内所需要的次数满足预设的阈值时,终端就停止步进调整裁切比例。如图7B所示,如果增大裁切的比例,虽然FOV会减小,但是可以保证更少的触发越界情况(crop more,FOV shrink)。如果增大裁切比例,仍然无法让越界的情况减少,则需要降低路径平滑的程度。如图8A和图8B所示,降低路径平滑的程度,如果路径平滑度降低至满足一定条件,如小于预设的某一阈值,越界次数仍然无法满足要求,则继续增大裁切比例,并交替执行以上过程,进行迭代。在迭代的过程中,可以使用越界尺寸和各视频帧调整至显示区域内所需要的次数作为反馈信息,加入到迭代中,自适应地加快迭代的过程,直至找到可以满足条件的视频帧的裁切比例。In other embodiments, it is possible to re-determine the frame and the crop size at which the crop ratio takes effect according to the current path smoothness, exercise intensity, and the number of triggers for cross-border cropping. When the motion intensity represented by the data in the video frame buffer reaches a certain threshold, after the trimming ratio adjustment is triggered, the terminal can iteratively find a suitable trimming size according to a certain step size. In this embodiment, the trimming ratio is increased. Take an example for illustration. The terminal predicts the movement trend based on the data collected by the IMU, and calculates the current exercise intensity of the terminal. The ultimate goal of the terminal to re-determine the cutting ratio is to find the largest segment within the buffer length window according to its movement trend and exercise intensity, which can cause the cut to cross the boundary. The terminal can increase the cutting ratio stepping, and stepping refers to increasing the cutting ratio regularly. The terminal calculates the position of the boundary point of the output image in the input image according to the rotation vector of each video frame. From the calculation result, it can count which video frames are out of bounds, and can count the number of out of bounds video frames. By calculating the position of the boundary point of the output image in the input image, it is also possible to calculate the out-of-bounds size of each video frame and the number of adjustments required for each video frame to adjust the out-of-bounds part of the image to the display area. As shown in FIG. 7A, if an out-of-bounds situation occurs in the output image after calculation, it is adjusted according to the initially calculated motion vector, and it is found that some pixels of the output image are not defined in the input image. As shown in FIG. 7A, the video frame on the left is the input frame. After calculation and image distortion, the image on the right is obtained, that is, the output image is obtained. The situation shown in FIG. 7A is the hit boundary of the output image, that is, some pixels of the input image are not defined in the output image. The terminal adjusts the cutting ratio step by step. Each step calculates the number of cross-border cropping frames, calculates the size of each cross-border crop frame, and the number of times required for each cross-border crop frame to be adjusted to the display area. When the above conditions meet certain conditions, for example, when the number of times required for each cross-border cropping frame to be adjusted within the display area meets a preset threshold, the terminal stops stepping to adjust the cropping ratio. As shown in FIG. 7B, if the cutting ratio is increased, although the FOV will be reduced, it can ensure that fewer trigger cross-border situations (crop more, FOV shrink) are ensured. If you increase the cropping ratio and still cannot reduce the cross-border situations, you need to reduce the smoothness of the path. As shown in Figure 8A and Figure 8B, reduce the degree of path smoothness. If the path smoothness is reduced to meet certain conditions, such as less than a preset threshold, and the number of cross-borders still cannot meet the requirements, continue to increase the cutting ratio, and Perform the above process alternately and iterate. In the iterative process, the out-of-bounds size and the number of times each video frame needs to be adjusted to the display area can be used as feedback information and added to the iteration to adaptively speed up the iterative process until a video frame that meets the conditions is found. Cut proportions.
在一些实施例中,对应上述步骤S310,终端可以根据运动趋势确定确定是否调整裁切比例。如图9所示,在步骤S900中,终端判断是否触发裁切比例调整。如果触发了裁切比例调整,则进入步骤S910,在步骤S910中视频帧的输入图和输出图匹配裁切比例动态模型。在步骤S911中,根据裁切比例动态模型计算出各视频帧的裁切比例。在步骤S912中,对由新裁切比例处理的输出图进行路径平滑和边界保持处理,也即进行上述实施例中的迭代过程。在步骤S913中,对经过迭代过程确定的裁切比例裁切的视频帧进行图像扭曲(warp)。在步骤S900中,如果终端判断没有触发裁切比例调整,则进入步骤S920,保持当前裁 切比例。在步骤S921中,对保持当前裁切比例的视频帧图像进行路径平滑和边界保持处理。在步骤S922中,对经过处理的视频帧进行图像扭曲(warp)。具体的,如图10A所示,当前终端的buffer里存储了2N+1帧,其中N为当前送显帧到最新帧的距离,图10A中的1号帧即为当前送显帧,从2N+1号帧开始进行图像扭曲。如图10B所示,图中的横坐标为时间,纵坐标为经过计算的触发边界的次数。在图10B的第二象限中的曲线101,表示裁切比例为20%时裁切的视频帧触发越界的情况。在图10B的第一象限中的曲线102,表示裁切比例调整到30%时裁切的视频帧触发越界的情况。图10B中的曲线103为经过路径平滑以后的视频帧变化曲线。更进一步地,如图11所示,终端根据运动强度变化的速率调整裁切比例变化的速度,使视角变化更平滑。表示视角的变化可以采用图11的方式,但本申请不做限制,也可采用直线、线段、分段函数直接映射。视角频繁的变化,会造成用户的不适,可以采用如下策略进行限制。如在视频拍摄的过程中,只允许视角发生单方向调整,不允许裁切比例增大后再减小或减小后再增大等。又如,在视频拍摄过程中,只允许视角发生限定次数的调整,例如N次,N为预设的有限数值。又如,在统计不同的运动状态的次数时,当停留在某个运动状态的连续次数达到某一限定次数时,例如M次,才允许视角进行调整。上述对于视角的调整即为对视角裁切比例的调整。In some embodiments, corresponding to the foregoing step S310, the terminal may determine whether to adjust the cropping ratio according to the movement trend. As shown in FIG. 9, in step S900, the terminal determines whether to trigger the trimming ratio adjustment. If the trimming scale adjustment is triggered, step S910 is entered, where the input image and the output image of the video frame match the trimming dynamic model. In step S911, the cropping ratio of each video frame is calculated according to the cropping ratio dynamic model. In step S912, path smoothing and boundary maintaining processing is performed on the output map processed by the new cropping scale, that is, the iterative process in the above-mentioned embodiment is performed. In step S913, image warp is performed on the video frame cropped by the cropping ratio determined by the iterative process. In step S900, if the terminal determines that the trimming ratio adjustment has not been triggered, it proceeds to step S920 to maintain the current trimming ratio. In step S921, path smoothing and boundary maintaining processing are performed on the video frame image maintaining the current cropping ratio. In step S922, image warping (warp) is performed on the processed video frame. Specifically, as shown in Figure 10A, 2N+1 frames are stored in the buffer of the current terminal, where N is the distance from the current frame to the latest frame. Frame No. 1 in Figure 10A is the current frame, starting from 2N The image distortion begins at frame +1. As shown in Fig. 10B, the abscissa in the figure is time, and the ordinate is the number of times the boundary has been triggered. The curve 101 in the second quadrant of FIG. 10B represents a situation where the cropped video frame triggers an out-of-bounds when the cropping ratio is 20%. The curve 102 in the first quadrant of FIG. 10B represents a situation where the cropped video frame triggers an out-of-bounds when the cropping ratio is adjusted to 30%. The curve 103 in FIG. 10B is the change curve of the video frame after path smoothing. Furthermore, as shown in FIG. 11, the terminal adjusts the speed of the change of the cropping ratio according to the rate of change of the exercise intensity, so that the change of the viewing angle is smoother. The method of Fig. 11 can be used to indicate the change of the viewing angle, but this application is not limited, and straight lines, line segments, and piecewise functions can also be used for direct mapping. Frequent changes in the viewing angle will cause discomfort to the user, and the following strategies can be used to limit it. For example, in the process of video shooting, only one-way adjustment of the angle of view is allowed, and the crop ratio is not allowed to increase and then decrease or decrease and then increase. For another example, during the video shooting process, only a limited number of adjustments of the angle of view are allowed, such as N times, where N is a preset limited number. For another example, when counting the number of different motion states, when the number of consecutive times of staying in a certain motion state reaches a certain limited number of times, such as M times, the angle of view is allowed to be adjusted. The above adjustment of the viewing angle is the adjustment of the cutting ratio of the viewing angle.
在另一些实施例中,可以根据深度学习的模型来建立运动强度和重新确定裁切比例的映射关系。如图12所示,在步骤S1201中终端采集一定量的视频帧,以单位时间进行视频分段,并且采集IMU和陀螺仪的数据,对这些数据进行均方根和绝对值积分,或者把这些数据输入到机器学习的训练模型中。在步骤S1202中,根据上述传感器采集的数据对每个视频片段内的终端运动强度进行分类和统计。在步骤S1203中,在上述视频片段集内,统计每个视频片段以不同裁切比例裁切时,触发越界的次数,并将其记录。在步骤S1204中,根据记录的不同的视频片段使用的裁切比例,判断触发越界的次数是否小于预设的特定数值,如X阈值。如果触发越界的次数不小于预设的特定数值,则返回步骤S1203继续统计。如果触发越界的次数小于预设的特定数值,则进入步骤S1205。在步骤S1205中,使用神经网络或者机器学习模型对采集的传感器数据进行训练,得到运动强度和最佳裁切比例的对应关系。在步骤S1206中,当第一次检测到根据运动状态或者运动强度需要改变裁切比例时,终端自动提示用户是否开启动态FOV调整模式,具体如图6所示。如果用户选择开启动态FOV调整模式,则根据深度学习模型计算的结果,对裁切比例进行动态调整。In other embodiments, the mapping relationship between exercise intensity and re-determination of the crop ratio can be established according to the deep learning model. As shown in Figure 12, in step S1201, the terminal collects a certain amount of video frames, performs video segmentation in unit time, and collects IMU and gyroscope data, performs root-mean-square and absolute-value integrals on these data, or integrates these data The data is fed into the training model of machine learning. In step S1202, the terminal motion intensity in each video segment is classified and counted according to the data collected by the above-mentioned sensor. In step S1203, in the above-mentioned video clip set, count the number of triggering cross-border times when each video clip is cut with different cutting ratios, and record them. In step S1204, it is determined whether the number of times of triggering the out-of-bounds is less than a preset specific value, such as an X threshold, according to the cropping ratio used by different recorded video clips. If the number of triggering out-of-bounds is not less than the preset specific value, return to step S1203 to continue counting. If the number of triggering out-of-bounds is less than the preset specific value, step S1205 is entered. In step S1205, a neural network or a machine learning model is used to train the collected sensor data to obtain the corresponding relationship between the exercise intensity and the optimal cutting ratio. In step S1206, when it is detected for the first time that the cropping ratio needs to be changed according to the exercise state or exercise intensity, the terminal automatically prompts the user whether to enable the dynamic FOV adjustment mode, as shown in FIG. 6 specifically. If the user chooses to turn on the dynamic FOV adjustment mode, the cutting ratio will be dynamically adjusted according to the results calculated by the deep learning model.
在一些实施例中,终端可以是一种电子设备,如图13A所示,出示了电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193, 显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。In some embodiments, the terminal may be an electronic device. As shown in FIG. 13A, a schematic structural diagram of the electronic device 100 is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2. , Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. Among them, the different processing units may be independent devices or integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。I2S接口和PCM接口都可以用于音频通信。The I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively through different I2C bus interfaces. For example, the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100. Both I2S interface and PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。 MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on. In some embodiments, the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on. The GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处 理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information, and it can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required by at least one function, and the like. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be provided on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors and so on. The capacitive pressure sensor may include at least two parallel plates with conductive materials. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要 补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the movement posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers, and so on.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F, used to measure distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The button 190 includes a power-on button, a volume button, and so on. The button 190 may be a mechanical button. It can also be a touch button. The electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
图2是本发明实施例的电子设备100的软件结构框图。FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间 通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers is through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 2, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图13B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in FIG. 13B, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The content provider is used to store and retrieve data and make these data accessible to applications. The data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, and so on. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, and so on. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。The system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
2D图形引擎是2D绘图的绘图引擎。The 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。In the following, the workflow of the software and hardware of the electronic device 100 will be exemplified in conjunction with capturing a photo scene.
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.). The original input events are stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer. The camera 193 captures still images or videos.
以上描述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内;在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。因此,本申请的保护范围应以权利要求的保护范围。The above description is only the specific implementation of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Covered within the protection scope of the present application; the embodiments of the present application and the features in the embodiments can be combined with each other if there is no conflict. Therefore, the protection scope of this application should be the protection scope of the claims.

Claims (15)

  1. 一种移动终端,其特征在于,包括摄像头、显示屏、运动传感器、处理器;A mobile terminal, characterized by comprising a camera, a display screen, a motion sensor, and a processor;
    所述摄像头用于录制视频;所述显示屏用于显示视频录制界面;The camera is used to record video; the display screen is used to display a video recording interface;
    所述运动传感器用于在所述摄像头录制视频时持续采集运动数据;The motion sensor is used to continuously collect motion data when the camera records a video;
    根据所述运动数据,确定运动强度是否变化;According to the exercise data, determine whether the exercise intensity changes;
    若所述运动强度发生变化,所述视频录制界面用于显示启动动态防抖的提示;If the exercise intensity changes, the video recording interface is used to display a prompt for starting dynamic anti-shake;
    所述显示屏用于接收点击所述提示的触摸操作,所述处理器用于执行动态防抖。The display screen is used to receive the touch operation of clicking the prompt, and the processor is used to perform dynamic anti-shake.
  2. 根据权利要求1所述的移动终端,其特征在于,所述运动传感器包括惯性传感器、加速度传感器、陀螺仪。The mobile terminal according to claim 1, wherein the motion sensor includes an inertial sensor, an acceleration sensor, and a gyroscope.
  3. 根据权利要求1所述的移动终端,其特征在于,所述启动动态防抖的提示包括:动态防抖的说明部分和开关控制部分。The mobile terminal according to claim 1, wherein the prompt for starting dynamic anti-shake includes: an explanation part of dynamic anti-shake and a switch control part.
  4. 根据权利要求1所述的移动终端,其特征在于,所述摄像头录制视频时会生成视频帧;将所述运动数据与所述视频帧进行时间戳对齐,所述时间戳对齐为根据时间建立所述运动数据与所述视频帧的对应关系;对所述视频帧进行电子图像防抖处理,所述电子图像防抖为对所述视频帧进行裁切,将经过所述裁切的所述视频帧进行扭曲;计算所述视频帧的旋转矢量;根据所述运动数据,进行路径平滑;所述路径平滑为优化由所述运动数据组成的曲线;确定所述移动终端的运动状态;统计经过所述扭曲的所述视频帧的越界次数;若所述越界次数大于第一阈值,则增大裁切比例;若所述越界次数小于等于第一阈值,则保持所述裁切比例。The mobile terminal according to claim 1, wherein the camera generates a video frame when recording a video; the motion data is time stamp aligned with the video frame, and the time stamp alignment is based on the establishment of time stamps. The corresponding relationship between the motion data and the video frame; electronic image anti-shake processing is performed on the video frame, and the electronic image anti-shake is to cut the video frame, and the cut video The frame is warped; the rotation vector of the video frame is calculated; the path is smoothed according to the motion data; the path is smoothed to optimize the curve composed of the motion data; the motion state of the mobile terminal is determined; The number of cross-borders of the distorted video frame; if the number of cross-borders is greater than a first threshold, the cropping ratio is increased; if the number of cross-borders is less than or equal to the first threshold, the cropping ratio is maintained.
  5. 根据权利要求4所述的移动终端,其特征在于,所述越界为进行所述扭曲前的所述视频帧的部分像素在进行所述扭曲后的所述视频帧中没有定义。The mobile terminal according to claim 4, wherein the out-of-bounds means that some pixels of the video frame before the warping are not defined in the video frame after the warping.
  6. 一种视频处理方法,其特征在于,包括:A video processing method, characterized in that it comprises:
    移动终端的摄像头采集视频帧;The camera of the mobile terminal collects video frames;
    所述移动终端的运动传感器采集运动数据;The motion sensor of the mobile terminal collects motion data;
    所述移动终端的处理器将所述视频帧和所述运动数据进行时间戳对齐;The processor of the mobile terminal performs time stamp alignment on the video frame and the motion data;
    所述处理器对所述视频帧进行电子图像防抖,所述电子图像防抖为对所述视频帧进行裁切,将经过所述裁切的所述视频帧进行扭曲;The processor performs electronic image stabilization on the video frame, where the electronic image stabilization is to cut the video frame and warp the cut video frame;
    根据所述运动数据计算所述视频帧的旋转矢量;Calculating the rotation vector of the video frame according to the motion data;
    所述处理器识别所述移动终端的运动状态;The processor recognizes the motion state of the mobile terminal;
    所述处理器对所述视频帧进行裁切处理,统计经过所述裁切处理后的所述视频帧的越界次数;Performing cropping processing on the video frame by the processor, and counting the number of out-of-bounds times of the video frame after the cropping processing;
    所述处理器根据所述越界次数确定是否调整裁切比例;The processor determines whether to adjust the cutting ratio according to the number of cross-border times;
    若所述越界次数小于等于第一阈值,则保持裁切比例,所述处理器计算所述视频帧对应的H矩阵;根据所述H矩阵进行图像扭曲处理;If the number of cross-borders is less than or equal to the first threshold, the cropping ratio is maintained, and the processor calculates the H matrix corresponding to the video frame; and performs image warping processing according to the H matrix;
    若所述越界次数大于所述第一阈值,所述处理器计算所述视频帧新的裁切比 例,生成所述新的裁切比例下的初始视频帧;If the number of out-of-bounds times is greater than the first threshold, the processor calculates a new cropping ratio of the video frame, and generates an initial video frame at the new cropping ratio;
    所述处理器根据所述移动终端的运动强度变化确定各个所述视频帧的裁切比例;Determining, by the processor, a cropping ratio of each of the video frames according to changes in the motion intensity of the mobile terminal;
    所述处理器计算所述视频帧对应的H矩阵;Calculating the H matrix corresponding to the video frame by the processor;
    根据所述H矩阵进行图像扭曲处理。Image distortion processing is performed according to the H matrix.
  7. 根据权利要求6所述的方法,其特征在于,所述移动终端的摄像头采集的所述视频帧存储在存储器的缓存中。The method according to claim 6, wherein the video frame collected by the camera of the mobile terminal is stored in a buffer of a memory.
  8. 根据权利要求6所述的方法,其特征在于,所述运动数据包括:所述移动终端的加速度、角速度。The method according to claim 6, wherein the motion data comprises: acceleration and angular velocity of the mobile terminal.
  9. 根据权利要求6所述的方法,其特征在于,所述时间戳对齐为所述处理器使用样条插值将所述运动数据由离散值变为连续曲线;所述处理器对所述连续曲线进行非线性优化,得到不同所述连续曲线之间的时间差;所述处理器循环执行非线性优化,当所述时间差符合特定条件,所述循环结束。The method according to claim 6, wherein the time stamp alignment is such that the processor uses spline interpolation to change the motion data from a discrete value to a continuous curve; and the processor performs processing on the continuous curve. Non-linear optimization obtains the time difference between the different continuous curves; the processor performs the non-linear optimization in a loop, and when the time difference meets a specific condition, the loop ends.
  10. 根据权利要求6所述的方法,其特征在于,所述处理器根据所述旋转矢量对所述视频帧进行路径平滑。The method according to claim 6, wherein the processor performs path smoothing on the video frame according to the rotation vector.
  11. 根据权利要求10所述的方法,其特征在于,所述运动路径平滑为所述处理器计算所述运动数据中每两个相邻数据点的向量,并对所有数据点进行遍历;所述处理器去掉所述向量相同的两个所述相邻数据点中的一个;所述处理器去掉由所述运动数据组成的数据曲线中的拐点;所述处理器去掉所述所有数据点中两个可以直接通过的数据点之间的数据点。The method according to claim 10, wherein the motion path smoothing is that the processor calculates the vector of every two adjacent data points in the motion data, and traverses all the data points; the processing The processor removes one of the two adjacent data points with the same vector; the processor removes the inflection point in the data curve composed of the motion data; the processor removes two of the data points Data points between data points that can be passed directly.
  12. 根据权利要求6所述的方法,其特征在于,所述越界为经过裁切处理前的所述视频帧的部分像素在经过裁切处理后的所述视频帧中没有定义。The method according to claim 6, wherein the out-of-bounds means that some pixels of the video frame before the cropping process are not defined in the video frame after the cropping process.
  13. 根据权利要求6所述的方法,其特征在于,若所述越界次数大于所述第一阈值,所述移动终端的显示屏显示提示用户开启动态防抖的界面;The method according to claim 6, wherein if the number of cross-border times is greater than the first threshold, the display screen of the mobile terminal displays an interface prompting the user to enable dynamic anti-shake;
    所述显示屏接收所述用户的触摸操作,开启动态防抖。The display screen receives the user's touch operation to turn on dynamic anti-shake.
  14. 根据权利要求13所述的方法,其特征在于,所述动态防抖为所述处理器根据所述运动强度的变化,调整所述裁切比例。The method according to claim 13, wherein the dynamic anti-shake is that the processor adjusts the cropping ratio according to the change of the exercise intensity.
  15. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在移动终端上运行时,使得所述移动终端执行如权利要求6-14中任一项所述的方法。A computer-readable storage medium, comprising instructions, characterized in that, when the instructions are executed on a mobile terminal, the mobile terminal is caused to execute the method according to any one of claims 6-14.
PCT/CN2021/088267 2020-04-27 2021-04-20 Video processing method and mobile terminal WO2021218694A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010345609.8A CN113572993B (en) 2020-04-27 2020-04-27 Video processing method and mobile terminal
CN202010345609.8 2020-04-27

Publications (1)

Publication Number Publication Date
WO2021218694A1 true WO2021218694A1 (en) 2021-11-04

Family

ID=78157666

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/088267 WO2021218694A1 (en) 2020-04-27 2021-04-20 Video processing method and mobile terminal

Country Status (2)

Country Link
CN (1) CN113572993B (en)
WO (1) WO2021218694A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095659A (en) * 2021-11-29 2022-02-25 厦门美图之家科技有限公司 Video anti-shake method, device, equipment and storage medium
CN115242981A (en) * 2022-07-25 2022-10-25 维沃移动通信有限公司 Video playing method, video playing device and electronic equipment
CN116704046A (en) * 2023-08-01 2023-09-05 北京积加科技有限公司 Cross-mirror image matching method and device
CN116723382A (en) * 2022-02-28 2023-09-08 荣耀终端有限公司 Shooting method and related equipment

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116934654A (en) * 2022-03-31 2023-10-24 荣耀终端有限公司 Image ambiguity determining method and related equipment thereof
CN117714875A (en) * 2024-02-06 2024-03-15 博大视野(厦门)科技有限公司 End-to-end video anti-shake method based on deep neural network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007300581A (en) * 2006-05-08 2007-11-15 Casio Comput Co Ltd Moving image photographing apparatus and moving image photographing program
US20120081558A1 (en) * 2010-06-04 2012-04-05 Panasonic Corporation Image capture device, image generating method, and computer program thereof
US20120320227A1 (en) * 2011-06-10 2012-12-20 Tsuchida Yukitaka Imaging apparatus
CN104065876A (en) * 2013-03-22 2014-09-24 卡西欧计算机株式会社 Image processing device and image processing method
CN106454063A (en) * 2015-08-13 2017-02-22 三星电机株式会社 Shakiness correcting method and apparatus
CN106911889A (en) * 2015-09-15 2017-06-30 佳能株式会社 Image blur collection and slant correction equipment and its control method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5777599A (en) * 1992-02-14 1998-07-07 Oki Electric Industry Co., Ltd. Image generation device and method using dithering
JP5094550B2 (en) * 2008-05-20 2012-12-12 キヤノン株式会社 Imaging device
US8810666B2 (en) * 2012-01-16 2014-08-19 Google Inc. Methods and systems for processing a video for stabilization using dynamic crop
US10741286B2 (en) * 2015-05-27 2020-08-11 Ryozo Saito Stress evaluation program for mobile terminal and mobile terminal provided with program
CN110731077B (en) * 2018-03-23 2021-10-01 华为技术有限公司 Video image anti-shake method and terminal
CN110213479B (en) * 2019-04-30 2021-05-04 北京迈格威科技有限公司 Anti-shake method and device for video shooting
CN110602386B (en) * 2019-08-28 2021-05-14 维沃移动通信有限公司 Video recording method and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007300581A (en) * 2006-05-08 2007-11-15 Casio Comput Co Ltd Moving image photographing apparatus and moving image photographing program
US20120081558A1 (en) * 2010-06-04 2012-04-05 Panasonic Corporation Image capture device, image generating method, and computer program thereof
US20120320227A1 (en) * 2011-06-10 2012-12-20 Tsuchida Yukitaka Imaging apparatus
CN104065876A (en) * 2013-03-22 2014-09-24 卡西欧计算机株式会社 Image processing device and image processing method
CN106454063A (en) * 2015-08-13 2017-02-22 三星电机株式会社 Shakiness correcting method and apparatus
CN106911889A (en) * 2015-09-15 2017-06-30 佳能株式会社 Image blur collection and slant correction equipment and its control method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095659A (en) * 2021-11-29 2022-02-25 厦门美图之家科技有限公司 Video anti-shake method, device, equipment and storage medium
CN114095659B (en) * 2021-11-29 2024-01-23 厦门美图之家科技有限公司 Video anti-shake method, device, equipment and storage medium
CN116723382A (en) * 2022-02-28 2023-09-08 荣耀终端有限公司 Shooting method and related equipment
CN115242981A (en) * 2022-07-25 2022-10-25 维沃移动通信有限公司 Video playing method, video playing device and electronic equipment
CN116704046A (en) * 2023-08-01 2023-09-05 北京积加科技有限公司 Cross-mirror image matching method and device
CN116704046B (en) * 2023-08-01 2023-11-10 北京积加科技有限公司 Cross-mirror image matching method and device

Also Published As

Publication number Publication date
CN113572993A (en) 2021-10-29
CN113572993B (en) 2022-10-11

Similar Documents

Publication Publication Date Title
WO2021218694A1 (en) Video processing method and mobile terminal
WO2020187157A1 (en) Control method and electronic device
JP7391102B2 (en) Gesture processing methods and devices
WO2022068537A1 (en) Image processing method and related apparatus
WO2021179773A1 (en) Image processing method and device
WO2021052414A1 (en) Slow-motion video filming method and electronic device
WO2021027725A1 (en) Method for displaying page elements and electronic device
CN111669462B (en) Method and related device for displaying image
WO2021082815A1 (en) Display element display method and electronic device
WO2024016564A1 (en) Two-dimensional code recognition method, electronic device, and storage medium
US20230224574A1 (en) Photographing method and apparatus
CN111553846A (en) Super-resolution processing method and device
WO2023093169A1 (en) Photographing method and electronic device
CN111768352A (en) Image processing method and device
CN113938602A (en) Image processing method, electronic device, chip and readable storage medium
CN111524528B (en) Voice awakening method and device for preventing recording detection
CN113099146B (en) Video generation method and device and related equipment
WO2024032124A1 (en) Method for folding and unfolding scroll screen and related product
CN114422686A (en) Parameter adjusting method and related device
WO2022206589A1 (en) Image processing method and related device
WO2022228259A1 (en) Target tracking method and related apparatus
EP4329320A1 (en) Method and apparatus for video playback
EP4210312A1 (en) Photographing method and electronic device
WO2024067551A1 (en) Interface display method and electronic device
CN115150542B (en) Video anti-shake method and related equipment

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: 21797612

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21797612

Country of ref document: EP

Kind code of ref document: A1