Image fusion (splicing) tool imagefusion

Source: Internet
Author: User

 

Image fusion is an image stitching tool developed based on the demo of cximage 6.0. It targets continuous frames of images in the online WebGIS. These images are characterized by overlapping parts of continuous images (obtained through the landscape screen), as long as the given area matches, the rest can be considered to be matched (this is the application scenario of the tool ).

 

Image processing platform selection:

(1) gdal:

It can process images of several hundred megabytes and several Gbit/s. This can be used as a development platform for subsequent versions.

(2) GDI +:

Close the source of the code without consideration.

(3) opencv:

Not familiar, so do not consider.

(4) cximage (version 6.0 I used ):

Excellent open-source class libraries, including BMP, GIF, JPG, JPEG, PNG, ICO, Tif, Tiff, TGA, PCX, wbmp, WMF,

EMF, j2k, JP2, jbg, j2c, JPC, pgx, PNM, PGM, ppm, Ras, MNG, jng, ska, NEF, CrW, CR2, mrw, Raf,

ERF, 3fr, DCR, raw, DNG, VF, x3f, arw, Sr2, MEF, and open-ended database. It also provides a powerful demo function (supporting adjustment of large images

Some parameters), so I chose to develop this tool based on the demo of cximage 6.0. Cximage Memory leakage and unapproved

I have solved these problems.

Splicing principle:

For the two images that are spliced, if fig A matches fig B, it is called a stacked graph, and fig B is the basemap. That is, the base map is first pasted, And Then stacked at a certain position of the base map.

The positions here include a point (m_dxoffset, m_dyoffset) in the base map and the position point (m_xoffset, m_yoffset) at the beginning of the stacked graph ).

The matching principle is that the color features of a given area are the same (RGB, A-channel ignored. Match and search to determine the position of the stitching.

The match matrix is (the starting row, the row height, the starting column, and the column width). These four parameters can be adjusted to avoid the black area.

(1) Horizontal join query:

(1) Ensure that the color matrix of the last two columns of the basemap involved in the operation is not repeated. Find the first matching point. Collect data from top to bottom in the last column of the basemap

For the fixed base map color matrix, the matching color matrix is found from top to bottom in the first column of the stacked graph, and then from top to bottom in the second column.

Record the start column and start row of the stacked graph and the start row of the basemap.

(2) find other matching points in the (column width-1) group. Search for matching parameters from (1) until the search is complete.

 

(2) Search for vertical stitching:

 

(1) Ensure that the color matrix of the first two rows of the stacked graph involved in the operation is not repeated. Find the first matching point. Collect data from left to right from the first line of the stacked Graph

In the matrix, for the fixed base map color matrix, from the last line of the base map from left to right, and then the last line from left to right, find the matching color matrix in turn

And record the starting column and the starting row of the basemap and the starting row of the stacked graph.

(2) Search for other matching points in the (Row Height-1) group. Search for matching parameters from (1) until the search is complete.

(3) Merge horizontally and vertically:

We recommend that you add the valid part of the image as much as possible. For the covered part, you must paste it back. The algorithm is not provided, mainly obtained through splicing and searching.

Obtain the rectangular area of the image after the combination of the basemap and the stacked graph, and paste two images into the area.

 

 

Image fusion Main Interface

 

 

 

Examples of horizontal stitching

 

Horizontally spliced

 

 

Vertical stitching example

 

Vertically spliced

 

Thank you for your criticism. My Email: wxy3064one@163.com.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.