Video fusion method, device, equipment, and storage medium

By acquiring video data and shooting parameters, calculating motion trajectories and postures, the precise fusion of video and three-dimensional space is achieved, which solves the problem of large deviations in the fusion of video and three-dimensional space information in the existing technology, and improves accuracy and efficiency.

CN112489121BActive Publication Date: 2024-10-22丰图科技(深圳)有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201910857230.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-11
Publication Date
2024-10-22
Estimated Expiration
2039-09-11

AI Technical Summary

Technical Problem

Existing positioning algorithms are based on two-dimensional or three-dimensional spatial information platforms without video fusion, and cannot accurately determine the coordinates of moving targets, resulting in large deviations and low accuracy in the fusion of video and three-dimensional spatial information.

Method used

By obtaining the video data and its shooting parameters, the motion trajectory and posture are calculated, loaded into the three-dimensional space scene, the initial coordinates are obtained, and the projection coordinates are adjusted to achieve precise integration of the video and the three-dimensional space.

Benefits of technology

It improves the accuracy and efficiency of the fusion of video and three-dimensional space information, ensures the accurate determination of moving target coordinates, and enhances the information content of video images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112489121B_ABST
    Figure CN112489121B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a video fusion method, device, equipment and computer-readable storage medium. The embodiment of the present application obtains video data and shooting parameters corresponding to the video data; obtains the motion trajectory and motion posture corresponding to the video data according to the shooting parameters; obtains a three-dimensional space scene, and loads the video data in the three-dimensional space scene according to the motion trajectory and motion posture to obtain the initial coordinates corresponding to the video data; calculates the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and video data; adjusts the initial coordinates according to the projection coordinates to obtain the adjusted coordinates; and fuses the video data with the three-dimensional space scene according to the adjusted coordinates. The fusion of motion video and three-dimensional scene is achieved, and the accuracy and efficiency of obtaining the specific position in the video data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a video fusion method, device, equipment and storage medium. Background Art

[0002] At present, the usual positioning algorithm research is based on a two-dimensional or three-dimensional space information platform without video fusion. However, in practical applications, it is necessary not only to determine the coordinates of the moving target, but also to know the specific space of the moving target for positioning and tracking. However, based on a two-dimensional or three-dimensional space information platform without video fusion, the coordinates of the moving target cannot be determined, resulting in large deviations in the fusion of video and three-dimensional space information and very low accuracy. Summary of the invention

[0003] The embodiments of the present application provide a video fusion method, apparatus, device and storage medium, which can determine the coordinates of a moving target, thereby improving the accuracy and precision of the fusion.

[0004] In a first aspect, an embodiment of the present application provides a video fusion method, including:

[0005] Acquire video data, and acquire shooting parameters corresponding to the video data;

[0006] Acquire the motion trajectory and motion posture corresponding to the video data according to the shooting parameters;

[0007] Acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data;

[0008] Calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data;

[0009] Adjusting the initial coordinates according to the projection coordinates to obtain adjusted coordinates;

[0010] The video data is fused with the three-dimensional space scene according to the adjusted coordinates.

[0011] In some implementations, the shooting parameters include angle and posture, and obtaining the shooting parameters corresponding to the video data includes:

[0012] Get the initial geographic coordinates and initial angle attitude;

[0013] Acquire a sequence of images of the video data;

[0014] Extract feature points of adjacent sequence images;

[0015] Acquire a basic matrix of adjacent sequence images according to the feature points;

[0016] Fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix;

[0017] The initial angle posture is adjusted by the fused matrix to obtain the angle posture, and the initial geographic coordinates are adjusted by the fused matrix to obtain the adjusted geographic coordinates.

[0018] In some implementations, the shooting parameters further include camera internal parameters and camera external parameters, and calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data includes:

[0019] Acquire a video frame of the video data, and acquire initial pixel coordinates of the video frame;

[0020] Performing distortion correction on the video frame based on the initial pixel coordinates of the video frame to obtain pixel coordinates of the video frame;

[0021] Based on the pixel coordinates and the internal parameters of the camera, obtaining the camera coordinates corresponding to the video data through coordinate conversion;

[0022] The projection coordinates of the video data in the three-dimensional space scene are obtained according to the camera external parameters and the camera coordinates.

[0023] In some implementations, the shooting parameters include positioning time, and after fusing the video data with the three-dimensional space scene according to the adjusted coordinates, the method further includes:

[0024] Obtain the 3D rendering frame rate and the video frame rate in the video data;

[0025] Matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain a matched time;

[0026] Moving the projection coordinates according to the motion trajectory data, the angle posture and the matched time;

[0027] The video data is fused with the three-dimensional space scene according to the moved projection coordinates.

[0028] In some implementations, matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain the matched time includes:

