CN115170685A - Mask-guided image mosaic line generation method and device, computer equipment and storage medium - Google Patents

Mask-guided image mosaic line generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115170685A
CN115170685A CN202210865265.2A CN202210865265A CN115170685A CN 115170685 A CN115170685 A CN 115170685A CN 202210865265 A CN202210865265 A CN 202210865265A CN 115170685 A CN115170685 A CN 115170685A
Authority
CN
China
Prior art keywords
image
file
mosaic
mask
intersection
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.)
Pending
Application number
CN202210865265.2A
Other languages
Chinese (zh)
Inventor
张竹林
熊嘉梁
王晓檀
冯晨轶
农凤情
王振华
周玉巧
李明明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Zhongketianqi Remote Sensing Technology Co ltd
Original Assignee
Suzhou Zhongketianqi Remote Sensing Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Zhongketianqi Remote Sensing Technology Co ltd filed Critical Suzhou Zhongketianqi Remote Sensing Technology Co ltd
Priority to CN202210865265.2A priority Critical patent/CN115170685A/en
Priority to PCT/CN2022/107692 priority patent/WO2024016368A1/en
Publication of CN115170685A publication Critical patent/CN115170685A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/13Satellite images

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Astronomy & Astrophysics (AREA)
  • Remote Sensing (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a device, computer equipment and a storage medium for generating mask-guided image mosaic lines, wherein the method comprises the steps of generating a mask image file and an initial mosaic grid file, calculating the position of an image range of an image to be mosaic in the mask image file, generating a marked image file of each scene of the image to be mosaic, dividing the image and updating the mosaic grid file according to the intersection of any two masks of the image to be mosaic with intersection, assigning a pixel value to each pixel in the mosaic grid file until all the intersected images are traversed, and performing vectorization on the mosaic grid file to generate a mosaic line vector file.

Description

Mask-guided image mosaic line generation method and device, computer equipment and storage medium
Technical Field
The invention relates to the field of remote sensing data processing, in particular to a method and a device for generating an image mosaic line.
Background
With the development of remote sensing technology, satellite remote sensing images have gradually become one of the most important sources of spatial data. The most critical step in the process of splicing two or more ortho images together to form a larger ortho mosaic image is the generation of image mosaic lines. At present, some image mosaic lines are drawn in GIS editing software such as ArcGIS by a manual editing method, or splicing lines between every two images are calculated by using an automatic image segmentation method and then combined into image mosaic lines in an area. The defects of manual editing are that the workload is large, the efficiency is low, and the application scene requirement of rapid drawing is difficult to meet. The mosaic line method generated by the segmentation method has the defects that only part of artificial ground objects with obvious characteristics can be avoided, the effect is unstable, and a large amount of manual editing is still needed.
Disclosure of Invention
The invention aims to provide a mask-guided image mosaic line generation method and device, so as to realize automatic generation of the image mosaic line and improve the generation efficiency and accuracy of the image mosaic line.
In order to achieve the above object, the present invention provides a method for generating a mask-guided image mosaic line, comprising:
generating a mask image file according to the interpretation data;
generating an initial mosaic wire grid file according to an image to be mosaic;
calculating the position of the image range of the image to be embedded in the mask image file, and generating a marked image file of each scene of the image to be embedded;
dividing the image and updating the mosaic grid file according to the intersection of any two masks with intersection of the images to be embedded;
assigning a pixel value to each pixel in the updated mosaic wire grid file until all the intersected images are traversed to complete assignment;
and vectorizing the mosaic wire grid file to generate a mosaic wire vector file.
The invention also provides a mask-guided image mosaic line generation device, which comprises:
the mask image file generation module is used for generating a mask image file in a standard format;
the initial mosaic wire grid file generating module is used for generating an initial mosaic wire grid file according to the combined image range of the images to be mosaiced;
the marked image file generation module is used for generating a marked image file of each scene of the image to be embedded according to the position of the image range of the image to be embedded in the mask image file;
the mosaic grid file updating module is used for dividing the image and updating the mosaic grid file according to the intersection of any two masks of the image to be mosaiced with the intersection;
the pixel value assigning module is used for assigning a pixel value to each pixel in the updated mosaic grid file until all the intersected images are traversed and assigned; and
and the mosaic line vector file generation module is used for carrying out vectorization on the mosaic line grid file to generate a mosaic line vector file.
The invention also provides a computer device for generating a mask-guided image mosaic line, comprising:
a processor, a memory for storing processor-executable instructions, and a computer program stored on the memory and executable on the processor, the processor implementing the above method when executing the program.
The invention also proposes a computer-readable storage medium, on which a computer program is stored, characterized in that the computer program implements the above-mentioned method when executed by a processor.
The beneficial effects of the invention are: according to the method for generating the mask-guided image mosaic lines, in the calculation process of the generation of the image mosaic lines, the rule formulated by the pixel value relation of any one point and neighborhood position points in the mask intersection of an intersection image is considered, the adjustment weight of pixels is obtained, the intersection image is subjected to splicing line calculation according to the adjustment weight to generate a binary mask, the pixel value of the intersection image during mosaic is obtained, and a mosaic grid file is updated according to the pixel value, so that the mosaic lines are more accurate, and the generation efficiency is greatly improved due to self-drawing generation through a computer program.
Drawings
FIG. 1 is a block diagram of a mask-guided image mosaic line generation method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an embodiment of the present invention for converting an interpretation vector or raster file into a standard reticle image file;
FIG. 3a is a schematic diagram illustrating an actual range of a three-scene image to be mosaiced according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of a circumscribed rectangular range of a three-scene image to be mosaiced according to an embodiment of the present invention;
FIG. 3c is a schematic diagram illustrating the merging range of three scene images to be mosaiced according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the positions of the to-be-mosaiced image range and the local image range in the mosaic grid file and the mask file according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating the use of mask modification to graph cut energy function connection weights in an embodiment of the present invention;
FIG. 6 is a diagram illustrating tessellation lines after an intersection image is assigned different pixel values during tessellation, in accordance with an embodiment of the present invention.
Detailed Description
The technical solution of the embodiment of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention.
The embodiment of the invention discloses a method for generating a mask-guided image mosaic line, which comprises the following steps as shown in figure 1:
step one, converting the existing interpretation data into a standard mask image file with a grid format, which specifically comprises the following steps:
and judging the format type of the interpreted data, if the interpreted data is in a vector format, carrying out classification system conversion on the interpreted data according to the rules of the predefined mask image, and then carrying out rasterization. If the interpreted data is a raster file and is in a standard format, the interpreted data is not processed, if the interpreted data is not in the standard format, classification system conversion is carried out on the interpreted data according to a predefined rule, and a Mask image file Mask in a standard raster form is generated. Referring to fig. 2, the first column of data SrcClassA to SrcClassH are vector data of the ground feature types such as buildings, roads, etc., the second column of data SrcValueA to SrcValueH are pixel values of the corresponding ground feature types, and the third and fourth columns are mask raster files converted into the standard format.
The rules of the mask image are defined according to actual needs, and can be defined as follows:
representative type Pixel value Means of
Building construction 1 Prevent the inlaid wire from passing through
Road 2 Preferential passage through
Water area 3 Preferentially pass through
Others 255 Adapting to general rules
Step two, generating an initial mosaic wire grid file, and combining the initial mosaic wire grid file with the graphs shown in fig. 3a to 3c, wherein the specific method comprises the following steps:
s21, calculating the external rectangular range (three rectangles shown in figure 3 b) of each scene to be embedded and recording as the range E of the image to be embedded i Wherein i =1,2, \8230;, n;
s22, setting the image range E of each scene to be embedded i Merging to obtain a merged image range E rst (the largest rectangle shown in FIG. 3 c);
s23, creating an empty raster file, range and merged image range E rst The resolution is multiple times of the image to be embedded, and the file is the initial embedded grid file MosaicFile. If the resolution of the initial mosaic grid file MosaicFile is 10 times of that of the image to be mosaicked, and if the resolution of the image to be mosaicked is 2 meters, the resolution of the file is 20 meters.
Step three, generating a marked image file of each scene to be embedded with images, wherein the specific method comprises the following steps:
s31, calculating the position of the image range Ei to be embedded in the Mask image file Mask, as shown in FIG. 4, the position includes the top left row and column number (x) tl ,y tl ) And the bottom right corner column number (x) br ,y br );
S32, cutting out a local image from the Mask image file Mask according to the position calculated in the step S31;
and S33, sampling the resolution of the local image to be consistent with that of the initial mosaic grid file MosaicFile.
Step four, image segmentation and embedded line raster file updating, wherein the specific method comprises the following steps:
s41, calculating the intersection region n ij of the images img (i) and img (j) to be embedded with any two images img (i) and img (j) to be embedded with intersection;
s42, finding the marked image files corresponding to the images img (i) and img (j) to be embedded, and cutting out the part covered by the intersection area n ij to obtain a mask intersection intersectactmask;
s43, calculating the connection weight of the energy function edge of the graph cut algorithm without the mask, wherein the specific formula is as follows:
Figure BDA0003758334960000051
wherein Vec (I) p ) Vector, vec (I), representing the composition of the eigenvalues at the p-points of the three bands p )-Vec(I q ) The characteristic values of the wave bands corresponding to the p point and the q point are subtracted, and dot represents the dot product of the two vectors; sigma 3 Is an index for evaluating the dispersion of the image, and for calculating the energy function of a second-order neighborhood, the index comprises
Figure BDA0003758334960000052
Wherein (p, q) ∈ N L Representing that q is a point located in four directions of the point p, namely left, upper right;
s44, comparing any point (p, q) in the mask intersection intersectatmask with a neighborhood pixel, such as a relationship between pixel values of four fields (p, q + 1), (p, q-1), (p +1, q), and (p-1, q), and adjusting the weight calculated in step S43 according to a preset rule of a relationship between any point and a pixel value of a field position point, as shown in fig. 5, the method is to multiply the calculated weight by a coefficient λ, for example, the rule may be defined as:
Figure BDA0003758334960000061
s45, based on the weight calculated in the step S44, a stitching line calculation is carried out on the intersection region # ij of the image img (i) to be mosaiced and the image img (j) to be mosaiced by using a graph cut algorithm, a binary mask BinaryMosaic (i, j) is generated, if the pixel value of the binary mask BinaryMosaic (i, j) is i, the pixel value of the img (i) is adopted in the region corresponding to the mask during mosaicing, and otherwise, if the pixel value of the binary mask BinaryMosaic (i, j) is j, the pixel value of the img (j) is adopted in the region corresponding to the mask during mosaicing.
Step five, writing the segmentation results of every two images into the initial mosaic grid file MosaicFile generated in the step two until each pixel of the mosaic grid file is endowed with a value, and combining the steps shown in FIG. 6, the method specifically comprises the following steps:
s51, finding out the range E of the image to be embedded i Location in the initial tessellated grid file MosaicFile, if E i If any pixel of the range of the MosaicFile is not assigned, setting the pixel value as i;
s52, finding out the range E of the image to be embedded j Location in the initial mosaic grid File MosaicFile, if E j If any pixel of the range of the MosaicFile is not assigned, setting the pixel value as j;
s53, finding the position of the binary mask BinaryMosaic (i, j) in the initial mosaic grid file MosaicFile, and setting the MosaicFile pixel value in the range of BinaryMosaic (i, j) as the value of BinaryMosaic (i, j).
And step six, processing the next pair of mosaic images according to the step five until all the intersected images are processed in a traversing manner.
And seventhly, vectorizing the mosaic wire grid file to generate a mosaic wire vector file and obtain mosaic wires of the image. For example, the mosaic grid file MosaicFile is vectorized by using a GDALPolygonize function provided by GDAL (Geospatial data abstraction Library) to generate a mosaic line vector file MosaicShp, and a mosaic line of the image is obtained.
Therefore, the scope of the invention should not be limited to the disclosure of the embodiments, but includes various alternatives and modifications that do not depart from the spirit of the invention and are intended to be covered by the claims of this patent application.

