Search code examples
c#vips

NetVips Mosiac how to calculate the merge point


Doing some work to merge a bunch of images into one large image. I found the vips library and the mosaic function (Link to vips doc which worked how I want it to work in an example. The issue I'm running into is how to calculate the merge point. It doesn't look like vips has a way to do this out of the box, and I haven't found a different C# library that accomplishes finding that merge point. Any pointer or places to look would be appreciated!


Solution

  • You probably want the libvips mosaic operation:

    https://www.libvips.org/API/current/libvips-mosaicing.html#vips-mosaic

    You give it an approximate overlap, it searches for the true overlap, then calls merge for you. You can use the params to control the search window and the accuracy of the initial overlap. By default you need to be within about 10 pixels (from memory).

    The "Description" section at the top of that page has a general introduction.