Method and system for identifying curves
By establishing a planar coordinate system and curve fitting algorithm in the image, the image is directly converted into a Bezier/Nurbs curve, solving the problem of inefficient manual conversion in the prior art and improving the recognition accuracy and efficiency.
Patent Information
- Application Number
- CN202210516956.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-05-12
AI Technical Summary
In the prior art, the process of converting from image format to Bezier/Nurbs curve mainly relies on manual labor, is inefficient, and there is no mature automation application on the market.
By establishing a planar coordinate system in the image, obtaining areas with pixel gray value greater than the preset threshold, determining the end points and inflection points of the connecting area, and using a curve fitting algorithm to connect points to form the identified curve lines.
The direct conversion of images to Bezier/Nurbs curves is realized, which improves the accuracy of subsequent recognition methods and saves designer time and training costs.
Smart Images

Figure CN114863438B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of curve recognition, and in particular to a method and system for recognizing a curve. Background Art
[0002] In the commonly used design process in traditional graphic design, industrial design, architectural design, environmental design and other design fields, designers first need to use physical media (paper, pen) to draw a large number of scheme sketches. The selected scheme sketches are then scanned or photographed and input into the computer for further design work. In the subsequent design process, it is usually necessary to convert the pixel-format lines drawn by brush strokes in the image into digital Bezier curves or Nurb curves to achieve smoothness, accuracy, reduce data volume, and facilitate modification and editing.
[0003] In the field of graphic design, the conversion from image format to Bezier / Nurbs curves is often used in the process of creating vector graphics. In the fields of industrial design, architectural design, environmental design, etc. involving solid 3D modeling, the conversion from image format to Bezier / Nurbs curves is often the initial step to start 3D design. This process is indispensable in the entire design process.
[0004] This conversion is still mainly done manually. On the one hand, it requires designers to have certain skills and requires a lot of training costs. On the other hand, it is inefficient. The specific process can be regarded as manually tracing all the lines repeatedly on the computer, which takes a lot of time for designers in the conversion process. Automating this process can save a lot of manpower and time for the vast number of design practitioners and has broad prospects. However, due to the relatively small application scenario, the knowledge structure of practitioners in the relevant industry chain is solidified, and there is a lack of determination and motivation to subvert, resulting in less related research. At present, there is no mature application on the market that converts image formats to Bezier / Nurbs curves. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method and system for identifying curves, which can accurately identify curves in an image.
[0006] In order to achieve the above object, the present invention provides a method for identifying a curve, comprising:
[0007] Obtain an image to be recognized;
[0008] Establishing a plane coordinate system on the image to obtain array coordinates of areas where the pixel grayscale value is greater than a preset first threshold value to form an array set;
[0009] Determining an array coordinate point set corresponding to a connected area of the image according to the array set, wherein the connected area includes at least two endpoints and a line connecting the at least two endpoints;
[0010] Deleting the array coordinate point set of the connected area whose number of elements in the connected area is less than a preset second threshold;
[0011] Determine the endpoints and the order of the endpoints of each connected region array coordinate point set;
[0012] Dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points;
[0013] Deleting a jump point in the array coordinate point set, wherein the array coordinate point set includes a plurality of inflection points, each of the inflection points corresponds to a deflection direction, and the jump point is an inflection point whose deflection direction is the same as that of two adjacent inflection points and whose deflection direction is opposite to that of the two adjacent inflection points;
[0014] Deleting the inflection points in the array coordinate point set whose deflection angle is less than a preset third threshold;
[0015] Using a preset number of points in the range of points to replace each point in the array coordinate point set;
[0016] Each point in the array coordinate point set is connected based on a line fitting algorithm to form an identified curve line.
[0017] Optionally, determining the array coordinate point set corresponding to the connected area of the image according to the array set includes:
[0018] Randomly select an unselected point from the array set as a starting point;
[0019] Searching for a point adjacent to the starting point in the array set and adding the point to the array coordinate point set;
[0020] Determine whether there is an unselected point in the current array set;
[0021] In the case where it is determined that there are unselected points in the current array set, the step of randomly selecting an unselected point from the array set is performed again until it is determined that there are no unselected points in the current array set;
[0022] When it is determined that there are unselected points in the current array set, the array coordinate point set generated in each cycle is output.
[0023] Optionally, deleting the array coordinate point set of the connected region whose number of connected region elements is less than a preset second threshold comprises:
[0024] Count the number of points in each array coordinate point set;
[0025] The array coordinate point set having a number of points less than the second threshold is deleted.
[0026] Optionally, determining the endpoints and the order of the endpoints of each array coordinate point set includes:
[0027] Determine the center point of the array coordinate point set;
[0028] Calculate the distance between each point in the array coordinate point set and the corresponding center point;
[0029] The point with the largest distance is taken as the starting point of the array coordinate point set.
[0030] Optionally, determining the endpoints and the order of the endpoints of each array coordinate point set includes:
[0031] Starting from the starting point of the array coordinate point set, searching the array coordinate point set for a plurality of points located around the currently selected starting point to form a slice;
[0032] Starting from the current slice, multiple points located around all points of the slice and not generating slices are searched in the array coordinate point set to form a new slice;
[0033] Determine whether there are any points in the current array coordinate point set that have not generated slices;
[0034] When it is determined that there are still points for which a slice has not been generated in the current array coordinate point set, the step of starting from the current slice and searching the array coordinate point set for a plurality of points for which a slice has not been generated and which are located around all points of the slice to form a new slice is returned to the execution again, until it is determined that there are no points for which a slice has not been generated in the current array coordinate point set.
[0035] Optionally, dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points comprises:
[0036] Selecting the unselected slices in order from the array coordinate point set;
[0037] Determining whether there is a discontinuity in the sheet layer;
[0038] In the case where it is determined that there is no discontinuity in the slice layer, determining whether there is still the slice layer that has not been selected;
[0039] If it is determined that there are still unselected slices, returning to the step of selecting the unselected slices in order in the array coordinate point set;
[0040] In the case where it is determined that there is no unselected slice at present, determining that the current array coordinate point set has been divided into array coordinate point sets without bifurcation points;
[0041] When it is determined that there are discontinuities in the slice, all points before the current slice are aggregated into a new array coordinate point set, and all points before the current slice are deleted from the original array coordinate point set;
[0042] Starting from the continuous points in the current slice respectively, a new slice is regenerated in the original array coordinate point set to divide the original array coordinate point set into a plurality of new array coordinate point sets;
[0043] The step of selecting the unselected slices in the array coordinate point set in order is returned again.
[0044] Optionally, dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points comprises:
[0045] Calculating the mathematical center point of each of the slices;
[0046] Connect each mathematical center point to form a partitioned array coordinate point set.
[0047] Optionally, replacing each point in the array coordinate point set with a preset number of points includes:
[0048] Selecting a starting point and a final point in the array coordinate point set;
[0049] Selecting a plurality of points between the starting point and the final point approximately on average as points after replacement;
[0050] All selected points are connected to form the replaced array coordinate point set.
[0051] On the other hand, the present invention further provides a system for identifying a curve, the system comprising a processor, and the processor is used to execute any of the above methods.
[0052] In yet another aspect, the present invention further provides a computer-readable storage medium storing instructions, wherein the instructions are used to be read by a machine so as to enable the machine to execute any of the above methods.
[0053] Through the above technical solution, the method and system for identifying a curve provided by the present invention obtains an array set by establishing a plane coordinate system in an image, and determines the endpoints and inflection points of the curve according to the obtained array set, and finally uses a curve fitting algorithm for the obtained endpoints and inflection points and the connected areas in the array set to obtain the identified curve. Compared with the prior art, the method and system provided by the present invention can directly convert an image into a Bezier / Nurbs curve, so that subsequent recognition methods such as OCR can achieve higher recognition accuracy.
[0054] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0056] Figure 1 is a flow chart of a method for identifying a curve according to one embodiment of the present invention;
[0057] Figure 2a is an example diagram of an image acquired according to an embodiment of the present invention;
[0058] Figure 2b is an example diagram of an image acquired according to an embodiment of the present invention;
[0059] Figure 2c is an example diagram of an image acquired according to an embodiment of the present invention;
[0060] Figure 2d is an example diagram of an image acquired according to an embodiment of the present invention;
[0061] Figure 3 is a flow chart of a method for generating array coordinate points of the connected area according to one embodiment of the present invention;
[0062] Figure 4 A flowchart of a method for obtaining a starting point of a connected region according to an embodiment of the present invention;
[0063] Figure 5 is a flowchart of a method for obtaining the endpoint sequence of a connected region according to an embodiment of the present invention;
[0064] Figure 6 is a flow chart of a method for growing a sheet according to one embodiment of the present invention;
[0065] Figure 7is a flowchart of a secondary partitioning method according to one embodiment of the present invention. DETAILED DESCRIPTION
[0066] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0067] like Figure 1 FIG. 1 is a flow chart of a method for identifying a curve according to an embodiment of the present invention. Figure 1 In, the method may include:
[0068] In step S10, an image to be identified is obtained;
[0069] In step S11, a plane coordinate system is established on the image to obtain array coordinates of areas where the pixel grayscale value is greater than a preset first threshold value to form an array set;
[0070] In step S12, an array coordinate point set corresponding to a connected area of the image is determined according to the array set, wherein the connected area includes at least two endpoints and a line connecting the at least two endpoints;
[0071] In step S13, the array coordinate point sets of the connected regions whose number of connected region elements is less than a preset second threshold are deleted;
[0072] In step S14, the endpoints and the order of the endpoints of each connected region array coordinate point set are determined;
[0073] In step S15, the array coordinate point set with bifurcation points is divided into array coordinate point sets without bifurcation points;
[0074] In step S16, a jump point in the array coordinate point set is deleted, wherein the array coordinate point set includes a plurality of inflection points, each inflection point corresponds to a deflection direction, and the jump point is an inflection point whose deflection direction is the same as that of two adjacent inflection points and whose deflection direction is opposite to that of the two adjacent inflection points;
[0075] In step S17, inflection points whose deflection angles are less than a preset third threshold value are deleted from the array coordinate point set;
[0076] In step S18, a preset number of points are used to replace the points in each array coordinate point set;
[0077] In step S19, the points in each array coordinate point set are connected based on a line fitting algorithm to form a recognized curve line.
[0078] In this Figure 1In the method shown, the image acquired in step S10 may be a rectangular grayscale image, which may be, for example Figure 2a to Figure 2d As shown. Figure 2a to Figure 2d In the above example, the input images are all grayscale images and are composed of multiple lines. If the input images are not grayscale images or the boundaries are not obvious, the input images can be preprocessed. Specifically, the preprocessing can be to color the images, correct the foreground image to a dark color, and correct the background image to a light color, or to extract the boundaries of the color blocks in the image and then delete the original color blocks.
[0079] Step S11 can be used to establish a plane coordinate system on the image to obtain the array coordinates of the area whose pixel grayscale value is greater than a preset first threshold value to form an array set. Step S12 can be used to determine the array coordinate points corresponding to the connected area of the image according to the array set. Among them, the connected area represents a continuous line in the image, and the array coordinate points corresponding to the connected area can represent the points corresponding to the continuous lines in the image. As for the method of generating the connected area, although it can be a variety of forms known to those skilled in the art. However, in a preferred example of the present invention, the method of generating the array coordinate points of the connected area can include the following: Figure 3 In the steps shown in Figure 3 In the step S12, the step S12 may include:
[0080] In step S20, a non-selected point is randomly selected from the array set as a starting point;
[0081] In step S21, a point adjacent to the starting point is searched in the array set and added to the array coordinate point set;
[0082] In step S22, it is determined whether there are any unselected points in the current array set;
[0083] In the case where it is determined that there are unselected points in the current array set, the step of randomly selecting an unselected point from the array set is performed again until it is determined that there are no unselected points in the current array set;
[0084] In step S23, when it is determined that there are unselected points in the current array set, the array coordinate point set generated in each cycle is output.
[0085] In this Figure 3In the method shown, the method of searching for points adjacent to the starting point in step S21 can be, for example, for the horizontal coordinate or vertical coordinate of the current starting point + 1, so as to obtain points adjacent to the starting point in the horizontal coordinate direction or the vertical coordinate direction. After each search in step S21 is completed, a connected area with the initially selected point as the starting point can be obtained, and when step S22 determines that there are still unselected points, it means that there are still other connected areas in the array set, then it can return to step S20 to start the generation process of a new connected area. Return, after the point search of the last connected area is completed, step S22 determines that there are no unselected points at present, then the connected areas obtained in each cycle can be combined to form the corresponding array coordinate point set composed of each connected area.
[0086] After the array coordinate point set consisting of a single connected area is generated in step S12, considering that there may be ink points in the figure caused by unintentional touches during drawing, it is necessary to screen the generated array coordinate point set. In this embodiment, considering that the most obvious feature of ink points is that the overall area is very small relative to the complete lines, it can be determined whether the connected area is an ink point by judging the number of elements in the connected area (that is, the number of array coordinate points in the connected area), that is, step S13: delete the array coordinate point set of the connected area whose number of elements in the connected area is less than the preset second threshold. Specifically, step S13 can be to first count the number of points in each array coordinate point set, and then delete the array coordinate point set whose number of points is less than the second threshold.
[0087] After the ink dots are deleted in step S13, it is necessary to identify the characteristics of the array coordinate points of each connected region, wherein the characteristics may include the endpoints and the sequence of the endpoints (i.e., the starting point and the end point) of the connected region. Specifically, the method of obtaining the starting point may include: Figure 4 The steps shown in Figure 4 In the method of obtaining the starting point, the method may include:
[0088] In step S30, the center point of the array coordinate point set is determined;
[0089] In step S31, the distance between each point in the array coordinate point set and the corresponding center point is calculated;
[0090] In step S32, the point with the largest distance is used as the starting point of the array coordinate point set.
[0091] As for the endpoint order, it can be adopted as follows Figure 5 The method shown is to search. Figure 5 In, the method may include:
[0092] In step S40, starting from the starting point of the array coordinate point set, multiple points located around the currently selected starting point are searched in the array coordinate point set to form a slice;
[0093] In step S41, starting from the current slice, multiple points located around all points of the slice and not generating slices are searched in the array coordinate point set to form a new slice;
[0094] In step S42, it is determined whether there are any points in the current array coordinate point set that have not generated slices;
[0095] When it is determined that there are still points in the current array coordinate point set for which no slices have been generated, the step of starting from the current slice and searching the array coordinate point set for multiple points that are located around all points in the slice and for which no slices have been generated to form a new slice is returned to the execution again, until it is determined that there are no points in the current array coordinate point set for which no slices have been generated.
[0096] In this Figure 5 In the method shown, a slice can be a set of adjacent points starting from a starting point. Figure 6 Take the array coordinate point set shown in as an example. Figure 6 , the starting point of the array coordinate point set is (1, 7). Then the first slice obtained after processing in step S40 is (2, 6), and the second slice can be {(3, 7), (3, 6), (3, 5)}, that is, the coordinates of the points of the new slice are the coordinate points obtained by adding 1 to the horizontal coordinates or vertical coordinates of the coordinate points of the previous slice. In the case that step S42 determines that there are no unselected coordinate points at present, it means that all the array coordinate points of the current connected area have been covered by the slice, so it can be directly ended and the slice growth process of the new connected area can be started.
[0097] After all the slice growth operations are completed in step S14, it can be found through observation that for each generated slice, if the current connected area has one and only one end point, then it is obvious that the array coordinate points contained in each slice are continuous; conversely, if the current connected area has at least two end points, then there must be at least one slice with discontinuous array coordinate points, that is, there is a bifurcation point. Therefore, step S15 can be used to divide the position of each existing bifurcation point, thereby completing the secondary division of the connected area with the bifurcation point. Although the specific process of the secondary division can be in various forms known to those skilled in the art, in a preferred example of the present invention, the secondary division can include the following: Figure 7 In the steps shown in Figure 7 In the process of secondary division, the process may include:
[0098] In step S50, unselected slices are selected in order from the array coordinate point set;
[0099] In step S51, it is determined whether there is a discontinuity in the slice;
[0100] In step S52, when it is determined that there is no discontinuity in the slice, it is determined whether there is any slice that has not been selected;
[0101] If it is determined that there are still unselected slices, returning to the step of selecting the unselected slices in the array coordinate point set in order;
[0102] In step S53, when it is determined that there is no unselected slice at present, it is determined that the current array coordinate point set has been divided into array coordinate point sets without bifurcation points;
[0103] In step S54, when it is determined that there are discontinuities in the slice, all points before the current slice are aggregated into a new array coordinate point set, and all points before the current slice are deleted from the original array coordinate point set;
[0104] In step S55, starting from the continuous points in the current slice, a new slice is regenerated in the original array coordinate point set to divide the original array coordinate point set into a plurality of new array coordinate point sets. The method of regenerating a new slice may be as follows: Figure 5 The method shown in ;
[0105] Return again to execute the step of selecting the unselected slices in the array coordinate point set in order.
[0106] After determining that the current array coordinate point set has been divided into array coordinate point sets without bifurcation points, the starting point and the end point can be re-determined for the divided array coordinate point sets, that is, the mathematical center point of each slice is calculated, and then each mathematical center point is connected to form the divided array coordinate point set.
[0107] After the division in step S15 is completed, each connected area is a line with a single starting point and an end point. However, even if it is a line with a single starting point and an end point, there may be a situation where the line is not a curve. For example, a connected area may be a broken line composed of two straight lines, in which case the connected area cannot be regarded as a curve. Therefore, it is necessary to go through steps S16 and S17 to remove this situation. That is, the jump points are deleted in step S16 and the points with too small deflection angles are deleted in step S17.
[0108] After step S16 and step S17 are completed, each connected area at this time can meet the conditions of the curve, and a line fitting algorithm can be used to form the identified line. However, considering that the number of points in different connected areas is different, before executing the curve fitting algorithm, if the number of points is too large, the amount of calculation of the algorithm will increase, and conversely, if the number of points is too small, the fitting effect of the curve fitting algorithm will be poor. Therefore, it is also necessary to execute step S18, that is, to replace the points in each array coordinate point set with points within a preset number range. Specifically, it can be to first select a starting point and a final point in the array coordinate point set, and then select multiple points between the starting point and the final point as the replaced points by approximately averaging, and finally connect all the selected points to form the replaced array coordinate point set.
[0109] On the other hand, the present invention further provides a system for identifying a curve, the system comprising a processor, and the processor is used to execute any of the above methods.
[0110] In yet another aspect, the present invention further provides a computer-readable storage medium storing instructions, wherein the instructions are used to be read by a machine so as to enable the machine to execute any of the above methods.
[0111] Through the above technical solution, the method and system for identifying a curve provided by the present invention obtains an array set by establishing a plane coordinate system in an image, and determines the endpoints and inflection points of the curve according to the obtained array set, and finally uses a curve fitting algorithm for the obtained endpoints and inflection points and the connected areas in the array set to obtain the identified curve. Compared with the prior art, the method and system provided by the present invention can directly convert an image into a Bezier / Nurbs curve, so that subsequent recognition methods such as OCR can achieve higher recognition accuracy.
[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0113] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0117] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0120] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for identifying a curve, characterized in that: The method comprises: Obtain an image to be recognized; Establishing a plane coordinate system on the image to obtain array coordinates of areas where the pixel grayscale value is greater than a preset first threshold value to form an array set; Determining an array coordinate point set corresponding to a connected area of the image according to the array set, wherein the connected area includes at least two endpoints and a line connecting the at least two endpoints; Deleting the array coordinate point set of the connected area whose number of elements in the connected area is less than a preset second threshold; Determine the endpoints and the order of the endpoints of each connected region array coordinate point set; Dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points; Deleting a jump point in the array coordinate point set, wherein the array coordinate point set includes a plurality of inflection points, each of the inflection points corresponds to a deflection direction, and the jump point is an inflection point whose deflection direction is the same as that of two adjacent inflection points and whose deflection direction is opposite to that of the two adjacent inflection points; Deleting the inflection points in the array coordinate point set whose deflection angle is less than a preset third threshold; Using a preset number of points in the range of points to replace each point in the array coordinate point set; Connecting each point in the array coordinate point set based on a line fitting algorithm to form an identified curve line; Determining the array coordinate point set corresponding to the connected area of the image according to the array set includes: Randomly select an unselected point from the array set as a starting point; Searching for a point adjacent to the starting point in the array set and adding the point to the array coordinate point set; Determine whether there is an unselected point in the current array set; In the case where it is determined that there are unselected points in the current array set, the step of randomly selecting an unselected point from the array set is performed again until it is determined that there are no unselected points in the current array set; When it is determined that there are unselected points in the current array set, the array coordinate point set generated in each cycle is output.
2. The method according to claim 1, characterized in that: Deleting the array coordinate point set of the connected region whose number of elements in the connected region is less than a preset second threshold comprises: Count the number of points in each array coordinate point set; The array coordinate point set having a number of points less than the second threshold is deleted.
3. The method according to claim 1, characterized in that Determining the endpoints and the order of the endpoints of each array coordinate point set includes: Determine the center point of the array coordinate point set; Calculate the distance between each point in the array coordinate point set and the corresponding center point; The point with the largest distance is taken as the starting point of the array coordinate point set.
4. The method according to claim 3, characterized in that Determining the endpoints and the order of the endpoints of each array coordinate point set includes: Starting from the starting point of the array coordinate point set, searching the array coordinate point set for a plurality of points located around the currently selected starting point to form a slice; Starting from the current slice, multiple points located around all points of the slice and not generating slices are searched in the array coordinate point set to form a new slice; Determine whether there are any points in the current array coordinate point set that have not generated slices; When it is determined that there are still points for which a slice has not been generated in the current array coordinate point set, the step of starting from the current slice and searching the array coordinate point set for a plurality of points for which a slice has not been generated and which are located around all points of the slice to form a new slice is returned to the execution again, until it is determined that there are no points for which a slice has not been generated in the current array coordinate point set.
5. The method according to claim 4, characterized in that Dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points comprises: Selecting the unselected slices in order from the array coordinate point set; Determining whether there is a discontinuity in the sheet layer; In the case where it is determined that there is no discontinuity in the slice layer, determining whether there is still the slice layer that has not been selected; If it is determined that there are still unselected slices, returning to the step of selecting the unselected slices in order in the array coordinate point set; In the case where it is determined that there is no unselected slice at present, determining that the current array coordinate point set has been divided into array coordinate point sets without bifurcation points; When it is determined that there are discontinuities in the slice, all points before the current slice are aggregated into a new array coordinate point set, and all points before the current slice are deleted from the original array coordinate point set; Starting from the continuous points in the current slice respectively, a new slice is regenerated in the original array coordinate point set to divide the original array coordinate point set into a plurality of new array coordinate point sets; The step of selecting the unselected slices in the array coordinate point set in order is returned again.
6. The method according to claim 5, characterized in that Dividing the array coordinate point set with bifurcation points into array coordinate point sets without bifurcation points comprises: Calculating the mathematical center point of each of the slices; Connect each mathematical center point to form a partitioned array coordinate point set.
7. The method according to claim 1, characterized in that Replacing each point in the array coordinate point set with a preset number of points includes: Selecting a starting point and a final point in the array coordinate point set; Selecting a plurality of points between the starting point and the final point approximately on average as points after replacement; All selected points are connected to form the replaced array coordinate point set.
8. A system for identifying a curve, characterized in that: The system comprises a processor, and the processor is configured to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are used to be read by a machine so as to enable the machine to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
High-precision semi-automatic image data labeling method, electronic device and storage medium
CN111028261A
Image binarization using dynamic sub-image division
US20090185236A1