Method, device and equipment for displaying combination of two-dimensional data and three-dimensional model, and medium

By using canvas conversion technology to transform the position and shape parameters of 2D data and 3D models to a second canvas coordinate system, the problem of time-consuming and laborious alignment of 2D data and 3D models is solved, achieving automated and accurate alignment and improved efficiency.

CN119048721BActive Publication Date: 2025-11-04HANGZHOU HIKROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411211237.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-11-04
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Aligning two-dimensional data with three-dimensional models in existing technologies is time-consuming, labor-intensive, and difficult to align accurately, resulting in low efficiency.

Method used

By acquiring the model parameters of the 3D model and the data parameters of the 2D data, and using canvas transformation technology, the position and shape parameters are transformed from the first canvas to the second canvas coordinate system, so that the 2D data is aligned with the projected image of the 3D model on the second canvas.

Benefits of technology

It achieves automated and precise alignment between 2D data and 3D models, improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048721B_ABST
    Figure CN119048721B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a two-dimensional data and three-dimensional model combined display method, device, equipment and medium. The method comprises: obtaining model parameters of a three-dimensional model and data parameters of two-dimensional data; displaying the three-dimensional model on a first canvas; creating a second canvas on the upper layer of the first canvas, with the center point of the second canvas aligned with the center point of the three-dimensional model; converting the data parameters into parameters in the coordinate system of the second canvas; and displaying the two-dimensional data on the second canvas based on the converted data parameters. Since the position and shape of the two-dimensional data defined by the converted data parameters on the projection image corresponding to the currently displayed three-dimensional model are aligned with the position and shape of the two-dimensional data defined by the data parameters before conversion on the projection image corresponding to the previously displayed three-dimensional model, the automatic and accurate alignment of the two-dimensional data and the three-dimensional model can be achieved when displaying the two-dimensional data based on the converted parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine vision technology, and in particular to a method, apparatus, device, and medium for displaying a combination of two-dimensional data and three-dimensional models. Background Technology

[0002] With the development of 3D visualization technology, 3D models are being used more and more widely in various technical fields. When displaying a 3D model of an object, users often focus on certain areas of the 3D model and hope to add additional 2D data (such as 2D graphics, text, etc.) to these areas of interest to facilitate further analysis of the 3D model or enhance their understanding of it.

[0003] The traditional method for accurately adding 2D data to the region of interest in a 3D model is to first display the 2D data and then rely on the user to manually drag and drop it into the region of interest to align the 2D data with the 3D model. However, this method is not only time-consuming and inefficient, but also makes it difficult to guarantee accurate alignment between the 2D data and the 3D model. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, device, and medium for displaying combined two-dimensional data and three-dimensional models, so as to achieve automated and accurate alignment of two-dimensional data and three-dimensional models. The specific technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a method for displaying a combination of two-dimensional data and a three-dimensional model, the method comprising:

[0006] The model parameters of the three-dimensional model and the data parameters of the two-dimensional data are obtained. The data parameters include shape parameters and position parameters. The two-dimensional data is data added to a first image. The first image is a projection image of the three-dimensional model from the target viewpoint. The position parameters indicate the position of the two-dimensional data in the coordinate system of the first image.

[0007] Based on the model parameters, the 3D model is displayed on the first canvas;

[0008] Create a second canvas on top of the first canvas, wherein the center point of the second canvas is aligned with the center point of the 3D model displayed on the first canvas;

[0009] convert the position parameter and the shape parameter into parameters in a coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data defined by the converted position parameter and the converted shape parameter on the second image are aligned with the position and shape of the two-dimensional data defined by the unconverted position parameter and the unconverted shape parameter on the first image;

[0010] display the two-dimensional data on the second canvas based on the converted position parameter and the converted shape parameter.

[0011] Optionally, the size of the first canvas is the same as the size of the second canvas.

[0012] The conversion of the position parameter and the shape parameter into parameters in the coordinate system of the second canvas comprises:

[0013] scaling the position parameter and the shape parameter according to a stretching ratio between the second image and the first image;

[0014] determining distances between two adjacent sides of a circumscribed rectangle of the second image and two corresponding adjacent sides of the first canvas, wherein the distances include a horizontal distance and a vertical distance, the horizontal distance is a distance between a vertical side of the circumscribed rectangle and a corresponding vertical side of the first canvas, and the vertical distance is a distance between a horizontal side of the circumscribed rectangle and a corresponding horizontal side of the first canvas;

[0015] adjusting a horizontal parameter of the scaled position parameter according to the horizontal distance;

[0016] adjusting a vertical parameter of the scaled position parameter according to the vertical distance.

[0017] Optionally, the size of the second canvas is the same as the size of the circumscribed rectangle of the second image.

[0018] The conversion of the position parameter and the shape parameter into parameters in the coordinate system of the second canvas comprises:

[0019] scaling the position parameter and the shape parameter according to a stretching ratio between the second image and the first image.

[0020] Optionally, the model parameter of the three-dimensional model and the data parameter of the two-dimensional data are determined in the following manner:

[0021] displaying the three-dimensional model on a third canvas, adjusting the three-dimensional model to the target view angle, recording three-dimensional shape parameters and geometric transformation parameters of the adjusted three-dimensional model as model parameters of the three-dimensional model;

[0022] obtaining a projection image of the three-dimensional model displayed on the third canvas under the target view angle as the first image, and displaying the first image on a fourth canvas;

[0023] obtaining two-dimensional data added by a user on the first image;

[0024] determining a type of the two-dimensional data, and recording shape parameters and position parameters of the two-dimensional data as data parameters of the two-dimensional data according to a shape parameter type and a position parameter type corresponding to the type.

[0025] Optionally, the model parameters include three-dimensional shape parameters and geometric transformation parameters, the three-dimensional shape parameters include size parameters and a shape type, and the geometric transformation parameters include rotation angles and scaling ratios of the three-dimensional model on respective coordinate axes.

[0026] In a case where the two-dimensional data is a rectangle, the shape parameters include size parameters of the rectangle and a rotation angle of the rectangle, and the position parameters include coordinates of vertices of the rectangle.

[0027] In a case where the two-dimensional data is a circle, the shape parameters include a radius of the circle, and the position parameters include a center coordinate of the circle.

[0028] In a case where the two-dimensional data is text, the shape parameters include text content, and the position parameters include a starting coordinate of the text.

[0029] Optionally, a data format of the data parameters is Base64, and the first canvas and the second canvas are canvas.

[0030] In a second aspect, an embodiment of the present application provides a combination display device of two-dimensional data and a three-dimensional model, and the device includes:

[0031] a parameter acquisition module configured to acquire model parameters of a three-dimensional model and data parameters of two-dimensional data, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model under a target view angle, and the position parameters indicate positions of the two-dimensional data in a coordinate system of the first image;

[0032] a first display module configured to display the three-dimensional model on a first canvas based on the model parameters.

[0033] a canvas creating module, configured to create a second canvas on an upper layer of the first canvas, wherein a center point of the second canvas is aligned with a center point of the three-dimensional model displayed on the first canvas;

