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

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

Info

Publication number
WO2024016368A1
WO2024016368A1 PCT/CN2022/107692 CN2022107692W WO2024016368A1 WO 2024016368 A1 WO2024016368 A1 WO 2024016368A1 CN 2022107692 W CN2022107692 W CN 2022107692W WO 2024016368 A1 WO2024016368 A1 WO 2024016368A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
mosaic
file
mask
generate
Prior art date
Application number
PCT/CN2022/107692
Other languages
French (fr)
Chinese (zh)
Inventor
张竹林
熊嘉梁
王晓檀
冯晨轶
农凤情
王振华
周玉巧
李明明
Original Assignee
苏州中科天启遥感科技有限公司
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 苏州中科天启遥感科技有限公司 filed Critical 苏州中科天启遥感科技有限公司
Publication of WO2024016368A1 publication Critical patent/WO2024016368A1/en

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

Definitions

  • the present invention relates to the field of remote sensing data processing, and in particular to a method and device for generating image mosaic lines.
  • the object of the present invention is to provide a mask-guided image mosaic line generation method and device to realize the automatic generation of image mosaic lines and improve the efficiency and accuracy of image mosaic line generation.
  • the present invention proposes a mask-guided generation method of image mosaic lines, which includes:
  • the present invention also proposes a device for generating mask-guided image mosaic lines, which includes:
  • Mask image file generation module used to generate mask image files in standard format
  • the initial mosaic line raster file generation module is used to generate an initial mosaic line raster file based on the merged image range of the image to be mosaic;
  • the marked image file generation module is used to generate a marked image file for each scene of the image to be mounted based on the calculated position of the image range of the image to be mounted in the mask image file;
  • the mosaic line raster file update module is used to segment the image and update the mosaic line raster file based on the mask intersection of any two intersecting images to be mosaic;
  • the pixel value assignment module is used to assign a pixel value to each pixel in the updated mosaic line raster file until all intersecting image traversals complete assignment;
  • the mosaic line vector file generation module is used to vectorize the mosaic line raster file and generate a mosaic line vector file.
  • the present invention also proposes a computer device for generating mask-guided image mosaic lines, including:
  • a processor a memory for storing instructions executable by the processor, and a computer program stored on the memory and executable on the processor. The above method is implemented when the processor executes the program.
  • the present invention also proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the above method is implemented.
  • the method for generating mask-guided image mosaic lines disclosed in the present invention considers any point and neighborhood position points in the mask intersection of the intersection image during the calculation process of generating the image mosaic line. According to the rules established by the pixel value relationship, the adjustment weight of the pixel is obtained, and based on the adjustment weight, the stitching line calculation is performed on the intersection image, a binary mask is generated, and the pixel value of the intersection image during mosaic is obtained, and updated according to the pixel value Mosaic line raster files, so the mosaic lines are more accurate, and because they are self-drawn by a computer program, the generation efficiency is greatly improved.
  • Figure 1 is a flow chart of a mask-guided image mosaic line generation method according to an embodiment of the present invention
  • Figure 2 is a schematic diagram of converting a decoded vector or raster file into a standard mask image file according to an embodiment of the present invention
  • Figure 3a is a schematic diagram of the actual range of the three scene images to be mosaic in the embodiment of the present invention.
  • Figure 3b is a schematic diagram of the circumscribed rectangular range of the three scene images to be mosaic in the embodiment of the present invention.
  • Figure 3c is a schematic diagram of the range of merging images of three scenes to be mosaic in the embodiment of the present invention.
  • Figure 4 is a schematic diagram of the positions of the image range to be mosaic and the local image range in the mosaic line grid file and the mask file in the embodiment of the present invention
  • Figure 5 is a schematic diagram of using a mask to modify the connection weight of the graph cut energy function in an embodiment of the present invention
  • FIG. 6 is a schematic diagram of mosaic lines after assigning different pixel values to the intersection image during mosaic in an embodiment of the present invention.
  • An embodiment of the present invention discloses a method for generating mask-guided image mosaic lines, as shown in Figure 1, which includes the following steps:
  • Step 1 Convert the existing interpretation data into a standard raster format mask image file, including:
  • the format type of the interpreted data If it is a vector format, convert it into a classification system according to the predefined mask image rules, and then rasterize it. If the interpretation data is a raster file and is in a standard format, it will not be processed. If it is not in a standard format, it will be converted into a classification system according to predefined rules to generate a mask image file Mask in a standard raster form.
  • the first column of data SrcClassA ⁇ SrcClassH is the vector data of ground object categories such as buildings, roads, etc.
  • the second column of data SrcValueA ⁇ SrcValueH is the pixel value of the corresponding ground object category
  • the third and fourth columns Convert to a standard format mask raster file.
  • Step 2 Generate an initial mosaic line raster file, as shown in Figures 3a to 3c.
  • the specific method includes:
  • Step 3 Generate labeled image files for each scene to be mosaiced. Specific methods include:
  • the position includes the row and column number of the upper left corner (x tl , y tl ) and the row and column number of the lower right corner (x br , y br );
  • Step 4 Segment the image and update the mosaic line raster file. Specific methods include:
  • Vec(I p ) represents the vector composed of the eigenvalues at point p of the three bands
  • Vec(I p )-Vec(I q ) represents the subtraction of the eigenvalues of the bands corresponding to the two points p and q
  • dot represents two The dot product of vectors
  • ⁇ 3 is an index to evaluate the discreteness of an image.
  • (p, q) ⁇ N L means that q is a point located in the four directions of left, upper left, upper and upper right of point p;
  • step S45 Based on the weight calculated in step S44, use the graph cut algorithm to calculate the splicing line of the intersection area ⁇ ij of the mosaic image img(i) and img(j) to generate the binary mask BinaryMosaic(i,j). If The pixel value of the binary mask BinaryMosaic(i,j) is i, then the area corresponding to the mask uses the pixel value of img(i) when mosaic. On the contrary, if the pixel value of the binary mask BinaryMosaic(i,j) If the pixel value is j, then the area corresponding to the mask will use the pixel value of img(j) when mosaic.
  • Step 5 Write the segmentation results of the pair of images into the initial mosaic line raster file MosaicFile generated in step 2 until each pixel of the mosaic line raster file is assigned a value.
  • the specific steps are:
  • Step 6 Process the next pair of mosaic images according to Step 5 until all intersecting images are traversed and processed.
  • Step 7 Perform vectorization processing on the mosaic line raster file, generate a mosaic line vector file, and obtain the mosaic line of the image.
  • GDALPolygonize function provided by GDAL (Geospatial Data Abstraction Library) to vectorize the mosaic line raster file MosaicFile, generate the mosaic line vector file MosaicShp, and obtain the mosaic line of the image.

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