Claims (10)

1. A method for generating a mask-guided image mosaic line, comprising:
generating a mask image file according to the interpretation data;
generating an initial mosaic grid file according to an image to be mosaicked;
calculating the position of the image range of the image to be embedded in the mask image file, and generating a marked image file of each scene of the image to be embedded;
according to the intersection of the masks of any two images to be embedded with intersection, dividing the images and updating the grid files of the embedded lines;
assigning a pixel value to each pixel in the updated mosaic wire grid file until all the intersected images are traversed to complete assignment;
and vectorizing the mosaic wire grid file to generate a mosaic wire vector file.
2. The method of claim 1, wherein the mask image file is a standard format mask image file, and the creating comprises:
judging the format of the existing interpreted data:
if the existing data is in a vector format, carrying out classification system conversion on the existing data according to a predefined rule, and then carrying out rasterization;
if the interpreted data is in the nonstandard format of the raster file, the interpreted data is subjected to classification system conversion according to a predefined rule to generate a mask image file in the standard raster format.
If the interpreted data is already in the standard format of a raster file, it is not processed.
3. The method of claim 1, wherein the initial mosaic grid file is an empty grid file with the same range as the merged image range of the images to be mosaiced, and the resolution of the initial mosaic grid file is several times that of the images to be mosaiced.
4. The method for generating mask-guided image mosaic lines according to claim 1, wherein said generating a labeled image file for each scene to be mosaiced comprises:
calculating the position of the image range to be embedded in the mask image file, and cutting a local image of the position;
the resolution of the local image is sampled to be consistent with that of the initial mosaic grid file.
5. The method of claim 1, wherein segmenting the image and updating the mosaic grid file comprises:
calculating an intersection image for any two images to be embedded with an intersection;
finding a marked image file corresponding to the image to be embedded, and cutting out a part covered by the intersection image to obtain a mask intersection;
calculating the connection weight of the energy function edge of the graph cut algorithm without adding a mask;
adjusting the weight of any point in the mask intersection according to the relation between the point and the pixel value of the neighborhood position point to obtain an adjusted weight;
and based on the adjustment weight, performing splicing line calculation on the intersection image by using a graph cut algorithm to generate a binary mask, obtaining a pixel value of the intersection image during inlaying, and updating the mosaic grid file according to the pixel value.
6. The method of claim 5, wherein the method of calculating the edge-joining weights of the energy function of the mask-less segmentation algorithm comprises:
Figure FDA0003758334950000021
wherein Vec (I) p ) A vector representing the composition of the eigenvalues at the p-points of the three bands, vec (I) p )-Vec(I q ) The characteristic values of the wave bands corresponding to the p point and the q point are subtracted, and dot represents the dot product of the two vectors; sigma 3 The method is an index for evaluating the image dispersion, and for calculating the energy function of a second-order neighborhood:
Figure FDA0003758334950000022
wherein (p, q) ∈ N L And q is a point located in four directions of the point p, i.e., left, upper right, and lower right.
7. The method of claim 5, wherein the adjustment weight is obtained by multiplying the calculated weight by a coefficient according to a predefined rule of relationship between pixel values of any one point in the intersection of the masks and its neighboring position points.
8. A mask-guided image mosaic line generation apparatus, comprising:
the mask image file generation module is used for generating a mask image file in a standard format;
the initial mosaic wire grid file generating module is used for generating an initial mosaic wire grid file according to the combined image range of the images to be mosaiced;
the marked image file generation module is used for generating a marked image file of each scene of the image to be embedded according to the position of the image range of the image to be embedded in the mask image file;
the mosaic grid file updating module is used for dividing the image and updating the mosaic grid file according to the intersection of any two masks of the image to be mosaiced with the intersection;
the pixel value assigning module is used for assigning a pixel value to each pixel in the updated mosaic wire grid file until all the intersected images are traversed to complete assignment; and
and the mosaic line vector file generation module is used for carrying out vectorization on the mosaic line grid file to generate a mosaic line vector file.
9. A computer apparatus for generating mask-guided image mosaic lines, comprising:
a processor, a memory for storing processor-executable instructions, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202210865265.2A 2022-07-21 2022-07-21 Mask-guided image mosaic line generation method and device, computer equipment and storage medium Pending CN115170685A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210865265.2A CN115170685A (en) 2022-07-21 2022-07-21 Mask-guided image mosaic line generation method and device, computer equipment and storage medium
PCT/CN2022/107692 WO2024016368A1 (en) 2022-07-21 2022-07-25 Mask-guided image mosaic line generation method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210865265.2A CN115170685A (en) 2022-07-21 2022-07-21 Mask-guided image mosaic line generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115170685A true CN115170685A (en) 2022-10-11

