Geometric figure processing method and device, equipment and storage medium

By recognizing, optimizing, and denoising geometric figures, vector elements are generated and edited, solving the problems of inaccurate geometric figure recognition and low editing efficiency in existing technologies, and achieving high-precision and high-efficiency geometric figure processing.

CN119131799BActive Publication Date: 2026-02-27SHENZHEN JYEOO NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411210915.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2026-02-27
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Existing image processing and recognition technologies are insufficient to meet the high accuracy and ease of editing requirements of geometric figures in educational settings, especially when processing geometric figures in scanned exam papers or photos. The recognition accuracy and efficiency are low, leading to the need for a large amount of manpower for subsequent adjustments.

Method used

By acquiring the image to be identified, the initial geometric inset is determined through identification and segmentation. Then, optimization and denoising processes are performed, image features are extracted, target geometric elements are classified and identified, their relationships are decomposed, vector elements are generated, and vectorization editing is performed based on editing instructions. Finally, the image is exported to a graphics resource library.

Benefits of technology

It achieves high-precision geometric shape recognition and vectorized editing, reducing the manpower cost of subsequent adjustments and improving the accuracy and efficiency of editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131799B_ABST
    Figure CN119131799B_ABST
Patent Text Reader

Abstract

The application provides a geometric figure processing method and device, equipment and a storage medium. The method comprises the following steps: acquiring a to-be-recognized image, and recognizing and cutting the to-be-recognized image to determine an initial geometric illustration; performing optimization processing on the initial geometric illustration to determine a target geometric illustration; performing denoising processing on the target geometric illustration to obtain a denoised geometric illustration, acquiring image features of the denoised geometric illustration, classifying the image features to determine a target geometric element, and determining a first vector element according to the target geometric element and a geometric element relationship obtained by disassembling the target geometric element; editing a to-be-edited vector element in the first vector element based on an editing instruction, determining a vector figure according to the to-be-edited vector element and a non-editing vector element, and exporting the vector figure to a figure resource library in a standard format. Thus, high-precision recognition is performed on the geometric figure, and the subsequent labor cost for adjusting the geometric figure is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of graphics processing, and particularly relates to a geometric figure processing method and device, equipment and a storage medium. BACKGROUND

[0002] With the rise of digital education, in order to transfer the geometric figures on paper text to online for display, teachers and students have an increasing demand for efficient and accurate geometric figure processing tools. Although existing image processing and recognition technologies provide a certain degree of solution, they often fail to meet the high standards of figure accuracy and editing convenience in the education scenario. Especially when processing geometric figures in scanned test papers or photos, due to the fluctuation of image quality and the interference of complex background, the accuracy and efficiency of recognition are not high, and then a large amount of manpower is needed to adjust the recognized geometric figures. SUMMARY

[0003] In view of the deficiencies of the prior art, the present application provides a geometric figure processing method, device, equipment and storage medium, aiming to solve the technical problem that the accuracy of recognizing geometric figures in the prior art is not high, and then a large amount of human resources is wasted to adjust them. Specifically:

[0004] In the first aspect, the embodiments of the present application provide a geometric figure processing method, which comprises: acquiring a to-be-recognized image, and recognizing and cutting the to-be-recognized image to determine an initial geometric figure; performing optimization processing on the initial geometric figure to determine a target geometric figure; performing denoising processing on the target geometric figure to obtain a denoised geometric figure, acquiring image features of the denoised geometric figure, classifying the image features to determine a target geometric element, and determining a first vector element according to the target geometric element and a geometric element relationship obtained by disassembling the target geometric element; wherein the target geometric element comprises at least one of a solid line, a dashed line, an arrow line segment, a circle, an ellipse, an angle, a circular arc, a curve and a text; editing a to-be-edited vector element in the first vector element based on an editing instruction, determining a vector figure according to the to-be-edited vector element and a non-editing vector element, and exporting the vector figure to a figure resource library in a standard format.

[0005] In a second aspect, an embodiment of the present application provides a geometric figure processing apparatus, which comprises: a recognition cutting module configured to acquire a to-be-recognized image, and to recognize and cut the to-be-recognized image to determine an initial geometric drawing; an optimization processing module configured to optimize the initial geometric drawing to determine a target geometric drawing; a vector element determination module configured to perform denoising processing on the target geometric drawing to obtain a denoised geometric drawing, to acquire image features of the denoised geometric drawing, to classify the image features to determine target geometric elements, and to determine first vector elements according to the target geometric elements and geometric element relationships obtained by disassembling the target geometric elements; wherein the target geometric elements comprise at least one of a solid line, a dashed line, a line segment with an arrow, a circle, an ellipse, an angle, a circular arc, a curve, and a text; and a derivation module configured to edit a to-be-edited vector element in the first vector elements based on an editing instruction, to determine a vector figure according to the to-be-edited vector element and non-editing vector elements, and to derive the vector figure into a standard format and export the vector figure into a figure resource library.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, which comprises one or more processors, a memory, and one or more application programs. The one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more application programs are configured to execute the method of the first aspect.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program codes. The program codes can be invoked by a processor to execute the method of the first aspect.