[0034] a parameter converting module, configured to convert the position parameter and the shape parameter into parameters in a coordinate system in which the second canvas is located, wherein the three-dimensional model projects an image on the second canvas, and a position and a shape of two-dimensional data defined by the converted position parameter and the converted shape parameter on the second image are aligned with a position and a shape of the two-dimensional data defined by the unconverted position parameter and the unconverted shape parameter on the first image;

[0035] a second displaying module, configured to display the two-dimensional data on the second canvas based on the converted position parameter and the converted shape parameter.

[0036] Optionally, the size of the first canvas is the same as the size of the second canvas; the parameter converting module is specifically configured to scale the position parameter and the shape parameter according to a stretching ratio between the second image and the first image; determine distances between two adjacent sides of a circumscribed rectangle of the second image and two corresponding adjacent sides of the first canvas, wherein the distances include a horizontal distance and a vertical distance, the horizontal distance is a distance between a vertical side of the circumscribed rectangle and a corresponding vertical side of the first canvas, and the vertical distance is a distance between a horizontal side of the circumscribed rectangle and a corresponding horizontal side of the first canvas; adjust a horizontal parameter of the scaled position parameter according to the horizontal distance; and adjust a vertical parameter of the scaled position parameter according to the vertical distance.

[0037] Optionally, the size of the second canvas is the same as the size of the circumscribed rectangle of the second image; and the parameter converting module is specifically configured to scale the position parameter and the shape parameter according to a stretching ratio between the second image and the first image.

[0038] Optionally, the model parameters of the three-dimensional model and the data parameters of the two-dimensional data are determined in the following manner: displaying the three-dimensional model on a third canvas, adjusting the three-dimensional model to the target view angle, recording the three-dimensional shape parameters and the geometric transformation parameters of the adjusted three-dimensional model as the model parameters of the three-dimensional model; obtaining a projection image of the three-dimensional model displayed on the third canvas under the target view angle as the first image, and displaying the first image on a fourth canvas; obtaining the two-dimensional data added by a user on the first image; determining the type of the two-dimensional data, and recording the shape parameters and the position parameters of the two-dimensional data as the data parameters of the two-dimensional data according to the shape parameter type and the position parameter type corresponding to the type.

[0039] Optionally, the model parameters include three-dimensional shape parameters and geometric transformation parameters, the three-dimensional shape parameters include size parameters and shape types, and the geometric transformation parameters include rotation angles and scaling ratios of the three-dimensional model on respective coordinate axes; in the case that the two-dimensional data is a rectangle, the shape parameters include size parameters and rotation angles of the rectangle, and the position parameters include coordinates of vertices of the rectangle; in the case that the two-dimensional data is a circle, the shape parameters include a radius of the circle, and the position parameters include a center coordinate of the circle; in the case that the two-dimensional data is text, the shape parameters include text content, and the position parameters include a starting coordinate of the text.

[0040] Optionally, the data format of the data parameters is Base64, and the first canvas and the second canvas are canvas.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0042] a memory for storing a computer program;

[0043] a processor for executing the program stored on the memory, and implementing the method of any of the first aspect.

[0044] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of any of the first aspect.

[0045] The embodiment of the present application has the following beneficial effects:

[0046] In the scheme provided by the embodiments of the present application, the model parameters of the three-dimensional model and the data parameters of the two-dimensional data are obtained, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in the coordinate system of the first image; the three-dimensional model is displayed on a first canvas based on the model parameters; a second canvas is created on the upper layer of the first canvas, wherein the center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas; the position parameters and the shape parameters are converted into parameters in the coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data defined by the converted position parameters and the converted shape parameters on the second image are aligned with the position and shape of the two-dimensional data defined by the unconverted position parameters and the unconverted shape parameters on the first image; and the two-dimensional data is displayed on the second canvas based on the converted position parameters and the converted shape parameters. By converting the position parameters and the shape parameters into parameters in the coordinate system of the second canvas, the display position and shape of the two-dimensional data on the second canvas can be aligned with the display position and shape of the two-dimensional data on the projection image corresponding to the three-dimensional model previously displayed, and the center point of the second canvas is aligned with the center point of the three-dimensional model currently displayed, which can make the display position and shape of the two-dimensional data on the second canvas consistent with the display position and shape of the two-dimensional data on the image projected by the three-dimensional model currently displayed on the second canvas, so that the position and shape of the two-dimensional data defined by the converted data parameters on the projection image corresponding to the three-dimensional model currently displayed are aligned with the position and shape of the two-dimensional data defined by the unconverted data parameters on the projection image corresponding to the three-dimensional model previously displayed, and the automatic and accurate alignment of the two-dimensional data and the three-dimensional model is realized. Meanwhile, compared with the manual alignment method, the automatic alignment can greatly improve the processing efficiency.

[0047] Of course, implementing any of the products or methods of the present application does not necessarily require all the advantages described above to be achieved at the same time. BRIEF DESCRIPTION OF DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.

[0049] Figure 1 A flowchart of a two-dimensional data and three-dimensional model combination display method provided by the embodiments of the present application;

[0050] Figure 2A flow chart of a parameter conversion mode of the embodiment shown in Figure 1 A flow chart of a parameter conversion mode of the embodiment shown in

[0051] Figure 3a A flow chart of a parameter conversion mode of the embodiment shown in Figure 2 A flow chart of a parameter conversion mode of the embodiment shown in

[0052] Figure 3b A flow chart of a parameter conversion mode of the embodiment shown in Figure 2 A flow chart of a parameter conversion mode of the embodiment shown in

[0053] Figure 3c A flow chart of a parameter conversion mode of the embodiment shown in Figure 2 A flow chart of a parameter conversion mode of the embodiment shown in

[0054] Figure 4 A flow chart of a parameter conversion mode of the embodiment shown in Figure 1 A flow chart of a parameter conversion mode of the embodiment shown in

[0055] Figure 5a A flow chart of a parameter conversion mode of the embodiment shown in Figure 4 A flow chart of a parameter conversion mode of the embodiment shown in

[0056] Figure 5b A flow chart of a parameter conversion mode of the embodiment shown in Figure 4 A flow chart of a parameter conversion mode of the embodiment shown in

[0057] Figure 6 A flow chart of a parameter conversion mode of the embodiment shown in A flow chart of a parameter conversion mode of the embodiment shown in

[0058] A flow chart of a parameter conversion mode of the embodiment shown in Figure 7 A flow chart of a parameter conversion mode of the embodiment shown in DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application are within the scope of protection of the present application.

[0060] In order to realize automatic and accurate alignment of two-dimensional data and three-dimensional models, the embodiments of the present application provide a two-dimensional data and three-dimensional model combination display method, device, electronic equipment, computer readable storage medium and computer program product. First, a two-dimensional data and three-dimensional model combination display method provided by the embodiments of the present application will be introduced.

[0061] The two-dimensional data and three-dimensional model combination display method provided by the embodiments of the present application can be applied to any electronic device that needs to display two-dimensional data on a three-dimensional model to achieve automatic and accurate alignment with the three-dimensional model, for example, a mobile phone, a computer, a smart large screen terminal device, or a server. In this regard, no specific limitation is made, and for the sake of clarity, the following is referred to as an electronic device.

[0062] As shown in Figure 1 A two-dimensional data and three-dimensional model combination display method includes:

