Three-dimensional graph recognition method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of image processing, in particular to a three-dimensional image recognition method, a three-dimensional image recognition device, three-dimensional image recognition equipment and a storage medium.
Background
The dimension object recognition is a research hotspot in the field of computer vision in recent years, and has important application prospects in the aspects of automatic driving, medical image processing and the like. However, the existing three-dimensional pattern recognition technology still has the problems that the existing three-dimensional pattern recognition technology is more complex, and the three-dimensional pattern recognition based on deep learning needs more training data and is not flexible enough, so that a more effective scheme needs to be provided.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a three-dimensional pattern recognition method, a device, equipment and a storage medium, which effectively solve the problems that deep learning three-dimensional pattern recognition needs more training data and is not flexible enough, and improve the recognition accuracy.
The invention solves the technical problems by the following technical means:
a method of three-dimensional pattern recognition, the method comprising:
determining the characteristic point distance between the graphic characteristic points according to the position coordinates of each graphic characteristic point in the target source graphic;
similar primitive objects with the same characteristic point distance in a preset range are searched in a circulating mode, and grouping is conducted according to the primitive data types of the similar primitive objects;
forming a new graph by extracting similar primitive objects in each group to obtain graph data;
rendering pre-acquired graphic data through an image rendering element of a browser to generate a target three-dimensional object, wherein the graphic data are displayed on the surface of the target three-dimensional object;
and displaying the target three-dimensional object in a browsing page of the browser.
Preferably, before determining the feature point distance between the feature points according to the position coordinates of each feature point in the target source graph, the method further includes: acquiring a preselected target source graph;
collecting a plurality of graph feature points in a target source graph;
the method also comprises the following steps of before acquiring the source graph: a predefined configuration file is read.
Preferably, the determining the feature point distances between the feature points of the graph according to the position coordinates of each feature point of the graph in the target source graph comprises:
inputting a preselected target source graph into a neural network for feature extraction to obtain image features of the target source graph in at least one network level;
calculating the Euclidean distance between the real value corresponding to the image feature and the network predicted value;
calculating the Euclidean distance between a real value corresponding to the image feature and a network predicted value according to the following formula:
wherein x is a 3D point, R and t are a rotation matrix and a translation vector corresponding to the true value,
and
the prediction values are rotation matrix and translation vector.
Preferably, the forming a new graph by extracting similar primitive objects in each group includes:
acquiring the quantity of graphic elements in a target source graph;
and when the number of the primitives is equal to that of the primitives of the similar primitive object, stopping the extraction action and obtaining a new graph.
Preferably, the image rendering element includes: a two-dimensional image rendering element and a three-dimensional image rendering element; the rendering the text data through the image rendering element of the browser to generate a target three-dimensional object includes: drawing the text data on a canvas through a character drawing interface of the two-dimensional image rendering element to obtain a target canvas; converting the target canvas through a picture conversion interface of the two-dimensional image rendering element to generate a target picture; and rendering the target picture to an original three-dimensional object through a three-dimensional drawing interface called by the three-dimensional image rendering element to obtain the target three-dimensional object.
Preferably, the displaying the target three-dimensional object in a browsing page of the browser includes: acquiring speed data of the target three-dimensional object; dynamically displaying the target three-dimensional object in the browsing page according to the speed data; wherein the speed data is used for controlling the movement speed of the target three-dimensional object on the browsing page; the speed data includes: the speed of a vertical axis used for controlling the target three-dimensional object to move upwards or downwards in the browsed page and the speed of a horizontal axis used for controlling the target three-dimensional object to move leftwards or rightwards in the browsed page.
Preferably, the displaying the target three-dimensional object in a browsing page of the browser includes: responding to the moving operation of the target three-dimensional object, and dynamically displaying the target three-dimensional object in the browsing page according to the moving track indicated by the moving operation; and matching the movement track of the target three-dimensional object in the browsing page with the movement track indicated by the movement operation.
A three-dimensional pattern recognition apparatus, the apparatus comprising:
the determining module is used for determining the characteristic point distance between the graphic characteristic points according to the position coordinates of each graphic characteristic point in the target source graph;
the searching module is used for circularly searching similar primitive objects with the same characteristic point distance in a preset range and grouping the similar primitive objects according to the primitive data types of the similar primitive objects;
the acquisition module is used for forming a new graph by extracting the similar primitive objects in each group and acquiring graph data;
the generating module is used for rendering pre-acquired graphic data through an image rendering element of a browser to generate a target three-dimensional object, and the graphic data are displayed on the surface of the target three-dimensional object;
and the display module is used for displaying the target three-dimensional object in a browsing page of the browser.
An apparatus for recognizing a three-dimensional figure, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method as a three-dimensional pattern recognition.
A computer-readable storage medium having computer program instructions stored thereon which, when executed by a processor, implement a method such as three-dimensional pattern recognition.
The invention has the beneficial effects that:
the invention provides a three-dimensional graph recognition method, a device, equipment and a storage medium, which overcome the problems of low voxel data resolution and texture loss, and obtain better recognition accuracy than the prior method by using less parameters. Firstly, determining the characteristic point distance between the characteristic points of the graphs according to the position coordinates of each characteristic point of the graphs in the target source graph; similar primitive objects with the same characteristic point distance in a preset range are searched in a circulating mode, and grouping is conducted according to the primitive data types of the similar primitive objects; secondly, forming a new graph by extracting similar primitive objects in each group to obtain graph data; and finally, rendering the pre-acquired graphic data through an image rendering element of the browser to generate a target three-dimensional object, and displaying the target three-dimensional object in a browsing page of the browser. The problem of the recognition of the geometric shape of the three-dimensional graph is effectively solved, and the problem of asynchronism caused by the fact that a plurality of cameras are used for collecting images is avoided. The method can replace the traditional multi-camera acquisition of graphic images, thereby eliminating the measurement error caused by asynchronous image acquisition.
Drawings
In order to more clearly illustrate the detailed description of the invention or the technical solutions in the prior art, the drawings that are needed in the detailed description of the invention or the prior art will be briefly described below. Throughout the drawings, like elements or portions are generally identified by like reference numerals. In the drawings, elements or portions are not necessarily drawn to scale.
Fig. 1 is a flowchart of a three-dimensional pattern recognition method provided by the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and therefore are only examples, and the protection scope of the present invention is not limited thereby.
It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which the invention pertains.
As shown in fig. 1, the present invention provides a general solution to a three-dimensional pattern recognition method for overcoming the drawbacks of the prior art, which mainly comprises the following steps:
step S1, determining the characteristic point distance between the graphic characteristic points according to the position coordinates of each graphic characteristic point in the target source graphic;
step S2, circularly searching similar primitive objects with the same characteristic point distance in a preset range, and grouping according to the primitive data types of the similar primitive objects;
step S3, forming a new graph by extracting similar primitive objects in each group, and acquiring graph data;
step S4, rendering pre-acquired graphic data through an image rendering element of a browser to generate a target three-dimensional object, wherein the graphic data are displayed on the surface of the target three-dimensional object;
and step S5, displaying the target three-dimensional object in a browsing page of the browser.
In step S1, before determining the feature point distance between the feature points of the graph according to the position coordinates of each feature point of the graph in the target source graph, the method further includes: acquiring a preselected target source graph;
collecting a plurality of graph feature points in a target source graph;
the method also comprises the following steps of before acquiring the source graph: a predefined configuration file is read.
Determining the feature point distance between the feature points of the graph according to the position coordinates of each feature point of the graph in the target source graph comprises the following steps:
inputting a preselected target source graph into a neural network for feature extraction to obtain image features of the target source graph in at least one network level;
calculating the Euclidean distance between the real value corresponding to the image feature and the network predicted value;
calculating the Euclidean distance between a real value corresponding to the image feature and a network predicted value according to the following formula:
wherein x is a 3D point, R and t are a rotation matrix and a translation vector corresponding to the true value,
and
the prediction values are rotation matrix and translation vector.
In step S3, forming a new graph by extracting similar primitive objects in each group includes:
acquiring the quantity of graphic elements in a target source graph;
and when the number of the primitives is equal to that of the primitives of the similar primitive object, stopping the extraction action and obtaining a new graph.
In step S4, the image rendering element includes: a two-dimensional image rendering element and a three-dimensional image rendering element; the rendering the text data through the image rendering element of the browser to generate a target three-dimensional object includes: drawing the text data on a canvas through a character drawing interface of the two-dimensional image rendering element to obtain a target canvas; converting the target canvas through a picture conversion interface of the two-dimensional image rendering element to generate a target picture; and rendering the target picture to an original three-dimensional object through a three-dimensional drawing interface called by the three-dimensional image rendering element to obtain the target three-dimensional object.
In step S5, the displaying the target three-dimensional object in the browsing page of the browser includes: acquiring speed data of the target three-dimensional object; dynamically displaying the target three-dimensional object in the browsing page according to the speed data; wherein the speed data is used for controlling the movement speed of the target three-dimensional object on the browsing page; the speed data includes: the speed of a vertical axis used for controlling the target three-dimensional object to move upwards or downwards in the browsed page and the speed of a horizontal axis used for controlling the target three-dimensional object to move leftwards or rightwards in the browsed page.
Displaying the target three-dimensional object in a browsing page of the browser, including: responding to the moving operation of the target three-dimensional object, and dynamically displaying the target three-dimensional object in the browsing page according to the moving track indicated by the moving operation; and matching the movement track of the target three-dimensional object in the browsing page with the movement track indicated by the movement operation.
Example 2:
based on the same technical concept, the specific embodiment of the present invention further provides a three-dimensional image recognition apparatus, including:
the determining module is used for determining the characteristic point distance between the graphic characteristic points according to the position coordinates of each graphic characteristic point in the target source graph;
the searching module is used for circularly searching similar primitive objects with the same characteristic point distance in a preset range and grouping the similar primitive objects according to the primitive data types of the similar primitive objects;
the acquisition module is used for forming a new graph by extracting the similar primitive objects in each group and acquiring graph data;
the generating module is used for rendering pre-acquired graphic data through an image rendering element of a browser to generate a target three-dimensional object, and the graphic data are displayed on the surface of the target three-dimensional object;
and the display module is used for displaying the target three-dimensional object in a browsing page of the browser.
Further, according to the technical idea of the above embodiment, the embodiments of the present invention also provide a three-dimensional figure recognition apparatus and a computer-readable storage medium. Wherein, a three-dimensional figure's recognition equipment includes: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method of embodiment 1.
A computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method of embodiment 1.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.