[0008] In the technical solution provided in the present application, the to-be-recognized image is acquired, and the to-be-recognized image is recognized and cut to determine an initial geometric drawing. The initial geometric drawing is optimized to determine a target geometric drawing. The target geometric drawing is denoised to obtain a denoised geometric drawing, the image features of the denoised geometric drawing are acquired, the image features are classified to determine target geometric elements, and first vector elements are determined according to the target geometric elements and geometric element relationships obtained by disassembling the target geometric elements. The to-be-edited vector elements in the first vector elements are edited based on an editing instruction, a vector figure is determined according to the to-be-edited vector elements and non-editing vector elements, and the vector figure is derived into a standard format and exported into a figure resource library. Thus, by performing high-precision recognition on geometric figures, the subsequent human cost for adjustment is greatly reduced. Meanwhile, since the initial geometric drawing is optimized, the geometric figure is recognized and disassembled to obtain corresponding vector elements, subsequent vectorization editing can be performed, which meets the needs of high-precision and high-efficiency recognition of geometric figures, and also meets the needs of high-efficiency and high-accuracy editing of the recognized geometric figures. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced as follows. Obviously, the drawings in the following description only represent some of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all other embodiments and drawings obtained by those of ordinary skill in the art without creative effort belong to the scope of the present application.

[0010] Figure 1 A flow diagram of a geometric figure processing method according to an embodiment of the present application is shown.

[0011] Figure 2 A flow diagram of another geometric figure processing method according to an embodiment of the present application is shown.

[0012] Figure 3 A structural block diagram of a geometric figure processing device according to an embodiment of the present application is shown.

[0013] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present application is shown.

[0014] Figure 5 A structural block diagram of a computer readable storage medium according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0015] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of the present application.

[0016] It should be understood that, when used in the present specification and the appended claims, the terms "comprise" and "include" indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0017] It should also be understood that the terms used in the present specification and the appended claims are only for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0018] It should also be further understood that the term "and / or" used in the description and the appended claims of the present application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0019] In the field of education, especially in the teaching and examination of subjects such as mathematics and physics, the accuracy and standardization of geometric figures are crucial for students to understand and master the knowledge points. However, in traditional education practice, teachers often need to manually draw or input geometric figures when preparing teaching materials or test papers, which not only consumes time but also is prone to errors. In addition, when it is necessary to adjust or personalize existing geometric figures, teachers often have to redraw them, which not only is inefficient but also is difficult to ensure the consistency and standardization of the figures.

[0020] With the rise of digital education, teachers and students have an increasing demand for efficient and accurate geometric figure processing tools. Although existing image processing and recognition technologies provide some solutions, they often fail to meet the high standards of accuracy and editing convenience in educational scenarios. Especially when dealing with geometric figures in scanned test papers or photos, due to fluctuations in image quality and interference from complex backgrounds, the accuracy and efficiency of recognition are not high, which in turn leads to the need for a large amount of manual editing of recognized geometric figures, resulting in low editing efficiency and errors.

[0021] Therefore, in order to solve the problems existing in the prior art, the present application proposes a geometric figure processing method, device, equipment and storage medium, which will be described below in conjunction with specific embodiments.

[0022] Please refer to Figure 1 , Figure 1 A geometric figure processing method provided by the present application is shown, which includes at least steps S110 to S140, specifically:

[0023] In step S110, an image to be recognized is obtained, and the image to be recognized is recognized and cut to determine an initial geometric drawing.

[0024] In the embodiments of the present application, the initial geometric drawing refers to a single geometric drawing obtained for recognition.

[0025] In the embodiments of the present application, the initial geometric drawing can be obtained by first obtaining a text image, then recognizing and cutting the text image to obtain the initial geometric drawing. The text image can be a test paper image, a photo image, or other images on paper, and the present application mainly takes the test paper image as an example for explanation and description.

[0026] In some embodiments, an image acquisition device with a camera or video module or other image acquisition module can be used to acquire text images, then automatically detect all geometric insets in the text images, and then cut all the detected geometric insets to obtain a single initial geometric inset.

[0027] In some embodiments, the image acquisition device may be, for example, a mobile phone, computer, camera, camcorder, and scanner. It is understood that, in order to improve subsequent recognition accuracy and editing speed, the image acquisition device may be a high-resolution device.

[0028] In step S120, the initial geometric inset is optimized to determine the target geometric inset.

