Solid line identification system and method of ruler drawing operation automatic correction system
By designing a solid line identification system for automatic correction system for drawing operations, the problem of inaccurate solid line identification in the existing technology is solved, the accurate and efficient identification of solid lines is achieved, and the correction efficiency and fairness of results are improved.
Patent Information
- Application Number
- CN202411991911.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, in the solid line identification process, inaccurate feature extraction, imperfect recognition algorithm, and inability to fully consider the length, width, curvature, direction of the line, etc., resulting in identification deviations and cannot meet the accurate recognition. need.
A solid line recognition system for automatic correction system for ruled drawing operations is designed, including image acquisition, image preprocessing, feature extraction and solid line recognition units. By obtaining the scanned image, converting it to a grayscale image, removing irrelevant pixel points, building a coordinate system, extracting features such as line length, width, curvature and direction, and determining whether the drawn line is a solid line through feature analysis.
It realizes accurate and efficient identification of the actual lines of the ruler's drawing operation, improves the efficiency of correction, reduces labor and time costs, and ensures the consistency and fairness of the correction results.
Smart Images

Figure CN119399790A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a solid line recognition system and method for an automatic correction system for ruler drawing operations. Background Art
[0002] In the field of education, especially when it comes to courses such as engineering drawing and geometric drawing, grading students' ruler drawing assignments is an important but tedious task. Traditional grading methods usually rely on teachers' manual judgment, which is not only inefficient but also easily affected by subjective factors, resulting in inconsistent evaluation standards. With the development of science and technology, although some automated grading systems have emerged, there are still deficiencies in the recognition of solid lines in ruler drawing assignments. In actual ruler drawing assignments, accurate recognition of solid lines is crucial to evaluating the quality and accuracy of students' drawings. However, due to the complexity and diversity of drawn lines and various interference factors in the image acquisition and processing process, how to accurately and efficiently identify solid lines has become a problem that needs to be solved urgently.
[0003] The existing technologies for identifying solid lines in ruler and compass drawing operations may have problems such as inaccurate feature extraction, imperfect recognition algorithms, and failure to fully consider multiple features of the lines such as length, width, curvature, and direction. In the process of processing, the image pre-processing effect may be poor, resulting in deviations in subsequent recognition, and unable to meet the needs of accurate recognition of solid lines in ruler and compass drawing operations.
[0004] Therefore, in order to improve the efficiency and accuracy of marking ruler and compass drawing assignments, a method and system that can accurately and efficiently identify solid lines is needed. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a solid line recognition system and method for an automatic correction system for ruler drawing operations, which solves the problem.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a solid line recognition system and method for an automatic correction system for ruler drawing operations, comprising: An image acquisition unit is used to obtain a scanned image of the ruler and gauge drawing operation, and the scanned image is directly obtained by scanning the ruler and gauge drawing operation with a scanner; An image preprocessing unit is used to convert the scanned image into a grayscale image, and according to the preset grayscale value interval corresponding to the drawing line, remove the pixel points corresponding to the grayscale value that is not in the grayscale value interval, and then mark the retained pixel points as an analysis image containing only the drawing line; at the same time, in the analysis image, a coordinate system is constructed based on the pixel points of the analysis image, and the coordinates of each pixel point corresponding to the drawing line are obtained, wherein the drawing line refers to the line drawn in the ruler drawing operation; A feature extraction unit is used to perform feature extraction processing on the analysis image and obtain a plurality of specified data features, the data features including line length, line width, line curvature, and line direction; A solid line recognition unit is used to perform feature analysis on the extracted data features and determine whether the corresponding drawn line is a solid line; The result output unit is used to output the solid line mark or the non-solid line mark corresponding to each drawn line as the recognition result.
[0007] Preferably, wherein: line length refers to the distance measurement of the line from one end to the other end; line width refers to the dimension of the line perpendicular to its extension direction; line curvature describes the degree of bending of the line; and line direction refers to the extension direction of the line.
[0008] Preferably, the data features are extracted as follows: S1. Obtain drawing lines corresponding to consecutive adjacent pixel points, select a drawing line from them, and obtain the coordinates of all pixel points on the drawing line; S2. Obtain the coordinates of the pixels at the beginning and end of the drawn line from the coordinates of all the pixels corresponding to the drawn line, and mark the coordinates of the two pixels as (x g1 ,y g1 ) and (x g0 ,y g0 ), where g1 and g0 refer to the coordinate points of the corresponding pixels at the beginning and end of the drawn line respectively; S3, calculating the line direction of the drawn line by a predetermined line direction calculation formula; S4, compare |x at the same time g0 -x g1 |with|y g0 -y g1 |size; If |x g0 -x g1 |>|y g0 -y g1 |, then take the y-axis coordinate as the reference, and obtain all the consecutive adjacent pixels with different x-coordinate values corresponding to the same y-coordinate; Select all pixel points with different x-coordinate values corresponding to the same y-coordinate, calculate the middle value of all x-coordinate values, and use the middle value and the corresponding y-coordinate as the standard coordinate value of a node in the drawing line; Similarly, the standard coordinate values of the continuous nodes that make up the drawing line are calculated; S5, substituting the standard coordinate values of the continuous nodes corresponding to the drawn line into a predetermined length calculation formula to obtain the length value of the drawn line; S6. Select standard coordinate values corresponding to three consecutive adjacent nodes from the standard coordinate values of all nodes in the drawn line, and calculate the curvature approximation value corresponding to the middle node by using the curvature approximation value calculation formula; S7, selecting a node on the drawing line, and obtaining pixel points on the edge on both sides of the node along a direction perpendicular to the drawing line, and obtaining coordinate values corresponding to the two pixel points, and then substituting them into a predetermined width calculation formula to calculate the line width corresponding to the drawing line; S8. According to the steps of S1-S7, the line length, line width, line curvature and line direction of each drawn line are extracted.
[0009] Preferably, in S4, if |x g0 -x g1 |<|y g0 -y g1 |, then take the x-axis coordinate as the reference and obtain all the pixel points with different y-coordinate values corresponding to the same x-coordinate; Select all pixel points with different y coordinate values corresponding to the same x coordinate, calculate the middle value of all y coordinate values, and use the middle value and the corresponding x coordinate to form the standard coordinate value of a node in the drawing line.
[0010] Preferably, in S3, the line direction calculation formula is, , θ is the line direction of the corresponding drawn line.
[0011] Preferably, in S5, the length calculation formula is: , L is the length of the corresponding drawn line; Among them, (x j ,y j ) and (x j+1 ,y j+1 ) are the standard coordinate values corresponding to the adjacent nodes, j=1, 2, ...m, and m represents the number of continuous nodes corresponding to the drawn line.
[0012] Preferably, in S6, the curvature approximation value calculation formula is: , Where k is the approximate value of curvature, (x 1 ,y 1 )、(x 2 ,y 2 )、(x 3 ,y 3 ) represent the standard coordinate values corresponding to the three adjacent nodes, and (x 2 ,y 2 ) The standard coordinate values corresponding to the intermediate nodes.
[0013] Preferably, in S7, the width calculation formula is: , W is the line width corresponding to the corresponding drawing line; (x r ,y r ) and (x t ,y t ) are the coordinate values of the pixel points at the edges on both sides perpendicular to the drawing line direction; wherein r and t refer to the pixel points at the edges on both sides perpendicular to the drawing line direction respectively.
[0014] Preferably, the feature analysis method is as follows: In the analysis image, extract the line length, line width, line curvature, and line direction corresponding to the drawing line formed by continuous adjacent pixel points, select a drawing line, use the drawing line as the comparison line, and then compare other drawing lines with the comparison line one by one. The comparison method is as follows: SS1, extract the line length, line width, line curvature, and line direction of the comparison line, and mark them as L0, W0, k0, and θ0 respectively; At the same time, the line length, line width, line curvature, and line direction of another drawn line are extracted and marked as L1, W1, k1, and θ1 respectively; SS2. Combine L0 with the preset determination coefficient a to obtain the length comparison interval [L0-L0*a, L0+L0*a], and compare L1 with the length comparison interval: If L1 is within the length comparison interval [L0-L0*a, L0+L0*a], the comparison line is preliminarily determined to be a solid line; SS3, based on the fact that the comparison line is a solid line as determined in SS2: Combine W0 with the preset determination coefficient b to obtain the width comparison interval [W0-W0*b,W0+W0*b], and compare W1 with the width comparison interval: If W1 is within the length comparison interval [W0-W0*b, W0+W0*b], the comparison line is further determined to be a solid line; SS4. On the basis that SS3 determines that the comparison line is a solid line: Combine k0 with the preset determination coefficient c to obtain the width comparison interval [k0-k0*c, k0+k0*c], and compare k1 with the width comparison interval: If k1 is within the length comparison interval [k0-k0*c, k0+k0*c], the comparison line is further determined to be a solid line; SS5. Based on the fact that the comparison line is a solid line as determined in SS4: Combine θ0 with the preset determination coefficient d to obtain the width comparison interval [θ0-θ0*d,θ0+θ0*d], and compare θ1 with the width comparison interval: If θ1 is within the length comparison interval [θ0-θ0*d,θ0+θ0*d], the comparison line is determined to be a solid line; SS6, based on the determination result of SS5, compare the solid line marking and the non-solid line marking of the lines; A solid line mark refers to a mark that identifies the alignment line as a solid line, while a non-solid line mark is the opposite; SS7, and so on, obtain the solid line mark or non-solid line mark corresponding to each drawn line; Preferably, in SS2, if L1 is not within the length comparison interval [L0-L0*a, L0+L0*a], it is preliminarily determined that the comparison line is not a solid line; In SS3, if W1 is not within the length comparison interval [W0-W0*b, W0+W0*b], it is preliminarily determined that the comparison line is not a solid line; In SS4, if k1 is not in the length comparison interval [k0-k0*c, k0+k0*c], it is preliminarily determined that the comparison line is not a solid line; In SS5, if θ1 is not within the length comparison interval [θ0-θ0*d,θ0+θ0*d], it is determined that the comparison line is not a solid line.
[0015] A solid line recognition method for an automatic correction system for ruler and compass drawing operations is provided. The system is realized by the above-mentioned solid line recognition system for the automatic correction system for ruler and compass drawing operations.
[0016] The present invention provides a solid line recognition system and method for an automatic correction system for ruler and compass drawing operations. Compared with the prior art, it has the following beneficial effects: It realizes the automatic recognition and correction of solid lines in ruler and compass drawing operations, greatly improving the correction efficiency and saving manpower and time costs.
[0017] By acquiring scanned images through the image acquisition unit, the original information of the operation can be accurately obtained, laying the foundation for subsequent precise analysis.
[0018] The image preprocessing unit converts the scanned image into a grayscale image and removes irrelevant pixels to obtain an analysis image containing only drawn lines. At the same time, a coordinate system is constructed to obtain pixel coordinates, thereby improving the accuracy and efficiency of subsequent feature extraction.
[0019] The feature extraction unit can accurately extract multiple key data features such as line length, line width, line curvature and line direction, providing comprehensive and detailed information for accurate judgment of solid lines.
[0020] The solid line recognition unit adopts a scientific and reasonable feature analysis method. By comparing with the preset determination coefficient and comparison interval, it can accurately determine whether the drawn line is a solid line, thereby improving the accuracy and reliability of recognition.
[0021] The result output unit can clearly output the solid line mark or non-solid line mark corresponding to each drawn line as the recognition result, providing a clear basis for subsequent homework correction and evaluation.
[0022] The entire system and method have a high degree of automation and intelligence, which can effectively avoid the subjectivity and errors that may occur in manual marking, and ensure the consistency and fairness of the marking results.
[0023] The application of the present invention helps to improve the teaching quality and efficiency, provide students with accurate feedback in a timely manner, and promote students' learning and progress. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a system block diagram of the present invention; Figure 2 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Embodiment 1 See also Figure 1-Figure 2 The present invention provides a technical solution: a solid line recognition system for an automatic correction system for ruler drawing operations, comprising: An image acquisition unit is used to obtain a scanned image of the ruler and gauge drawing operation, and the scanned image is directly obtained by scanning the ruler and gauge drawing operation with a scanner; An image preprocessing unit is used to perform denoising, grayscale and binarization processing on the scanned image, and obtain a processed scanned image. According to a preset grayscale value interval corresponding to a drawing line, pixels corresponding to grayscale values that are not in the grayscale value interval are removed from the processed scanned image, and then the retained pixels are marked as an analysis image containing only the drawing line. At the same time, in the analysis image, a coordinate system is constructed based on the pixel points of the analysis image, and the coordinates of each pixel point corresponding to the drawing line are obtained; Among them, the drawn line refers to the line drawn in the ruler and compass drawing operation; A feature extraction unit is used to perform feature extraction processing on the analysis image and obtain a plurality of specified data features, including line length, line width, line curvature, and line direction; In this example: The length of a line is a measure of the distance from one end of the line to the other; in two dimensions, it can be determined by calculating the straight-line distance between the two end points of the line, or for a curve, by integrating along the curve to find the approximate or exact length. Line width refers to the dimension of a line perpendicular to its extension direction; for actual physical lines, such as drawn lines, the width is its thickness; in some mathematical or computer graphics concepts, line width can also be a property that defines the thickness of a line when it is displayed or processed; The curvature of a line describes the amount of curvature of a line. The greater the curvature, the more curved the line is. A curvature of zero indicates that the line is straight. The magnitude and sign of the curvature indicate the degree of curvature of the line and the direction of curvature, such as concave or convex. The direction of a line refers to the direction in which the line extends. In a two-dimensional plane, it is usually expressed by the angle with the coordinate axis or the ratio of the horizontal and vertical components. In three-dimensional space, it is necessary to use angles in three directions or a vector to accurately describe the direction of the line. The data features are extracted as follows: S1. Obtain drawing lines corresponding to consecutive adjacent pixel points, select a drawing line from them, and obtain the coordinates of all pixel points on the drawing line; S2. Obtain the coordinates of the pixels at the beginning and end of the drawn line from the coordinates of all the pixels corresponding to the drawn line, and mark the coordinates of the two pixels as (x g1 ,y g1 ) and (x g0 ,y g0 ), where g1 and g0 refer to the coordinate points of the corresponding pixels at the beginning and end of the drawn line respectively; S3, through , calculate the line direction θ of the drawn line; S4, compare |x at the same time g0 -x g1 |with|y g0 -y g1 |size; If |x g0 -x g1 |>|y g0 -y g1 |, then take the y-axis coordinate as the reference, and obtain all the consecutive adjacent pixels with different x-coordinate values corresponding to the same y-coordinate; Taking all the pixels with different x-coordinate values corresponding to the same y-coordinate as an example, the middle value of all the x-coordinate values is calculated, and the middle value and the corresponding y-coordinate are used as the standard coordinate value of a node in the drawing line; Similarly, the standard coordinate values of the continuous nodes that make up the drawing line are calculated; In this embodiment, the purpose of determining the standard coordinate value is to determine the length of the drawn line. In the ruler drawing operation, the width of the drawn line occupies multiple pixels in the analysis image. In order to calculate the length and width of the drawn line conveniently, the coordinates corresponding to a pixel point need to be selected for calculation; If |x g0 -x g1 |<|y g0 -y g1 |, then take the x-axis coordinate as the reference and obtain all the pixel points with different y-coordinate values corresponding to the same x-coordinate; Taking all pixel points with different y coordinate values corresponding to the same x coordinate as an example, calculate the middle value of all y coordinate values, and use the middle value and the corresponding x coordinate as the standard coordinate value of a node in the drawing line; S5. Mark the standard coordinate values of the continuous nodes that make up the drawing line as (x j ,y j ), j = 1, 2, ... m, m represents the number of consecutive nodes corresponding to the drawn line; Then through , calculate the length L of the drawn line; Among them, (x j ,y j ) and (x j+1 ,y j+1 ) are the standard coordinate values corresponding to the adjacent nodes; S6. Select standard coordinate values corresponding to three consecutive adjacent nodes from the standard coordinate values of all nodes in the drawn line, and calculate the curvature approximation value corresponding to the middle node by using the curvature approximation value calculation formula; The curvature approximation calculation formula is: , Where k is the approximate value of curvature, (x 1 ,y 1 )、(x 2 ,y 2 )、(x 3 ,y 3 ) represent the standard coordinate values corresponding to the three adjacent nodes, and (x 2 ,y 2 ) Standard coordinate values corresponding to the middle nodes; S7, select a node on the drawing line, and on the node, obtain the pixel points on the edge on both sides along the direction perpendicular to the drawing line, and obtain the coordinate values (x r ,y r ) and (x t ,y t ); Among them, r and t refer to the pixel points located on the two sides of the edge perpendicular to the drawing line direction; Then through the formula , calculate the line width W corresponding to the drawn line; S8, extracting the line length, line width, line curvature, and line direction of each drawn line according to the steps of S1-S7; A solid line recognition unit is used to perform feature analysis on the extracted data features and determine whether the corresponding drawn line is a solid line; The feature analysis method is as follows: In the analyzed image, the line length, line width, line curvature, and line direction corresponding to the drawn line formed by the continuous adjacent pixel points are extracted; Take a drawing line as an example, and use it as the comparison line. Then compare other drawing lines with the comparison line one by one: The comparison is as follows: SS1, extract the line length, line width, line curvature, and line direction of the comparison line, and mark them as L0, W0, k0, and θ0 respectively; At the same time, the line length, line width, line curvature, and line direction of another drawn line are extracted and marked as L1, W1, k1, and θ1 respectively; SS2. Combine L0 with the preset determination coefficient a to obtain the length comparison interval [L0-L0*a, L0+L0*a], and compare L1 with the length comparison interval: If L1 is within the length comparison interval [L0-L0*a, L0+L0*a], the comparison line is preliminarily determined to be a solid line; If L1 is not within the length comparison interval [L0-L0*a, L0+L0*a], it is preliminarily determined that the comparison line is not a solid line; SS3, based on the fact that the comparison line is a solid line as determined in SS2: Combine k0 with the preset determination coefficient c to obtain the width comparison interval [k0-k0*c, k0+k0*c], and compare k1 with the width comparison interval: If k1 is within the length comparison interval [k0-k0*c, k0+k0*c], the comparison line is further determined to be a solid line; If k1 is not within the length comparison interval [k0-k0*c, k0+k0*c], it is preliminarily determined that the comparison line is not a solid line; SS4. On the basis that SS3 determines that the comparison line is a solid line: Combine θ0 with the preset determination coefficient d to obtain the width comparison interval [θ0-θ0*d,θ0+θ0*d], and compare θ1 with the width comparison interval: If θ1 is within the length comparison interval [θ0-θ0*d,θ0+θ0*d], the comparison line is determined to be a solid line; If θ1 is not within the length comparison interval [θ0-θ0*d,θ0+θ0*d], it is determined that the comparison line is not a solid line; SS5. Based on the determination result of SS4, compare the solid line marking and the non-solid line marking of the lines; A solid line mark refers to a mark that identifies the alignment line as a solid line, while a non-solid line mark is the opposite; SS6. Similarly, obtain the solid line mark or non-solid line mark corresponding to each drawn line; The result output unit is used to output the solid line mark or non-solid line mark corresponding to each drawn line as the recognition result, so as to provide data support for the automatic correction system.
[0027] Embodiment 2 As the second embodiment of the present invention, when the present application is implemented, compared with the first embodiment, the difference between the technical solution of the present embodiment and the first embodiment is that: in the feature analysis technology of the first embodiment, on the basis of determining that the comparison line is a solid line: Combine W0 with the preset determination coefficient b to obtain the width comparison interval [W0-W0*b,W0+W0*b], and compare W1 with the width comparison interval: If W1 is within the length comparison interval [W0-W0*b, W0+W0*b], the comparison line is further determined to be a solid line; If W1 is not within the length comparison interval [W0-W0*b, W0+W0*b], it is preliminarily determined that the comparison line is not a solid line.
[0028] Embodiment 3 As the third embodiment of the present invention, when the present application is specifically implemented, compared with the first and second embodiments, the technical solution of this embodiment is to combine the solutions of the first and second embodiments mentioned above for implementation.
[0029] The present invention also provides a solid line recognition method for a ruler and compass drawing operation automatic correction system, which is implemented by the above-mentioned solid line recognition system for a ruler and compass drawing operation automatic correction system, and the method comprises the following steps: Step 1: Image acquisition: Scan the ruler drawing work directly through the scanner to obtain its scanned image; Step 2: Image preprocessing: De-noise, grayscale and binarize the scanned image. According to the preset grayscale value interval corresponding to the drawing line, remove the pixels corresponding to the grayscale value that are not in the grayscale value interval in the processed image, and mark the remaining pixels as the analysis image containing only the drawing line. At the same time, a coordinate system is constructed based on the pixel points of the analyzed image to obtain the coordinates of each pixel point corresponding to the drawn line, wherein the drawn line refers to the line drawn in the ruler drawing operation; Step 3: Feature extraction: Perform feature extraction on the analysis image to obtain multiple specified data features, including line length, line width, line curvature, and line direction; Step 4: Solid line recognition: Perform feature analysis on the extracted data features to determine whether the corresponding drawn line is a solid line. Mark the corresponding drawn line as a solid line or a non-solid line. Step 5: Result output: The solid line mark or non-solid line mark corresponding to each drawn line is output as the recognition result to provide data support for the automatic correction system.
[0030] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0031] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0032] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A solid line recognition system for an automatic correction system for ruler drawing work, characterized in that: include, An image acquisition unit is used to obtain a scanned image of the ruler and gauge drawing operation, and the scanned image is directly obtained by scanning the ruler and gauge drawing operation with a scanner; An image preprocessing unit is used to convert the scanned image into a grayscale image, and according to the preset grayscale value interval corresponding to the drawing line, remove the pixel points corresponding to the grayscale value that is not in the grayscale value interval, and then mark the retained pixel points as an analysis image containing only the drawing line; at the same time, in the analysis image, a coordinate system is constructed based on the pixel points of the analysis image, and the coordinates of each pixel point corresponding to the drawing line are obtained, wherein the drawing line refers to the line drawn in the ruler drawing operation; A feature extraction unit is used to perform feature extraction processing on the analysis image and obtain a plurality of specified data features, the data features including line length, line width, line curvature, and line direction; A solid line recognition unit is used to perform feature analysis on the extracted data features and determine whether the corresponding drawn line is a solid line; The result output unit is used to output the solid line mark or the non-solid line mark corresponding to each drawn line as the recognition result.
2. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 1 is characterized in that: in: Line length refers to the distance measurement from one end of the line to the other; line width refers to the dimension of the line in the direction perpendicular to its extension; line curvature describes the degree of bending of the line; line direction refers to the direction in which the line extends.
3. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 1 is characterized by: The data features are extracted as follows: S1. Obtain drawing lines corresponding to consecutive adjacent pixel points, select a drawing line from them, and obtain the coordinates of all pixel points on the drawing line; S2. Obtain the coordinates of the pixels at the beginning and end of the drawn line from the coordinates of all the pixels corresponding to the drawn line, and mark the coordinates of the two pixels as (x g1 ,y g1 ) and (x g0 ,y g0 ), where g1 and g0 refer to the coordinate points of the corresponding pixels at the beginning and end of the drawn line respectively; S3, calculating the line direction of the drawn line by a predetermined line direction calculation formula; S4, compare |x at the same time g0 -x g1 |with|y g0 -y g1 |size; If |x g0 -x g1 |>|y g0 -y g1 |, then take the y-axis coordinate as the reference, and obtain all the consecutive adjacent pixels with different x-coordinate values corresponding to the same y-coordinate; Select all pixel points with different x-coordinate values corresponding to the same y-coordinate, calculate the middle value of all x-coordinate values, and use the middle value and the corresponding y-coordinate as the standard coordinate value of a node in the drawing line; Similarly, the standard coordinate values of the continuous nodes that make up the drawing line are calculated; S5, substituting the standard coordinate values of the continuous nodes corresponding to the drawn line into a predetermined length calculation formula to obtain the length value of the drawn line; S6. Select standard coordinate values corresponding to three consecutive adjacent nodes from the standard coordinate values of all nodes in the drawn line, and calculate the curvature approximation value corresponding to the middle node by using the curvature approximation value calculation formula; S7, selecting a node on the drawing line, and obtaining pixel points on the edge on both sides of the node along a direction perpendicular to the drawing line, and obtaining coordinate values corresponding to the two pixel points, and then substituting them into a predetermined width calculation formula to calculate the line width corresponding to the drawing line; S8. According to the steps of S1-S7, the line length, line width, line curvature and line direction of each drawn line are extracted.
4. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 3 is characterized in that: In S4, if |x g0 -x g1 |<|y g0 -y g1 |, then take the x-axis coordinate as the reference and obtain all the pixel points with different y-coordinate values corresponding to the same x-coordinate; Select all pixel points with different y coordinate values corresponding to the same x coordinate, calculate the middle value of all y coordinate values, and use the middle value and the corresponding x coordinate to form the standard coordinate value of a node in the drawing line.
5. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 3 is characterized in that: In S3, the line direction calculation formula is: , θ is the line direction of the corresponding drawn line.
6. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 3 is characterized in that: In S5, the length calculation formula is , L is the length of the corresponding drawn line; Among them, (x j ,y j ) and (x j+1 ,y j+1 ) are the standard coordinate values corresponding to the adjacent nodes, j=1, 2, ...m, and m represents the number of continuous nodes corresponding to the drawn line.
7. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 3 is characterized in that: In S6, the curvature approximation is calculated as: , Where k is the curvature approximation value, (x1, y1), (x2, y2), and (x3, y3) represent the standard coordinate values corresponding to the three adjacent nodes, and (x2, y2) represents the standard coordinate value corresponding to the middle node.
8. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 3 is characterized in that: In S7, the width calculation formula is: , W is the line width corresponding to the corresponding drawing line; (x r ,y r ) and (x t ,y t ) are the coordinate values of the pixel points at the edges on both sides perpendicular to the drawing line direction; wherein r and t refer to the pixel points at the edges on both sides perpendicular to the drawing line direction respectively.
9. The solid line recognition system of the automatic correction system for ruler drawing work according to claim 1, characterized in that: The feature analysis method is as follows: In the analysis image, extract the line length, line width, line curvature, and line direction corresponding to the drawing line formed by continuous adjacent pixel points, select a drawing line, use the drawing line as the comparison line, and then compare other drawing lines with the comparison line one by one. The comparison method is as follows: SS1, extract the line length, line width, line curvature, and line direction of the comparison line, and mark them as L0, W0, k0, and θ0 respectively; At the same time, the line length, line width, line curvature, and line direction of another drawn line are extracted and marked as L1, W1, k1, and θ1 respectively; SS2. Combine L0 with the preset determination coefficient a to obtain the length comparison interval [L0-L0*a, L0+L0*a], and compare L1 with the length comparison interval: If L1 is within the length comparison interval [L0-L0*a, L0+L0*a], the comparison line is preliminarily determined to be a solid line; If L1 is not within the length comparison interval [L0-L0*a, L0+L0*a], it is preliminarily determined that the comparison line is not a solid line; SS3, based on the fact that the comparison line is a solid line as determined in SS2: Combine W0 with the preset determination coefficient b to obtain the width comparison interval [W0-W0*b,W0+W0*b], and compare W1 with the width comparison interval: If W1 is within the length comparison interval [W0-W0*b, W0+W0*b], the comparison line is further determined to be a solid line; If W1 is not within the length comparison interval [W0-W0*b, W0+W0*b], it is preliminarily determined that the comparison line is not a solid line; SS4. On the basis that SS3 determines that the comparison line is a solid line: Combine k0 with the preset determination coefficient c to obtain the width comparison interval [k0-k0*c, k0+k0*c], and compare k1 with the width comparison interval: If k1 is within the length comparison interval [k0-k0*c, k0+k0*c], the comparison line is further determined to be a solid line; If k1 is not within the length comparison interval [k0-k0*c, k0+k0*c], it is preliminarily determined that the comparison line is not a solid line; SS5. Based on the fact that the comparison line is a solid line as determined in SS4: Combine θ0 with the preset determination coefficient d to obtain the width comparison interval [θ0-θ0*d,θ0+θ0*d], and compare θ1 with the width comparison interval: If θ1 is within the length comparison interval [θ0-θ0*d,θ0+θ0*d], the comparison line is determined to be a solid line; If θ1 is not within the length comparison interval [θ0-θ0*d,θ0+θ0*d], it is determined that the comparison line is not a solid line; SS6, based on the determination result of SS5, compare the solid line marking and the non-solid line marking of the lines; A solid line mark refers to a mark that is used to identify the alignment line as a solid line, while a non-solid line mark is the opposite; SS7. Similarly, obtain the solid line mark or non-solid line mark corresponding to each drawn line.
10. A solid line recognition method for an automatic correction system for ruler drawing work, characterized in that: The system is implemented by a solid line recognition system of an automatic correction system for ruler drawing operations as described in any one of claims 1-9.
Citation Information
Patent Citations
Engineering drawing line and line type recognition method based on Hough transformation
CN112418123A
AI-based ruler drawing operation automatic correction system and method
CN117934976A
Automatic correction system and method for ruler drawing paper homework
CN118072334A
Image segmentation system for correcting ruler drawing operation
CN118762053A