Summary: Not feasible via stitching. The perspective differences are to large and the resulting image will always have artifacts, which goes against the idea of having a publishable image.
See #117 for better approach.
Things to consider when dealing with homographies:
You want to detect many keypoints via an algorithm like ORB and then calculate a proper homography via a consensus algorithm like RANSAC
The next image illustrates bad matching of keypoints:
The following image illustrates better matching via RANSAC, but they are not well distributed over the whole image
The result of the above homography when used for stitching:
The grid does not allign properly in the stitched images - likely cause of a bad homography. The default stitching algorithm produces the following result:
This result is not good either, because it is to soft. It seems to make a consensus between both images.
efe2ab9288b17800bf3f184cbf332a16bec38a1c Added sample to stitch images together.
This works only for a few images. The stitching process must be further adjusted.
OpenCvSharp does not expose enough of the stitching api of opencv, which is why EMGU is used. For example I could not find HomographyBasedEstimator, BundleAdjusterRay and so on in OpenCVSharp.
The StichPhotos2 Method explains the overall steps, which are used to stitch photos together.
d273f8ca0bab00d60d43d911103b9e0fd0eabb74 added a manual stitching method to test getting a proper homography between two images.
The implementation is based upon https://stackoverflow.com/questions/53079167/emgucv-opencv-orbdetector-finding-only-bad-matches
It works much better than all of my manual implementations, see comparison between Good and Bad Feature Matching images.
Major takeaways are: Request many features from ORB - not just the default amount. Lowes algorithm is implemented in Features2DToolbox. KNN matchings needs to have the model descriptors added before calling KnnMatch.
http://6.869.csail.mit.edu/fa12/lectures/lecture13ransac/lecture13ransac.pdf is a good description of how feature mapping works.
b4717fb4da427b93a38f69ea72e6ebb49a6d1a13 cleanup of code and proper disposing of opencv objects - the testhost still does not exit blocking the project from building again.
As soon as DetectAndCompute is run from the feature detector this problems occurs. The same problem occured when using OpenCVSharp and not EMGU
f05a8ee4e2e68029092b015f7f56b7acc8bde7e5 Photos are now aligned properly by translating the homography such that a border can be added to the original image. The border is necessary, else pixels might go out of bounds after warping the perspective.
The current problem is the perspective change, which leads to gaps when overlapping the images. Maybe calculate better Homography?
Summary: Not feasible via stitching. The perspective differences are to large and the resulting image will always have artifacts, which goes against the idea of having a publishable image. See #117 for better approach.
Things to consider when dealing with homographies: