Real scene twin system and method for image detection
By initializing the virtual environment in digital twin technology and updating it with real-time sensor data, it solves the problem that traditional three-dimensional visualization cannot reflect changes in real time, realizes the improvement of multi-perspective display and interactive functions, and meets the monitoring and management needs in complex scenarios. .
Patent Information
- Application Number
- CN202410839428.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-29
AI Technical Summary
Traditional three-dimensional visualization cannot reflect changes in the physical world in real time and cannot support complex predictive analysis and optimization. Existing digital twin technology can only provide a single perspective when monitoring and managing scenes, and its interactive functions are weak.
Obtain basic modeling data through the initialization unit, establish a static virtual environment, and combine real-time sensor data for texture map updates to provide command interaction functions. WebGL technology is used for 3D rendering and multi-view display to achieve real-time updates and multimedia of the static virtual environment. Streaming.
It provides a more complete scene display, enhances user interaction experience, meets multi-perspective requirements in complex scenes, and realizes real-time monitoring and management of actual scenes.
Smart Images

Figure CN118864580A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin technology, and in particular to a real-scene twin system and method for image detection. Background Art
[0002] Traditional 3D visualization visualizes 3D models, usually in a static manner based on pre-collected and processed data. As a result, the data is updated infrequently and cannot reflect changes in the physical world in real time. For application scenarios that require real-time detection and processing, traditional 3D visualization cannot provide real-time data support, making it impossible to perform complex predictive analysis and optimization.
[0003] Digital twin technology refers to the full use of physical models, sensor updates, operation history and other data, integrating multi-disciplinary, multi-physical quantity, multi-scale, and multi-probability simulation processes, completing mapping in virtual space, and thus reflecting the entire life cycle of the corresponding physical equipment.
[0004] When it is necessary to monitor or manage preset scenes, most existing technologies use traditional video surveillance or display systems (digital twins combined with three-dimensional visualization) for monitoring or on-site management, but the above technologies can only provide a single perspective, have weak display capabilities, and have fewer functions for interacting with users. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the present invention provides a real scene twin scene system for image detection, the system comprising:
[0006] Initialization unit: obtains basic modeling data by pre-surveying the scene to be detected, establishes a static virtual environment based on the basic modeling data, and initializes the position and posture of the sensor in the static virtual environment;
[0007] A real-time updating unit: by acquiring real-time data from the sensor and combining the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time;
[0008] Instruction interaction unit: used to obtain instructions issued by the user in the UI interface corresponding to the static virtual environment, and based on the instructions, implement preset operations on preset targets in the actual scene;
[0009] Display unit: Render the static virtual environment based on a preset technology and publish it to a web page, so that the user can directly interact with the static virtual environment through a browser; encode the rendered static virtual environment into a video stream, and transmit or save the video stream to a preset terminal; encode the rendered static virtual environment into a multimedia stream, and the multimedia stream is locally displayed through a display.
[0010] The present invention is implemented through the following technical scheme: first, the scene to be detected is pre-surveyed through an initialization unit to obtain basic modeling data, including pre-modeling of the scene to be detected, peripherals in the scene, and static textures of the scene; then, a static virtual environment is established through the basic modeling data, and the position and posture of the sensor (camera) in the scene are initialized. The purpose of initialization is to reduce the update deviation caused by the position and posture of the camera when the real-time video data is obtained by the camera to update the scene later.
[0011] Then, based on the real-time update unit, the texture map in the static virtual environment is updated by acquiring real-time data from the sensor and combining it with the initialized position and posture of the sensor. At the same time, the status of peripheral targets (such as lights) in the scene is obtained to update the status of peripherals in the static virtual environment.
[0012] The present invention also provides an instruction interaction unit, which obtains the instructions issued by the user in the UI interface and implements the preset operations corresponding to the preset targets in the actual scene based on the instructions. For example, by clicking the indicator light in the UI interface of the static virtual environment, the indicator light in the real scene can be lit, providing users with more interactive functions.
[0013] Finally, the display unit is used for various display methods. First, the static virtual environment is rendered in 3D through the preset technology (WebGL technology) and then published to the web page. The user can directly interact with the rendered static virtual environment through the browser, such as viewing the scene by controlling the viewing angle; second, the static virtual environment is converted into a video stream after encoding for transmission and storage, which is convenient for real-time monitoring or archiving; third, the static virtual environment is converted into a multimedia stream (HDMI) after encoding for local high-quality display; through the above methods, the diverse needs in different scenarios can be met.
[0014] As an optional technical solution, the sensor is a camera, and the camera is used to collect real-time video data.
[0015] As an optional technical solution, the system further includes a 3D rendering unit, which is used to perform 3D rendering of the static virtual environment, specifically including:
[0016] Obtaining position information of the camera in the detection scene;
[0017] Based on the position information, obtaining a first transformation matrix from a world coordinate system to a local coordinate system;
[0018] Based on the internal parameters of the camera, an orthogonal projection matrix corresponding to the projector coordinate system is obtained;
[0019] Multiplying the first transformation matrix by the orthogonal projection matrix to obtain a second transformation matrix from the world coordinate system to the projector coordinate system;
[0020] Based on the second transformation matrix, the real-time video data is projected onto the static virtual environment to achieve 3D presentation of the static virtual environment.
[0021] As an optional technical solution, the 3D rendering unit is used to render the static virtual environment in 3D, and further includes:
[0022] Dividing the map model corresponding to the static virtual environment into a plurality of identical grids;
[0023] The sizes of the grids are all smaller than the field of view of a single camera;
[0024] Use the divided grids for multi-channel mapping, and each grid contains up to 4 camera maps.
[0025] As an optional technical solution, the 3D rendering unit is used to render the static virtual environment in 3D, and further includes:
[0026] When performing multi-channel mapping, obtain the overlapping area of the corresponding mappings of multiple cameras;
[0027] Calculating the distances between all texture pixels in the overlapping area and the corresponding camera center to obtain multiple calculation results;
[0028] Based on all calculation results and preset rules, different weights are assigned to each texture pixel in the overlapping area to achieve smooth fusion of the overlapping area.
[0029] As an optional technical solution, the preset rule is:
[0030] Assigning a weight to each texture pixel in the overlapping area is achieved by the following formula;
[0031]
[0032] Γ is the weight value of a single texture pixel in the overlapping area, d is the distance between a single texture pixel in the overlapping area and the corresponding camera center, and A is a constant.
[0033] As an optional technical solution, the system further includes a parameter transformation unit, which is specifically used to:
[0034] Based on the real-time video data, preset parameters of the projected video are adjusted so that the video frames for generating the scene texture in the static virtual environment are accurately aligned with the static virtual environment for 3D presentation, thereby optimizing the update of the texture map in the static virtual environment.
[0035] As an optional technical solution, the system further includes a perspective roaming unit for controlling the rotation, tilt and zoom of the perspective to achieve a 3D display of the static virtual environment.
[0036] As an optional technical solution, the preset technology is WebGL technology.
[0037] In order to solve the deficiencies in the prior art, the present invention also provides a real scene twinning method for image detection, which comprises the following steps:
[0038] By pre-surveying the scene to be detected, basic modeling data is obtained, a static virtual environment is established based on the basic modeling data, and the position and posture of the sensor in the static virtual environment are initialized;
[0039] By acquiring real-time data from the sensor and combining it with the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time;
[0040] Obtaining instructions issued by a user in a UI interface corresponding to the static virtual environment, and implementing preset operations on preset targets in the actual scene based on the instructions;
[0041] The static virtual environment is rendered based on a preset technology and published to a web page, and the user interacts with the static virtual environment directly through a browser; the rendered static virtual environment is encoded and converted into a video stream, and the video stream is transmitted or saved to a preset terminal; the rendered static virtual environment is encoded and converted into a multimedia stream, and the multimedia stream is locally displayed through a display.
[0042] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:
[0043] The present invention can integrate information of multiple positions and angles by projecting multiple video frames into an initialized static virtual environment, thereby providing a more complete scene display.
[0044] The present invention solves the problem that traditional video monitoring or display systems can only provide a single viewing angle and are unable to meet the multi-viewing display requirements in complex scenes through 3D presentation and multi-viewing roaming.
[0045] The perspective roaming unit of the present invention allows users to explore and view the content in a static virtual environment more freely, providing a better interactive experience.
[0046] The instruction interaction unit of the present invention obtains instructions issued by the user in the UI interface, and based on the instructions, implements preset operations corresponding to preset targets in actual scenarios, thereby providing users with more interactive functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of the present invention, and do not constitute a limitation on the embodiments of the present invention;
[0048] Figure 1 It is a schematic diagram of the composition of a real-scene twin-scene system for image detection in the present invention;
[0049] Figure 2 It is a design flow chart of a real-scene twin-scene system for image detection in the present invention;
[0050] Figure 3 is a schematic diagram of a grid independent map in the present invention;
[0051] Figure 4 It is a schematic flow chart of a real scene twin scene method for image detection in the present invention. DETAILED DESCRIPTION
[0052] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those within the scope of this description. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0054] Embodiment 1
[0055] Please refer to Figure 1 and Figure 2 , Figure 1 is a schematic diagram of the composition of a real-scene twin-scene system for image detection in the present invention, Figure 2 It is a design flow chart of a real scene twin scene system for image detection in the present invention, and the system includes:
[0056] Initialization unit: obtains basic modeling data by pre-surveying the scene to be detected, establishes a static virtual environment based on the basic modeling data, and initializes the position and posture of the sensor in the static virtual environment;
[0057] A real-time updating unit: by acquiring real-time data from the sensor and combining the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time;
[0058] Instruction interaction unit: used to obtain instructions issued by the user in the UI interface corresponding to the static virtual environment, and based on the instructions, implement preset operations on preset targets in the actual scene;
[0059] Display unit: Render the static virtual environment based on a preset technology and publish it to a web page, so that the user can directly interact with the static virtual environment through a browser; encode the rendered static virtual environment into a video stream, and transmit or save the video stream to a preset terminal; encode the rendered static virtual environment into a multimedia stream, and the multimedia stream is locally displayed through a display.
[0060] The specific embodiments of the present invention are as follows:
[0061] Initialization: The initialization unit is used to pre-survey the scene that needs to be detected and obtain basic modeling data, including pre-modeling of the scene that needs to be detected, the peripheral targets in the scene, and the static texture of the scene. Based on the basic modeling data, a static virtual environment with high precision is established, and the position and posture of the sensor in the static virtual environment are initialized. The sensor is a camera, which is used to collect real-time video data.
[0062] Runtime input: A real-time update unit, which updates the texture map of the static virtual environment in real time by acquiring real-time video data from the camera and combining it with the initialized camera position and posture; and acquires the status of peripherals in the scene (such as indicator lights or ground locks, etc.) in real time, and displays the status of peripherals in the static virtual environment in real time, thereby reflecting changes in the real scene in real time; a command interaction unit, which is used to obtain commands issued by the user in the UI interface corresponding to the static virtual environment, thereby providing more complex user interactions, such as the user clicking on the camera in the static virtual environment to obtain the real-time video stream image of the camera in the actual scene, clicking on the indicator light to light up the indicator light in the real scene, and dragging the screen for multi-perspective roaming display.
[0063] Runtime output: Display unit, used to provide a variety of display methods, 1) Use WebGL technology to render the static virtual environment into 3D and publish it to the web page. Users can directly interact with the 3D scene through the browser and control the perspective in real time to view the scene; 2) Support the encoding of the rendered static virtual environment into a video stream for transmission and storage, which is convenient for real-time monitoring or archiving; 3) Support the encoding of the rendered static virtual environment into a high-definition multimedia stream (HDMI) for local display, thereby meeting the diverse needs in different scenarios.
[0064] The system further includes a 3D rendering unit, which is used to render the static virtual environment in 3D, specifically including:
[0065] Obtaining position information of the camera in the detection scene;
[0066] Based on the position information, obtaining a first transformation matrix from a world coordinate system to a local coordinate system;
[0067] Based on the internal parameters of the camera, an orthogonal projection matrix corresponding to the projector coordinate system is obtained;
[0068] Multiplying the first transformation matrix by the orthogonal projection matrix to obtain a second transformation matrix from the world coordinate system to the projector coordinate system;
[0069] Based on the second transformation matrix, the real-time video data is projected onto the static virtual environment to achieve 3D presentation of the static virtual environment.
[0070] This embodiment obtains a first transformation matrix from the world coordinate system to the local coordinate system through the position information of the camera in the scene, obtains an orthogonal projection matrix representing the viewing frustum of the projector through the internal parameters of the camera, multiplies the first transformation matrix by the orthogonal projection matrix, and obtains a second transformation matrix from the world coordinate system to the projector coordinate system. The second transformation matrix is applied to project real-time video data on a static virtual environment to achieve the presentation of a 3D twin scene.
[0071] Please refer to Figure 3 , Figure 3 is a schematic diagram of a grid independent map in the present invention, wherein the 3D rendering unit is used to render the static virtual environment in 3D, and further comprises:
[0072] Dividing the map model corresponding to the static virtual environment into a plurality of identical grids;
[0073] The sizes of the grids are all smaller than the field of view of a single camera;
[0074] Use the divided grids for multi-channel mapping, and each grid contains up to 4 camera maps.
[0075] In order to achieve large-scale multi-channel mapping, this embodiment divides the map model corresponding to the static virtual environment into multiple grid independent maps to get rid of the upper limit of the map projection transformation matrix required for each rendering of Unity 3D. The size of each grid is smaller than the field of view of a single camera, so that each grid contains at most 4 camera maps.
[0076] Furthermore, the 3D rendering unit is used to render the static virtual environment in 3D, and further includes:
[0077] When performing multi-channel mapping, obtain the overlapping area of the corresponding mappings of multiple cameras;
[0078] Calculating the distances between all texture pixels in the overlapping area and the corresponding camera center to obtain multiple calculation results;
[0079] Based on all calculation results and preset rules, different weights are assigned to each texture pixel in the overlapping area to achieve smooth fusion of the overlapping area.
[0080] The preset rules are:
[0081] Assigning a weight to each texture pixel in the overlapping area is achieved by the following formula;
[0082]
[0083] Γ is the weight value of a single texture pixel in the overlapping area, d is the distance between a single texture pixel in the overlapping area and the corresponding camera center, and A is a constant.
[0084] For fusion of overlapping areas of multiple cameras, please refer to Figure 3 There will be overlap in the field of view of multiple cameras. In this embodiment, by calculating the distance between the texture pixel points in the overlapping area and the distance between the camera center, different weights are assigned to each texture pixel point in the overlapping area according to a preset rule (that is, the smaller the distance, the greater the weight). For example, the pixel value of any pixel point (such as the first pixel point) in the overlapping area after fusion is V, and the pixel value of the first pixel point in the first image corresponding to the first camera is V1. The weight value of the first pixel point in the first image calculated by the above formula is W1, and the pixel value in the second image corresponding to the second camera is V2. The weight value of the first pixel point in the second image calculated by the above formula is W2. Then the pixel value of the first pixel point after fusion is V=V1×W1+V2×W2. All texture pixel points in the overlapping area are processed based on the above method, and finally smooth fusion of the overlapping area is achieved.
[0085] Furthermore, the system also includes a parameter transformation unit, which is specifically used to:
[0086] Based on the real-time video data, preset parameters of the projected video are adjusted so that the video frames for generating the scene texture in the static virtual environment are accurately aligned with the static virtual environment for 3D presentation, thereby optimizing the update of the texture map in the static virtual environment.
[0087] The user is allowed to adjust the projected video size, position, angle, etc. through the transformation parameter unit, ensuring that the video frames used to generate scene textures in the static virtual environment can be accurately aligned with the 3D scene, thereby optimizing the texture map update in the static virtual environment, and further ensuring that the texture map update in the static virtual environment corresponds to the update in the real scene.
[0088] Furthermore, the system also includes a perspective roaming unit for controlling the rotation, tilt and zoom of the perspective to realize the 3D display of the static virtual environment. The perspective roaming unit realizes the perspective PTZ and XYZ roaming functions, through which the user controls the rotation, control and output of the perspective, which provides flexibility and convenience for multi-tasking in complex scenes.
[0089] Furthermore, the preset technology is WebGL technology. WebGL (Web Graphics Library) is a 3D drawing protocol. This drawing technology standard allows JavaScript and OpenGL ES2.0 to be combined together. By adding a JavaScript binding to OpenGL ES2.0, WebGL can provide hardware 3D accelerated rendering for HTML5 Canvas, so that 3D scenes and models can be displayed more smoothly in the browser with the help of the system graphics card.
[0090] Embodiment 2
[0091] Please refer to Figure 4 , Figure 4 1 is a flow chart of a real scene twinning method for image detection in the present invention, the method comprising the following steps:
[0092] By pre-surveying the scene to be detected, basic modeling data is obtained, a static virtual environment is established based on the basic modeling data, and the position and posture of the sensor in the static virtual environment are initialized;
[0093] By acquiring real-time data from the sensor and combining it with the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time;
[0094] Obtaining instructions issued by a user in a UI interface corresponding to the static virtual environment, and implementing preset operations on preset targets in the actual scene based on the instructions;
[0095] The static virtual environment is rendered based on a preset technology and published to a web page, and the user interacts with the static virtual environment directly through a browser; the rendered static virtual environment is encoded and converted into a video stream, and the video stream is transmitted or saved to a preset terminal; the rendered static virtual environment is encoded and converted into a multimedia stream, and the multimedia stream is locally displayed through a display.
[0096] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0097] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A real-scene twin-view system for image detection, characterized in that: The system comprises: Initialization unit: obtains basic modeling data by pre-surveying the scene to be detected, establishes a static virtual environment based on the basic modeling data, and initializes the position and posture of the sensor in the static virtual environment; A real-time updating unit: by acquiring real-time data from the sensor and combining the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time; Instruction interaction unit: used to obtain instructions issued by the user in the UI interface corresponding to the static virtual environment, and based on the instructions, implement preset operations on preset targets in the actual scene; Display unit: Render the static virtual environment based on a preset technology and publish it to a web page, so that the user can directly interact with the static virtual environment through a browser; encode the rendered static virtual environment into a video stream, and transmit or save the video stream to a preset terminal; encode the rendered static virtual environment into a multimedia stream, and the multimedia stream is locally displayed through a display.
2. A real-scene twin-view system for image detection according to claim 1, characterized in that: The sensor is a camera, and the camera is used to collect real-time video data.
3. A real-scene twin-view system for image detection according to claim 2, characterized in that: The system further includes a 3D rendering unit, which is used to render the static virtual environment in 3D, specifically including: Obtaining position information of the camera in the detection scene; Based on the position information, obtaining a first transformation matrix from a world coordinate system to a local coordinate system; Based on the internal parameters of the camera, an orthogonal projection matrix corresponding to the projector coordinate system is obtained; Multiplying the first transformation matrix by the orthogonal projection matrix to obtain a second transformation matrix from the world coordinate system to the projector coordinate system; Based on the second transformation matrix, the real-time video data is projected onto the static virtual environment to achieve 3D presentation of the static virtual environment.
4. A real-scene twin-view system for image detection according to claim 3, characterized in that: The 3D rendering unit is used to render the static virtual environment in 3D, and further includes: Dividing the map model corresponding to the static virtual environment into a plurality of identical grids; The sizes of the grids are all smaller than the field of view of a single camera; Use the divided grids for multi-channel mapping, and each grid contains up to 4 camera maps.
5. A real-scene twin-view system for image detection according to claim 4, characterized in that: The 3D rendering unit is used to render the static virtual environment in 3D, and further includes: When performing multi-channel mapping, obtain the overlapping area of the corresponding mappings of multiple cameras; Calculating the distances between all texture pixels in the overlapping area and the corresponding camera center to obtain multiple calculation results; Based on all calculation results and preset rules, different weights are assigned to each texture pixel in the overlapping area to achieve smooth fusion of the overlapping area.
6. A real-scene twin-view system for image detection according to claim 5, characterized in that: The preset rules are: Assigning a weight to each texture pixel in the overlapping area is achieved by the following formula; Γ is the weight value of a single texture pixel in the overlapping area, d is the distance between a single texture pixel in the overlapping area and the corresponding camera center, and A is a constant.
7. A real-scene twin-view system for image detection according to claim 2, characterized in that: The system also includes a parameter transformation unit, which is specifically used for: Based on the real-time video data, preset parameters of the projected video are adjusted so that the video frames for generating the scene texture in the static virtual environment are accurately aligned with the static virtual environment for 3D presentation, thereby optimizing the update of the texture map in the static virtual environment.
8. The real scene twin system for image detection according to claim 1, characterized in that: The system also includes a viewing angle roaming unit, which is used to control the rotation, tilt and zoom of the viewing angle to achieve 3D display of the static virtual environment.
9. A real-scene twin-view system for image detection according to claim 1, characterized in that: The preset technology is WebGL technology.
10. A real scene twinning method for image detection, characterized in that: The method comprises the following steps: By pre-surveying the scene to be detected, basic modeling data is obtained, a static virtual environment is established based on the basic modeling data, and the position and posture of the sensor in the static virtual environment are initialized; By acquiring real-time data from the sensor and combining it with the initialized position and posture of the sensor, the texture map in the static virtual environment is updated in real time; by acquiring the status of the peripherals in the scene in real time, the status of the peripherals in the static virtual environment is updated in real time; Obtaining instructions issued by a user in a UI interface corresponding to the static virtual environment, and implementing preset operations on preset targets in the actual scene based on the instructions; The static virtual environment is rendered based on a preset technology and published to a web page, and the user interacts with the static virtual environment directly through a browser; the rendered static virtual environment is encoded and converted into a video stream, and the video stream is transmitted or saved to a preset terminal; the rendered static virtual environment is encoded and converted into a multimedia stream, and the multimedia stream is locally displayed through a display.