[0063] S101, obtaining model parameters of a three-dimensional model and data parameters of two-dimensional data.

[0064] The data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in a coordinate system of the first image.

[0065] S102, displaying the three-dimensional model on a first canvas based on the model parameters.

[0066] S103, creating a second canvas on the upper layer of the first canvas.

[0067] The center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas.

[0068] S104, converting the position parameters and the shape parameters into parameters in a coordinate system of the second canvas.

[0069] The image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data on the second image defined by the converted position parameters and the converted shape parameters are aligned with the position and shape of the two-dimensional data on the first image defined by the unconverted position parameters and the unconverted shape parameters.

[0070] S105, displaying the two-dimensional data on the second canvas based on the converted position parameters and the converted shape parameters.

[0071] In the scheme provided by the embodiments of the present application, the model parameters of the three-dimensional model and the data parameters of the two-dimensional data are obtained, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model under a target view angle, and the position parameters indicate the position of the two-dimensional data in the coordinate system of the first image; the three-dimensional model is displayed on a first canvas based on the model parameters; a second canvas is created on the upper layer of the first canvas, wherein the center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas; the position parameters and the shape parameters are converted into parameters in the coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data defined by the converted position parameters and the converted shape parameters on the second image are aligned with the position and shape of the two-dimensional data defined by the unconverted position parameters and the unconverted shape parameters on the first image; and the two-dimensional data is displayed on the second canvas based on the converted position parameters and the converted shape parameters. By converting the position parameters and the shape parameters into parameters in the coordinate system of the second canvas, the display position and shape of the two-dimensional data on the second canvas can be aligned with the display position and shape of the two-dimensional data on the projection image corresponding to the previously displayed three-dimensional model, and the center point of the second canvas is aligned with the center point of the currently displayed three-dimensional model, which can make the display position and shape of the two-dimensional data on the second canvas consistent with the display position and shape of the two-dimensional data on the image projected by the currently displayed three-dimensional model on the second canvas, so that the position and shape of the two-dimensional data defined by the converted data parameters on the projection image corresponding to the currently displayed three-dimensional model are aligned with the position and shape of the two-dimensional data defined by the unconverted data parameters on the projection image corresponding to the previously displayed three-dimensional model, and the automatic and accurate alignment of the two-dimensional data and the three-dimensional model is achieved. Compared with the manual alignment, the automatic alignment can greatly improve the processing efficiency.

[0072] Before the electronic device executes the method for combined display of two-dimensional data and three-dimensional model provided by the embodiments of the present application, the three-dimensional model needs to be displayed, and the projection image of the three-dimensional model under a target view angle needs to be determined, and then the two-dimensional data added by a user on the projection image is obtained. In this process, the device for displaying the three-dimensional model and adding the two-dimensional data can be the electronic device, or can be another device different from the electronic device.

[0073] For example, the electronic device can first display the three-dimensional model, then determine the projection image of the three-dimensional model under a target view angle, and further display the projection image, and then the electronic device can obtain the two-dimensional data added by a user on the projection image, and finally, the electronic device executes the method for combined display of two-dimensional data and three-dimensional model provided by the embodiments of the present application, and displays the two-dimensional data and the three-dimensional model again, and aligns them.

[0074] For example, the first device can first display the three-dimensional model, then determine the projection image of the three-dimensional model at the target view angle and send it to the second device. Then the second device can display the projection image and obtain the two-dimensional data added by the user on the projection image. Finally, the electronic device performs the method for displaying the combination of the two-dimensional data and the three-dimensional model provided in the embodiments of the present application, displays the two-dimensional data and the three-dimensional model, and aligns them.

[0075] Here, the first device is used to display the three-dimensional model and the second device is used to add the two-dimensional data, and the determination method of the model parameters of the three-dimensional model and the data parameters of the two-dimensional data in the embodiments of the present application is introduced.

[0076] When the three-dimensional model needs to be displayed, the first device can create a canvas and display the three-dimensional model on the canvas. Then the user can rotate and scale the displayed three-dimensional model through the first device according to actual needs, so as to change the view angle of the three-dimensional model and view the structure and detail information of different parts of the three-dimensional model.

[0077] When the user views the three-dimensional model at a certain view angle, if the user wants to add additional two-dimensional data to some areas of the three-dimensional model at the current view angle (i.e., the target view angle) in order to further analyze the three-dimensional model or enhance the understanding of the three-dimensional model. Then the user can trigger the first device to project the three-dimensional model onto the projection plane corresponding to the current view angle to obtain a projection image (i.e., a first image) by clicking the projection control displayed on the first device. In addition, the first device can also record the three-dimensional shape parameters (size parameters and shape types, etc.) and geometric transformation parameters (rotation angles and scaling ratios of the three-dimensional model on each coordinate axis) of the three-dimensional model at the current view angle, that is, record the model parameters of the three-dimensional model.

[0078] The projection image corresponding to the three-dimensional model is an image obtained by removing the background from the initial projection image obtained by projecting the three-dimensional model onto the projection plane corresponding to the current view angle. The size information of the projection image is the same as the size information of the minimum circumscribed rectangle of the three-dimensional model.

[0079] After obtaining the projection image and the model parameters of the three-dimensional model, on the one hand, the first device can send the model parameters of the three-dimensional model to the electronic device, so that the electronic device subsequently displays the three-dimensional model according to the model parameters, and on the other hand, the first device can also send the projection image to the second device, so that the second device displays the projection image and obtains the two-dimensional data added by the user on the projection image.

[0080] The second device can create a canvas after obtaining the projection image, and display the projection image on the canvas. Then, the user can add two-dimensional data such as two-dimensional graphics and text on the projection image according to actual needs. For example, the user can add various rectangular frames on the projection image to partition the three-dimensional model, so that the number of defects in different areas of the three-dimensional model can be counted according to the partition information after subsequent defect detection.

[0081] After obtaining the two-dimensional data added by the user on the projection image, the second device can determine the type of the two-dimensional data, for example, determine whether the two-dimensional data is a rectangle, a circle, text or other types of two-dimensional data, and then the second device can record the shape parameters and the position parameters of the two-dimensional data according to the shape parameter type and the position parameter type corresponding to the type of the two-dimensional data by using a data format such as Base64, HTML (HyperText Markup Language) or XML (Extensible Markup Language), that is, record the data parameters of the two-dimensional data, wherein the position parameters of the two-dimensional data indicate the position of the two-dimensional data in the coordinate system of the projection image.

[0082] For example, if the two-dimensional data is a rectangle, the shape parameters of the two-dimensional data can include the size parameters of the rectangle and the rotation angle of the rectangle, and the position parameters of the two-dimensional data can include the coordinates of the vertex of the rectangle; if the two-dimensional data is a circle, the shape parameters of the two-dimensional data can include the radius of the circle, and the position parameters of the two-dimensional data can include the center coordinates of the circle; if the two-dimensional data is text, the shape parameters of the two-dimensional data can include the text content, and the position parameters of the two-dimensional data can include the starting coordinates of the text.

[0083] After obtaining the data parameters of the two-dimensional data, the second device can send the data parameters of the two-dimensional data to the electronic device, so that the electronic device can subsequently reproduce the two-dimensional data on the three-dimensional model according to the data parameters.