[0029] Obtaining a 3D rendering frame rate, and setting the 3D rendering frame rate as a video frame rate;

[0030] Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate;

[0031] Acquire the video time according to the video frame rate;

[0032] The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the video time, the rendering time of the three-dimensional space and the positioning time to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0033] In some implementations, matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain the matched time includes:

[0034] Setting the 3D rendering frame rate to a preset value;

[0035] Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate;

[0036] Calculating the playback time of the video data according to the rendering time of the three-dimensional space;

[0037] The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the rendering time, the playing time and the positioning time of the three-dimensional space to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0038] In some implementations, after fusing the video data with the three-dimensional space scene according to the adjusted coordinates, the method further includes:

[0039] Receive split-screen display instructions;

[0040] According to the split-screen display instruction, the video data and the fused three-dimensional space scene are displayed separately.

[0041] In a second aspect, the embodiment of the present application further provides a video fusion device, including:

[0042] A first acquisition unit is used to acquire video data and shooting parameters corresponding to the video data; acquire a motion trajectory and a motion posture corresponding to the video data according to the shooting parameters; acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture to obtain initial coordinates corresponding to the video data;

[0043] A calculation unit, configured to calculate the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data;

[0044] An adjustment unit, configured to adjust the initial coordinates according to the projection coordinates to obtain adjusted coordinates;

[0045] The first fusion unit is used to fuse the video data with the three-dimensional space scene according to the adjusted coordinates.

[0046] In some implementations, the first acquisition unit includes:

[0047] A first acquisition subunit is used to acquire initial geographic coordinates and initial angle posture; and acquire a sequence of images of the video data;

[0048] An extraction subunit, used to extract feature points of adjacent sequence images;

[0049] A second acquisition subunit is used to acquire a basic matrix of adjacent sequence images according to the feature points;

[0050] A fusion subunit, used for fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix;

[0051] The adjustment subunit is used to adjust the initial angle posture through the fused matrix to obtain the angle posture, and to adjust the initial geographic coordinates through the fused matrix to obtain adjusted geographic coordinates.

[0052] In some embodiments, the computing unit comprises:

[0053] A third acquisition subunit, used to acquire a video frame of the video data and to acquire initial pixel coordinates of the video frame;

[0054] A correction subunit, configured to perform distortion correction on the video frame based on the initial pixel coordinates of the video frame to obtain pixel coordinates of the video frame;

[0055] A fourth acquisition subunit, configured to acquire the camera coordinates corresponding to the video data through coordinate conversion based on the pixel coordinates and the camera internal parameters;

[0056] The fifth acquisition subunit is used to acquire the projection coordinates of the video data in the three-dimensional space scene according to the camera external parameters and the camera coordinates.

[0057] In some implementations, the video fusion device further includes:

[0058] A second acquisition unit, used to acquire a 3D rendering frame rate and a video frame rate in the video data;

[0059] A matching unit, used for matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate and the positioning time to obtain a matched time;

[0060] A moving unit, used for moving the projection coordinates according to the motion trajectory data, angle posture and matched time;

[0061] The second fusion unit is used to fuse the video data with the three-dimensional space scene according to the moved projection coordinates.

[0062] In some embodiments, the matching unit comprises:

[0063] A sixth acquisition subunit is used to acquire a 3D rendering frame rate, and set the 3D rendering frame rate as a video frame rate; acquire a corresponding 3D space rendering time according to the 3D rendering frame rate; and acquire the video time according to the video frame rate;

[0064] The first matching subunit is used to match the video time, the rendering time of the three-dimensional space and the positioning time according to the video time, the rendering time of the three-dimensional space and the positioning time to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0065] In some embodiments, the matching unit comprises:

[0066] A setting subunit, used to set the 3D rendering frame rate to a preset value;

[0067] A seventh acquisition subunit, configured to acquire a corresponding rendering time of the three-dimensional space according to the three-dimensional rendering frame rate;

[0068] A calculation subunit, used for calculating the playback time of the video data according to the rendering time of the three-dimensional space;

[0069] The second matching subunit is used to match the video time, the rendering time of the three-dimensional space and the positioning time according to the rendering time, the playing time and the positioning time of the three-dimensional space to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0070] In some implementations, the video fusion device further includes:

[0071] A receiving unit, used for receiving a split-screen display instruction;

[0072] The display unit is used to display the video data and the fused three-dimensional space scene respectively according to the split-screen display instruction.

[0073] In a third aspect, an embodiment of the present application further provides a device, comprising a processor and a memory, wherein the memory stores program code, and when the processor calls the program code in the memory, the video fusion method described above is executed.

[0074] In a fourth aspect, an embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and the program is loaded by a processor to execute the video fusion method as described above.