[0029] In this embodiment of the application, the optimization process may include handwriting removal and binarization; handwriting removal is used to remove handwriting marks from the acquired initial geometric illustration; binarization is used to black and white the initial geometric illustration after removing handwriting marks to obtain a black and white geometric illustration, thereby improving the speed of subsequent geometric figure recognition.

[0030] Specifically, after obtaining the initial geometric illustration, the initial geometric illustration can be first processed to remove handwriting to obtain a de-handwritten geometric illustration. Then, the de-handwritten geometric illustration can be binarized to obtain the target geometric illustration, thereby optimizing the quality of the image for subsequent recognition and improving the subsequent recognition rate.

[0031] In step S130, the target geometric illustration is denoised to obtain a denoised geometric illustration. The image features of the denoised geometric illustration are obtained, the image features are classified to determine the target geometric elements, and the first vector element is determined based on the relationship between the target geometric elements and the geometric elements obtained by decomposing the target geometric elements.

[0032] In this embodiment of the application, geometric elements refer to the elements that make up the geometric illustration, including solid lines, dashed lines, arrowed line segments, circles, ellipses, angles, arcs, curves and text; vector elements refer to vectorized geometric elements; target geometric elements include at least one of solid lines, dashed lines, arrowed line segments, circles, ellipses, angles, arcs, curves and text; the first vector element is the vectorized target geometric element determined according to step S130.

[0033] In some embodiments, Gaussian filtering can be used to denoise the target geometric inset, wherein the Gaussian filtering formula is: , Let (a, b) be the Gaussian kernel function, and (a, b) be the center of the Gaussian kernel. The standard deviation is denoted as .

[0034] In other embodiments, the target geometric sketch can also be denoised using mean filtering, median filtering, wavelet denoising, non-local mean denoising, total variation denoising, and the like. It can be understood that since each denoising method corresponds to different denoising effects, the aforementioned denoising methods can be combined according to actual needs.

[0035] In some embodiments, an edge detection algorithm can be used to determine the image edges in the denoised geometric sketch, and then the image features corresponding to the image edges are obtained, so as to convert the target geometric sketch into a feature vector that can be understood and processed by a machine learning algorithm. The edge detection algorithm can be, for example, Sobel, Canny, and the like.

[0036] It can be understood that by denoising the target geometric sketch and extracting features, the accuracy of subsequent recognition can be improved.

[0037] Further, to better convert the feature vector into a vector form required by the machine learning algorithm, the feature vector can be simply spliced according to certain rules, or a dimension reduction method (e.g., PCA) is used to convert the aforementioned obtained feature vector into a lower-dimensional feature vector representation, at which time the image features are the low-dimensional feature vectors.

[0038] In some embodiments, after the image features are extracted, a classification machine learning algorithm can be used to classify the image features, so as to determine the target geometric elements corresponding to the target geometric sketch. The classification machine learning algorithm formula can be, for example, ; wherein, is the output of the neural network, is the weight, is the activation coefficient.

[0039] Further, in some embodiments, the classification machine learning algorithm can be, for example, a support vector machine (SVM), a random forest (Random Forest), a k-nearest neighbor (k-Nearest Neighbors), and the like.

[0040] In the embodiments of the present application, after the target geometric elements are obtained, the geometric element relationships between the target geometric elements can also be obtained. The geometric element relationships are used to represent the positional relationships of the target geometric elements in the coordinate system.

[0041] Specifically, the target geometric elements are first geometrically decomposed to determine the geometric element relationships between the target geometric elements, and then the first vector elements are determined based on the target geometric elements and the geometric element relationships. The positions of the first vector elements in the coordinate system correspond to the geometric element relationships.

[0042] Further, the target geometric element can be algebraized by analyzing geometric formulas (e.g., linear equation ) and topological relations (e.g., point on line, intersection of lines, etc.), the geometric element relation can be determined, and finally the first vector element can be determined according to the target geometric element and the geometric element relation corresponding to the target geometric element.

[0043] In some embodiments, the target geometric sketch can also be denoised to obtain a denoised geometric sketch, and then the first feature can be determined based on the first feature extraction method, the second feature can be determined based on the second feature extraction method, and the third feature can be determined based on the third feature extraction method. Then, the first element and the first element relation, the second element and the second element relation, and the third element and the third element relation can be determined according to the feature processing mode corresponding to the first feature, the second feature, and the third feature. The target geometric element can be determined according to the first element, the second element, and the third element, the geometric element relation can be determined according to the first element relation, the second element relation, and the third element relation, and finally the first vector element can be determined according to the target geometric element and the geometric element relation.

