A visible video camera screening method based on bidirectional detection in projection space
By performing bidirectional detection of the video camera and the main camera in the projection space, and using binary feature codes and bit operations to quickly filter out visible video cameras, solving the problem of inefficient fusion in the prior art, and achieving efficient fusion of video and three-dimensional scenes.
Patent Information
- Application Number
- CN202210029631.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-01-12
AI Technical Summary
In the fusion of video and three-dimensional scenes, it is difficult to quickly and accurately screen out visible video cameras, resulting in inefficient fusion.
The two-way detection method based on the projection space is adopted to perform forward and reverse detection of the video camera and the main camera. By transforming the vertex to the projection space, calculating the binary feature code and performing bit operations, the visible video camera is quickly filtered out.
Fast and accurate visible video camera screening is achieved, improving the efficiency of fusion between video and three-dimensional scenes.
Smart Images

Figure CN114598861B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of spatial information, and in particular relates to a visible video camera screening method based on projection space bidirectional detection. Background Art
[0002] For the display optimization of 3D scenes, many current works mainly rely on viewpoint-dependent algorithms to clip and simplify 3D models or terrains. In video-enhanced 3D scenes, the video needs to be decoded frame by frame and loaded into the GPU for fusion. The number of videos involved in the fusion has a great impact on the fusion efficiency. Therefore, it is not enough to just optimize the 3D model. The video data also needs to be optimized. However, there is little research on video cameras and their video data clipping, and there is not much related research work.
[0003] One optimization method is to let all video cameras participate in the fusion calculation. The rendering pipeline only performs texture mapping once in each cycle, that is, only one texture is rendered. If multiple textures are to be rendered, multiple rendering passes are required. This method is suitable for scenes with a small number of video cameras. Another optimization method is to group the video cameras. Since each group has fewer video cameras involved, the fusion efficiency can be improved. However, the grouping needs to be specified in advance, and the grouping results may not be completely consistent with the actual situation, which limits the application of this method. Therefore, how to efficiently screen visible video cameras is an effective means to improve fusion efficiency.
[0004] Among the methods for screening visible cameras, the method based on line of sight can only make judgments in one direction (line of sight direction), the method based on line of sight angle can only be used to eliminate cameras with poor fusion effects, and the method based on the view cone bounding box is too simple and rough, which may cause invisible video cameras to be incorrectly screened. Patent ZL201711057783.7 proposes a method for screening visible cameras by calculating the visible pixel ratio of the video camera's view cone. Although this method is relatively accurate, it involves a rasterization process and has a large amount of calculation. Therefore, a fast and accurate method for screening visible video cameras is the key to improving the fusion performance of video and three-dimensional scenes. Summary of the invention
[0005] Purpose of the invention: In view of the above-mentioned deficiencies in the prior art, the present invention proposes a visible video camera screening method based on two-way detection in projection space, which can automatically screen each video camera according to the field of view under the user's current viewpoint, and screen out visible video cameras with speed and accuracy.
[0006] Technical solution: The present invention proposes a visible video camera screening method based on two-way detection in projection space, which performs two-way detection on the video camera and the main camera in the projection space, including forward detection and reverse detection, and specifically includes the following steps:
[0007] (1) Perform forward detection on the video camera and main camera:
[0008] (1.1) Transform all vertices of the video camera frustum to the projection space of the main camera frustum;
[0009] (1.2) Calculate the six-bit binary feature code of all vertices of the video camera's viewing cone;
[0010] (1.3) Perform a bitwise “&” operation on the feature codes of all vertices of the video camera’s viewing cone to obtain the detection code CP1;
[0011] (1.4) If CP1 is not equal to 0, the video camera is not visible and exit; otherwise, continue with reverse detection;
[0012] (2) Reverse detection of the video camera and the main camera:
[0013] (2.1) Transform all vertices of the main camera's view frustum to the projection space of the video camera's view frustum;
[0014] (2.2) Calculate the six-bit binary feature codes of all vertices of the main camera's viewing cone;
[0015] (2.3) Perform a bitwise “&” operation on the feature codes of all vertices of the main camera’s viewing cone to obtain the detection code CP2;
[0016] (2.4) If CP2 is not equal to 0, the video camera is invisible, otherwise the video camera is visible and retained, completing the screening.
[0017] Furthermore, the encoding rule of the six-bit binary feature code P5P4P3P2P1P0 of the vertex is: suppose the transformed coordinates are (X, Y, Z, W), if X>W, then P0=1, otherwise P0=0; if Y>W, then P1=1, otherwise P1=0; if Z>W, then P2=1, otherwise P2=0; if X<-W, then P3=1, otherwise P3=0; if Y<-W, then P4=1, otherwise P4=0; if Z<-W, then P5=1, otherwise P5=0.
[0018] Furthermore, the bitwise "&" operation of the vertex feature code is a serial operation. In the forward detection, as long as the result of a certain bitwise "&" operation is 0, it is possible to directly jump to the reverse detection; in the reverse detection, as long as the result of a certain bitwise "&" operation is 0, it is possible to directly determine that the video camera is visible and terminate the screening in advance.
[0019] Furthermore, it is characterized in that the order of each bit of the six-bit binary feature code of the vertex is adjustable.
[0020] Beneficial effects: Compared with the prior art, the present invention has the following beneficial effects: the present invention utilizes the binary feature code after projection transformation and bit operation to achieve high screening efficiency, utilizes bidirectional detection to achieve screening accuracy, and improves the efficiency of video and three-dimensional fusion in video enhancement scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of the present invention;
[0022] Figure 2 This is the classification result diagram after frustum screening. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0024] The present invention provides a visible video camera screening method based on projection space bidirectional detection, which performs bidirectional detection on the video camera and the main camera, including forward detection and reverse detection. Figure 1 As shown, the specific steps are as follows:
[0025] (1) Perform forward detection on the video camera and main camera:
[0026] (1.1) Transform all vertices of the video camera frustum to the projection space of the main camera frustum;
[0027] Get the main camera's observation matrix V and projection matrix P, and then calculate all the frustum vertices V of the video camera i (i=0..7) is transformed, and the transformed vertex is defined as TV i (i=0..7)
[0028] VP=P*V
[0029] TV i =VP*V i
[0030] (1.2) Calculate the six-bit binary feature codes of all vertices of the video camera's viewing cone:
[0031] The encoding rule of the six-bit binary feature code P5P4P3P2P1P0 of the vertex is: suppose the transformed coordinates are (X,Y,Z,W), if X>W, then P0=1, otherwise P0=0; if Y>W, then P1=1, otherwise P1=0; if Z>W, then P2=1, otherwise P2=0; if X<-W, then P3=1, otherwise P3=0; if Y<-W, then P4=1, otherwise P4=0; if Z<-W, then P5=1, otherwise P5=0.
[0032] definition:
[0033] CLIP_RIGHT=1<<0, CLIP_TOP=1<<1,
[0034] CLIP_FAR=1<<2, CLIP_LEFT=1<<3,
[0035] CLIP_BOTTOM=1<<4,CLIP_NEAR=1<<5
[0036] Then each vertex V i The calculation method of the feature code ClipFlag[i] is as follows:
[0037] ClipFlag[i]=((TV i .x>TV i .w)? CLIP_RIGHT:0)|((TV i .y>TV i .w)? CLIP_TOP:0)|
[0038] ((TV i .z>TV i .w)? CLIP_FAR:0)|((TV i .x<-TV i .w)? CLIP_LEFT:0)|
[0039] ((TV i .y<-TV i .w)? CLIP_BOTTOM:0)|((TV i .z<-TV i .w)? CLIP_NEAR:0)
[0040] The order of each bit of the six-bit binary feature code of the vertex can be adjusted.
[0041] (1.3) Perform the bitwise “&” operation on the feature codes of all vertices to obtain the detection code CP1; as long as the result of a certain “&” operation is 0, it can directly jump to the reverse detection.
[0042] CP1=ClipFlag[0]&ClipFlag[1]&ClipFlag[2]
[0043] &ClipFlag[3]&ClipFlag[4]&ClipFlag[5]&ClipFlag[6]&ClipFlag[7].
[0044] (1.4) If CP1 is not equal to 0, the video camera is not visible and exit; otherwise, continue reverse detection.
[0045] (2) Perform reverse detection on the video camera and the main camera.
[0046] (2.1) Transform all vertices of the main camera frustum to the projection space of the video camera frustum.
[0047] (2.2) Calculate the characteristic codes of all vertices according to the method in (1.2).
[0048] (2.3) Perform a bitwise “&” operation on the feature codes of all vertices to obtain the detection code CP2; as long as the result of a certain “&” operation is 0, it can be directly determined that the video camera is visible, retained, and the screening is terminated early.
[0049] (2.4) If CP2 is not equal to 0, the video camera is not visible, otherwise the video camera is visible and retained, completing the screening, such as Figure 2 shown.
Claims
1. A visible video camera screening method based on projection space bidirectional detection, characterized in that: The video camera and the main camera are bidirectionally detected in the projection space, including forward detection and reverse detection, which specifically includes the following steps: (1) Perform forward detection on the video camera and main camera: (1.1) Transform all vertices of the video camera frustum to the projection space of the main camera frustum: Get the main camera's observation matrix V and projection matrix P, and then calculate all the frustum vertices V of the video camera i Perform the transformation and define the transformed vertex as TV i : VP=P*V TV i =VP*V i Wherein, i=0...7; (1.2) Calculate the six-bit binary feature code of all vertices of the video camera's viewing cone: The encoding rule of the six-bit binary feature code P5P4P3P2P1P0 of the vertex is: let the transformed coordinates be (X, Y, Z, W), if X>W, then P0=1, otherwise P0=0; if Y>W, then P1=1, otherwise P1=0; if Z>W, then P2=1, otherwise P2=0; if X<-W, then P3=1, otherwise P3=0; if Y<-W, then P4=1, otherwise P4=0; if Z<-W, then P5=1, otherwise P5=0; (1.3) Perform a bitwise "&" operation on the feature codes of all vertices of the video camera's viewing cone to obtain the detection code CP1; (1.4) If CP1 is not equal to 0, the video camera is not visible and exit; otherwise, continue with reverse detection; (2) Reverse detection of the video camera and the main camera: (2.1) Transform all vertices of the main camera's view frustum to the projection space of the video camera's view frustum; (2.2) Calculate the six-bit binary feature codes of all vertices of the main camera's viewing cone; (2.3) Perform a bitwise "&" operation on the feature codes of all vertices of the main camera's viewing cone to obtain the detection code CP2; (2.4) If CP2 is not equal to 0, the video camera is invisible, otherwise the video camera is visible and retained, completing the screening.
2. The visible video camera screening method based on projection space bidirectional detection according to claim 1 is characterized in that: The bitwise "&" operation of the vertex feature code is a serial operation. In the forward detection, as long as the result of a certain bitwise "&" operation is 0, it can directly jump to the reverse detection; in the reverse detection, as long as the result of a certain bitwise "&" operation is 0, it can be directly determined that the video camera is visible and the screening is terminated in advance.
3. The visible video camera screening method based on projection space bidirectional detection according to claim 1 is characterized in that: The order of each bit of the six-bit binary feature code of the vertex is adjustable.
Citation Information
Patent Citations
Optimization method for video enhancement scene
CN107888897A
Virtual and actual reality integration method of multiple video streams and three-dimensional scene
CN104599243A
Method for fusing multiple paths of videos and three-dimensional GIS scene
CN110659385A