Family

ID=83497805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210865265.2A Pending CN115170685A (en) 2022-07-21 2022-07-21 Mask-guided image mosaic line generation method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN115170685A (en)
WO (1) WO2024016368A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087373A (en) * 2018-07-06 2018-12-25 航天星图科技(北京)有限公司 A kind of extensive remotely-sensed data network splicing line automatic generation method
CN110322556B (en) * 2019-04-29 2022-06-03 武汉大学 High-speed high-precision vector grid superposition analysis method based on boundary clipping
CN110866869B (en) * 2019-10-28 2023-04-07 苏州中科天启遥感科技有限公司 Image mosaic method and device combining Thiessen polygon and minimum spanning tree image segmentation
CN111311750B (en) * 2020-01-17 2022-06-21 武汉大学 Mosaic line network global optimization method based on constrained triangulation network
CN112508988A (en) * 2021-01-14 2021-03-16 西安中科星图空间数据技术有限公司 Method and device for accurately extracting mosaic lines of remote sensing images

Also Published As

Publication number Publication date
WO2024016368A1 (en) 2024-01-25

Similar Documents

Publication Publication Date Title
CN111145174B (en) 3D target detection method for point cloud screening based on image semantic features
CN113516135B (en) Remote sensing image building extraction and contour optimization method based on deep learning
CN112734641A (en) Training method and device of target detection model, computer equipment and medium
JP4806230B2 (en) Deterioration dictionary generation program, method and apparatus
CN110322556B (en) High-speed high-precision vector grid superposition analysis method based on boundary clipping
CN109934110B (en) Method for identifying illegal buildings near river channel
US8401333B2 (en) Image processing method and apparatus for multi-resolution feature based image registration
CN106952338B (en) Three-dimensional reconstruction method and system based on deep learning and readable storage medium
Wei et al. BuildMapper: A fully learnable framework for vectorized building contour extraction
KR102065197B1 (en) Electron beam drawing device, electron beam drawing method, and recrding media
CN111985381B (en) Guidance area dense crowd counting method based on flexible convolution neural network
CN110647795A (en) Form recognition method
CN109635714B (en) Correction method and device for document scanning image
WO2016076026A1 (en) System, method, and program for predicting information
CN116645592B (en) Crack detection method based on image processing and storage medium
CN112419202A (en) Wild animal image automatic identification system based on big data and deep learning
CN115331245A (en) Table structure identification method based on image instance segmentation
CN109978904A (en) Emergent aquactic plant growth information extracting method based on image technique
CN116805356A (en) Building model construction method, building model construction equipment and computer readable storage medium
US20060104532A1 (en) Digital image processing method
CN114419430A (en) Cultivated land plot extraction method and device based on SE-U-Net +model
CN114067339A (en) Image recognition method and device, electronic equipment and computer readable storage medium
CN113808033A (en) Image document correction method, system, terminal and medium
CN115170685A (en) Mask-guided image mosaic line generation method and device, computer equipment and storage medium
CN114882490A (en) Unlimited scene license plate detection and classification method based on point-guided positioning

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