[0044] The first feature extraction method is to extract through ResNet50 and Sigmoid; the second feature extraction method is to first extract multi-scale features from the image, and then gradually up-sample low-resolution features from the extracted multi-scale features to generate high-resolution pixel-by-pixel features; the third feature extraction method is to extract through ResNet50; the first element includes angle, solid line, dashed line, and arrow line segment; the second element includes angle, circle, ellipse, curve, and circular arc; the third element includes text; the first feature is at least one corresponding feature of solid line, dashed line, and arrow line segment; the second feature is at least one corresponding feature of circle, ellipse, curve, and circular arc; the third feature is a corresponding feature of text; the text at least includes one of Chinese, English, and numbers; and the first feature, the second feature, and the third feature are image features.

[0045] Further, after determining the target geometric sketch, the target geometric sketch needs to be feature extracted using the first feature extraction method, the second feature extraction method, and the third feature extraction method; if the first feature is obtained according to the first feature extraction method, it indicates that the target geometric sketch includes a line segment (the line segment includes at least one of a solid line, a dashed line, and an arrow line segment), and thus the first element and the first element relationship need to be obtained, that is, the end point coordinates of the line segment and the intersection point coordinates of multiple line segments are obtained and the line segment type is determined, and then the direction and angle of each point are predicted; if the second feature is obtained according to the second feature extraction method, the corresponding second element and the second element relationship are obtained, and the specific process is that the circle and the ellipse are distinguished according to the distance from the major axis and the minor axis of the circle to the center of the circle, the center coordinates of the circle and the diameter of the circle and the major axis and the minor axis of the ellipse are calculated, the curve and the circular arc are determined according to the length of the arc, and the point coordinates, the angle, and the direction of the curve and the circular arc are calculated; if the third feature is obtained according to the third feature extraction method, the third element and the third element relationship are determined, that is, the text in the target geometric sketch and the text coordinates corresponding to each text are determined.

[0046] In some embodiments, the second feature extraction method further includes: determining an embedding vector of the target geometric sketch according to a Transformer, and then calculating cross attention according to the embedding vector and the pixel-by-pixel feature, so as to improve the performance of the model.

[0047] In some embodiments, the circular arc can be an arc line with a relatively short length and surrounded by an included angle formed by two straight lines; the diameter of the circle is determined by the distance from the center to the side.

[0048] In some embodiments, in order to reduce the subsequent workload of manual adjustment, the points of each coordinate on the arc line can be fitted and corrected, and finally a smooth curve is obtained.

[0049] In some embodiments, in order to ensure the accuracy of the text, on the basis of the above steps, the corresponding text can also be cut from the initial geometric sketch according to the text coordinates and recognized again by using a Transformer+CTC structure. It can be understood that after the coordinates of the text and the specific content of the text are determined, the text can be finally filled into the first vector element.

[0050] Further, after determining the target geometric element and the geometric element relationship, the target geometric element is vectorized based on the target geometric element and the geometric element relationship, so as to obtain the first vector element.

[0051] In some embodiments, in order to facilitate subsequent editing, the obtained solid line, dashed line, arrow line segment, circle, ellipse, circular arc, curve, and text can be displayed in different layer areas respectively.

[0052] In step S140, the to-be-edited vector elements in the first vector elements are edited based on the editing instruction, a vector graph is determined according to the to-be-edited vector elements and non-edited vector elements, and the vector graph is exported to a graph resource library in a standard format.

[0053] In the embodiments of the present application, the editing instruction is an editing instruction selected by a user, the standard format is an SVG format, the graph resource library can be a teaching graph resource library, the to-be-edited vector elements are vector elements corresponding to the editing instruction and needing to be edited and adjusted, and the non-edited vector elements are vector elements not needing to be adjusted.

[0054] Specifically, since the solid line, the dashed line, the arrow line segment, the circle, the ellipse, the arc, the curve and the text are respectively in different layers, after the editing instruction is obtained, the to-be-edited vector elements corresponding to the editing instruction can be determined, then the to-be-edited vector elements in the first vector elements are edited based on the editing instruction, and finally the vector graph corresponding to the first vector elements is obtained, so as to realize vector editing. Each editing instruction corresponds to a to-be-edited vector element, and the to-be-edited vector element is at least one of the solid line, the dashed line, the arrow line segment, the circle, the ellipse, the arc, the curve and the text.

[0055] It can be understood that, since the initial geometric graph has been recognized with high precision before editing, subsequent editing operation is not needed to adjust the first vector elements to obtain the vector graph corresponding to the initial geometric graph, so that the human cost is saved, the errors in the human adjustment process are reduced, and the editing accuracy and efficiency are greatly improved.

[0056] In some embodiments, the user can also newly create a canvas, and then combine and adjust the existing standard geometric elements to obtain a new geometric graph. Specifically, the selection instruction selected by the user can be obtained first, then the to-be-adjusted standard geometric elements are determined based on the selection instruction, then the adjustment instruction is obtained and the standard geometric elements are adjusted based on the adjustment instruction to obtain a standard graph, and finally the standard graph is exported to a graph resource library in a standard format. The number of the standard geometric elements is at least 1.