[0075] The embodiment of the present application obtains video data, wherein the video data is motion video data, and obtains shooting parameters corresponding to the video data; obtains the motion trajectory and motion posture corresponding to the video data according to the shooting parameters; obtains a three-dimensional space scene, and loads the video data in the three-dimensional space scene according to the motion trajectory and the motion posture, and obtains the initial coordinates corresponding to the video data, without the need to construct a three-dimensional space scene, thereby improving the efficiency of loading the video data; calculates the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data, thereby determining the coordinates of the moving target in the video data, and adjusts the initial coordinates according to the projection coordinates to obtain the adjusted coordinates; merges the video data with the three-dimensional space scene according to the adjusted coordinates, thereby accurately mapping the motion video data to a real three-dimensional scene, and rendering it in an integrated manner with other geographic space data; and maps the geographic elements of the three-dimensional space scene to the video data, thereby enhancing the information of the video image, and since the efficiency of loading the video data is improved, the efficiency of the video and the three-dimensional space scene is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0077] Figure 1 It is a flowchart of the video fusion method provided in the embodiment of the present application;

[0078] Figure 2 is a structural schematic diagram of a video fusion device provided in an embodiment of the present application;

[0079] Figure 3 It is a schematic diagram of the structure of the device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0081] See also Figure 1 , Figure 1 : is a flowchart of a video fusion method provided in an embodiment of the present application. The execution subject of the video fusion method may be a video fusion device provided in an embodiment of the present application, or a device integrated with the video fusion device, such as a terminal or a server, etc. The device may be a smart phone, a tablet computer, a PDA, or a laptop computer, a fixed computer, and a server, etc., equipped with a camera head and an IMU (Inertial measurement unit). The video fusion method may include:

[0082] S101, obtaining video data, and obtaining shooting parameters corresponding to the video data.

[0083] Specifically, in this embodiment, the video data can be obtained by shooting with a shooting device installed on a transportation vehicle, such as shooting with a shooting device installed on a tricycle, a bus, or a two-wheeled electric vehicle, or by shooting with a handheld shooting device, such as shooting with a mobile phone, and obtaining video data, which is not limited here. Then, the shooting parameters corresponding to the video data are obtained, wherein the shooting parameters corresponding to the video data are the parameters collected by the shooting device corresponding to the video data, including the positioning time, positioning coordinates, and angle attitude, etc. collected by the IMU (Inertial measurement unit) and GPS (Global Positioning System) in the shooting device.

[0084] Specifically, when the shooting parameters include an angle posture, the process of acquiring the angle posture may include:

[0085] Get the initial geographic coordinates and initial angle attitude;

[0086] Acquire a sequence of images of the video data;

[0087] Extract feature points of adjacent sequence images;

[0088] Acquire a basic matrix of adjacent sequence images according to the feature points;

[0089] Fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix;

[0090] The initial angle posture is adjusted by the fused matrix to obtain the angle posture, and the initial geographic coordinates are adjusted by the fused matrix to obtain the adjusted geographic coordinates.

[0091] The initial geographic coordinates and initial angle attitude are obtained, wherein the initial angle attitude is the angle attitude obtained by collecting through the IMU, and the initial geographic coordinates are the actual positioning coordinates when the shooting module is shooting. Then, the sequence images of the video data are further obtained, and the feature points of adjacent sequence images are extracted. Specifically, the feature points can be extracted through the SURF feature extraction method, and the basic matrix of the adjacent sequence images is obtained according to the epipolar geometry principle and the feature points. The basic matrix is ​​fused with the motion matrix corresponding to the motion trajectory to obtain a fused matrix, wherein the motion matrix corresponding to the motion trajectory is the motion matrix obtained by the IMU, and then the initial angle attitude is adjusted through the fused matrix to obtain the angle attitude, and the initial geographic coordinates are adjusted through the fused matrix to obtain the adjusted geographic coordinates, thereby realizing the precision correction of the geographic coordinates and angle attitude, obtaining a more precise angle attitude, and making the subsequent video fusion more precise.

[0092] S102: Acquire a motion trajectory and a motion posture corresponding to the video data according to the shooting parameters.

[0093] Specifically, the motion trajectory corresponding to the video data is the motion trajectory of the moving target in the video data. According to the positioning coordinates of the moving target at each moment, the displacement, velocity and acceleration of the moving target in three directions are obtained, where the three directions are the directions on the X-axis, Y-axis and Z-axis, so as to construct the motion trajectory of the moving target according to the displacement, velocity and acceleration of the moving target in three directions. The motion posture is the positioning time, positioning coordinates and acceleration etc. acquired by the IMU.

[0094] S103, acquiring a three-dimensional space scene, and loading the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data.