[0084] In this way, the electronic device can obtain the model parameters of the three-dimensional model and the data parameters of the two-dimensional data.

[0085] It should be noted that users may add additional 2D data to multiple 3D models, or add additional 2D data to multiple viewpoints of the same 3D model. In this case, the electronic device will obtain model parameters of multiple 3D models and data parameters of multiple 2D data. To establish the correlation between the model parameters of the 3D models and the data parameters of the 2D data, when the first device sends a projected image or model parameters of the 3D model to the electronic device, it can carry identification information for identifying the model itself and the model's viewpoint. When the second device sends data parameters of the 2D data added to the projected image to the electronic device, it can also carry the identification information for identifying the model itself and the model's viewpoint carried by the first device when sending the projected image. In this way, when the electronic device obtains model parameters of multiple 3D models and data parameters of multiple 2D data, it can determine the corresponding model parameters of the 3D models and data parameters of the 2D data based on the identification information.

[0086] When it is necessary to display two-dimensional data on a three-dimensional model to achieve automated and precise alignment between the two-dimensional data and the three-dimensional model, the electronic device can determine the initial three-dimensional shape of the three-dimensional model based on its size and shape parameters. Then, based on geometric transformation parameters such as rotation angles and scaling ratios along the coordinate axes of the three-dimensional model, it can determine the transformed three-dimensional shape. Finally, the electronic device displays the three-dimensional model on a first created canvas based on the determined transformed three-dimensional shape.

[0087] After the electronic device creates the first canvas, it can also create a second canvas on top of the first canvas to display two-dimensional data. The center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas. The second canvas can be a fully transparent canvas or a semi-transparent canvas. The transparency of the semi-transparent canvas only needs to be sufficient for the user to see the three-dimensional model displayed on the first canvas through the second canvas, and there is no specific limitation here.

[0088] The electronic device can also convert position parameters and shape parameters into parameters in the coordinate system of the second canvas. Then, it can determine the position of the two-dimensional data on the second canvas based on the converted position parameters, and display the two-dimensional data at the determined position on the second canvas according to the converted shape parameters.

[0089] In this process, on the one hand, the position parameter and the shape parameter are converted into parameters in the coordinate system of the second canvas, so that the display position and shape of the two-dimensional data on the second canvas are aligned with the position and shape of the two-dimensional data on the projection image corresponding to the three-dimensional model displayed before. The second image is the image of the projection of the three-dimensional model on the second canvas. On this basis, the alignment of the center point of the second canvas with the center point of the current three-dimensional model can ensure that the display position and shape of the two-dimensional data on the second canvas are consistent with the display position and shape of the two-dimensional data on the image projected by the currently displayed three-dimensional model on the second canvas.

[0090] Therefore, through the above parameter conversion and center point alignment, the position and shape of the two-dimensional data defined by the converted data parameters on the projection image corresponding to the currently displayed three-dimensional model are aligned with the position and shape of the two-dimensional data defined by the data parameters before conversion on the projection image corresponding to the three-dimensional model displayed before, realizing the automatic and accurate alignment of the two-dimensional data and the three-dimensional model.

[0091] In an embodiment, when the electronic device creates the second canvas and converts the position parameter and the shape parameter into parameters in the coordinate system of the second canvas, the following methods can be used:

[0092] When the coordinate system of the first image is a coordinate system established with the center point of the first image as the coordinate origin, the second canvas created by the electronic device can have any size, for example, the size of the second canvas can be the same as the size of the first canvas, the size of the first image, or the size of the second image.

[0093] In a preferred manner, in order to ensure that the two-dimensional data can be displayed completely, the size information of the second canvas can be any size between the size of the second image and the size of the first canvas.

[0094] Further, the electronic device can scale the position parameter and the shape parameter according to the stretching ratio between the second image and the first image, so as to convert the position parameter and the shape parameter into parameters in the coordinate system of the second canvas.

[0095] Regarding the effect of aligning the center point of the second canvas with the center point of the three-dimensional model displayed on the first canvas, the electronic device can achieve the following two methods:

[0096] In the first method, when the electronic device creates the first canvas, the electronic device can display the first canvas in the center and display the three-dimensional model in the center when displaying the three-dimensional model on the first canvas. Further, when the electronic device creates the second canvas on the first canvas, the electronic device can also display the second canvas in the center, so that the center point of the second canvas is aligned with the center point of the three-dimensional model.

[0097] In the second mode, after the electronic device displays the three-dimensional model on the first canvas, the electronic device can record the position information of the center point of the three-dimensional model, and then when the electronic device creates the second canvas on the first canvas, the electronic device can take the position information of the center point of the three-dimensional model recorded in advance as the position information of the center point of the second canvas, and then create the second canvas based on the position information of the center point of the second canvas, so that the center point of the second canvas is aligned with the center point of the three-dimensional model.

[0098] In an embodiment, the first canvas and the second canvas can be canvas.

[0099] In the scheme provided by the embodiments of the present application, the electronic device can convert the position parameter and the shape parameter into parameters in the coordinate system of the second canvas, so that the display position of the two-dimensional data on the second canvas is consistent with the position of the two-dimensional data on the original three-dimensional model, and the center point of the second canvas is aligned with the center point of the current three-dimensional model, so that the display position of the two-dimensional data on the second canvas is consistent with the position of the two-dimensional data on the current three-dimensional model, so that the position of the two-dimensional data on the three-dimensional model defined by the converted parameters is the same as the position of the two-dimensional data on the three-dimensional model defined by the original parameters, and the automatic and accurate alignment of the two-dimensional data and the three-dimensional model is achieved. Compared with the manual alignment mode, the automatic alignment can greatly improve the processing efficiency.

[0100] In addition to the above-mentioned embodiments, the embodiments of the present application also provide two embodiments for the electronic device to create the second canvas and convert the position parameter and the shape parameter into parameters in the coordinate system of the second canvas. The two embodiments will be introduced in the following Figure 2 -3 and Figure 4 -5 respectively.

[0101] In the first embodiment, when the electronic device creates the second canvas, the electronic device can set the size of the second canvas to be the same as the size of the first canvas.

[0102] In this case, when the electronic device converts the position parameter and the shape parameter into parameters in the coordinate system of the second canvas, the electronic device can perform the conversion in the manner shown in the following Figure 2

[0103] S201, scaling the position parameter and the shape parameter according to the stretching ratio between the second image and the first image.

[0104] ​The size of the three-dimensional model displayed on the first device may also be inconsistent with the size of the three-dimensional model displayed by the electronic device. In this case, in order to adapt the two-dimensional data to the three-dimensional model with a changed size, the electronic device needs to scale the data parameters of the two-dimensional data. Specifically,

[0105] In addition to obtaining the model parameters of the three-dimensional model and the data parameters of the two-dimensional data, the electronic device can also obtain the size information of the first image to which the two-dimensional data is added. In addition, the electronic device can also determine the size of the projection image of the three-dimensional model displayed by itself on the second canvas, i.e., determine the size of the second image.