[0057] Further, secondary creation can also be performed on the basis of the vector graph, that is, secondary creation is performed on the basis of the recognized geometric graph, and the method is a combination of the above steps, which will not be described here.

[0058] It should be noted that, in the embodiments of the present application, the adjustment of the first vector elements and the subsequent creation are both completed in the vector editing interface.

[0059] Further, the editing interface can provide editing operations such as multi-element or single-element selection, drag box selection, copy, paste, delete, backtracking, alignment, manual addition of geometric elements, and the like, so as to meet the needs of users for personalized adjustment and secondary creation of the graph.

[0060] Further, for a straight line, the mouse can perform operations such as dragging, stretching, rotating, and color selection, and the attribute settings can include line style (solid line, dashed line), arrow style (none, single arrow, double arrow), top and tail positions (x, y), line thickness, rotation angle, level, and the like; for an arc, the mouse can perform operations such as dragging, stretching, arc stretching, rotating, and color selection, and the attribute settings can include line style (solid line, dashed line), line thickness, rotation angle, level, and the like; for a circle, the mouse can perform operations such as dragging, zooming, style selection (solid, hollow), and color selection, and the attribute settings can include original shape, stroke style (solid line, dashed line), stroke thickness, and diameter, and the like; for a sphere, the mouse can perform operations such as dragging and color selection, and the attribute settings can include sphere center position, horizontal auxiliary line, vertical auxiliary line, and the like; for text, the mouse can perform operations such as dragging and rotating, and the attribute settings can include font style, font style, font size, line height, character spacing, special symbols, and the like.

[0061] In the technical solution provided in the present application, an initial geometric drawing is determined by acquiring an image to be recognized and performing recognition and cutting on the image to be recognized; a target geometric drawing is determined by performing optimization processing on the initial geometric drawing; a denoised geometric drawing is obtained by performing denoising processing on the target geometric drawing, image features of the denoised geometric drawing are acquired, target geometric elements are determined by classifying the image features, and a first vector element is determined according to the target geometric elements and geometric element relationships obtained by disassembling the target geometric elements; a vector element to be edited in the first vector element is edited based on an editing instruction, a vector graph is determined according to the vector element to be edited and a non-editing vector element, and the vector graph is exported to a graph resource library in a standard format. Thus, by performing high-precision recognition on the geometric graph, the subsequent human cost for adjustment is greatly reduced; meanwhile, on the basis of optimization processing on the initial geometric drawing, the corresponding vector elements are obtained by recognizing and disassembling the geometric graph, so that subsequent vector editing can be performed, which meets the needs of high-precision and high-efficiency recognition of the geometric graph and the needs of high-efficiency and high-accuracy editing of the recognized geometric graph.

[0062] Please refer to Figure 2 , Figure 2 Another method for processing a geometric graph is shown, which includes steps S210 to S270, specifically:

[0063] In step S210, an image to be recognized is acquired, and the image to be recognized is recognized and cut to determine an initial geometric drawing.

[0064] In step S220, the initial geometric drawing is optimized to determine a target geometric drawing.

[0065] In step S230, the target geometric drawing is denoised to obtain a denoised geometric drawing, image features of the denoised geometric drawing are acquired, the image features are classified to determine target geometric elements, and first vector elements are determined according to the target geometric elements and geometric element relationships obtained by disassembling the target geometric elements.

[0066] In the embodiments of the present application, the specific descriptions of steps S210 to S230 can be referred to the foregoing steps S110 to S130, which will not be described here again.

[0067] In step S240, second vector elements corresponding to the target geometric drawing are acquired based on the target geometric elements.

[0068] Specifically, second geometric elements included in each line in the target geometric drawing can be acquired based on the target geometric elements, and then the second vector elements are determined based on the second geometric elements by selecting a corresponding fitting method. The target geometric elements include at least one of a solid line, a dashed line, an arrow line segment, a circle, an ellipse, a circular arc, and a curve.

[0069] In some embodiments, if the line is any one of a solid line, a dashed line, and an arrow line segment, then the coordinates of two end points of the line are acquired, and then the two end points are fitted into a corresponding vector line according to the coordinates.

[0070] In some embodiments, if the line is an ellipse, then a first coordinate of two points with the same horizontal coordinate and the largest vertical coordinate difference is acquired, and a second coordinate of two points with the same vertical coordinate and the largest horizontal coordinate difference is acquired; then the two points corresponding to the first coordinate and the two points corresponding to the second coordinate are fitted to obtain a corresponding vector line. It can be understood that the major axis and the minor axis of the ellipse can be determined after the first coordinate and the second coordinate are determined.

[0071] In some embodiments, if the line is a circle, then a center coordinate of the circle and a circumference coordinate of any point on the circumference of the circle are acquired, and the center coordinate and the circumference coordinate are fitted to obtain a corresponding vector line.