[0095] Acquire a three-dimensional space scene, and load digital terrain, aerial images or satellite images, three-dimensional building models, road models, vector points, lines, surfaces, etc. in the three-dimensional space scene. The three-dimensional space model can be a pre-established three-dimensional virtual space scene. Specifically, it can be based on the collected scene or model, which can specifically include aerial images or satellite images, three-dimensional building models, road models, vector points, lines, surfaces, etc., and merge with the three-dimensional model to obtain a three-dimensional virtual space scene. Then, according to the motion trajectory and motion posture, the video data is loaded in the three-dimensional space scene to form a target three-dimensional space scene with initial spatial coordinates. The loading method can be online real-time loading through the GB28281 protocol, or it can be loaded offline, which is not limited here.

[0096] S104: Calculate projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data.

[0097] The shooting parameters may include camera external parameters and camera internal parameters, that is, the projection coordinates of the video data in the three-dimensional space scene may be calculated based on the camera internal parameters and external parameters, as well as the image in the video data.

[0098] Specifically, step S104 may include:

[0099] Acquire a video frame of the video data, and acquire initial pixel coordinates of the video frame;

[0100] Performing distortion correction on the video frame based on the initial pixel coordinates of the video frame to obtain pixel coordinates of the video frame;

[0101] Based on the pixel coordinates and the internal parameters of the camera, obtaining the camera coordinates corresponding to the video data through coordinate conversion;

[0102] The projection coordinates of the video data in the three-dimensional space scene are obtained according to the camera external parameters and the camera coordinates.

[0103] First, each video frame in the video data is obtained. Specifically, the video data can be converted from an electrical signal to an image signal in a compressed state, and the compressed image signal is further decompressed to obtain the video frame. Then, the upper left corner of the video frame is taken as the origin, and a coordinate system is established in pixels to obtain the initial pixel coordinates of each pixel point in the video frame. Due to the deviation of the camera manufacturing process, the refraction error of the incident light when passing through each lens, and the CCD (Charge-coupled Device) dot position error, the actual optical system has nonlinear geometric distortion, so that there are multiple geometric distortions between the target image point and the theoretical image point. Therefore, it is necessary to perform distortion correction on the video frame to obtain the original distortion map, and further obtain the pixel coordinates of the original distortion map. Specifically, the lens distortion coefficient and the distortion model in the internal parameters of the camera are obtained, and the initial pixel coordinates are adjusted by the distortion model and the lens distortion coefficient to obtain the pixel coordinates. Then, based on the pixel coordinates and the camera internal parameters, the camera coordinates corresponding to the video data are obtained through coordinate conversion. Specifically, based on the camera internal parameters, the camera coordinates corresponding to the video data are obtained through the corresponding conversion relationship. The specific conversion relationship is: u-u0=fs x x / z=f x x / z,v-v0=fs y y / z=f y y / z, where fs x= f x ,fs y= f y , are defined as the effective focal lengths in the X and Y directions, respectively, and f x 、f y is the camera internal parameter, u 0 、v 0 The pixel coordinate origin is further combined with the lens distortion coefficient (k, s, p) to obtain the camera coordinates. Then, according to the camera external parameters and the camera coordinates, the projection coordinates of the video data in the three-dimensional space scene are obtained. Specifically, the conversion relationship is: Where T is the coordinate of the origin of the projection coordinate system in the camera coordinate system, and the matrix R is the orthogonal rotation matrix. R satisfies the constraint r 11 2 +r 12 2 +r 13 2 =1, r 21 2 +r 22 2 +r 23 2 =1, r 31 2 +r 322 +r 33 2 =1, R and t x ,t y , t z are the camera extrinsic parameters.

[0104] The reference point coordinates (x, y, z) and image coordinates (u, v) in the video frame are used to determine the geometric and optical properties inside the camera (internal parameters) and the coordinate relationship of the camera in the three-dimensional world (external parameters). The internal parameters include the lens distortion coefficients (k, s, p) and the image coordinate origin (u 0 , v 0 ) etc. The external parameters include the orthogonal rotation matrix R of the camera coordinate system relative to the world coordinate system and the translation vector t and other parameters.

[0105] S105: Adjust the initial coordinates according to the projection coordinates to obtain adjusted coordinates.

[0106] The initial coordinates are adjusted according to the calculated projection coordinates, for example, the coordinate values ​​of the initial coordinates are adjusted to the coordinate values ​​of the projection coordinates, and the coordinate values ​​of the initial coordinates are moved accordingly to obtain the adjusted coordinates.

[0107] S106: Fusing the video data with the three-dimensional space scene according to the adjusted coordinates.

