CN-121010732-B - Curve graph generation method and device based on three-dimensional camera visual angle
Abstract
The embodiment of the specification provides a curve graph generating method and device based on a three-dimensional camera view angle, wherein the method comprises the steps of obtaining a two-dimensional pixel curve and three-dimensional camera coordinate points, obtaining a two-dimensional data point set according to the two-dimensional pixel curve, projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set, constructing a plurality of planes according to the three-dimensional data point set and the three-dimensional camera coordinate points, generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions, and connecting the curve segments to obtain a complete three-dimensional curve graph. Thereby improving the calculation efficiency.
Inventors
- ZHANG HAI
- QIU XIAOQING
- WANG BAOHUI
- WANG GUIYU
Assignees
- 北京安德盛威科技发展有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20250723
Claims (7)
- 1.A curve graph generation method based on three-dimensional camera visual angles is characterized by comprising the following steps: acquiring a two-dimensional pixel curve and a three-dimensional camera coordinate point; Obtaining a two-dimensional data point set according to the two-dimensional pixel curve; projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; constructing a plurality of planes according to the three-dimensional data point set and the coordinate points of the three-dimensional camera; generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions; Connecting the curve segments to obtain a complete three-dimensional curve graph; generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions comprises: The plane includes coordinates of a first data point and a second data point; Determining a coordinate range according to the coordinates of the first data point and the second data point; determining a 3D point range of the model according to the coordinate range and the preset target three-dimensional model; Determining intersection lines according to the 3D point range, the plane, the three-dimensional data point set and preset line segment limiting conditions; The calculation formula for determining the intersection is as follows: Wherein, the Representing three-dimensional data points on a plane; representing a distance of the three-dimensional data point from the plane; representing a threshold.
- 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set comprises the following steps: Mapping the two-dimensional data point set into a standardized equipment coordinate system based on a viewport transformation matrix to obtain an NDC coordinate; converting the NDC coordinates into view space based on back projection transformation to obtain view space coordinates; And converting the view space coordinates into a world coordinate system based on inverse view transformation to obtain a three-dimensional data point set.
- 3. The method of claim 1, wherein the step of determining the position of the substrate comprises, The constructing a plurality of planes according to the three-dimensional data point set and the three-dimensional camera coordinate points comprises: Traversing data points in the three-dimensional data point set; every two adjacent data points in the three-dimensional data point set and the coordinate point of the three-dimensional camera form a plane; after traversing all the data points in the three-dimensional data point set, a plurality of planes are obtained.
- 4. A three-dimensional camera view angle-based curve pattern generation device, characterized by comprising: the acquisition module is used for acquiring a two-dimensional pixel curve and a three-dimensional camera coordinate point; the two-dimensional point set determining module is used for obtaining a two-dimensional data point set according to the two-dimensional pixel curve; The three-dimensional point set determining module is used for projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; The plane construction module is used for constructing a plurality of planes according to the three-dimensional data point set and the coordinate points of the three-dimensional camera; The curve segment generation module is used for generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions; the curve graph generating module is used for connecting the curve segments to obtain a complete three-dimensional curve graph; The curve segment generation module is configured to: The plane includes coordinates of a first data point and a second data point; Determining a coordinate range according to the coordinates of the first data point and the second data point; determining a 3D point range of the model according to the coordinate range and the preset target three-dimensional model; determining intersection lines according to the 3D point range, the plane and preset line segment limiting conditions; Generating a plurality of curve segments according to the intersecting lines; The calculation formula for determining the intersection is as follows: Wherein, the Representing three-dimensional data points on a plane; representing a distance of the three-dimensional data point from the plane; representing a threshold.
- 5. The apparatus of claim 4, wherein the three-dimensional point set determination module is configured to: Mapping the two-dimensional data point set into a standardized equipment coordinate system based on a viewport transformation matrix to obtain an NDC coordinate; converting the NDC coordinates into view space based on back projection transformation to obtain view space coordinates; And converting the view space coordinates into a world coordinate system based on inverse view transformation to obtain a three-dimensional data point set.
- 6. The apparatus of claim 4, wherein the plane construction module is configured to: Traversing data points in the three-dimensional data point set; every two adjacent data points in the three-dimensional data point set and the coordinate point of the three-dimensional camera form a plane; after traversing all the data points in the three-dimensional data point set, a plurality of planes are obtained.
- 7. A storage medium storing computer executable instructions which when executed implement the steps of the three-dimensional camera perspective-based curve graph generation method of any one of claims 1-3.
Description
Curve graph generation method and device based on three-dimensional camera visual angle Technical Field The present document relates to the field of computer graphics, and in particular, to a method and apparatus for generating a curve graph based on a three-dimensional camera view angle. Background The three-dimensional curve graph is an optimal solution describing a complex spatial trajectory. In the existing three-dimensional modeling and graph generation technology, a three-dimensional curve graph is usually generated by generating a dependent parameter equation through Bezier curves and B-spline curves or directly manually drawing by a user. However, the existing technology relies on mathematical parameters, requires a user to input complicated control points or parameters, is complicated to operate, is difficult to accurately control by manually drawing a curve in a three-dimensional space, lacks intuitiveness, and the traditional method may require a large amount of computation to generate a curve conforming to a viewing angle, resulting in low computation efficiency. Disclosure of Invention In view of the above, the present application aims to provide a method and an apparatus for generating a curve graph based on a three-dimensional camera view angle, so as to solve at least one of the above technical problems. In a first aspect, one or more embodiments of the present disclosure provide a method for generating a graph of a curve based on a three-dimensional camera viewing angle, including: acquiring a two-dimensional pixel curve and a three-dimensional camera coordinate point; Obtaining a two-dimensional data point set according to the two-dimensional pixel curve; projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; constructing a plurality of planes according to the three-dimensional data point set and the coordinate points of the three-dimensional camera; generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions; And connecting the curve segments to obtain a complete three-dimensional curve graph. Further, mapping the two-dimensional data point set into a standardized equipment coordinate system based on a viewport transformation matrix to obtain NDC coordinates; converting the NDC coordinates into view space based on back projection transformation to obtain view space coordinates; And converting the view space coordinates into a world coordinate system based on inverse view transformation to obtain a three-dimensional data point set. Further, traversing data points in the three-dimensional data point set; every two adjacent data points in the three-dimensional data point set and the coordinate point of the three-dimensional camera form a plane; after traversing all the data points in the three-dimensional data point set, a plurality of planes are obtained. Further, the plane includes coordinates of the first data point and the second data point; Determining a coordinate range according to the coordinates of the first data point and the second data point; determining a 3D point range of the model according to the coordinate range and the preset target three-dimensional model; Determining intersection lines according to the 3D point range, the plane, the three-dimensional data point set and preset line segment limiting conditions; and generating a plurality of curve segments according to the intersecting lines. Further, the calculation formula for determining the intersection is as follows: Wherein, the Representing three-dimensional data points on a plane; representing a distance of the three-dimensional data point from the plane; representing a threshold. In a second aspect, an embodiment of the present application provides a curve graph generating apparatus based on a three-dimensional camera viewing angle, including: the acquisition module is used for acquiring a two-dimensional pixel curve and a three-dimensional camera coordinate point; the two-dimensional point set determining module is used for obtaining a two-dimensional data point set according to the two-dimensional pixel curve; The three-dimensional point set determining module is used for projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; The plane construction module is used for constructing a plurality of planes according to the three-dimensional data point set and the coordinate points of the three-dimensional camera; The curve segment generation module is used for generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and preset line segment limiting conditions; and the curve graph generating module is used for connecting the curve segments to obtain a complete three-dimensio