[0072] In some embodiments, if the line is a circular arc or a curve, then end point coordinates of two end points on the arc line and a midpoint coordinate on the arc line are acquired, and then the end point coordinates and the midpoint coordinate are fitted to determine a corresponding vector line.

[0073] In step S250, a first distance between the first vector element and the target geometric element is determined, and a second distance between the second vector element and the target geometric element is determined.

[0074] Specifically, the average pixel distance between each vector line in the first vector element and the corresponding target geometric element is taken as the first distance, and the average distance between each vector line in the second vector element and the corresponding target geometric element is taken as the second distance.

[0075] In some embodiments, if the vector line is any one of a solid line, a dashed line and an arrow line segment, the average distance difference is determined according to the coordinates of the two end points of the vector line on the first vector element and the target geometric element.

[0076] In some embodiments, if the vector line is a circle, the average distance is determined according to the coordinates of the center and the radius of the circle of the first vector element and the target geometric element.

[0077] In some embodiments, if the vector line is an ellipse, the average distance is determined according to the major axis and the minor axis of the ellipse of the first vector element and the target geometric element.

[0078] In some embodiments, if the vector line is a circular arc or a curve, the average distance is determined according to the coordinates of the end points and the coordinates of the midpoint.

[0079] It should be noted that since the angle has been considered when determining the first vector element, the correction is only for further fine adjustment, and therefore, in order to reduce the amount of calculation, only the line itself is considered when calculating the distance, and the angle is not considered.

[0080] In step S260, the target vector element is determined based on the first vector element, the first distance, the second vector element and the second distance.

[0081] In the embodiments of the present application, the vector lines in the first vector element that deviate greatly from the target geometric drawing can be screened out, and then the vector lines are corrected. Specifically, the first vector element corresponding to the first distance greater than or equal to a preset distance is taken as a first preliminary screening element; a correction element is determined based on the first preliminary screening element, the second vector element, the first distance and the second distance; and the target vector element is determined based on the first vector element and the correction element.

[0082] Further, the second preliminary screening element corresponding to the first preliminary screening element in the second vector element is determined; and the vector element in the second preliminary screening element with the second distance smaller than the first distance is taken as the correction element. The correction element is the vector element in the first vector element that needs to be corrected and replaced.

[0083] Further, the vector element in the first vector element that does not correspond to the correction element is obtained as a non-correction element; and the target vector element is determined according to the non-correction element and the correction element.

[0084] It can be understood that if there is no vector element with a second distance smaller than the first distance in the second initial screening element, it indicates that the second initial screening element deviates more than or equal to the first initial screening element, and in this case, the first vector element is taken as the target vector element.

[0085] In some embodiments, in order to facilitate subsequent user editing and adjustment, the first initial screening element that is not corrected can be edited and reminded. For example, it can be highlighted.

[0086] In step S270, the to-be-edited vector element in the target vector element is edited based on the editing instruction, the vector graph is determined according to the to-be-edited vector element and the non-edited vector element, and the vector graph is exported to the graphic resource library in a standard format.

[0087] In the embodiments of the present application, the specific description of step S270 can be referred to the foregoing step S140, and will not be repeated here.

[0088] In the technical solutions provided in the present application, the initial geometric drawing is determined by acquiring and recognizing and cutting the to-be-recognized image; the target geometric drawing is determined by optimizing the initial geometric drawing; the denoised geometric drawing is obtained by denoising the target geometric drawing, the image features of the denoised geometric drawing are acquired, the target geometric element is determined by classifying the image features, and the first vector element is determined according to the target geometric element and the geometric element relationship obtained by disassembling the target geometric element; the second vector element corresponding to the target geometric drawing is acquired based on the target geometric element; the first distance between the first vector element and the target geometric element is determined, and the second distance between the second vector element and the target geometric element is determined; the target vector element is determined based on the first vector element, the first distance, the second vector element and the second distance; the to-be-edited vector element in the target vector element is edited based on the editing instruction, the vector graph is determined according to the to-be-edited vector element and the non-edited vector element, and the vector graph is exported to the graphic resource library in a standard format. Therefore, on the basis of high-precision recognition of the geometric drawing, the geometric drawing can be further automatically corrected, greatly reducing the labor cost of subsequent adjustment; meanwhile, on the basis of the optimization processing of the initial geometric drawing, the corresponding vector element is obtained by recognizing and disassembling the geometric drawing, so that subsequent vector editing can be performed, which not only meets the demand for high-precision and high-efficiency recognition of the geometric drawing, but also meets the demand for high-efficiency and high-accuracy editing of the recognized geometric drawing.