[0106] Then the electronic device can determine the stretching ratio between the first image and the second image according to the size of the first image and the size of the second image, and scale the position parameters and the shape parameters according to the stretching ratio.

[0107] For example, the size information of the first image is: length 10, width 4, and the size information of the second image is: length 15, width 6. Then the stretching ratio between the first image and the second image includes: horizontal stretching ratio (10:15) and vertical stretching ratio (4:6). Assuming that the position parameters of the two-dimensional data (circle) are the center coordinates (3, 3), and the shape parameters are the radius 0.5, then because the values of the horizontal stretching ratio and the vertical stretching ratio between the first image and the second image are the same, the electronic device can directly scale the center coordinates and the radius of the circle according to the horizontal stretching ratio or the vertical stretching ratio between the first image and the second image, to obtain the scaled position parameters as the center coordinates (4.5, 4.5), and the scaled shape parameters as the radius 0.75.

[0108] In order to describe more clearly, let's take another example. Assuming that the size information of the first image is: length 4, width 2, and the size information of the second image is: length 8, width 6. Then the stretching ratio between the first image and the second image includes: horizontal stretching ratio (4:8) and vertical stretching ratio (2:6). Assuming that the position parameters of the two-dimensional data (rectangle) are the top-left vertex coordinates (3, 3), and the shape parameters are: length 1, width 1, then the electronic device can scale the horizontal coordinate of the top-left vertex of the rectangle and the length of the rectangle according to the horizontal stretching ratio (4:8) between the first image and the second image, to obtain the scaled horizontal coordinate as 6 and the scaled length as 2, and scale the vertical coordinate of the top-left vertex of the rectangle and the width of the rectangle according to the vertical stretching ratio (2:6) between the first image and the second image, to obtain the scaled vertical coordinate as 9 and the scaled width as 3. That is, the scaled position parameters are the top-left vertex (6, 9), and the scaled shape parameters are length 2, width 3.

[0109] S202, determine the distance between the two adjacent sides of the circumscribed rectangle of the second image and the corresponding two adjacent sides of the first canvas.

[0110] After the step of displaying the three-dimensional model on the first canvas is performed, the electronic device further determines distances between the three-dimensional model displayed on the first canvas and two adjacent boundaries of the first canvas respectively, wherein the distance between the three-dimensional model and the boundary of the first canvas is measured by the distance between the circumscribed rectangle of the projection image of the three-dimensional model on the second canvas and the boundary of the first canvas.

[0111] When the electronic device determines the distances between the adjacent two sides of the circumscribed rectangle of the second image and the corresponding adjacent two boundaries in the first canvas, it can first determine which two adjacent sides of the circumscribed rectangle of the second image need to be used by the following way:

[0112] When the three-dimensional model is displayed centrally in the first canvas, the distances between the circumscribed rectangle of the second image and the upper and lower boundaries of the first canvas are equal, and similarly, the distances between the circumscribed rectangle of the second image and the left and right boundaries of the first canvas are also equal. Therefore, in this case, the electronic device can use any two adjacent sides of the circumscribed rectangle of the second image when determining the distances. That is, the upper and left sides of the circumscribed rectangle of the second image can be used, or the upper and right sides of the circumscribed rectangle of the second image can be used, or the lower and left sides of the circumscribed rectangle of the second image can be used, or the lower and right sides of the circumscribed rectangle of the second image can be used.

[0113] When the three-dimensional model is not displayed centrally in the first canvas, the electronic device needs to keep the position of the intersection of the two adjacent sides of the circumscribed rectangle of the second image consistent with the position of the coordinate origin in the coordinate system of the first image when determining the distances.

[0114] For example, if the position of the coordinate origin in the coordinate system of the first image is the upper left corner, then the left and upper sides of the circumscribed rectangle of the second image need to be used; if the position of the coordinate origin in the coordinate system of the first image is the lower left corner, then the left and lower sides of the circumscribed rectangle of the second image need to be used; if the position of the coordinate origin in the coordinate system of the first image is the lower right corner, then the right and lower sides of the circumscribed rectangle of the second image need to be used; and if the position of the coordinate origin in the coordinate system of the first image is the upper right corner, then the right and upper sides of the circumscribed rectangle of the second image need to be used.

[0115] After the electronic device determines which two adjacent sides of the circumscribed rectangle of the second image need to be used, it can determine the adjacent two boundaries corresponding to the two adjacent sides from the boundaries of the first canvas, wherein the two adjacent sides are in the same position as the adjacent two boundaries.

[0116] For example, if the top and left sides of the bounding rectangle of the second image are used, then the two adjacent boundaries are the top and left boundaries of the first canvas; if the top and right sides of the bounding rectangle of the second image are used, then the two adjacent boundaries are the top and right boundaries of the first canvas; if the bottom and left sides of the bounding rectangle of the second image are used, then the two adjacent boundaries are the bottom and left boundaries of the first canvas; if the bottom and right sides of the bounding rectangle of the second image are used, then the two adjacent boundaries are the bottom and right boundaries of the first canvas.

[0117] Accordingly, the distances between the two adjacent sides of the determined second image's circumscribed rectangle and the corresponding adjacent boundaries in the first canvas can include: horizontal distance and vertical distance. The horizontal distance is the distance between the vertical side of the circumscribed rectangle and the corresponding vertical boundary in the first canvas, and the vertical distance is the distance between the horizontal side of the circumscribed rectangle and the corresponding horizontal boundary in the first canvas.

[0118] by Figure 3a For example, the 3D model displayed on the first canvas is 301, and the bounding rectangle of its corresponding second image is 302. Since the 3D model is centered on the first canvas, any two adjacent sides of the bounding rectangle 302 can be used to determine the distances. Assuming the top and left sides of the bounding rectangle 302 are used, the corresponding adjacent boundaries in the first canvas are the top and left boundaries. The distances between the adjacent sides of the bounding rectangle of the second image and the corresponding adjacent boundaries in the first canvas include a horizontal distance of 3 and a vertical distance of 5.

[0119] S203, adjust the horizontal parameter of the scaled position parameter according to the horizontal distance.

[0120] S204, adjusts the vertical parameter of the scaled position parameter according to the vertical distance.

[0121] Because the position parameters of the two-dimensional data include two sub-parameters, namely a horizontal parameter and a vertical parameter, and simultaneously, the distances between the adjacent sides of the second image's circumscribed rectangle determined by the electronic device and their corresponding adjacent boundaries in the first canvas also include two distances, namely a horizontal distance and a vertical distance. Therefore, the electronic device can adjust the horizontal parameter based on the horizontal distance and the vertical parameter based on the vertical distance. Specifically, it adds the horizontal distance to the scaled horizontal parameter of the position parameters and adds the vertical distance to the scaled vertical parameter of the position parameters.

[0122] Following the examples of two-dimensional data as circles and distances mentioned above, in Figure 3bIn the figure, the circle defined by the circle center coordinate (3, 3) and the radius 0.5 is 303. After scaling the circle center coordinate and the radius according to the stretching ratio between the second image and the first image, the scaled circle center coordinate and the scaled radius, i.e., the circle center coordinate (4.5, 4.5) and the radius 0.75, are obtained. After the electronic device increases the horizontal distance 3 based on the horizontal coordinate of the circle center coordinate and increases the vertical distance 5 based on the vertical coordinate of the circle center coordinate, the adjusted circle center coordinate (7.5, 9.5) and the radius 0.75 are obtained, and the circle defined by the adjusted circle center coordinate and the scaled radius is 305. Finally, the combination display effect of the two-dimensional data and the three-dimensional model can be as shown in the figure. Figure 3c

