Forum Moderators: phranque
I'm not concerned about the viewing part, I'm more wanting to find out whether anyone knows of a solution to create the panoramics? I know how to create them on my own PC, but when it comes to doing it automatically on the server, I'm stumped!
My current thinking says that the best way to achieve this would be to run a command-line image stitcher. I've found a few such programs, but they all seem to need either user input or input images in a format other than jpeg.
Can anyone shed any light?
It would need to be done by a specialist program, as I doubt PHP has the processing power to be able to do such a thing- it involves analysing the image, finding common points, morphing them together, etc.
There are several *nix programs that do this, but all of them require user input, none of them seem to be able to be run automatically from the command line.
My guess is once you find that server, you can fairly easily script the user input stuff and mix it in with the shell stuff, without any real issues.
But not many hosters support the php shell access, mine does, but very few others I've seen do, since it requires very high end security and network admin skills on the hosters part to maintain system stability and security.
The only problem is, I haven't managed to find a program to automatically merge the images. The user input for the program I do have consists of clicking on points in the images, so it's not something that I can script, as it would differ for every series of images uploaded.
I've found a windows command line program that claims to be the first automatic photo stitcher, but it is only available in a demo and it still has a gui, not a command line interface. I'm going to contact the author, but it's a student who has spent two years on the project and doesn't seem very commercial-minded. As such, it doesn't look like a finished product is going to see the light of day for a while...
If making the process more userfriendly, instead of automated, is not a possibility, maybe consider getting the guy you found to code a custom interface for you? Or hire another bright coder to do it for you (not me :o))?
I do a lot of work with the PHP image functions and know you could do something like this:
Assuming: you know the order of images that complete the panorama (ie. image A goes next to image B goes next to image C) and assuming the images wouldn't need to be rotated or considerably resized to be stitched together, and assuming the images were the same height you could basically just use a number of FOR loops to test if the rightmost pixel column of A and the leftmost pixel column of B were very different, then the 2 right columns of A and the 2 left columns of B, etc. Keep track of the one that gave you the best results and use it.
Of course, if those assumptions are invalid, it gets much more complicated...
That sounds like a real solution, I was going to suggest flash interacting with php too, but I don't have your experience in it.
Sounds like the poster should spend some time talking to you about this project if you ask me, outside of this thread.
Obviously I don't want to give away the final application of this little code snippet, but suffice to say that it's not the focus of the site- it would just be a really cool feature! But the thing that would make it really cool would be the ability to just upload photos and then see a panorama on their page. So having any user input at all, apart from the uploading photos isn't really where I want to go...
But it is an interesting problem and the autostitch program (the one by the student) is the closest that I can find to solving it. I've tried to read through his (and others') documentation, but it's been 5 years since I did any sort of university-level maths and I got totally lost!
Perhaps this site is just a couple of years ahead of its time :-)