[0089] Please refer to Figure 3 , Figure 3The embodiment of the application shows a geometric figure processing device 100, which comprises an identification cutting module 110, an optimization processing module 120, a vector element determination module 130 and an export module 140. Specifically,

[0090] The identification cutting module 110 is configured to acquire a to-be-identified image, identify and cut the to-be-identified image, and determine an initial geometric drawing.

[0091] The optimization processing module 120 is configured to perform optimization processing on the initial geometric drawing to determine a target geometric drawing.

[0092] The vector element determination module 130 is configured to perform denoising processing on the target geometric drawing to obtain a denoised geometric drawing, acquire image features of the denoised geometric drawing, classify the image features to determine target geometric elements, and determine first vector elements according to the target geometric elements and geometric element relationships obtained by disassembling the target geometric elements, wherein the target geometric elements include at least one of a solid line, a dashed line, an arrowed line segment, a circle, an ellipse, an angle, a circular arc, a curve and a text.

[0093] The export module 140 is configured to edit a to-be-edited vector element in the first vector elements based on an editing instruction, determine a vector figure according to the to-be-edited vector element and non-edited vector elements, and export the vector figure in a standard format to a figure resource library.

[0094] It should be noted that each of the embodiments in the specification adopts a progressive manner for description, and each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to. For the device embodiment, since it is basically similar to the method embodiment, it is described more simply, and the relevant part can be referred to the part of the method embodiment. For any processing manner described in the method embodiment, it can be realized by a corresponding processing module in the device embodiment, and the device embodiment will not be described one by one.

[0095] Please refer to Figure 4 , Figure 4 The embodiment of the application shows an electronic device 200, which can be a computer, a tablet, a mobile phone, etc. The electronic device 200 in the application can include one or more of the following components: a processor 210, a memory 220, and one or more application programs, wherein the one or more application programs can be stored in the memory 220 and configured to be executed by the one or more processors 210, and the one or more application programs are configured to perform the method described in the foregoing method embodiment.

[0096] The processor 210 can include one or more processing cores. The processor 210 connects various parts within the entire electronic device 200 with various interfaces and lines, performs various functions of the electronic device 200 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Alternatively, the processor 210 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 210 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program, etc.; the GPU is responsible for rendering and drawing display content; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 210, but can be implemented by a separate communication chip.

[0097] The memory 220 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 220 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 220 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a feature extraction function, a vectorization processing function, an export function, etc.), instructions for implementing each method embodiment described below, etc. The data storage area can also store data created by the electronic device 200 in use (for example, target geometric elements, first vector elements, etc.).

[0098] Please refer to Figure 5 , Figure 5 A structure block diagram of a computer readable storage medium according to an embodiment of the present application is shown. The computer readable storage medium 300 stores program codes, and the program codes can be called and executed by a processor to perform the methods described in the above method embodiments.

[0099] The computer-readable storage medium 300 can be an electronic storage such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 comprises a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has a storage space for the program code 310 for performing any of the method steps of the above-described methods. The program code can be read from or written to one or more computer program products. The program code 310 can be compressed in an appropriate form.

[0100] The present application provides a geometric figure processing method and device, equipment and storage medium, by acquiring an image to be identified, and identifying and cutting the image to be identified to determine an initial geometric illustration; the initial geometric illustration is optimized to determine a target geometric illustration; the target geometric illustration is denoised to obtain a denoised geometric illustration, the image features of the denoised geometric illustration are acquired, the image features are classified to determine a target geometric element, and a first vector element is determined according to the target geometric element and the geometric element relationship obtained by disassembling the target geometric element; the first vector element is edited according to the editing instruction, a vector figure is determined according to the vector element to be edited and the non-editing vector element, and the vector figure is exported to a figure resource library in a standard format. Thus, by high-precision identification of the geometric figure, the subsequent labor cost for adjustment is greatly reduced; at the same time, since the initial geometric illustration is optimized, the geometric figure is identified and disassembled to obtain the corresponding vector element, so that subsequent vector editing can be performed, which not only meets the needs of high-precision and high-efficiency identification of the geometric figure, but also meets the needs of high-efficiency and high-accuracy editing of the identified geometric figure.

