CN117114971B - Pixel map-to-vector map conversion method and system - Google Patents
Pixel map-to-vector map conversion method and system Download PDFInfo
- Publication number
- CN117114971B CN117114971B CN202310956729.5A CN202310956729A CN117114971B CN 117114971 B CN117114971 B CN 117114971B CN 202310956729 A CN202310956729 A CN 202310956729A CN 117114971 B CN117114971 B CN 117114971B
- Authority
- CN
- China
- Prior art keywords
- pixel
- vector
- corner
- point
- map
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 239000013598 vector Substances 0.000 title claims abstract description 132
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000006243 chemical reaction Methods 0.000 title claims description 17
- 238000010586 diagram Methods 0.000 claims abstract description 27
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012937 correction Methods 0.000 claims description 8
- 238000012545 processing Methods 0.000 claims description 8
- 238000010276 construction Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000012216 screening Methods 0.000 claims description 3
- 230000003321 amplification Effects 0.000 abstract description 3
- 238000003199 nucleic acid amplification method Methods 0.000 abstract description 3
- 238000004422 calculation algorithm Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention relates to a method and a system for converting a pixel map into a vector map, wherein the method comprises the following steps: optionally one from the pixel map as a starting point; constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window; chamfering all the corner points of the pixel diagram to screen out correct corner points; and calculating a line segment mathematical expression formed by adjacent correct corner points to form a final vector diagram. The invention finds out the corner points of the pixel map by using the search window, calculates the line segment mathematical expression formed by the adjacent correct corner points to form the final vector map, and the vector map is described by a mathematical formula, so that lossless amplification and reduction can be realized, and the converted vector map can be kept clear and sharp under any resolution, and the pixelation problem can not occur.
Description
Technical Field
The present invention relates to the field of image conversion technologies, and in particular, to a method and a system for converting a pixel map into a vector map.
Background
In CAD drawing automation processing, two expression modes exist in the drawing: 1. a pixel map; 2. and (5) vector diagram. The vector diagram has the advantages of high precision, no scaling precision loss, and the pixel diagram has the advantage that special algorithms which cannot be operated in the vector diagram and must be operated in the pixel diagram can be realized. In the conversion of a pixel map to a vector map, conventional methods typically use interpolation and optimization algorithms to convert the data points of the pixel map to a smooth vector curve. However, due to limitations of interpolation algorithms and the presence of image noise, distortion and inaccuracy often exist in the conversion results.
Disclosure of Invention
In order to solve the above problems, an embodiment of the present invention is to provide a method and a system for converting a pixel map into a vector map.
A method of converting a pixel map to a vector map, comprising:
step 1: optionally one from the pixel map as a starting point;
step 2: constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window;
step 3: chamfering all the corner points of the pixel map to screen out correct corner points;
step 4: and calculating a line segment mathematical expression formed by adjacent correct corner points to form a final vector diagram.
Preferably, the step 2: constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window, wherein the method comprises the following steps:
step 2.1: searching a pixel point in the search window at will as the latest pixel, and changing the starting point into a next new pixel;
step 2.2: constructing a search window by taking the latest pixel as a base point, searching the pixel clockwise from the next new pixel, wherein the first pixel is the pixel to be added;
step 2.3: calculating an included angle between the latest pixel and the secondary new pixel, wherein the included angle between the latest pixel and two straight lines formed by the pixels to be added;
step 2.4: when the included angle of the two straight lines is 180 degrees, the latest pixel is not the corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.5: when the included angle of the two straight lines is 90 degrees, the latest pixel is taken as a corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.6: traversing all pixel points on the pixel map until all corner points on the pixel map are found.
Preferably, the step 3: chamfering all the corner points of the pixel map to screen out correct corner points, including:
step 3.1: finding out four consecutive adjacent corner points in all the corner points, and connecting every two corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
step 3.2: respectively calculating included angles of the three vectors, and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
step 3.3: if any one condition is not met, all pixels are moved one clockwise, and the step 3.1 is returned until all the corner points are traversed;
step 3.4: if all the conditions are met, calculating the intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
Preferably, after the step 3, the method further includes:
judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
The invention also provides a system for converting the pixel image into the vector image, which comprises the following steps:
the starting point screening module is used for selecting one from the pixel graphs as a starting point;
the search window construction module is used for constructing a search window by taking the starting point as the center and finding all corner points of the pixel map based on the search window;
the chamfering processing module is used for chamfering all the corner points of the pixel graph to screen out correct corner points;
and the vector diagram conversion module is used for calculating a line segment mathematical expression formed by adjacent correct angular points to form a final vector diagram.
Preferably, the search window construction module includes:
the searching module is used for searching a pixel point in the searching window at will as the latest pixel, and the starting point is changed into a next new pixel;
the searching module is used for constructing a searching window by taking the latest pixel as a base point, searching the pixel from the next new pixel clockwise, and finding out the first pixel to be added;
the linear included angle calculation module is used for calculating included angles of two lines formed by the latest pixel and the pixel to be added;
the first result generation module is used for returning the pixel to be added to the search module as the latest pixel which is not the corner point when the included angle of the two straight lines is 180 degrees;
the second result generation module is used for returning the pixel to be added to the search module as the latest pixel when the included angle of the two straight lines is 90 degrees and the latest pixel is the corner point;
and the traversing module is used for traversing all the pixel points on the pixel map until all the corner points on the pixel map are found.
Preferably, the straight line included angle calculating module includes:
the adjacent corner point searching module is used for finding out four continuous adjacent corner points in all the corner points and connecting the four continuous adjacent corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
the judging module is used for respectively calculating the included angles of the three vectors and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
the first judgment result generation module is used for moving all pixels to one clockwise direction if any condition is not met, and returning to the adjacent corner searching module until all corners are traversed;
and the second judgment result generation module is used for calculating an intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point when all conditions are met, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
Preferably, the method further comprises:
the starting point correction module is used for judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
The invention also provides an electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the transceiver, the memory and the processor are connected through the bus, and the computer program realizes the steps in the pixel map-to-vector map conversion method when being executed by the processor.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a pixel map to vector map conversion method as described above.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
compared with the prior art, the invention finds out the corner points of the pixel map by utilizing the search window, calculates the line segment mathematical expression formed by the adjacent correct corner points to form a final vector map, and the vector map is described by a mathematical formula, so that lossless amplification and reduction can be realized, and the converted vector map can be kept clear and sharp under any resolution without pixelation.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for converting a pixel map into a vector map according to the present invention;
FIG. 2 is a diagram of pixels to be converted according to the present invention;
FIG. 3 is a schematic diagram of a pixel search according to the present invention;
FIG. 4 is a diagram of a pixel position when the included angle between two straight lines is 180 degrees;
FIG. 5 is a diagram of pixel position when the angle between two straight lines is 90 degrees;
FIG. 6 is a schematic diagram showing the finding of all corner points and the initial starting points on a pixel map according to the present invention;
FIG. 7 is a diagram of the location of the false corner provided by the invention;
FIG. 8 is a schematic diagram of correction of false corner points according to the present invention;
FIG. 9 is a diagram of pixel positions after correction of erroneous corner points according to the present invention;
FIG. 10 is a schematic diagram of a starting point correction provided by the present invention;
fig. 11 is a diagram of pixel positions after the correction of the starting point according to the present invention.
Description of the embodiments
In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," "secured," and the like are to be construed broadly and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
Referring to fig. 1, a method for converting a pixel map to a vector map includes:
step 1: optionally one from the pixel map as a starting point;
the preconditions for this algorithm are as follows:
1. all pixels in the pixel map form a closed image edge contour, and the width of the contour edge is 1 pixel.
2. After the pixel graph is converted into a vector graph, only straight line segments are formed.
Step 2: constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window;
further, the step 2 includes:
step 2.1: searching a pixel point in the search window at will as the latest pixel, and changing the starting point into a next new pixel;
step 2.2: constructing a search window by taking the latest pixel as a base point, searching the pixel clockwise from the next new pixel, wherein the first pixel is the pixel to be added;
step 2.3: calculating an included angle between the latest pixel and the secondary new pixel, wherein the included angle between the latest pixel and two straight lines formed by the pixels to be added;
step 2.4: when the included angle of the two straight lines is 180 degrees, the latest pixel is not the corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.5: when the included angle of the two straight lines is 90 degrees, the latest pixel is taken as a corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.6: traversing all pixel points on the pixel map until all corner points on the pixel map are found.
Step 3: chamfering all the corner points of the pixel map to screen out correct corner points;
further, the step 3 includes:
step 3.1: finding out four consecutive adjacent corner points in all the corner points, and connecting every two corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
step 3.2: respectively calculating included angles of the three vectors, and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
step 3.3: if any one condition is not met, all pixels are moved one clockwise, and the step 3.1 is returned until all the corner points are traversed;
step 3.4: if all the conditions are met, calculating the intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
After the step 3, the method further includes:
judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
Step 4: and calculating a line segment mathematical expression formed by adjacent correct corner points to form a final vector diagram.
The method for converting a pixel map into a vector map according to the present invention is further described below with reference to specific embodiments:
firstly, preparing a corner array A for storing the searched corner.
1. In a white grid canvas, each grid represents the position of a pixel, white represents null, and gray represents the pixels present in the bitmap, as shown in fig. 2.
2. In fig. 3, one gray pixel is taken as a starting point, such as pixel No. 1 in fig. 3.
3. One pixel is arbitrarily found in eight lattices around the pixel No. 1, such as the pixel No. 2 in fig. 3. The pixel No. 2 is called the latest pixel, and the pixel No. 1 is the next-new pixel.
4. Taking the latest pixel (No. 2 pixel point) as a base point, searching pixels from the next new pixel (No. 1 pixel point) clockwise by using a surrounding 3x3 range as a searching range, wherein the first pixel found is the pixel to be added (such as the No. 3 pixel point in FIG. 3) (if the pixel to be added is a starting point pixel, jumping to the step 5). Calculating the included angles of two straight lines formed by the new pixel and the pixel to be added, wherein the included angles can be two conditions:
1. the included angle is 180 degrees, indicating that three points are a straight line:
referring to fig. 4, it can be proved that the pixel point No. 2 is not the corner point, the pixel to be added is changed into a new pixel, the new pixel is changed into a next new pixel, and the step 4 is repeated.
2. The included angle is 90 degrees, and the No. 2 pixel point of the surface is an angular point:
referring to fig. 5, pixel No. 2 is added to the corner queue. Changing the pixel to be added into a new pixel, changing the new pixel into a next new pixel, and repeating the step 4.
5. To this end, all corner points and the original starting point are all placed in the corner point queue in order, as follows in fig. 6. Wherein: a is the starting point, B, C, F, G, H is the normal corner point, E and D are the wrong corner points, which is a special case in the arithmetic logic to be corrected in the next step of chamfering:
# chamfering flow
Chamfering: as shown in fig. 7, D and E are incorrect corner points, the true corner point is the gray pixel in the middle of two incorrect corner points, and this step requires deleting the incorrect corner points and finding the correct corner points.
1. In fig. 8, four consecutive pixels are found in succession and connected in pairs into four vectors.
The angles between the three vectors are calculated separately if the following conditions are met:
1. the v1 v2 included angle is larger than 0;
2. the v2 v3 included angle is greater than 0;
3. the v1 v3 included angle is 90 degrees;
then the middle two pixels are erroneous pixels, which need to be corrected in the next step;
if one condition is not met, then no correction is needed, all pixels are moved one back, repeat step 1, until the four pixels just started are returned.
2. Calculating a straight line l formed by the first point and the second point 1 Calculating a straight line l formed by the third point and the fourth point 2 Calculate l 1 And/l 2 The intersection point x of (2) is the actual corner point, the second point and the third point are deleted in the corner point queue, and the point x is added.
After all the point processing is completed, the corner point state is as shown in fig. 9, and then the processing is required to reach the starting point.
# origin processing
As shown in fig. 10, the included angle of the vector formed by the starting point and two corner points on two sides is calculated, if the angle is 180 degrees, the point is not the corner point, the point is deleted, after the processing is finished, all the rest points are corner points, and the line segment mathematical expression formed by the adjacent points is calculated, namely the final vector diagram is formed.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the invention finds out the corner points of the pixel map by using the search window, calculates the line segment mathematical expression formed by the adjacent correct corner points to form the final vector map, and the vector map is described by a mathematical formula, so that lossless amplification and reduction can be realized, and the converted vector map can be kept clear and sharp under any resolution, and the pixelation problem can not occur.
The invention also provides a system for converting the pixel image into the vector image, which comprises the following steps:
the starting point screening module is used for selecting one from the pixel graphs as a starting point;
the search window construction module is used for constructing a search window by taking the starting point as the center and finding all corner points of the pixel map based on the search window;
the chamfering processing module is used for chamfering all the corner points of the pixel graph to screen out correct corner points;
and the vector diagram conversion module is used for calculating a line segment mathematical expression formed by adjacent correct angular points to form a final vector diagram.
Preferably, the search window construction module includes:
the searching module is used for searching a pixel point in the searching window at will as the latest pixel, and the starting point is changed into a next new pixel;
the searching module is used for constructing a searching window by taking the latest pixel as a base point, searching the pixel from the next new pixel clockwise, and finding out the first pixel to be added;
the linear included angle calculation module is used for calculating included angles of two lines formed by the latest pixel and the pixel to be added;
the first result generation module is used for returning the pixel to be added to the search module as the latest pixel which is not the corner point when the included angle of the two straight lines is 180 degrees;
the second result generation module is used for returning the pixel to be added to the search module as the latest pixel when the included angle of the two straight lines is 90 degrees and the latest pixel is the corner point;
and the traversing module is used for traversing all the pixel points on the pixel map until all the corner points on the pixel map are found.
Preferably, the straight line included angle calculating module includes:
the adjacent corner point searching module is used for finding out four continuous adjacent corner points in all the corner points and connecting the four continuous adjacent corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
the judging module is used for respectively calculating the included angles of the three vectors and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
the first judgment result generation module is used for moving all pixels to one clockwise direction if any condition is not met, and returning to the adjacent corner searching module until all corners are traversed;
and the second judgment result generation module is used for calculating an intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point when all conditions are met, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
Preferably, the method further comprises:
the starting point correction module is used for judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
Compared with the prior art, the beneficial effects of the system for converting the pixel map into the vector map are the same as those of the method for converting the pixel map into the vector map, which is described in the technical scheme, and are not repeated herein.
The invention also provides an electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the transceiver, the memory and the processor are connected through the bus, and the computer program realizes the steps in the pixel map-to-vector map conversion method when being executed by the processor.
Compared with the prior art, the beneficial effects of the electronic equipment provided by the invention are the same as those of the pixel map-to-vector map conversion method described in the technical scheme, and the detailed description is omitted.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a pixel map to vector map conversion method as described above.
Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the invention are the same as those of the method for converting the pixel map into the vector map in the technical scheme, and the detailed description is omitted.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art can easily think about variations or alternatives within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (6)
1. A method for converting a pixel map to a vector map, comprising:
step 1: optionally one from the pixel map as a starting point;
step 2: constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window;
step 3: chamfering all the corner points of the pixel map to screen out correct corner points;
step 4: calculating a line segment mathematical expression formed by adjacent correct corner points to form a final vector diagram;
the step 2: constructing a search window by taking the starting point as the center, and finding all corner points of the pixel map based on the search window, wherein the method comprises the following steps:
step 2.1: searching a pixel point in the search window at will as the latest pixel, and changing the starting point into a next new pixel;
step 2.2: constructing a search window by taking the latest pixel as a base point, searching the pixel clockwise from the next new pixel, wherein the first pixel is the pixel to be added;
step 2.3: calculating an included angle between the latest pixel and the secondary new pixel, wherein the included angle between the latest pixel and two straight lines formed by the pixels to be added;
step 2.4: when the included angle of the two straight lines is 180 degrees, the latest pixel is not the corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.5: when the included angle of the two straight lines is 90 degrees, the latest pixel is taken as a corner point, the pixel to be added is taken as the latest pixel, and the step 2.2 is returned;
step 2.6: traversing all pixel points on the pixel map until all corner points on the pixel map are found;
the step 3: chamfering all the corner points of the pixel map to screen out correct corner points, including:
step 3.1: finding out four consecutive adjacent corner points in all the corner points, and connecting every two corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
step 3.2: respectively calculating included angles of the three vectors, and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
step 3.3: if any one condition is not met, all pixels are moved one clockwise, and the step 3.1 is returned until all the corner points are traversed;
step 3.4: if all the conditions are met, calculating the intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
2. The method of converting a pixel map to a vector map according to claim 1, further comprising, after said step 3:
judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
3. A system for converting a pixel map to a vector map, comprising:
the starting point screening module is used for selecting one from the pixel graphs as a starting point;
the search window construction module is used for constructing a search window by taking the starting point as the center and finding all corner points of the pixel map based on the search window;
the chamfering processing module is used for chamfering all the corner points of the pixel graph to screen out correct corner points;
the vector diagram conversion module is used for calculating a line segment mathematical expression formed by adjacent correct angular points to form a final vector diagram;
the search window construction module includes:
the searching module is used for searching a pixel point in the searching window at will as the latest pixel, and the starting point is changed into a next new pixel;
the searching module is used for constructing a searching window by taking the latest pixel as a base point, searching the pixel from the next new pixel clockwise, and finding out the first pixel to be added;
the linear included angle calculation module is used for calculating included angles of two lines formed by the latest pixel and the pixel to be added;
the first result generation module is used for returning the pixel to be added to the search module as the latest pixel which is not the corner point when the included angle of the two straight lines is 180 degrees;
the second result generation module is used for returning the pixel to be added to the search module as the latest pixel when the included angle of the two straight lines is 90 degrees and the latest pixel is the corner point;
the traversing module is used for traversing all pixel points on the pixel map until all corner points on the pixel map are found;
the straight line included angle calculation module comprises:
the adjacent corner point searching module is used for finding out four continuous adjacent corner points in all the corner points and connecting the four continuous adjacent corner points into three vectors; the first corner point is connected with the second corner point to be a first vector, the second corner point is connected with the third corner point to be a second vector, and the third corner point is connected with the fourth corner point to be a fourth vector;
the judging module is used for respectively calculating the included angles of the three vectors and judging whether the included angles of the three vectors meet the following conditions: the included angle between the first vector and the second vector is larger than 0, the included angle between the second vector and the third vector is larger than 0, and the included angle between the first vector and the third vector is equal to 90 degrees;
the first judgment result generation module is used for moving all pixels to one clockwise direction if any condition is not met, and returning to the adjacent corner searching module until all corners are traversed;
and the second judgment result generation module is used for calculating an intersection point of a first straight line formed by the first corner point and the second corner point and a second straight line formed by the third corner point and the fourth corner point when all conditions are met, taking the intersection point as a correct corner point, and deleting the second corner point and the third corner point.
4. A conversion device of a pixel map to vector map conversion system according to claim 3, further comprising:
the starting point correction module is used for judging the included angle of the vector formed by the starting point and the adjacent angular points at two sides, and deleting the starting point when the included angle is 180 degrees.
5. An electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored on the memory and operable on the processor, the transceiver, the memory and the processor being connected by the bus, characterized in that the computer program when executed by the processor implements the steps of a pixel map to vector map conversion method according to any of claims 1-2.
6. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of a pixel map to vector map conversion method according to any of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310956729.5A CN117114971B (en) | 2023-08-01 | 2023-08-01 | Pixel map-to-vector map conversion method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310956729.5A CN117114971B (en) | 2023-08-01 | 2023-08-01 | Pixel map-to-vector map conversion method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117114971A CN117114971A (en) | 2023-11-24 |
CN117114971B true CN117114971B (en) | 2024-03-08 |
Family
ID=88795603
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310956729.5A Active CN117114971B (en) | 2023-08-01 | 2023-08-01 | Pixel map-to-vector map conversion method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117114971B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118429480B (en) * | 2024-04-23 | 2024-10-01 | 东南大学 | Conversion method based on non-vector PDF drawing to CAD vector diagram |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101794446A (en) * | 2010-02-11 | 2010-08-04 | 东南大学 | Line search type detection method of image corner point |
CN103192397A (en) * | 2012-01-09 | 2013-07-10 | 沈阳新松机器人自动化股份有限公司 | Off-line visual programming method and system for robot |
CN103759648A (en) * | 2014-01-28 | 2014-04-30 | 华南理工大学 | Complex fillet weld joint position detecting method based on laser binocular vision |
CN110458174A (en) * | 2019-06-28 | 2019-11-15 | 南京航空航天大学 | A kind of unordered accurate extracting method of cloud key feature points |
CN110490913A (en) * | 2019-07-22 | 2019-11-22 | 华中师范大学 | Feature based on angle point and the marshalling of single line section describes operator and carries out image matching method |
CN111260731A (en) * | 2020-01-10 | 2020-06-09 | 大连理工大学 | Checkerboard sub-pixel level corner point self-adaptive detection method |
CN111444948A (en) * | 2020-03-21 | 2020-07-24 | 哈尔滨工程大学 | Image feature extraction and matching method |
CN111797555A (en) * | 2020-07-01 | 2020-10-20 | 上海理工大学 | Geometric reconstruction method based on finite element model |
CN112580626A (en) * | 2020-12-14 | 2021-03-30 | 夏永霞 | Method for determining addition amount of covering slag in metallurgical continuous casting process based on artificial intelligence |
CN113469220A (en) * | 2021-06-09 | 2021-10-01 | 广州虎牙科技有限公司 | Track identification method and related device and equipment |
CN115147389A (en) * | 2022-07-19 | 2022-10-04 | 歌尔股份有限公司 | Image processing method, apparatus, and computer-readable storage medium |
CN115267722A (en) * | 2021-04-29 | 2022-11-01 | 北京四维图新科技股份有限公司 | Angular point extraction method and device and storage medium |
CN116342704A (en) * | 2023-05-26 | 2023-06-27 | 北京斯年智驾科技有限公司 | Scanning point category determining method and device, computer equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102547296B (en) * | 2012-02-27 | 2015-04-01 | 开曼群岛威睿电通股份有限公司 | Motion estimation accelerating circuit and motion estimation method as well as loop filtering accelerating circuit |
-
2023
- 2023-08-01 CN CN202310956729.5A patent/CN117114971B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101794446A (en) * | 2010-02-11 | 2010-08-04 | 东南大学 | Line search type detection method of image corner point |
CN103192397A (en) * | 2012-01-09 | 2013-07-10 | 沈阳新松机器人自动化股份有限公司 | Off-line visual programming method and system for robot |
CN103759648A (en) * | 2014-01-28 | 2014-04-30 | 华南理工大学 | Complex fillet weld joint position detecting method based on laser binocular vision |
CN110458174A (en) * | 2019-06-28 | 2019-11-15 | 南京航空航天大学 | A kind of unordered accurate extracting method of cloud key feature points |
CN110490913A (en) * | 2019-07-22 | 2019-11-22 | 华中师范大学 | Feature based on angle point and the marshalling of single line section describes operator and carries out image matching method |
CN111260731A (en) * | 2020-01-10 | 2020-06-09 | 大连理工大学 | Checkerboard sub-pixel level corner point self-adaptive detection method |
CN111444948A (en) * | 2020-03-21 | 2020-07-24 | 哈尔滨工程大学 | Image feature extraction and matching method |
CN111797555A (en) * | 2020-07-01 | 2020-10-20 | 上海理工大学 | Geometric reconstruction method based on finite element model |
CN112580626A (en) * | 2020-12-14 | 2021-03-30 | 夏永霞 | Method for determining addition amount of covering slag in metallurgical continuous casting process based on artificial intelligence |
CN115267722A (en) * | 2021-04-29 | 2022-11-01 | 北京四维图新科技股份有限公司 | Angular point extraction method and device and storage medium |
CN113469220A (en) * | 2021-06-09 | 2021-10-01 | 广州虎牙科技有限公司 | Track identification method and related device and equipment |
CN115147389A (en) * | 2022-07-19 | 2022-10-04 | 歌尔股份有限公司 | Image processing method, apparatus, and computer-readable storage medium |
CN116342704A (en) * | 2023-05-26 | 2023-06-27 | 北京斯年智驾科技有限公司 | Scanning point category determining method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117114971A (en) | 2023-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102095626B1 (en) | Image processing method and apparatus | |
US7471809B2 (en) | Method, apparatus, and program for processing stereo image | |
CN117114971B (en) | Pixel map-to-vector map conversion method and system | |
CN110992356A (en) | Target object detection method and device and computer equipment | |
US20030002751A1 (en) | Method of correcting an image with perspective distortion and producing an artificial image with perspective distortion | |
CN104778688A (en) | Method and device for registering point cloud data | |
JP4784500B2 (en) | Image tilt correction apparatus and image tilt correction method | |
CN109697731B (en) | Plant canopy volume calculation method and system based on point cloud data and related equipment | |
CN111123242B (en) | Combined calibration method based on laser radar and camera and computer readable storage medium | |
JP2009230537A (en) | Image processor, image processing program, image processing method, and electronic equipment | |
CN109635714B (en) | Correction method and device for document scanning image | |
CN111105452A (en) | High-low resolution fusion stereo matching method based on binocular vision | |
CN103325109B (en) | Be applicable to the distortion correction method of the fish eye images of wall-mounted type panoramic camera | |
Tasar et al. | Polygonization of binary classification maps using mesh approximation with right angle regularity | |
CN103196460B (en) | A kind of method and apparatus estimating step-length | |
Luong et al. | Consistent ICP for the registration of sparse and inhomogeneous point clouds | |
CN117036475A (en) | Point cloud construction method, system, equipment and storage medium based on binocular matching | |
JP7210337B2 (en) | Image processing device and distortion correction coefficient calculation method | |
CN116879886A (en) | Early warning method for graded communication of micro-change monitoring radar on landslide surface | |
CN111914045A (en) | Data compression method and device, terminal equipment and storage medium | |
CN114295053B (en) | Method and device for determining volume of material, equipment, medium and product | |
CN112288759A (en) | Boundary extraction method, device, equipment and storage medium | |
US7899230B2 (en) | System and method for efficient real-time technique for point localization in and out of a tetrahedral mesh | |
CN113538478B (en) | Box boundary extraction method, system, equipment and storage medium based on image | |
CN115685223B (en) | Position identification method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |