opencv stitcher.stitch function explanation

  360-panorama, c++, image-stitching, opencv, python

I am trying to stitch to get 360-panorama image for 3~5 cameras.

For explanation, I set 1st camera, 2nd camera and 3rd camera, they are picturing 360 degrees.
Those cameras are located in a moving machine like robot.
So there are folders to save each pictures to be pictured each cameras.

Some pictures are stitched by opencv stitching functions.

But others are not. (Because of lacking with their matches)

The question is

  1. How I get homography matrix using opencv stitch function.
  2. How I can blend and warp their pictures

Once I get homography matrix for each pair (1st,2nd),(2nd,3rd),(3rd,1st),
then I can apply all the pictures especially failed to opencv stithch function.

Current my situation is followings.

  1. Find features
  2. Match features
  3. Find homography matrix H (using cv2.findHomography)
  4. Warping result images

(using cv2.warpperspective dst = (src1,H,(src1.width + src2.width , height)

  1. Concatenate images

not exact but pseudo code

(result[:src2]=src2 , result[src2,:]=dst)

But the result is not good.

I think between 3~5 steps I should do other things.

Or am I doing right way but getting improper homography matrix?

Can you help me? Thank you for reading.

Source: Windows Questions C++