[0123] It should be noted that, because the sizes of the first canvas and the second canvas are the same, in order to distinguish the two, the boundaries of the two are represented by straight lines and wavy lines in the figure, respectively. Figures 3a-3c In order to facilitate understanding of the position parameter and the shape parameter, the grid in the figure represents a unit distance. Figures 3a-3b The three-dimensional model of the vehicle shown in the figure is the three-dimensional model displayed on the first canvas, Figures 3a-3c The circle shown by the dashed line in the figure is only a schematic representation of the position of the two-dimensional data on the second canvas, and is not the actual display effect. Figure 3b

[0124] In the figure, the circle defined by the circle center coordinate (3, 3) and the radius 0.5 is 303. After scaling the circle center coordinate and the radius according to the stretching ratio between the second image and the first image, the scaled circle center coordinate and the scaled radius, i.e., the circle center coordinate (4.5, 4.5) and the radius 0.75, are obtained. After the electronic device increases the horizontal distance 3 based on the horizontal coordinate of the circle center coordinate and increases the vertical distance 5 based on the vertical coordinate of the circle center coordinate, the adjusted circle center coordinate (7.5, 9.5) and the radius 0.75 are obtained, and the circle defined by the adjusted circle center coordinate and the scaled radius is 305. Finally, the combination display effect of the two-dimensional data and the three-dimensional model can be as shown in the figure. Figure 2 It should be noted that, because the sizes of the first canvas and the second canvas are the same, in order to distinguish the two, the boundaries of the two are represented by straight lines and wavy lines in the figure, respectively.

[0125] In the scheme provided by the embodiment of the application, the electronic device can first create a second canvas with the same size as the first canvas, and then scale the position parameter and the shape parameter according to the stretching ratio between the second image and the first image, so that the two-dimensional data adapts to the three-dimensional model with the changed size, and finally adjust the position parameter of the two-dimensional data after scaling according to the distance between the three-dimensional model and the boundary of the first canvas, so as to determine the accurate position of the two-dimensional data, and thus realize the accurate alignment of the two-dimensional data and the three-dimensional model. Moreover, because the electronic device displays the two-dimensional data on the second canvas which is relatively large compared with the projection image of the currently displayed three-dimensional model, even if the two-dimensional data exceeds the size of the projection image in the projection image, the two-dimensional data can be completely displayed on the second canvas, and the problem of display loss does not occur.

[0126] ​​In the second implementation, the electronic device can set the size of the second canvas to be the same as the size of the second image when creating the second canvas.

[0127] In one implementation, the electronic device can create a second canvas with the same size as the second image by Figure 4

[0128] S401, create an initial canvas on the upper layer of the first canvas.

[0129] In addition to obtaining the model parameters of the three-dimensional model and the data parameters of the two-dimensional data, the electronic device can also obtain the size information of the first image to which the two-dimensional data is added. Thus, when creating the initial canvas, the electronic device can create an initial canvas with the same size as the first image on the upper layer of the first canvas.

[0130] For example, the length and width of the first image are 9 and 3 respectively. After displaying the three-dimensional model on the first canvas, the electronic device can create an initial canvas with the length and width of 9 and 3 respectively on the upper layer of the first canvas. At this time, the initial canvas created by the electronic device can be as shown in Figure 5a

[0131] S402, stretch the initial canvas with the center point of the initial canvas as the base point to obtain the second canvas.

[0132] After displaying the three-dimensional model on the first canvas, the electronic device can determine the projection image of the three-dimensional model on the second canvas, that is, determine the second image, and record the size information of the circumscribed rectangle of the second image. Further, after creating the initial canvas, the electronic device can stretch the initial canvas with the center point of the initial canvas as the base point to the same size as the circumscribed rectangle of the second image to obtain the second canvas.

[0133] Continuing the above example, in Figure 5a , the size information of the circumscribed rectangle of the projection image of the three-dimensional model displayed on the first canvas under the target view angle is: length 15, width 5. After creating the initial canvas, the electronic device can stretch the initial canvas with the center point of the initial canvas as the base point to the same size as the minimum circumscribed rectangle to obtain the second canvas as shown in Figure 5b

[0134] In this case, when converting the position parameters and shape parameters into parameters under the coordinate system of the second canvas, the electronic device can perform the following:

[0135] According to the stretching ratio between the second image and the first image, scale the position parameters and shape parameters.

[0136] ​​​Wherein, "scaling the position parameter and the shape parameter according to the stretching ratio between the second image and the first image" has been discussed in detail in the above step S201, and will not be repeated here.

[0137] In the scheme provided by the embodiments of the present application, the electronic device can create a second canvas with the same size as the circumscribed rectangle of the projection image of the three-dimensional model displayed on the first canvas at the target view angle, and then scale the position parameter and the shape parameter of the two-dimensional data according to the stretching ratio between the first image and the second image, so as to adapt the two-dimensional data to the three-dimensional model with the changed size, and then realize the accurate alignment of the two-dimensional data and the three-dimensional model.

[0138] Corresponding to the combination display method of the two-dimensional data and the three-dimensional model, the embodiments of the present application also provide a combination display device of two-dimensional data and three-dimensional model, which will be introduced below.

[0139] As shown in Figure 6 A combination display device of two-dimensional data and three-dimensional model, comprising:

[0140] The parameter acquisition module 610 is configured to acquire model parameters of a three-dimensional model and data parameters of two-dimensional data, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in the coordinate system of the first image.

[0141] The first display module 620 is configured to display the three-dimensional model on a first canvas based on the model parameters.

[0142] The canvas creation module 630 is configured to create a second canvas on the upper layer of the first canvas, wherein the center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas.

[0143] The parameter conversion module 640 is configured to convert the position parameters and the shape parameters into parameters in the coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data on the second image defined by the converted position parameters and the converted shape parameters are aligned with the position and shape of the two-dimensional data on the first image defined by the unconverted position parameters and the unconverted shape parameters.

[0144] The second display module 650 is configured to display the two-dimensional data on the second canvas based on the converted position parameters and the converted shape parameters.

