Accessing full native object in OpenCvSharp

1 day ago 4
ARTICLE AD BOX

I am using OpenCvSharp4 to to stitch images, and I'm able to use EstimateTransform to get a good transform, and once I have a good transform I'm able to use that transform to stitch other images together from the same camera rig as long as that transform is in memory.

I would like to save the transform so that I can load a transform from disk and use that same transform instead of dynamically finding a transform every time (I normally have to try estimating the transform on many different sets of images until I find a set with a high enough confidence to get a good transform that I can use on all of the image sets)

From this answer https://stackoverflow.com/a/72535899/4708150 it looks like that should be doable if I can save the camera parameters and the seam masks, but OpenCvSharp4 currently doesn't expose those properties or those setters.

Is there a way to access the full native Stitcher object from OpenCvSharp4 (there is a method to get the pointer to the Stitcher object, but I'm not sure what it would look like to access the camera properties and the seam masks from that pointer)? Or would this functionality need to be added to the wrapper through a pull request? I would consider trying to make that pull request, but I'm not that familiar with c# interop.

I've looked some in the OpenCvSharp git repo and looked at the NativeMethods_stitching.cs class to look at the external dll calls, and the methods there don't appear to match exactly the calls in the c++ documentation here

like stitching_Stitcher_composePanorama2_InputArray vs cv::Stitcher::composePanorama, so I wasn't sure if OpenCvSharp is using the native dlls directly or if there is some sort of intermediate dll that is being generated that it is using.

Read Entire Article