A mask-guided image mosaic line generation method and apparatus, a computer device, and a storage medium. The method comprises: generating a mask image file and an initial mosaic-line raster file; computing the positions of image ranges of images to be mosaicked, which positions are in the mask image file, and generating a marked image file of each of said images; according to a mask intersection of any two of said images that have an intersection therebetween, dividing said images and updating the mosaic-line raster file; assigning a pixel value to each pixel in the mosaic-line raster file until the traversal of all intersecting images is completed; and vectorizing the mosaic-line raster file, so as to generate a mosaic-line vector file. The method improves the efficiency and precision of image mosaic line generation.

Description

一种掩膜引导的影像镶嵌线的生成方法、装置、计算机设备及存储介质A method, device, computer equipment and storage medium for generating mask-guided image mosaic lines 技术领域Technical field
本发明涉及遥感数据处理领域,尤其涉及影像镶嵌线的生成方法及装置。The present invention relates to the field of remote sensing data processing, and in particular to a method and device for generating image mosaic lines.
背景技术Background technique
随着遥感技术的发展,卫星遥感影像已逐步成为最主要的空间数据的来源之一。把两幅或多幅正射影像拼接在一起,形成一幅更大的正射镶嵌影像的过程中,最为关键的步骤是影像镶嵌线的生成。目前,影像镶嵌线一部分是通过人工编辑的方法,在ArcGIS等GIS编辑软件中进行勾画,或是使用影像自动分割的方法计算影像两两之间的拼接线,再组合为区域内的影像镶嵌线。人工编辑的缺陷是工作量大,效率低下,难以满足需要快速出图的应用场景要求。通过分割方法生成的镶嵌线方法的缺陷是只能避开部分特征明显的人工地物,且效果很不稳定,而且仍然需要大量的人工编辑。With the development of remote sensing technology, satellite remote sensing images have gradually become one of the most important sources of spatial data. In the process of splicing two or more orthoimages together to form a larger orthomosaic image, the most critical step is the generation of image mosaic lines. At present, part of the image mosaic lines are drawn through manual editing in GIS editing software such as ArcGIS, or the automatic image segmentation method is used to calculate the splicing lines between two images, and then combined into image mosaic lines within the area. . The disadvantages of manual editing are heavy workload and low efficiency, making it difficult to meet the requirements of application scenarios that require quick drawing production. The disadvantage of the mosaic line method generated by the segmentation method is that it can only avoid some artificial features with obvious features, and the effect is very unstable, and it still requires a lot of manual editing.
发明内容Contents of the invention
本发明的目的在于提供一种掩膜引导的影像镶嵌线的生成方法及装置,以实现影像镶嵌线的自动生成,提高影像镶嵌线生成效率和精确性。The object of the present invention is to provide a mask-guided image mosaic line generation method and device to realize the automatic generation of image mosaic lines and improve the efficiency and accuracy of image mosaic line generation.
为实现上述目的,本发明提出一种掩膜引导的影像镶嵌线的生成方法,包括:In order to achieve the above objectives, the present invention proposes a mask-guided generation method of image mosaic lines, which includes:
根据解译数据生成掩膜影像文件;Generate mask image files based on the interpretation data;
根据待镶嵌影像生成初始镶嵌线栅格文件;Generate an initial mosaic line raster file based on the image to be mosaic;
计算待镶嵌影像的影像范围在掩膜影像文件中的位置,生成每景待镶嵌影像的标记影像文件;Calculate the position of the image range of the image to be mosaicked in the mask image file, and generate a marked image file for each scene of the image to be mosaic;
根据任意两个有交集的待镶嵌影像的掩膜交集,分割影像并更新镶嵌线栅格文件;According to the mask intersection of any two intersecting images to be mosaic, segment the image and update the mosaic line raster file;
为更新后的镶嵌线栅格文件中的每个像素赋予像素值,直至所有相交影像遍历完成赋值;Assign a pixel value to each pixel in the updated mosaic line raster file until all intersecting images are traversed and assigned;
对镶嵌线栅格文件进行矢量化,生成镶嵌线矢量文件。Vectorize the mosaic line raster file to generate a mosaic line vector file.
本发明还提出一种掩膜引导的影像镶嵌线的生成装置,包括:The present invention also proposes a device for generating mask-guided image mosaic lines, which includes:
掩膜影像文件生成模块,用于生成标准格式的掩膜影像文件;Mask image file generation module, used to generate mask image files in standard format;
初始镶嵌线栅格文件生成模块,用于根据待镶嵌影像的合并影像范围生成初始镶嵌线栅格文件;The initial mosaic line raster file generation module is used to generate an initial mosaic line raster file based on the merged image range of the image to be mosaic;
标记影像文件生成模块,用于根据计算待镶嵌影像的影像范围在掩膜影像文件中的位置,生成每景待镶嵌影像的标记影像文件;The marked image file generation module is used to generate a marked image file for each scene of the image to be mounted based on the calculated position of the image range of the image to be mounted in the mask image file;
镶嵌线栅格文件更新模块,用于根据任意两个有交集的待镶嵌影像的掩膜交集,分割影像并更新镶嵌线栅格文件;The mosaic line raster file update module is used to segment the image and update the mosaic line raster file based on the mask intersection of any two intersecting images to be mosaic;
像素值赋予模块,用于为更新后的镶嵌线栅格文件中的每个像素赋予像素值,直至所有相交影像遍历完成赋值;以及The pixel value assignment module is used to assign a pixel value to each pixel in the updated mosaic line raster file until all intersecting image traversals complete assignment; and
镶嵌线矢量文件生成模块,用于对镶嵌线栅格文件进行矢量化,生成镶嵌线矢量文件。The mosaic line vector file generation module is used to vectorize the mosaic line raster file and generate a mosaic line vector file.
本发明还提出一种生成掩膜引导的影像镶嵌线的计算机设备,包括:The present invention also proposes a computer device for generating mask-guided image mosaic lines, including:
处理器,用于存储处理器可执行指令的存储器,以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法。A processor, a memory for storing instructions executable by the processor, and a computer program stored on the memory and executable on the processor. The above method is implemented when the processor executes the program.
本发明还提出一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述方法。The present invention also proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the above method is implemented.
本发明的有益效果是:本发明揭示的掩膜引导的影像镶嵌线的生成方 法,其在影像镶嵌线生成的计算过程中,考虑了交集影像的掩膜交集中,任意一点与邻域位置点的像素值关系制定的规则,得到像素的调整权重,并根据该调整权重,对交集影像进行拼接线计算,生成二值掩膜,并得到交集影像在镶嵌时的像素值,根据该像素值更新镶嵌线栅格文件,因此,镶嵌线更准确,且由于是通过计算机程序自绘制生成,因此生成效率得以大幅提高。The beneficial effects of the present invention are: the method for generating mask-guided image mosaic lines disclosed in the present invention considers any point and neighborhood position points in the mask intersection of the intersection image during the calculation process of generating the image mosaic line. According to the rules established by the pixel value relationship, the adjustment weight of the pixel is obtained, and based on the adjustment weight, the stitching line calculation is performed on the intersection image, a binary mask is generated, and the pixel value of the intersection image during mosaic is obtained, and updated according to the pixel value Mosaic line raster files, so the mosaic lines are more accurate, and because they are self-drawn by a computer program, the generation efficiency is greatly improved.
附图说明Description of drawings
图1是本发明实施例掩膜引导的影像镶嵌线生成方法的流程框图;Figure 1 is a flow chart of a mask-guided image mosaic line generation method according to an embodiment of the present invention;
图2是本发明实施例将解译矢量或栅格文件转化为标准示掩膜影像文件的示意图;Figure 2 is a schematic diagram of converting a decoded vector or raster file into a standard mask image file according to an embodiment of the present invention;
图3a是本发明实施例中待镶嵌的三景影像的实际范围的示意图;Figure 3a is a schematic diagram of the actual range of the three scene images to be mosaic in the embodiment of the present invention;
图3b是本发明实施例中待镶嵌的三景影像的外接矩形范围的示意图;Figure 3b is a schematic diagram of the circumscribed rectangular range of the three scene images to be mosaic in the embodiment of the present invention;
图3c是本发明实施例中待镶嵌的三景影像合并的范围的示意图;Figure 3c is a schematic diagram of the range of merging images of three scenes to be mosaic in the embodiment of the present invention;
图4是本发明实施例中待镶嵌影像范围和局部影像范围在镶嵌线栅格文件和掩膜文件中的位置示意图;Figure 4 is a schematic diagram of the positions of the image range to be mosaic and the local image range in the mosaic line grid file and the mask file in the embodiment of the present invention;
图5是本发明实施例中使用掩膜修改图割能量函数连接权重的示意图;Figure 5 is a schematic diagram of using a mask to modify the connection weight of the graph cut energy function in an embodiment of the present invention;
图6是本发明实施例中交集影像在镶嵌时赋予不同像素值后镶嵌线的示意图。6 is a schematic diagram of mosaic lines after assigning different pixel values to the intersection image during mosaic in an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明的附图,对本发明实施例的技术方案进行清楚、完整的描述。The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the present invention.
本发明实施例公开的一种掩膜引导的影像镶嵌线的生成方法,如图1所示,其包括如下步骤:An embodiment of the present invention discloses a method for generating mask-guided image mosaic lines, as shown in Figure 1, which includes the following steps:
步骤一,将已有解译数据转换为标准的栅格格式的掩膜影像文件,具体包括:Step 1: Convert the existing interpretation data into a standard raster format mask image file, including:
判断解译数据的格式类型,如果是矢量格式,将其按照预定义的掩膜影像的规则进行分类体系转换,再进行栅格化。如果解译数据为栅格文件且已为标准格式,则不处理,如果不是标准格式,将其按照预定义规则进行分类体系转换,生成标准的栅格形式的掩膜影像文件Mask。结合图2所示,第一列数据SrcClassA~SrcClassH为地物类别如建筑物、道路等的矢量数据,第二列数据SrcValueA~SrcValueH为对应地物类别的像素值,第三列和第四列为转化为标准格式的掩膜栅格文件。Determine the format type of the interpreted data. If it is a vector format, convert it into a classification system according to the predefined mask image rules, and then rasterize it. If the interpretation data is a raster file and is in a standard format, it will not be processed. If it is not in a standard format, it will be converted into a classification system according to predefined rules to generate a mask image file Mask in a standard raster form. As shown in Figure 2, the first column of data SrcClassA ~ SrcClassH is the vector data of ground object categories such as buildings, roads, etc., the second column of data SrcValueA ~ SrcValueH is the pixel value of the corresponding ground object category, the third and fourth columns Convert to a standard format mask raster file.
掩膜影像的规则根据实际需要来定义,如可以做如下定义:The rules of mask images are defined according to actual needs. For example, they can be defined as follows:
代表类型Representative type 像素值Pixel values 含义meaning
建筑物building 11 避免镶嵌线穿过Avoid inlay lines crossing
道路the way 22 优先穿过Pass through first
水域waters 33 优先穿过Pass through first
其他other 255255 适应一般规则adapt to general rules
步骤二、生成初始镶嵌线栅格文件,结合图3a~3c所示,所述具体方法包括:Step 2: Generate an initial mosaic line raster file, as shown in Figures 3a to 3c. The specific method includes:
S21、计算每景待镶嵌影像的外接矩形范围(图3b所示的三个矩形),记为待镶嵌影像范围E i,其中i=1,2,…,n; S21. Calculate the circumscribed rectangular range of the image to be mosaic of each scene (the three rectangles shown in Figure 3b), and record it as the image range to be mosaic E i , where i=1, 2,...,n;
S22、将每景待镶嵌影像的影像范围E i进行合并,得到合并影像范围E rst(图3c所示最大的矩形); S22. Merge the image range E i of the images to be mosaiced in each scene to obtain the combined image range E rst (the largest rectangle shown in Figure 3c);
S23、创建一个空的栅格文件,范围与合并影像范围E rst相同,分辨率为待镶嵌影像的数倍,该文件即为初始镶嵌线栅格文件MosaicFile。如初始镶嵌线栅格文件MosaicFile分辨率为待镶嵌影像的10倍,待镶嵌影像分辨率如为2米,则该文件分辨率为20米。 S23. Create an empty raster file with the same range as the merged image range Erst and a resolution several times that of the image to be mosaic. This file is the initial mosaic line raster file MosaicFile. If the resolution of the initial mosaic line raster file MosaicFile is 10 times that of the image to be mosaiced, and the resolution of the image to be mosaic is 2 meters, the resolution of the file will be 20 meters.
步骤三、生成每景待镶嵌影像的标记影像文件,具体方法包括:Step 3: Generate labeled image files for each scene to be mosaiced. Specific methods include:
S31、计算待镶嵌影像范围Ei在掩膜影像文件Mask中的位置,如图4所示,本实施例中该位置包括左上角行列号(x tl,y tl)和右下角行列号(x br,y br); S31. Calculate the position of the image range Ei to be mosaicd in the mask image file Mask, as shown in Figure 4. In this embodiment, the position includes the row and column number of the upper left corner (x tl , y tl ) and the row and column number of the lower right corner (x br , y br );
S32、根据步骤S31中计算出的位置从掩膜影像文件Mask中裁切出局部影像;S32. Cut out the partial image from the mask image file Mask according to the position calculated in step S31;
S33、将局部影像的分辨率采样为与初始镶嵌线栅格文件MosaicFile的一致。S33. Sampling the resolution of the local image to be consistent with the initial mosaic line raster file MosaicFile.
步骤四、影像分割并更新镶嵌线栅格文件,具体方法包括:Step 4: Segment the image and update the mosaic line raster file. Specific methods include:
S41、对于任意两个有交集的待镶嵌影像img(i)和img(j),计算待镶嵌影像img(i)和img(j)的交集区域∩ij;S41. For any two intersection images img(i) and img(j) to be mosaic, calculate the intersection area ∩ij of the images img(i) and img(j) to be mosaic;
S42、找到待镶嵌影像img(i)和img(j)对应的标记影像文件,并裁剪出交集区域∩ij覆盖的部分,得到掩膜交集IntersectMask;S42. Find the marked image files corresponding to the images img(i) and img(j) to be mosaic, and crop out the part covered by the intersection area ∩ij to obtain the mask intersection IntersectMask;
S43、计算不加掩膜的图割算法能量函数边连接权重,具体公式为:S43. Calculate the edge connection weight of the energy function of the graph cut algorithm without masking. The specific formula is:
Figure PCTCN2022107692-appb-000001
Figure PCTCN2022107692-appb-000001
其中,Vec(I p)表示三个波段p点处的特征值组成的向量,Vec(I p)-Vec(I q)表示p、q两点对应波段的特征值相减,dot表示两个向量的点积;σ 3是评价图像离散度的指标,对于计算二阶邻域的能量函数,有 Among them, Vec(I p ) represents the vector composed of the eigenvalues at point p of the three bands, Vec(I p )-Vec(I q ) represents the subtraction of the eigenvalues of the bands corresponding to the two points p and q, and dot represents two The dot product of vectors; σ 3 is an index to evaluate the discreteness of an image. For calculating the energy function of the second-order neighborhood, there is
Figure PCTCN2022107692-appb-000002
Figure PCTCN2022107692-appb-000002
其中,(p,q)∈N L表示q是位于p点左、左上、上、右上四个方向的点; Among them, (p, q)∈N L means that q is a point located in the four directions of left, upper left, upper and upper right of point p;
S44、对于掩膜交集IntersectMask中的任意一点(p,q),对比其与邻域像素,如四领域(p,q+1)、(p,q-1)、(p+1,q)、(p-1,q)像素值的关系,根据预先设定的任意一点与领域位置点像素值关系的规则,调整步骤S43中计算出的权重weight,结合图5所示,方法为在计算出的权重上乘以一个系数λ,如规则可以定义为:S44. For any point (p, q) in the mask intersection IntersectMask, compare it with neighboring pixels, such as four areas (p, q+1), (p, q-1), (p+1, q) , (p-1, q) pixel value relationship, according to the preset rules of the relationship between any point and the domain location point pixel value, adjust the weight weight calculated in step S43, as shown in Figure 5, the method is to calculate The weight out is multiplied by a coefficient λ, as the rule can be defined as:
Figure PCTCN2022107692-appb-000003
Figure PCTCN2022107692-appb-000003
S45、基于步骤S44中计算出的权重,利用图割算法对待镶嵌影像img(i)和img(j)的交集区域∩ij进行拼接线计算,生成二值掩膜BinaryMosaic(i,j),如果二值掩膜BinaryMosaic(i,j)的像素值为i,那么掩膜对应的区域在镶嵌时就采用img(i)的像元值,反之,如果二值掩膜BinaryMosaic(i,j)的像素值为j,那么掩膜对应的区域在镶嵌时就采用img(j)的像元值。S45. Based on the weight calculated in step S44, use the graph cut algorithm to calculate the splicing line of the intersection area ∩ij of the mosaic image img(i) and img(j) to generate the binary mask BinaryMosaic(i,j). If The pixel value of the binary mask BinaryMosaic(i,j) is i, then the area corresponding to the mask uses the pixel value of img(i) when mosaic. On the contrary, if the pixel value of the binary mask BinaryMosaic(i,j) If the pixel value is j, then the area corresponding to the mask will use the pixel value of img(j) when mosaic.
步骤五、将两两影像的分割结果写入步骤二中生成的初始镶嵌线栅格文件MosaicFile中,直到镶嵌线栅格文件每个像素均被赋予值,结合图6所示,具体步骤为:Step 5: Write the segmentation results of the pair of images into the initial mosaic line raster file MosaicFile generated in step 2 until each pixel of the mosaic line raster file is assigned a value. As shown in Figure 6, the specific steps are:
S51、找到待镶嵌影像范围E i在初始镶嵌线栅格文件MosaicFile中的位置,如果E i范围的MosaicFile任意像素还未被赋值,则将像素值设为i; S51. Find the position of the image range E i to be mosaicked in the initial mosaic line raster file MosaicFile. If any pixel of the MosaicFile in the range E i has not been assigned a value, set the pixel value to i;
S52、找到待镶嵌影像范围E j在初始镶嵌线栅格文件MosaicFile中的位置,如果E j范围的MosaicFile任意像素还未被赋值,则将像素值设为j; S52. Find the position of the image range E j to be mosaicked in the initial mosaic line raster file MosaicFile. If any pixel in MosaicFile in the range E j has not been assigned a value, set the pixel value to j;
S53、找到二值掩膜BinaryMosaic(i,j)在初始镶嵌线栅格文件MosaicFile中的位置,将BinaryMosaic(i,j)范围的MosaicFile像素值设为BinaryMosaic(i,j)的值。S53. Find the position of the binary mask BinaryMosaic(i,j) in the initial mosaic line raster file MosaicFile, and set the MosaicFile pixel value in the range of BinaryMosaic(i,j) to the value of BinaryMosaic(i,j).
步骤六、对下一对镶嵌影像按照步骤五进行处理,直到所有相交影像均遍历处理完成。Step 6: Process the next pair of mosaic images according to Step 5 until all intersecting images are traversed and processed.
步骤七、对镶嵌线栅格文件进行矢量化处理,生成镶嵌线矢量文件,得到影像的镶嵌线。如利用GDAL(Geospatial Data Abstraction Library)提供的GDALPolygonize函数对镶嵌线栅格文件MosaicFile进行矢量化,生成镶嵌线矢量文件MosaicShp,得到影像的镶嵌线。Step 7: Perform vectorization processing on the mosaic line raster file, generate a mosaic line vector file, and obtain the mosaic line of the image. For example, use the GDALPolygonize function provided by GDAL (Geospatial Data Abstraction Library) to vectorize the mosaic line raster file MosaicFile, generate the mosaic line vector file MosaicShp, and obtain the mosaic line of the image.
本发明的技术内容及技术特征已揭示如上,然而熟悉本领域的技术人员仍可能基于本发明的教示及揭示而作种种不背离本发明精神的替换及修饰,因此,本发明保护范围应不限于实施例所揭示的内容,而应包括各种不背离本发明的替换及修饰,并为本专利申请权利要求所涵盖。The technical content and technical features of the present invention have been disclosed above. However, those skilled in the art may still make various substitutions and modifications based on the teachings and disclosures of the present invention without departing from the spirit of the present invention. Therefore, the scope of protection of the present invention should not be limited to The content disclosed in the embodiments should include various substitutions and modifications that do not deviate from the present invention, and are covered by the claims of this patent application.