[0108] According to the adjusted coordinates, the video data and the three-dimensional space scene are matched and then fused, thereby fusing the video data with the three-dimensional space scene. Furthermore, after the video data and the three-dimensional space scene are fused, the fused three-dimensional space scene can be displayed. The specific display method may include displaying the fused three-dimensional space scene separately, or displaying it in split screen, that is, displaying the video data and the fused three-dimensional space scene separately on the screen. When displaying in split screen, it can be displayed synchronously according to time, that is, the specific scene between the displayed video data and the fused three-dimensional space scene is corresponding. For example, assuming that the picture of the displayed video data is a house, the picture of the fused three-dimensional space scene displayed is also a house. In the specific implementation process, the video image can also be dynamically projected onto the surface of the scene model, or the video image moves in the three-dimensional scene according to the trajectory, the three-dimensional scene camera moves along the camera trajectory, and plays the video, locks the video scene, and reversely fuses the three-dimensional scene on the video for display.

[0109] Furthermore, since the video data may be a video collected in real time, real-time fusion may be performed. Specifically, after step 106, the following steps may be further performed:

[0110] Obtain the 3D rendering frame rate and the video frame rate in the video data;

[0111] Matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain a matched time;

[0112] Moving the projection coordinates according to the motion trajectory data, the angle posture and the matched time;

[0113] The video data is fused with the three-dimensional space scene according to the moved projection coordinates.

[0114] Obtain the three-dimensional rendering rate and the video frame rate in the video data, wherein the three-dimensional rendering rate refers to the number of frames of the picture refreshed per second when displaying the fused three-dimensional space scene, and the video frame rate refers to the number of frames of the picture refreshed per second when playing the video. Match the rendering time of the three-dimensional space corresponding to the three-dimensional rendering rate, the video time corresponding to the video frame rate and the positioning time to obtain the matched time; that is, synchronize the rendering time, video time and positioning time of the three-dimensional space, specifically, the three-dimensional rendering frame rate can be used as a benchmark for time matching, or the video frame rate can be used as a benchmark for time matching. Then, according to the motion trajectory data, the angle posture and the matched time, move the projection coordinates, that is, according to the update of the video, including the time update, the motion trajectory update and the angle posture update, move the projection coordinates, and fuse the video data with the three-dimensional space scene according to the moved projection coordinates, so as to fuse the video data with the three-dimensional space scene in real time, and realize the real-time positioning and tracking of the moving target in the video data.

[0115] Specifically, when the video frame rate is used as a reference for time matching, the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate and the positioning time are matched to obtain the matched time, and the process includes:

[0116] Obtaining a 3D rendering frame rate, and setting the 3D rendering frame rate as a video frame rate;

[0117] Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate;

[0118] Acquire the video time according to the video frame rate;

[0119] The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the video time, the rendering time of the three-dimensional space and the positioning time to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0120] Specifically, a 3D rendering frame rate is obtained, that is, an initial 3D rendering frame rate is obtained, wherein the initial 3D rendering frame rate may be a general playback frame rate or 0, and then the obtained initial 3D rendering frame rate is set to the video frame rate, that is, the initial 3D rendering frame rate is set to the same value as the video frame rate, and then the corresponding 3D space rendering time, that is, the number of images played per second, is obtained through the 3D rendering frame rate, and then the video time is obtained according to the video frame rate. Similarly, the video time is the number of video images played per second, and the video time, the 3D space rendering time and the positioning time are matched according to the video time, the 3D space rendering time and the positioning time to obtain the matched video time, the 3D space rendering time and the positioning time. Since the initial 3D rendering frame rate is set to the same value as the video frame rate, the video time and the 3D space rendering time are consistent. At this time, it is only necessary to match the video time with the positioning time. Specifically, the positioning time for starting shooting is matched with the video time. For example, assuming that the video shooting starts from 2 seconds, 2 seconds in the positioning time are matched with 1 second in the video time, so as to achieve the matching of the video time, the 3D space rendering time and the positioning time.

[0121] Specifically, when the 3D rendering frame rate is used as a reference for time matching, the rendering time of the 3D space corresponding to the 3D rendering frame rate, the video time corresponding to the video frame rate and the positioning time are matched to obtain the matched time, and the process includes:

[0122] Setting the 3D rendering frame rate to a preset value;

[0123] Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate;

[0124] Calculating the playback time of the video data according to the rendering time of the three-dimensional space;