[0145] In the scheme provided by the embodiments of the present application, the model parameters of the three-dimensional model and the data parameters of the two-dimensional data are obtained, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in the coordinate system of the first image; the three-dimensional model is displayed on a first canvas based on the model parameters; a second canvas is created on the upper layer of the first canvas, wherein the center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas; the position parameters and the shape parameters are converted into parameters in the coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data defined by the converted position parameters and the converted shape parameters on the second image are aligned with the position and shape of the two-dimensional data defined by the unconverted position parameters and the unconverted shape parameters on the first image; and the two-dimensional data is displayed on the second canvas based on the converted position parameters and the converted shape parameters. By converting the position parameters and the shape parameters into parameters in the coordinate system of the second canvas, the display position and shape of the two-dimensional data on the second canvas can be aligned with the display position and shape of the two-dimensional data on the projection image corresponding to the previously displayed three-dimensional model, and the center point of the second canvas is aligned with the center point of the currently displayed three-dimensional model, which can make the display position and shape of the two-dimensional data on the second canvas consistent with the display position and shape of the two-dimensional data on the image projected by the currently displayed three-dimensional model on the second canvas, so that the position and shape of the two-dimensional data defined by the converted data parameters on the projection image corresponding to the currently displayed three-dimensional model are aligned with the position and shape of the two-dimensional data defined by the unconverted data parameters on the projection image corresponding to the previously displayed three-dimensional model, thereby realizing automatic and accurate alignment of the two-dimensional data and the three-dimensional model. Compared with the manual alignment method, the automatic alignment can greatly improve the processing efficiency.

[0146] As an embodiment of the embodiments of the present application, the size of the first canvas can be the same as the size of the second canvas.

[0147] The parameter conversion module 640 can be specifically configured to scale the position parameters and the shape parameters according to the stretching ratio between the second image and the first image; determine the distance between the adjacent two sides of the circumscribed rectangle of the second image and the corresponding adjacent two side boundaries in the first canvas; the distance includes a horizontal distance and a vertical distance, the horizontal distance is the distance between the vertical side of the circumscribed rectangle and the corresponding vertical side boundary in the first canvas, and the vertical distance is the distance between the horizontal side of the circumscribed rectangle and the corresponding horizontal side boundary in the first canvas; adjust the horizontal parameter of the scaled position parameters according to the horizontal distance; and adjust the vertical parameter of the scaled position parameters according to the vertical distance.

[0148] As an implementation of the embodiment of the present application, the size of the second canvas can be the same as the size of the circumscribed rectangle of the second image.

[0149] The parameter conversion module 640 can be specifically configured to scale the position parameter and the shape parameter according to the stretching ratio between the second image and the first image.

[0150] As an implementation of the embodiment of the present application, the determination manner of the model parameter of the three-dimensional model and the data parameter of the two-dimensional data can include:

[0151] displaying the three-dimensional model on a third canvas, adjusting the three-dimensional model to a target view angle, recording the three-dimensional shape parameter and the geometric transformation parameter of the adjusted three-dimensional model as the model parameter of the three-dimensional model;

[0152] obtaining a projection image of the three-dimensional model displayed on the third canvas under the target view angle as the first image, and displaying the first image on a fourth canvas;

[0153] obtaining the two-dimensional data added by the user on the first image;

[0154] determining the type of the two-dimensional data, and recording the shape parameter and the position parameter of the two-dimensional data as the data parameter of the two-dimensional data according to the shape parameter type and the position parameter type corresponding to the type.

[0155] As an implementation of the embodiment of the present application, the model parameter can include a three-dimensional shape parameter and a geometric transformation parameter, the three-dimensional shape parameter can include a size parameter and a shape type, and the geometric transformation parameter can include a rotation angle and a scaling ratio of the three-dimensional model on each coordinate axis.

[0156] In the case that the two-dimensional data is a rectangle, the shape parameter can include a size parameter of the rectangle and a rotation angle of the rectangle, and the position parameter can include coordinates of a vertex of the rectangle.

[0157] In the case that the two-dimensional data is a circle, the shape parameter can include a radius of the circle, and the position parameter can include a center coordinate of the circle.

[0158] In the case that the two-dimensional data is text, the shape parameter can include text content, and the position parameter can include a starting coordinate of the text.

[0159] As an implementation of the embodiment of the present application, the data format of the data parameter can be Base64, and the first canvas and the second canvas can be canvas.

[0160] Corresponding to the combination display method of the two-dimensional data and the three-dimensional model, the embodiment of the present application further provides an electronic device, which comprises:Figure 7 As shown, comprising:

[0161] The memory 701 is configured to store a computer program.

[0162] The processor 702 is configured to execute the program stored in the memory 701, and realize the display method of combining two-dimensional data and three-dimensional model according to any one of the above embodiments.

[0163] In the scheme provided by the embodiment of the application, the model parameters of the three-dimensional model and the data parameters of the two-dimensional data are acquired, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in a coordinate system of the first image; the three-dimensional model is displayed on a first canvas based on the model parameters; a second canvas is created on an upper layer of the first canvas, wherein a center point of the second canvas is aligned with a center point of the three-dimensional model displayed on the first canvas; the position parameters and the shape parameters are converted into parameters in a coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data on the second image defined by the converted position parameters and the converted shape parameters are aligned with the position and shape of the two-dimensional data on the first image defined by the unconverted position parameters and the unconverted shape parameters; and the two-dimensional data is displayed on the second canvas based on the converted position parameters and the converted shape parameters. By converting the position parameters and the shape parameters into parameters in the coordinate system of the second canvas, the display position and shape of the two-dimensional data on the second canvas can be aligned with the display position and shape of the two-dimensional data on the projection image corresponding to the three-dimensional model, and the center point of the second canvas is aligned with the center point of the three-dimensional model, which can make the display position and shape of the two-dimensional data on the second canvas consistent with the display position and shape of the two-dimensional data on the image projected by the currently displayed three-dimensional model on the second canvas, so that the position and shape of the two-dimensional data on the projection image corresponding to the currently displayed three-dimensional model defined by the converted data parameters are aligned with the position and shape of the two-dimensional data on the projection image corresponding to the previously displayed three-dimensional model defined by the unconverted data parameters, and automatic and accurate alignment of the two-dimensional data and the three-dimensional model is realized. Meanwhile, compared with the manual alignment mode, the automatic alignment can greatly improve the processing efficiency.

[0164] The electronic device can further include a communication bus and / or a communication interface, and the processor 702, the communication interface, and the memory 701 can communicate with each other through the communication bus.

[0165] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0166] The communication interface is used for communication between the above electronic device and other devices.

[0167] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the above-mentioned processor.

[0168] The above processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0169] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the display method of the combination of two-dimensional data and a three-dimensional model according to any one of the above embodiments.

[0170] In another embodiment provided in the present application, a computer program product containing instructions is also provided, and when the computer program product is run on a computer, the computer is caused to execute the display method of the combination of two-dimensional data and a three-dimensional model according to any one of the above embodiments.

[0171] In the embodiments described above, all or some of the steps can be implemented by using software, hardware, firmware or any combination thereof. When implemented by using software, all or some of the steps can be implemented in form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded into and executed by a computer, all or some of the procedures or functions as described in the embodiments of the present application are performed. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatuses. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium or a set of medium including one or more of the available medium that is integrated into a server, data center, etc. data storage device. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a solid state disk (SSD), etc.

