OpenStitching / stitching

A Python package for fast and robust Image Stitching
Apache License 2.0
1.99k stars 156 forks source link

Heading of the pano #72

Closed snowface3 closed 1 year ago

snowface3 commented 1 year ago

Hi, Thank for making this tool, and sharing it with the public. I also commend your efforts to support the community for answering questions. I can imagine it takes a lot of effort. I'll try to keep my question brief:

I have visual odometry running, so I know the exact heading of each input frame. How can I find the heading of the panorama?

lukasalexanderweber commented 1 year ago

can you make a quick sketch with what you mean with heading? is your panorama creation successfull?

snowface3 commented 1 year ago

Hi, yes the panorama creation is successful.

Following is a rough sketch. The person is holding a 40 degree FoV camera, and rotating their head standing in place. Since we have odometer, we know the heading where the person is facing for each frame (frame A facing 20degrees north, frame B facing 50 degrees north etc.). I would like to know, what is the heading of the stitched pano. This heading can be defined at the middle of the pano or somewhere else. Hope this clarifies the question.

Screenshot 2023-04-14 at 8 26 51 AM
lukasalexanderweber commented 1 year ago

can't you just calculate it?

in your example the panorama seems to cover 0°-100°. So the Pano heading could be 50°?

snowface3 commented 1 year ago

that's assuming perfect alignment. Some images might be roll, pitch, yaw corrected when added to the pano. I guess I would need the transformation matrix of one (or more) images- of how they were added to the pano

lukasalexanderweber commented 1 year ago

the matrices can be found in the cameras variable.

https://github.com/lukasalexanderweber/stitching/blob/main/stitching/stitcher.py#L95 (you can also check out the tutorial to better analyze them)

I'm not that familiar with them but you can maybe find something in the opencv docs or code

lukasalexanderweber commented 1 year ago

If you have updates on this please feel free to share them