[0125] The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the rendering time, the playing time and the positioning time of the three-dimensional space to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0126] Specifically, the 3D rendering frame rate is set to a preset value, which can be set specifically according to user needs. For example, when the user is accustomed to playing at a relatively high speed, the video playback time is shorter due to the relatively high speed playback. At this time, the 3D rendering frame rate can be set to a higher value. Since the corresponding 3D space rendering time is obtained according to the set 3D rendering frame rate, the playback time of the video data is calculated according to the rendering time of the 3D space, so that the calculated playback time is shorter, that is, corresponding to the 3D rendering frame rate set by the user. For example, assuming that at a normal speed of 1.0, the video playback time is one hour, and at a speed of 1.5, it only takes 40 minutes to complete the playback. Therefore, when the user is accustomed to playing at a relatively high speed, the playback time to be calculated is relatively short. At this time, the 3D rendering frame rate can be set to a higher value, so that the calculated playback time is relatively short, which matches the user's habits. Specifically, according to receiving a preset value, the three-dimensional rendering frame rate is set according to the received preset value, and then the set three-dimensional rendering frame rate obtains the rendering time of the corresponding three-dimensional space, and the playback time of the video data is calculated according to the rendering time of the three-dimensional space. Specifically, the playback time of the video data can be calculated according to the size of the video data and the rendering time of the three-dimensional space, and the video time, the rendering time of the three-dimensional space and the positioning time are matched according to the rendering time, playback time and positioning time of the three-dimensional space to obtain the matched video time, rendering time and positioning time of the three-dimensional space. For details, please refer to the matching process when using the video frame rate as a benchmark for time matching, which will not be repeated here.

[0127] This embodiment obtains video data, wherein the video data is motion video data, and obtains shooting parameters corresponding to the video data; obtains the motion trajectory and motion posture corresponding to the video data according to the shooting parameters; obtains a three-dimensional space scene, and loads the video data in the three-dimensional space scene according to the motion trajectory and the motion posture to obtain the initial coordinates corresponding to the video data, without the need to construct a three-dimensional space scene, thereby improving the efficiency of loading video data; calculates the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data, thereby determining the coordinates of the moving target in the video data, and adjusts the initial coordinates according to the projection coordinates to obtain the adjusted coordinates; merges the video data with the three-dimensional space scene according to the adjusted coordinates, thereby accurately mapping the motion video data to a real three-dimensional scene, and rendering it in an integrated manner with other geographic space data; and maps the geographic elements of the three-dimensional space scene to the video data, thereby enhancing the information of the video image, and since the efficiency of loading the video data is improved, the efficiency of the video and the three-dimensional space scene is improved.

[0128] In order to better implement the video fusion method provided in the embodiment of the present application, the embodiment of the present application also provides a video fusion device based on the above. The meanings of the terms are the same as those in the above video fusion method, and the specific implementation details can refer to the description in the method embodiment.

[0129] See also Figure 2 , Figure 2 A schematic diagram of the structure of a video fusion device provided in an embodiment of the present application, wherein the object-video fusion device may include a first acquisition unit 201, a calculation unit 202, an adjustment unit 203, and a first fusion unit 204, etc.

[0130] Specifically, the video fusion device includes:

[0131] The first acquisition unit 201 is used to acquire video data and acquire shooting parameters corresponding to the video data; acquire a motion trajectory and a motion posture corresponding to the video data according to the shooting parameters; acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture to obtain initial coordinates corresponding to the video data;

[0132] A calculation unit 202, configured to calculate the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data;

[0133] An adjustment unit 203, configured to adjust the initial coordinates according to the projection coordinates to obtain adjusted coordinates;

[0134] The first fusion unit 204 is configured to fuse the video data with the three-dimensional space scene according to the adjusted coordinates.

[0135] In some implementations, the first acquiring unit 201 includes:

[0136] A first acquisition subunit is used to acquire initial geographic coordinates and initial angle posture;

[0137] An extraction subunit, used to extract feature points of adjacent sequence images;

[0138] A second acquisition subunit is used to acquire a basic matrix of adjacent sequence images according to the feature points;

[0139] A fusion subunit, used for fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix;

[0140] The adjustment subunit is used to adjust the initial angle posture through the fused matrix to obtain the angle posture, and to adjust the initial geographic coordinates through the fused matrix to obtain adjusted geographic coordinates.

[0141] In some implementations, the computing unit 202 includes:

[0142] A third acquisition subunit, used to acquire a video frame of the video data and to acquire initial pixel coordinates of the video frame;

[0143] A correction subunit, configured to perform distortion correction on the video frame based on the initial pixel coordinates of the video frame to obtain pixel coordinates of the video frame;

[0144] A fourth acquisition subunit, configured to acquire the camera coordinates corresponding to the video data through coordinate conversion based on the pixel coordinates and the camera internal parameters;

[0145] The fifth acquisition subunit is used to acquire the projection coordinates of the video data in the three-dimensional space scene according to the camera external parameters and the camera coordinates.

[0146] In some implementations, the video fusion device further includes:

[0147] A second acquisition unit, used to acquire a 3D rendering frame rate and a video frame rate in the video data;

[0148] A matching unit, used for matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate and the positioning time to obtain a matched time;

[0149] A moving unit, used for moving the projection coordinates according to the motion trajectory data, angle posture and matched time;

[0150] The second fusion unit is used to fuse the video data with the three-dimensional space scene according to the moved projection coordinates.

[0151] In some embodiments, the matching unit comprises:

[0152] A sixth acquisition subunit is used to acquire a 3D rendering frame rate, and set the 3D rendering frame rate as a video frame rate; acquire a corresponding 3D space rendering time according to the 3D rendering frame rate; and acquire the video time according to the video frame rate;

[0153] The first matching subunit is used to match the video time, the rendering time of the three-dimensional space and the positioning time according to the video time, the rendering time of the three-dimensional space and the positioning time to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0154] In some embodiments, the matching unit comprises:

[0155] A setting subunit, used to set the 3D rendering frame rate to a preset value;

[0156] A seventh acquisition subunit, configured to acquire a corresponding rendering time of the three-dimensional space according to the three-dimensional rendering frame rate;

[0157] A calculation subunit, used for calculating the playback time of the video data according to the rendering time of the three-dimensional space;

[0158] The second matching subunit is used to match the video time, the rendering time of the three-dimensional space and the positioning time according to the rendering time, the playing time and the positioning time of the three-dimensional space to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

[0159] In some implementations, the video fusion device further includes:

[0160] A receiving unit, used for receiving a split-screen display instruction;

[0161] The display unit is used to display the video data and the fused three-dimensional space scene respectively according to the split-screen display instruction.

[0162] The specific implementation of the above operations can be found in the first embodiment above, and will not be described in detail here.

[0163] Figure 3 The specific structural block diagram of the device provided in the embodiment of the present invention is shown, and the device is a video fusion device, which is specifically used to implement the video fusion method provided in the above embodiment. The device 400 can be a terminal such as a smart phone or a tablet computer, or a server.

[0164] like Figure 3 As shown, the device 400 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190. Those skilled in the art will understand that Figure 3 The structure of the device 400 shown in the figure does not constitute a limitation on the device 400, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0165] The RF circuit 110 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 110 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 110 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0166] The memory 120 can be used to store software programs and modules, such as the program instructions / modules of the video fusion method in the above embodiment. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120, that is, realizing the function of object volume calculation. The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 120 may further include a memory remotely arranged relative to the processor 180, and these remote memories may be connected to the device 400 via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0167] The input unit 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or a touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 131 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch-sensitive surface 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the input unit 130 may further include other input devices 132. Specifically, other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0168] The display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the device 400, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 131 may cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 3 In the embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to realize the input and output functions. However, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize the input and output functions.

[0169] The device 400 can help users send and receive emails, browse web pages, and access streaming media through the transmission module 170 (such as a Wi-Fi module), and it provides users with wireless broadband Internet access. Figure 3 The transmission module 170 is shown, but it is understandable that it is not a necessary component of the device 400 and can be omitted as needed without changing the essence of the invention.

[0170] The processor 180 is the control center of the device 400. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the device 400 and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.

[0171] The device 400 also includes a power supply 190 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0172] Specifically in this embodiment, the display unit 140 of the device 400 is a touch screen display, and the device 400 further includes a memory 120 and one or more programs, wherein the one or more programs are stored in the memory 120 and are configured to be executed by one or more processors 180. The one or more programs include instructions for performing the following operations:

[0173] Acquire video data, and acquire shooting parameters corresponding to the video data;

[0174] Acquire the motion trajectory and motion posture corresponding to the video data according to the shooting parameters;

[0175] Acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data;

[0176] Calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data;

[0177] Adjusting the initial coordinates according to the projection coordinates to obtain adjusted coordinates;

[0178] The video data is fused with the three-dimensional space scene according to the adjusted coordinates.

[0179] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the video fusion method above, and will not be repeated here.

[0180] A person skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a program, or by controlling related hardware through the program. The program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0181] To this end, an embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, which is loaded by a processor to execute the steps in any one of the video fusion methods provided in the embodiments of the present application. For example, the computer program may execute the following steps:

[0182] Acquire video data, and acquire shooting parameters corresponding to the video data;

[0183] Acquire the motion trajectory and motion posture corresponding to the video data according to the shooting parameters;

[0184] Acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data;

[0185] Calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data;

[0186] Adjusting the initial coordinates according to the projection coordinates to obtain adjusted coordinates;

[0187] The video data is fused with the three-dimensional space scene according to the adjusted coordinates.

[0188] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0189] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0190] Since the computer program stored in the storage medium can execute the steps in any one of the video fusion methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the video fusion methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0191] The above is a detailed introduction to a video fusion method, device, equipment and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A video fusion method, characterized in that: include: Acquire video data, and acquire shooting parameters corresponding to the video data; Acquire a motion trajectory and a motion posture corresponding to the video data according to the shooting parameters, wherein the motion trajectory corresponding to the video data is a motion trajectory of a moving target in the video data; Acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data; Calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data; Adjusting the initial coordinates according to the projection coordinates to obtain adjusted coordinates; fusing the video data with the three-dimensional space scene according to the adjusted coordinates; Wherein, the obtaining of shooting parameters corresponding to the video data includes: Get the initial geographic coordinates and initial angle attitude; Acquire a sequence of images of the video data; Extract feature points of adjacent sequence images; Acquire a basic matrix of adjacent sequence images according to the feature points; Fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix; The initial angle posture is adjusted by the fused matrix to obtain the angle posture, and the initial geographic coordinates are adjusted by the fused matrix to obtain the adjusted geographic coordinates.

