Method, equipment, medium and product for drawing embedded line
Technical Field
The invention relates to the field of mosaic line drawing, in particular to a mosaic line drawing method, equipment, a medium and a product.
Background
According to the general deployment of the national institute on the geographic monitoring work, the information elements of the geographic national conditions enter the normalized monitoring stage, so the production of the digital orthographic images is particularly important. In the process of manufacturing the digital orthographic image, remote sensing images of different satellites in single quarter, multiple phases and different satellites are adopted as base map data at the same time, and the base map data of the operation area are spliced by a method of embedding the drawn embedded lines. In the process of traditional embedded line drawing production, an operator is required to look over two or more images in a contrasting mode, comprehensively study and judge the trend of the embedded line according to the conditions of topography, landform, ground feature trend and the like, and manually draw the embedded line on an operation layer through digital drawing software, so that the process is time-consuming and labor-consuming.
Disclosure of Invention
In order to overcome the defects of the prior art, one of the purposes of the invention is to provide a method for drawing an embedded line, which can solve the problems that an operator needs to compare and check two or more images, comprehensively study and judge the trend of the embedded line according to the conditions of topography, topography trend and the like, and the whole drawing process is time-consuming and labor-consuming.
The second purpose of the invention is to provide an electronic device, which can solve the problems that an operator needs to compare and check two or more images, comprehensively study and judge the trend of the embedded line according to the conditions of topography, landform, feature trend and the like, and the whole drawing process is time-consuming and labor-consuming in the existing embedded line drawing method.
The third objective of the present invention is to provide a computer readable storage medium, which can solve the problems that an operator needs to compare and check two or more images, and comprehensively study and judge the trend of an inlaid line according to the conditions of topography, etc. in the existing inlaid line drawing method, and the whole drawing process is time-consuming and labor-consuming.
The fourth objective of the present invention is to provide a computer program product, which can solve the problems that an operator needs to compare and check two or more images, and comprehensively study and judge the trend of the mosaic line according to the conditions of topography, etc. in the existing mosaic line drawing method, and the whole drawing process is time-consuming and labor-consuming.
One of the purposes of the invention is realized by adopting the following technical scheme:
a drawing method of an embedded line comprises the following steps:
s1, acquiring an initial starting point and a final end point selected by a user on a base map image, and taking the initial starting point as a current starting point;
s2, determining a current end point according to a preset end point calculation parameter and the current start point, and calculating current direction vectors corresponding to the current start point and the current end point;
s3, selecting a corresponding current rectangular searching range on the base image by using the direction vector, and determining a current mosaic line drawing route in the current rectangular searching range according to a pixel value difference value between the residual pixel points in the current rectangular searching range and the pixel points corresponding to the current starting point and a vertical line distance between the residual pixel points and the current direction vector;
s4, drawing a corresponding current mosaic line along the current mosaic line drawing route according to a preset drawing rule;
s5, taking the actual end point corresponding to the current mosaic line as a new current start point, and returning to execute the steps S2-S4 until the distance between the current end point corresponding to the current mosaic line and the final end point is within a preset distance range.
Further, in the step S3, image noise avoiding processing is performed on the current rectangular searching range according to a preset machine learning noise model, a noise area is obtained, all pixels in the noise area are discarded as noise pixels, and the rest pixels do not include the noise pixels.
Further, the step S3 further includes obtaining a click noise area selected by the user in the current rectangular search range, adding the click noise area to a training sample library corresponding to a preset machine learning noise model in real time, and updating the preset machine learning noise model to obtain an updated preset machine learning noise model, performing image noise avoiding processing on the current rectangular search range by using the updated preset machine learning noise model, and removing corresponding noise pixels, wherein the rest pixels do not include the noise pixels.
Further, the method further comprises the step of receiving an operation instruction input by a user before the step S5, and starting a corresponding operation function according to the operation instruction.
Further, the operation instructions include one or more of pause, rollback, and speed regulation instructions.
Further, the determining the current mosaic line drawing route in the current rectangular search range according to the pixel value difference value between the residual pixel point and the pixel point corresponding to the current starting point in the current rectangular search range and the vertical line distance between the residual pixel point and the current direction vector specifically includes the following steps:
screening the current mosaic line drawing points, calculating the absolute value of a pixel value difference value between the residual pixel points in the current rectangular search range and the pixel points corresponding to the current starting point, calculating the vertical line distance between the residual pixel points and the current direction vector, adding the vertical line distance and the absolute value of the pixel value difference value to obtain the corresponding current comprehensive score of each residual pixel point, and taking the residual pixel point with the minimum current comprehensive score as the current mosaic line drawing point;
and circularly screening, namely circularly executing the step of screening the current mosaic line drawing points, wherein the current mosaic line drawing point in the previous step of screening the current mosaic line drawing points is not used as the residual pixel point in the next step of screening the current mosaic line drawing points in the circulation process.
Further, the step S4 specifically includes: and drawing the mosaic line along the current mosaic line drawing route at the speed of 100100px screen pixels per second to obtain the current mosaic line.
The second purpose of the invention is realized by adopting the following technical scheme:
an electronic device, comprising: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program including a drawing method for performing one of the mosaic lines described in the present application.
The third purpose of the invention is realized by adopting the following technical scheme:
a computer-readable storage medium having stored thereon a computer program that is executed by a processor to perform a method of drawing an inlaid strand as described herein.
The fourth technical scheme adopted by the invention is as follows:
a computer program product comprising a computer program which, when executed by a processor, implements a method of drawing an inlaid strand as described herein.
Compared with the prior art, the invention has the beneficial effects that: according to the method for drawing the embedded line, a current end point is determined according to preset end point calculation parameters and the current start point, and the current start point and the current end point are calculated to correspond to a current direction vector; selecting a corresponding current rectangular searching range on a base image by using the current direction vector, and determining a current mosaic line drawing route in the current rectangular searching range according to a pixel value difference value between the residual pixel points in the current rectangular searching range and the pixel points corresponding to the current starting point and a vertical line distance between the residual pixel points and the current direction vector; drawing a corresponding current mosaic line along the current mosaic line drawing route according to a preset drawing rule; taking the actual end point corresponding to the current embedded line as a new current starting point, and returning to the previous step until the distance between the current end point corresponding to the current embedded line and the final end point is within a preset distance range; the whole process does not need to be compared and checked by two or more images, and reduces manpower output, thereby improving the drawing efficiency of the embedded line.
The foregoing description is only an overview of the present invention, and is intended to provide a better understanding of the present invention, as it is embodied in the following description, with reference to the preferred embodiments of the present invention and the accompanying drawings. Specific embodiments of the present invention are given in detail by the following examples and the accompanying drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of a method of drawing an inlaid strand of the present invention;
fig. 2 is a schematic diagram of a current rectangular search range in a method for drawing an embedded line according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and detailed description, wherein it is to be understood that, on the premise of no conflict, the following embodiments or technical features may be arbitrarily combined to form new embodiments.
As shown in fig. 1, the invention provides a method for drawing an embedded line, which comprises the following steps:
s1, acquiring an initial starting point and a final end point selected by a user on a base map image, and taking the initial starting point as a current starting point.
S2, determining a current end point according to the preset end point calculation parameter and the current end point, and calculating a current direction vector corresponding to the current end point and the current end point. In this embodiment, a two-dimensional coordinate system is established on the map image, and each pixel point on the base map image corresponds to a unique coordinate value in the two-dimensional coordinate system, so the preset endpoint calculation parameters are as follows: and adding a first preset value to the coordinate value of the current starting point on the horizontal axis, adding a second preset value to the vertical axis, finally obtaining a new coordinate point, taking the new coordinate point as the current end point, wherein the first preset value and the second preset value are fixed in each calculation, and the first preset value and the second preset value can be the same or different.
S3, selecting a corresponding current rectangular search range on the base image by using a current direction vector, wherein a ray from the upper left corner to the lower right corner in FIG. 2 is the current direction vector, a rectangular region formed in FIG. 2 is the current rectangular search range, and determining a current embedded line drawing route in the current rectangular search range according to a pixel value difference value between a residual pixel point in the current rectangular search range and a pixel point corresponding to a current starting point and a vertical line distance between the residual pixel point and the current direction vector, wherein the residual pixel point is a pixel point except the current starting point in the current rectangular search range, but also comprises the following two cases that the residual pixel point is a pixel point except the current starting point and a noise pixel point in the current rectangular search range. The two cases are specifically:
1. and carrying out image noise avoidance processing on the current rectangular searching range according to a preset machine learning noise model to obtain a noise area, discarding all pixels in the noise area as noise pixels, wherein the rest pixels do not comprise the noise pixels. At this time, the noise points in the current rectangular search range are conventionally removed, for example, the areas with noise cloud blocks, scratches and spot stains are avoided and removed, and the pixels in the areas are not used as the rest pixels to participate in calculation.
2. In this embodiment, the area that is not used as the remaining pixel point may be selected by the user, specifically: the method comprises the steps of obtaining a click noise area selected by a user in a current rectangular search range, adding the click noise area to a training sample library corresponding to a preset machine learning noise model in real time, updating the preset machine learning noise model to obtain an updated preset machine learning noise model, performing image noise avoidance processing on the current rectangular search range by using the updated preset machine learning noise model, removing corresponding noise pixels, and removing the rest pixels which do not comprise the noise pixels.
The determining the current embedded line drawing route in the current rectangular searching range according to the pixel value difference value between the residual pixel point and the pixel point corresponding to the current starting point in the current rectangular searching range and the vertical line distance between the residual pixel point and the current direction vector specifically comprises the following steps:
screening the current mosaic line drawing points, calculating the absolute value of a pixel value difference value between the residual pixel points in the current rectangular search range and the pixel points corresponding to the current starting point, calculating the vertical line distance between the residual pixel points and the current direction vector, adding the vertical line distance to the absolute value of the pixel value difference value to obtain the corresponding current comprehensive score of each residual pixel point, and taking the residual pixel point with the minimum current comprehensive score as the current mosaic line drawing point;
and (3) circularly screening, namely circularly executing the step of screening the current mosaic line drawing points, wherein the current mosaic line drawing points in the step of screening the current mosaic line drawing points in the previous step are not used as the residual pixel points in the step of screening the current mosaic line drawing points in the next step in the circulation process.
And S4, drawing a corresponding current mosaic line along the current mosaic line drawing route according to a preset drawing rule. The method comprises the following steps: and drawing the mosaic line along the current mosaic line drawing route at the speed of 100100px screen pixels per second to obtain the current mosaic line.
S5, taking the actual end point corresponding to the current mosaic line as a new current starting point, and returning to execute the steps S2-S4 until the distance between the current end point corresponding to the current mosaic line and the final end point is within a preset distance range.
The present invention also provides an electronic device including: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program including a drawing method for performing one of the mosaic lines in the present application.
The present invention also provides a computer-readable storage medium having stored thereon a computer program for execution by a processor of a method of drawing a mosaic line in the present application.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method of tessellation line drawing as described herein.
According to the method for drawing the embedded line, a current end point is determined according to preset end point calculation parameters and a current start point, and a current direction vector corresponding to the current start point and the current end point is calculated; selecting a corresponding current rectangular searching range on the base map image by using a current direction vector, and determining a current embedded line drawing route in the current rectangular searching range according to a pixel value difference value between the residual pixel points in the current rectangular searching range and the pixel points corresponding to the current starting point and a vertical line distance between the residual pixel points and the current direction vector; drawing a corresponding current mosaic line along a current mosaic line drawing route according to a preset drawing rule; taking the actual end point corresponding to the current embedded line as a new current starting point, and returning to the previous step until the distance between the current end point corresponding to the current embedded line and the final end point is within a preset distance range; the whole process does not need to compare and check two or more images, reduces manpower output and improves the drawing efficiency of the embedded line; in addition, a user can preview and interfere the drawing effect in real time in the drawing process, and pause the drawing action of the embedded line in the drawing process, add a noise area to a sample library of machine learning in real time to train an identification model, automatically identify the noise area through a system, avoid the noise area and continue drawing the embedded line, and the new mode improves the time efficiency of original pure manual interpretation.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way; those skilled in the art can smoothly practice the invention as shown in the drawings and described above; however, those skilled in the art will appreciate that many modifications, adaptations, and variations of the present invention are possible in light of the above teachings without departing from the scope of the invention; meanwhile, any equivalent changes, modifications and evolution of the above embodiments according to the essential technology of the present invention still fall within the scope of the present invention.