0

How to use vision framework to stitching panorama picture?

vision's VNTranslationalImageRegistrationRequest can stitch two images.I try , it works. Now I want to stitch two fishPhotos. Like this enter image description here

VNHomographicImageRegistrationRequest or VNTranslationalImageRegistrationRequest ?Any suggestions? How to stitch them get a panorama picture while is expanding?

Community
  • 1
  • 1
ChokWah
  • 105
  • 8
  • Can you please let me know how you stich images using vision framework, particular code snippet will be very helpful THanks. – Abhishek Mar 29 '18 at 18:25
  • @Abhishek My code using vision framework only can stich images which's same size and even number's images.You sure about that's what you need ? – ChokWah Apr 01 '18 at 08:50
  • Yes I only need to stich two images of same size and I tried to stich but it still looked misaligned and stich line there so if you achieved this would like to know will be great help Thanks – Abhishek Apr 02 '18 at 17:48

1 Answers1

0

As far as I'm aware there is no support for this kind of stitching as of yet. In order to perform a successful stitching with this type of image, you first have to map the pixel coordinates for each lens onto a sphere - each giving a partial result - and then use some form of feature-matching algorithm (usually a combination of SIFT and RANSAC) that will accept polar coordinates (longitude and latitude) to compare the results. It's usual to then map the stitched results back into a 2D plane using something like a Mercator projection.

I have created manual stitching filters for this kind of image myself and can tell you that there are a great many different configurable elements in the equation that will depend on the equipment used, not least of which is the view angle of the lens.

Comparing 2D coordinates on fisheye lenses will rarely give good results when the matched areas are on the periphery of the lens. By way of demonstration, look at the computer mouse in the image you've given. On the right its general profile is flat and lozenge-like. On the left, it's distinctly banana-shaped.

You may get some traction by first converting both images into squares using a fisheye removal filter, although you'll probably find you have little control over whether the images are stitched side by side, one above the other, or at some strange angle where they meet over a corner.

Here's a document you may find useful for the purpose: https://pdfs.semanticscholar.org/9616/0d2df798a8c4de08fd669b1d091f519b3fe8.pdf

Ash
  • 9,064
  • 3
  • 48
  • 59
  • Y'know, I've been looking at that image a bit and it doesn't seem to stitch properly at all. The images feel like they're at 90 degrees to each other rather than back-to-back. What did you take it with? – Ash Feb 06 '18 at 14:30
  • This machine is like RICOH THETA(Do you know this ?). The different is it's camera cheaper.So they really are back-to-back, I just put it down on desk. It's a normal fisheye picture. Do you have a github account or blog?I wanna know more detail. – ChokWah Feb 07 '18 at 02:05
  • I have a Theta V myself, but it stitches automatically for still images. Looking closer at the image, the problem I was having is that one of the images is flipped horizontally. I've had to add an option to my stitching algorithm to flip the images. – Ash Feb 07 '18 at 10:16
  • Could you send the flipped horizontally images to me ? My email : chokwahchan@hotmail.com . Last year, I use RICOH THETA's iOS SDK in project.Everything's ok. Now I chooseed another camera which is cheaper. But it has only fisheye photo. Needs I do some stitching job myself. – ChokWah Feb 08 '18 at 06:57
  • It wouldn't be accurate because you'd have to flip only one lens and it could mess with the horizontal centring, which is an important part of the fisheye algorithm. Better to do it all during your stitching process - it's simple enough, you just invert the radial angle. My current stitching algorithm still needs adjustment - I think I need to add yet more parameters to adjust the final polar coordinates up and down a bit. – Ash Feb 08 '18 at 10:18
  • I’m new guy about stitching fisheye. Sorry can’t help you. I really wish you did it. – ChokWah Feb 10 '18 at 09:52