Claims (10)

  1. 一种掩膜引导的影像镶嵌线的生成方法,其特征在于,包括:A method for generating mask-guided image mosaic lines, which is characterized by including:
    根据解译数据生成掩膜影像文件;Generate mask image files based on the interpretation data;
    根据待镶嵌影像生成初始镶嵌线栅格文件;Generate an initial mosaic line raster file based on the image to be mosaic;
    计算待镶嵌影像的影像范围在掩膜影像文件中的位置,生成每景待镶嵌影像的标记影像文件;Calculate the position of the image range of the image to be mosaicked in the mask image file, and generate a marked image file for each scene of the image to be mosaic;
    根据任意两个有交集的待镶嵌影像的掩膜交集,分割影像并更新镶嵌线栅格文件;According to the mask intersection of any two intersecting images to be mosaic, segment the image and update the mosaic line raster file;
    为更新后的镶嵌线栅格文件中的每个像素赋予像素值,直至所有相交影像遍历完成赋值;Assign a pixel value to each pixel in the updated mosaic line raster file until all intersecting images are traversed and assigned;
    对镶嵌线栅格文件进行矢量化,生成镶嵌线矢量文件。Vectorize the mosaic line raster file to generate a mosaic line vector file.
  2. 根据权利要求1所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述掩膜影像文件为标准格式的掩膜影像文件,其创建包括:The method for generating mask-guided image mosaic lines according to claim 1, characterized in that the mask image file is a mask image file in a standard format, and its creation includes:
    判断已有解译数据的格式:Determine the format of the already interpreted data:
    如果已有数据为矢量格式,将其按照预定义规则进行分类体系转换,再进行栅格化;If the existing data is in vector format, convert it into a classification system according to predefined rules and then rasterize it;
    如果已有解译数据为栅格文件的非标准格式,将其按照预定义规则进行分类体系转换,生成标准的栅格格式的掩膜影像文件。If the interpreted data is in a non-standard format as a raster file, convert it into a classification system according to predefined rules to generate a mask image file in a standard raster format.
    如果已有解译数据为栅格文件的标准格式,则不处理。If there is already interpretation data in the standard format of a raster file, it will not be processed.
  3. 根据权利要求1所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述初始镶嵌线栅格文件为一空的栅格文件,范围与待镶嵌影像的合并影像范围相同,所述初始镶嵌线栅格文件的分辨率为待镶嵌影像的数倍。The method for generating mask-guided image mosaic lines according to claim 1, wherein the initial mosaic line raster file is an empty raster file, and the range is the same as the merged image range of the image to be mosaicked, and the The resolution of the initial mosaic line raster file is several times that of the image to be mosaicked.
  4. 根据权利要求1所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述生成每景待镶嵌影像的标记影像文件包括:The method for generating mask-guided image mosaic lines according to claim 1, wherein generating a marked image file for each scene to be mosaic includes:
    计算待镶嵌影像范围在掩膜影像文件中的位置,并裁切该位置的局部影像;Calculate the position of the image range to be mosaicd in the mask image file, and crop the partial image at that position;
    将局部影像的分辨率采样为与所述初始镶嵌线栅格文件的一致。The resolution of the local image is sampled to be consistent with that of the initial mosaic line raster file.
  5. 根据权利要求1所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述分割影像并更新镶嵌线栅格文件包括:The method for generating mask-guided image mosaic lines according to claim 1, wherein the segmenting the image and updating the mosaic line raster file includes:
    对于任意两个有交集的待镶嵌影像,计算交集影像;For any two intersecting images to be mosaic, calculate the intersection image;
    找到待镶嵌影像对应的标记影像文件,并裁剪出交集影像覆盖的部分,得到掩膜交集;Find the marked image file corresponding to the image to be mosaic, and crop out the part covered by the intersection image to obtain the mask intersection;
    计算不加掩膜的图割算法能量函数边连接权重;Calculate the edge connection weight of the energy function of the graph cut algorithm without masking;
    对于掩膜交集中的任意一点,根据其与邻域位置点的像素值的关系调整所述权重,得到调整权重;For any point in the mask intersection, adjust the weight according to its relationship with the pixel value of the neighborhood position point to obtain the adjustment weight;
    基于所述调整权重,用图割算法对交集影像进行拼接线计算,生成二值掩膜,并得到交集影像在镶嵌时的像素值,根据该像素值更新镶嵌线栅格文件。Based on the adjustment weight, a graph cut algorithm is used to calculate the stitching line of the intersection image, generate a binary mask, and obtain the pixel value of the intersection image during mosaic, and update the mosaic line raster file according to the pixel value.
  6. 根据权利要求5所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述计算不加掩膜的图割算法能量函数边连接权重的方法为:The method for generating mask-guided image mosaic lines according to claim 5, characterized in that the method for calculating the edge connection weight of the energy function of the graph cut algorithm without masking is:
    Figure PCTCN2022107692-appb-100001
    Figure PCTCN2022107692-appb-100001
    其中,Vec(I p)表示三个波段p点处的特征值组成的向量,Vec(I p)-Vec(I q)表示p、q两点对应波段的特征值相减,dot表示两个向量的点积;σ 3是评价图像离散度的指标,对于计算二阶邻域的能量函数: Among them, Vec(I p ) represents the vector composed of the eigenvalues at point p of the three bands, Vec(I p )-Vec(I q ) represents the subtraction of the eigenvalues of the bands corresponding to the two points p and q, and dot represents two The dot product of vectors; σ 3 is an index for evaluating the discreteness of an image, for calculating the energy function of the second-order neighborhood:
    Figure PCTCN2022107692-appb-100002
    Figure PCTCN2022107692-appb-100002
    其中,(p,q)∈N L表示q是位于p点左、左上、上、右上四个方向的点。 Among them, (p, q)∈N L means that q is a point located in the four directions of left, upper left, upper and upper right of point p.
  7. 根据权利要求5所述的掩膜引导的影像镶嵌线的生成方法,其特征在于,所述调整权重是根据预先定义的掩膜交集中的任意一点与其邻域位置点的像素值间的关系规则,通过在计算出的权重上乘以一个系数得到。The method for generating mask-guided image mosaic lines according to claim 5, wherein the adjustment weight is based on a predefined relationship rule between any point in the mask intersection and the pixel values of its neighboring position points. , obtained by multiplying the calculated weight by a coefficient.
  8. 一种掩膜引导的影像镶嵌线的生成装置,其特征在于,包括:A device for generating mask-guided image mosaic lines, which is characterized by including:
    掩膜影像文件生成模块,用于生成标准格式的掩膜影像文件;Mask image file generation module, used to generate mask image files in standard format;
    初始镶嵌线栅格文件生成模块,用于根据待镶嵌影像的合并影像范围生成初始镶嵌线栅格文件;The initial mosaic line raster file generation module is used to generate an initial mosaic line raster file based on the merged image range of the image to be mosaic;
    标记影像文件生成模块,用于根据计算待镶嵌影像的影像范围在掩膜影像文件中的位置,生成每景待镶嵌影像的标记影像文件;The marked image file generation module is used to generate a marked image file for each scene of the image to be mounted based on the calculated position of the image range of the image to be mounted in the mask image file;
    镶嵌线栅格文件更新模块,用于根据任意两个有交集的待镶嵌影像的掩膜交集,分割影像并更新镶嵌线栅格文件;The mosaic line raster file update module is used to segment the image and update the mosaic line raster file based on the mask intersection of any two intersecting images to be mosaic;
    像素值赋予模块,用于为更新后的镶嵌线栅格文件中的每个像素赋予像素值,直至所有相交影像遍历完成赋值;以及The pixel value assignment module is used to assign a pixel value to each pixel in the updated mosaic line raster file until all intersecting image traversals complete assignment; and
    镶嵌线矢量文件生成模块,用于对镶嵌线栅格文件进行矢量化,生成镶嵌线矢量文件。The mosaic line vector file generation module is used to vectorize the mosaic line raster file and generate a mosaic line vector file.
  9. 一种生成掩膜引导的影像镶嵌线的计算机设备,其特征在于,包括:A computer device for generating mask-guided image mosaic lines, characterized by comprising:
    处理器,用于存储处理器可执行指令的存储器,以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于:所述处理器执行所述程序时实现权利要求1至7中任意一项所述的方法。A processor, a memory for storing instructions executable by the processor, and a computer program stored on the memory and executable on the processor, characterized in that when the processor executes the program, claims 1 to 7 are implemented any of the methods described.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任意一项所述的方法。A computer-readable storage medium with a computer program stored thereon, characterized in that when the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
