I am trying to stitch a few images and getting assertion errors.
Image scheme is W*H*channels
.
I have two images of dimensions : 600*429*3 and 600*523*3
There is a overlap between the two images. On trying to stitch I get the following error:
OpenCV Error: Assertion failed (dst.cols < 0x7fff && dst.rows < 0x7fff && src.cols < 0x7fff && src.rows < 0x7fff) in remap, file /home/user/3.4.0/opencv-3.4.0/modules/imgproc/src/imgwarp.cpp, line 1749
I looked around an little bit and was suggested to comment out an Assertion in the imgwarp.cpp file. I commented it out and then I got a different error:
OpenCV Error: Assertion failed (u != 0) in create, file /home/user/3.4.0/opencv-3.4.0/modules/core/src/matrix.cpp, line 436
I went ahead and commented that line as well. I recompiled and linked the .so file to my python cv2 package. The code ran fine,no errors this time, but the stitched image has a width of 30000 instead of 600. The final image is highly distorted.
How do I fix this?
Is that 600x293 and 600x233 or 6004293x6005233 both images? That makes a bit of a difference.
Apologies. New to this forum's formatting. It is fixed now.
I see. Can you post the images so we can test?
https://imgur.com/a/wb4ng
These are the two images. I haven't still been able to figure out why the distortion is there. Can use a little help here. @
Have you tried setting the mode to scans? Like so?
How do I do that in python?
Huh. I don't typically use python, but I don't actually see a way to do it. @berak, @LBerger, do you know?
The documentation for python is really not upto the mark. I may switch to c++ if it doesn't work out.
Are you compiling your own? You can get the parameter by modifying the createStitcher function, but it looks like Stitcher::create is not exported to Python.
`import cv2
stitcher = cv2.createStitcher(False)
result = stitcher.stitch(tup) `
This is what I am doing. The
False
argument I think is to not use the gpu.