Digital Microscope Photo Stitching

SharpStitch .NET library performs high-precision, high-quality microscope photo stitching and image processing

Stitching (merging) photos taken from microscope is a complex task. High-quality, high-precision image stitching invariably consists of over dozen individual steps, which are necessary for optimal results.

The SharpStitch software is currently the most advanced and complete photo stitching technology suitable for scientific, forensics and industrial use.

High-precision image stitching

SharpStitch combines two completely different approaches to photo stitching into a single, proprietary algorithm that creates unparalleled results. Both feature matching and direct stitching are utilized.

Feature detection is robust to rotation, scale changes and blur. It is also partially robust to viewpoint changes and JPEG artifacts.

SharpStitch includes reliable methods for translation, isometry, similarity, affine, rotation and homography estimation. The estimation makes use of robust estimation combined with nonlinear refinement and guided matching.


SharpStitch supports 5 kinds of projections (warpings) out of the box:

  • Planar
  • Fisheye
  • Stereographic
  • Spherical
  • Cylindrical

Furthermore, support for additional projections can be easily added, with as little as a single line of code.

Software designed for stitching panoramas is usually unsuitable for microscope photo input, because it supports spherical or cylindrical models only. The planar projection is necessary for microscope photo stitching.

Rotation correction

Most photos, especially if taken using a manual or semi-automatic method, are rotated in one or more dimensions in relation to each other. When rotation is not corrected, stitching the images will result in a distorted output.

SharpStitch library automatically handles and corrects for rotated images in all dimensions.


Rotation Correction

Gigapixel photos support

SharpStitch is able to stitch and process huge mosaics with virtually unlimited resolution.

You can input enormous photos without worrying about running out of RAM, because the rendering is optimized.

HDR support

High dynamic range photos allow you to capture the most detail by combining several levels of exposure. Details remain visible even in extremely dark and bright areas of the image.

SharpStitch supports multiple HDR composition algorithms, including Exposure Fusion.

HDR image is usually of too high contrast to be displayed on traditional devices (LCD displays). Tone mapping algorithm can adjust HDR image to be displayed such that most details are visible even on low dynamic range display.

Both global and local tone mapping operators are supported. These include Reinhard05 and popular Fattal operator. Local tone mapping takes neighboring pixels into account, often leading to dramatic detail enhancement.

Automatic image matching

You can input un-ordered set of images into SharpStitch, as it can automatically find mosaics in them. It will calculate exactly where each image goes, using a robust proprietary algorithm that eliminates false positives.

SharpStitch will save you time, as you don't have to input images meticulously sorted based on a grid structure. This also means that you don't have to take unnecessary photos around the edges, just to have enough photos to fill a rectangular grid.

Focus stacking

Most microscopes (and cameras) allow you to see only smart portion of the image in focus at a time.

By using focus stacking (also known as focus blending), you can combines multiple images taken at different focus distances to create a resulting image with a greater depth of field than any of the individual source images.

The resulting image is then sharp and detailed in all focus levels, not just one.

SharpStitch can align the individual images and blend them as well.



Blending of the image overlaps is a critical step in the image stitching workflow. It makes the difference between gorgeous and fuzzy result.

SharpStitch allows you to blend the images perfectly, as it provides multiple blending algorithms for different purposes.

Image overlaps can be simply stacked on top of each other, averaged or blended with multiband (pyramid) blending algorithm. Blending masks can be constant (each image is given same weight at any place), transitional or seam-based. The seams are computed such that they minimize differences between images.

Optimal seams

SharpStitch automatically detects minimum error seams in each image overlap for optimal blending.

Calculating optimal seams is necessary for optimal results. The objects (specimen) in the photos often move, as a result of manipulation or naturally on their own. Moving objects cause blurriness and ghosting artifacts when not corrected for.

Global optimization

This step, also called "bundle adjustments", will increase the quality and precision of the output, by performing geometric corrections.

SharpStitch will automatically refine image positions and other parameters jointly for the whole mosaic (stitched image). Any possible misregistration errors are smoothed out with this process.

One drawback of real-time photo stitching technologies is that they usually lack these global optimizations. (SharpStitch can be adapted to perform real-time stitching as well.)

Distortion correction

SharpStitch automatically corrects barrel distortion, pincushion distortion, combined (wavy) distortion, and more.

Lens distortion correction is performed both before stitching and after stitching - during the global optimizations.

This is a cutting-edge innovative approach that further increases the quality of the resulting stitched image.

Vignetting correction

In photography and optics, vignetting is a reduction of an image's brightness or saturation at the edges compared to the image center.

SharpStitch automatically corrects for this common problem.

Lens calibration

Lens calibration can be computed fully automatically.

It can be also performed manually before the stitching, using photos with camera calibration targets.

The following photo demonstrates SharpStitch recognizing a grid calibration target:

Camera calibration target


The color balance of a digital image produced by an optical microscope is dependent not only upon the spectrum of wavelengths transmitted through or emitted by the specimen, but also on the spectral content of the light source.

Without proper configuration of the camera or color correction of the photos, the resulting image can have unnatural colors.

SharpStitch can perform automatic white balancing of the photos.

Exposure compensation

SharpStitch can automatically compensate for variance in the levels of exposure of the input photos.

Underexposure or overexposure of one or more of the input photos can happen for multiple reasons, such as unusual lightning distribution or changes, variations within the camera system, filters, and more.


The stitched image can be automatically cropped in such a way that maximum of the actual image is preserved.

SharpStitch's auto-crop algorithm is based on finding the largest inscribed rectangle, with additional refinements.

Complete workflow

You can perform all the steps easily with SharpStitch or SharpStitch SDK for .NET - it's all-in-one solution when it comes to digital photo stitching.

Interested in using SharpStitch? Contact us today!

Contact Us