PCT/CN2022/107692 2022-07-21 2022-07-25 Mask-guided image mosaic line generation method and apparatus, computer device, and storage medium WO2024016368A1 (en)

Applications Claiming Priority (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
CN202210865265.2 2022-07-21

Publications (1)

Publication Number Publication Date
WO2024016368A1 true WO2024016368A1 (en) 2024-01-25

Family

ID=83497805

Family Applications (1)

Application Number Title Priority Date Filing Date
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

Country Status (2)

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

Citations (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
CN110866869A (en) * 2019-10-28 2020-03-06 苏州中科天启遥感科技有限公司 Image mosaic method and device combining Thiessen polygon and minimum spanning tree image segmentation
CN111311750A (en) * 2020-01-17 2020-06-19 武汉大学 Mosaic line network global optimization method based on constrained triangulation network
US20200342655A1 (en) * 2019-04-29 2020-10-29 Wuhan University Method and system for vector-raster overlay analysis of ground surface image area based on edge clipping
CN112508988A (en) * 2021-01-14 2021-03-16 西安中科星图空间数据技术有限公司 Method and device for accurately extracting mosaic lines of remote sensing images

Patent Citations (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
US20200342655A1 (en) * 2019-04-29 2020-10-29 Wuhan University Method and system for vector-raster overlay analysis of ground surface image area based on edge clipping
CN110866869A (en) * 2019-10-28 2020-03-06 苏州中科天启遥感科技有限公司 Image mosaic method and device combining Thiessen polygon and minimum spanning tree image segmentation
CN111311750A (en) * 2020-01-17 2020-06-19 武汉大学 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
CN115170685A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN111145174B (en) 3D target detection method for point cloud screening based on image semantic features
CN112734641A (en) Training method and device of target detection model, computer equipment and medium
CN106952338B (en) Three-dimensional reconstruction method and system based on deep learning and readable storage medium
JPH05500874A (en) Polygon-based method for automatic extraction of selected text in digitized documents
Wei et al. BuildMapper: A fully learnable framework for vectorized building contour extraction
CN109635714B (en) Correction method and device for document scanning image
Hensel et al. Facade reconstruction for textured LoD2 CityGML models based on deep learning and mixed integer linear programming
CN111985381B (en) Guidance area dense crowd counting method based on flexible convolution neural network
CN112990183B (en) Method, system and device for extracting homonymous strokes of offline handwritten Chinese characters
CN115331245B (en) Table structure identification method based on image instance segmentation
CN114529837A (en) Building outline extraction method, system, computer equipment and storage medium
CN112348836A (en) Method and device for automatically extracting building outline
CN115909059A (en) Natural resource sample library establishing method and device
CN113033516A (en) Object identification statistical method and device, electronic equipment and storage medium
CN112419202A (en) Wild animal image automatic identification system based on big data and deep learning
CN113313002A (en) Multi-mode remote sensing image feature extraction method based on neural network
CN111292335A (en) Method and device for determining foreground mask feature map and electronic equipment
CN113449741A (en) Remote sensing image positioning method and system based on semantic inference and image understanding
CN113205023B (en) High-resolution image building extraction fine processing method based on prior vector guidance
CN114463503A (en) Fusion method and device of three-dimensional model and geographic information system
CN113066173B (en) Three-dimensional model construction method and device and electronic equipment
WO2024016368A1 (en) Mask-guided image mosaic line generation method and apparatus, computer device, and storage medium
CN116363319B (en) Modeling method, modeling device, equipment and medium for building roof
CN110874170A (en) Image area correction method, image segmentation method and device
CN112507938A (en) Geometric feature calculation method, geometric feature recognition method and geometric feature recognition device for text primitives

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22951637

Country of ref document: EP

Kind code of ref document: A1