2. The video fusion method according to claim 1, wherein the shooting parameters further include camera internal parameters and camera external parameters, wherein: The calculating the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data includes: Acquire a video frame of the video data, and acquire initial pixel coordinates of the video frame; Performing distortion correction on the video frame based on the initial pixel coordinates of the video frame to obtain pixel coordinates of the video frame; Based on the pixel coordinates and the internal parameters of the camera, obtaining the camera coordinates corresponding to the video data through coordinate conversion; The projection coordinates of the video data in the three-dimensional space scene are obtained according to the camera external parameters and the camera coordinates.

3. The video fusion method according to claim 1, wherein the shooting parameters include positioning time, After fusing the video data with the three-dimensional space scene according to the adjusted coordinates, the method further includes: Obtain the 3D rendering frame rate and the video frame rate in the video data; Matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain a matched time; Moving the projection coordinates according to the motion trajectory data, the angle posture and the matched time; The video data is fused with the three-dimensional space scene according to the moved projection coordinates.

4. The video fusion method according to claim 3, characterized in that: The step of matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain the matched time includes: Obtaining a 3D rendering frame rate, and setting the 3D rendering frame rate as a video frame rate; Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate; Acquire the video time according to the video frame rate; The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the video time, the rendering time of the three-dimensional space and the positioning time to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

5. The video fusion method according to claim 3, characterized in that: The step of matching the rendering time of the three-dimensional space corresponding to the three-dimensional rendering frame rate, the video time corresponding to the video frame rate, and the positioning time to obtain the matched time includes: Setting the 3D rendering frame rate to a preset value; Obtaining a corresponding three-dimensional space rendering time according to the three-dimensional rendering frame rate; Calculating the playback time of the video data according to the rendering time of the three-dimensional space; The video time, the rendering time of the three-dimensional space and the positioning time are matched according to the rendering time, the playing time and the positioning time of the three-dimensional space to obtain the matched video time, the rendering time of the three-dimensional space and the positioning time.

6. The video fusion method according to any one of claims 1 to 5, characterized in that: After fusing the video data with the three-dimensional space scene according to the adjusted coordinates, the method further includes: Receive split-screen display instructions; According to the split-screen display instruction, the video data and the fused three-dimensional space scene are displayed separately.

7. A video fusion device, characterized in that: include: A first acquisition unit is used to acquire video data and acquire shooting parameters corresponding to the video data; acquire a motion trajectory and a motion posture corresponding to the video data according to the shooting parameters; the motion trajectory corresponding to the video data is a motion trajectory of a moving target in the video data; Acquire a three-dimensional space scene, and load the video data into the three-dimensional space scene according to the motion trajectory and the motion posture, to obtain initial coordinates corresponding to the video data; A calculation unit, configured to calculate the projection coordinates of the video data in the three-dimensional space scene according to the shooting parameters and the video data; An adjustment unit, configured to adjust the initial coordinates according to the projection coordinates to obtain adjusted coordinates; A first fusion unit, configured to fuse the video data with the three-dimensional space scene according to the adjusted coordinates; Wherein, the obtaining of shooting parameters corresponding to the video data includes: Get the initial geographic coordinates and initial angle attitude; Acquire a sequence of images of the video data; Extract feature points of adjacent sequence images; Acquire a basic matrix of adjacent sequence images according to the feature points; Fusing the basic matrix with the motion matrix corresponding to the motion trajectory to obtain a fused matrix; The initial angle posture is adjusted by the fused matrix to obtain the angle posture, and the initial geographic coordinates are adjusted by the fused matrix to obtain the adjusted geographic coordinates.

8. A device, characterized in that The method comprises a processor and a memory, wherein the memory stores program codes, and the processor executes the video fusion method according to any one of claims 1 to 6 when calling the program codes in the memory.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded by a processor to execute the video fusion method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Digital full-space intelligent monitoring system and method

    CN101646067A

  • Real-time spatial positioning method for mobile monitoring target in geographical scene

    CN103226838A

  • Target positioning and tracking system and method based on video and three-dimensional spatial information registration fusion

    CN106204656A

  • Network real-time interaction live method and device based on three-dimensional virtual technology

    CN107801083A

  • AR stereoscopic display device with Inside-Out space positioning

    CN108022302A