[0101] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing geometric figures, characterized in that, The method includes: Acquire the image to be identified, and identify and cut the image to be identified to determine the initial geometric inset; The initial geometric inset is optimized to determine the target geometric inset; The target geometric illustration is denoised to obtain a denoised geometric illustration. A first feature is determined from the denoised geometric illustration using a first feature extraction method, a second feature is determined from the denoised geometric illustration using a second feature extraction method, and a third feature is determined from the denoised geometric illustration using a third feature extraction method. First elements and their relationships, second elements and their relationships, and third elements and their relationships are determined according to the feature processing methods corresponding to the first, second, and third features. Target geometric elements are determined based on the first, second, and third elements, and geometric element relationships are determined based on the first, second, and third element relationships. A first vector element is determined based on the target geometric element and the relationship between the geometric elements; wherein, the target geometric element includes at least one of solid line, dashed line, arrowed line segment, circle, ellipse, angle, arc, curve, and text; the first element includes the angle, the solid line, the dashed line, and the arrowed line segment; the second element includes the angle, the circle, the ellipse, the curve, and the arc; the third element includes the text; the first feature is a feature corresponding to at least one of the solid line, the dashed line, and the arrowed line segment; the second feature is a feature corresponding to at least one of the circle, the ellipse, the curve, and the arc; the third feature is a feature corresponding to the text; Based on the target geometric elements, obtain the second geometric elements included in each line of the target geometric illustration, and select the corresponding fitting method to determine the second vector element based on the second geometric elements; The average distance between each vector line in the first vector element and the corresponding target geometric element is taken as the first distance, and the average distance between each vector line in the second vector element and the corresponding target geometric element is taken as the second distance; The first vector element corresponding to the first distance that is greater than or equal to a preset distance is obtained as the first initial screening element. The correction element is determined based on the first initial screening element, the second vector element, the first distance and the second distance. The target vector element is determined based on the first vector element and the correction element. Edit the vector elements to be edited in the target vector elements based on the editing instructions, determine the vector graphics based on the vector elements to be edited and the non-editable vector elements, and export the vector graphics to the graphics resource library in a standard format.

2. The method according to claim 1, characterized in that, The step of determining the correction element based on the first initial screening element, the second vector element, the first distance, and the second distance includes: Determine the second initial screening element in the second vector elements that corresponds to the first initial screening element; Vector elements whose second distance is less than the first distance in the second initial screening elements are used as correction elements.

3. The method according to claim 2, characterized in that, Determining the target vector element based on the first vector element and the modified element includes: Obtain the vector elements in the first vector elements that do not correspond to the correction element as non-correction elements; The target vector element is determined based on the uncorrected element and the corrected element.

4. The method according to any one of claims 1-3, characterized in that, The optimization process for the initial geometric inset to determine the target geometric inset includes: The initial geometric illustration is processed to remove handwriting, resulting in a de-handwritten geometric illustration. The handwritten geometric illustration is binarized to obtain the target geometric illustration.

5. A geometric shape processing device, characterized in that, The device includes: The identification and cutting module is used to acquire the image to be identified and to identify and cut the image to be identified to determine the initial geometric inset; The optimization processing module is used to optimize the initial geometric inset to determine the target geometric inset; The vector element determination module is used to denoise the target geometric illustration to obtain a denoised geometric illustration. It determines a first feature from the denoised geometric illustration based on a first feature extraction method, a second feature from the denoised geometric illustration based on a second feature extraction method, and a third feature from the denoised geometric illustration based on a third feature extraction method. It determines the relationship between first elements and first elements, the relationship between second elements and second elements, and the relationship between third elements and third elements according to the feature processing methods corresponding to the first, second, and third features. It then determines target geometric elements based on the first, second, and third elements, and finally determines several [elements / relationships] based on the relationships between the first, second, and third elements. The relationship between the elements is determined, and a first vector element is determined based on the target geometric element and the relationship between the geometric elements; wherein, the target geometric element includes at least one of solid line, dashed line, arrowed line segment, circle, ellipse, angle, arc, curve, and text; the first element includes the angle, the solid line, the dashed line, and the arrowed line segment; the second element includes the angle, the circle, the ellipse, the curve, and the arc; the third element includes the text; the first feature is a feature corresponding to at least one of the solid line, the dashed line, and the arrowed line segment; the second feature is a feature corresponding to at least one of the circle, the ellipse, the curve, and the arc; the third feature is a feature corresponding to the text; The vector element determination module is further configured to obtain the second geometric element included in each line of the target geometric illustration based on the target geometric element, and select the corresponding fitting method to determine the second vector element based on the second geometric element; The vector element determination module is further configured to take the average distance between each vector line in the first vector element and the corresponding target geometric element as the first distance, and take the average distance between each vector line in the second vector element and the corresponding target geometric element as the second distance; The vector element determination module is further configured to obtain the first vector element corresponding to the first distance which is greater than or equal to the preset distance as the first initial screening element, determine the correction element based on the first initial screening element, the second vector element, the first distance and the second distance, and determine the target vector element based on the first vector element and the correction element; The export module is used to edit the vector elements to be edited in the target vector elements based on editing instructions, determine the vector graphics based on the vector elements to be edited and the non-editable vector elements, and export the vector graphics to the graphics resource library in a standard format.

6. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to perform the method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Stick figure computer scoring and auxiliary coloring method

    CN106530317A

  • Vector graph generation method and device, readable storage medium and electronic equipment

    CN115761043A

  • Image processing method and device based on vector graph drawing

    CN116645678A