[0172] It should be noted that the relative terms such as first and second, etc., are used herein only to differentiate one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0173] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, electronic device, computer readable storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0174] The above merely provides the preferred embodiment of the present application, and not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method of displaying a combination of two-dimensional data and a three-dimensional model, characterized by, The method comprises: obtaining model parameters of a three-dimensional model and data parameters of two-dimensional data, wherein the data parameters comprise shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate the position of the two-dimensional data in a coordinate system of the first image; displaying the three-dimensional model on a first canvas based on the model parameters; creating a second canvas on the upper layer of the first canvas, wherein the center point of the second canvas is aligned with the center point of the three-dimensional model displayed on the first canvas; converting the position parameters and the shape parameters into parameters in a coordinate system of the second canvas, wherein the image of the three-dimensional model projected on the second canvas is a second image, and the position and shape of the two-dimensional data defined by the converted position parameters and the converted shape parameters in the second image are aligned with the position and shape of the two-dimensional data defined by the unconverted position parameters and the unconverted shape parameters in the first image; displaying the two-dimensional data on the second canvas based on the converted position parameters and the converted shape parameters.

2. The method of claim 1, wherein, The size of the first canvas is the same as the size of the second canvas; the conversion of the position parameters and the shape parameters into parameters in the coordinate system of the second canvas comprises: scaling the position parameters and the shape parameters according to the stretching ratio between the second image and the first image; determining the distance between the adjacent two sides of the circumscribed rectangle of the second image and the corresponding adjacent two side boundaries in the first canvas; the distance comprises a horizontal distance and a vertical distance, the horizontal distance is the distance between the vertical side of the circumscribed rectangle and the corresponding vertical side boundary in the first canvas, and the vertical distance is the distance between the horizontal side of the circumscribed rectangle and the corresponding horizontal side boundary in the first canvas; adjusting the horizontal parameters of the scaled position parameters according to the horizontal distance; adjusting the vertical parameters of the scaled position parameters according to the vertical distance.

3. The method of claim 1, wherein, The size of the second canvas is the same as the size of the circumscribed rectangle of the second image; the conversion of the position parameters and the shape parameters into parameters in the coordinate system of the second canvas comprises: scaling the position parameters and the shape parameters according to the stretching ratio between the second image and the first image.

4. The method of claim 1, wherein, The determination method of the model parameters of the three-dimensional model and the data parameters of the two-dimensional data comprises: displaying the three-dimensional model on a third canvas, adjusting the three-dimensional model to the target view angle, recording the three-dimensional shape parameters and the geometric transformation parameters of the adjusted three-dimensional model as the model parameters of the three-dimensional model; obtaining the projection image of the three-dimensional model displayed on the third canvas at the target view angle as the first image, and displaying the first image on a fourth canvas; obtaining the two-dimensional data added by a user on the first image; Determine the type of the two-dimensional data, and record the shape parameter and the position parameter of the two-dimensional data as data parameters of the two-dimensional data according to the shape parameter type and the position parameter type corresponding to the type.

5. The method according to any one of claims 1 to 4, characterized in that, The model parameter includes a three-dimensional shape parameter and a geometric transformation parameter, the three-dimensional shape parameter includes a size parameter and a shape type, and the geometric transformation parameter includes a rotation angle and a scaling ratio of the three-dimensional model on each coordinate axis. In a case where the two-dimensional data is a rectangle, the shape parameter includes a size parameter of the rectangle and a rotation angle of the rectangle, and the position parameter includes coordinates of a vertex of the rectangle. In a case where the two-dimensional data is a circle, the shape parameter includes a radius of the circle, and the position parameter includes a center coordinate of the circle. In a case where the two-dimensional data is text, the shape parameter includes text content, and the position parameter includes a starting coordinate of the text.

6. The method according to any one of claims 1 to 4, characterized in that, The data format of the data parameter is Base64, and the first canvas and the second canvas are canvas.

7. A display device combining two-dimensional data and a three-dimensional model, characterized in that, The device includes: The parameter acquisition module is configured to acquire model parameters of a three-dimensional model and data parameters of two-dimensional data, wherein the data parameters include shape parameters and position parameters, the two-dimensional data is data added on a first image, the first image is a projection image of the three-dimensional model at a target view angle, and the position parameters indicate positions of the two-dimensional data in a coordinate system of the first image. The first display module is configured to display the three-dimensional model on a first canvas based on the model parameters. The canvas creation module is configured to create a second canvas on an upper layer of the first canvas, wherein a center point of the second canvas is aligned with a center point of the three-dimensional model displayed on the first canvas. The parameter conversion module is configured to convert the position parameters and the shape parameters into parameters in a coordinate system of the second canvas, wherein a projection image of the three-dimensional model on the second canvas is a second image, and a position and a shape of two-dimensional data defined by the converted position parameters and the converted shape parameters on the second image are aligned with a position and a shape of two-dimensional data defined by the unconverted position parameters and the unconverted shape parameters on the first image. The second display module is configured to display the two-dimensional data on the second canvas based on the converted position parameters and the converted shape parameters.

8. The apparatus of claim 7, wherein, The size of the first canvas is the same as the size of the second canvas; the parameter conversion module is specifically configured to scale the position parameter and the shape parameter according to a stretching ratio between the second image and the first image; determine distances between two adjacent sides of a circumscribed rectangle of the second image and two corresponding adjacent sides of the first canvas, wherein the distances include a horizontal distance and a vertical distance, the horizontal distance is a distance between a vertical side of the circumscribed rectangle and a corresponding vertical side of the first canvas, and the vertical distance is a distance between a horizontal side of the circumscribed rectangle and a corresponding horizontal side of the first canvas; adjust a horizontal parameter of the scaled position parameter according to the horizontal distance; and adjust a vertical parameter of the scaled position parameter according to the vertical distance. Or, The size of the second canvas is the same as the size of the circumscribed rectangle of the second image; the parameter conversion module is specifically configured to scale the position parameter and the shape parameter according to a stretching ratio between the second image and the first image. Or, The model parameter of the three-dimensional model and the data parameter of the two-dimensional data are determined in the following manner: displaying the three-dimensional model on a third canvas, adjusting the three-dimensional model to the target view angle, recording three-dimensional shape parameters and geometric transformation parameters of the adjusted three-dimensional model as the model parameter of the three-dimensional model; obtaining a projection image of the three-dimensional model displayed on the third canvas at the target view angle as the first image, and displaying the first image on a fourth canvas; obtaining two-dimensional data added by a user on the first image; determining a type of the two-dimensional data, and recording shape parameters and position parameters of the two-dimensional data as the data parameter of the two-dimensional data according to a shape parameter type and a position parameter type corresponding to the type; Or, The model parameter includes three-dimensional shape parameters and geometric transformation parameters, the three-dimensional shape parameters include size parameters and a shape type, and the geometric transformation parameters include rotation angles and scaling ratios of the three-dimensional model on respective coordinate axes; in a case where the two-dimensional data is a rectangle, the shape parameter includes size parameters of the rectangle and a rotation angle of the rectangle, and the position parameter includes coordinates of a vertex of the rectangle; in a case where the two-dimensional data is a circle, the shape parameter includes a radius of the circle, and the position parameter includes a center coordinate of the circle; in a case where the two-dimensional data is text, the shape parameter includes text content, and the position parameter includes a starting coordinate of the text. Or, The data format of the data parameter is Base64, and the first canvas and the second canvas are canvas.

9. An electronic device, comprising: Comprise: A memory for storing a computer program; A processor for executing the program stored on the memory to implement the method of any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Drawing feature and number matching method, system, equipment and medium

    CN116206320A

  • Data processing method and device, equipment and medium

    CN116758205A