@StephaneP gave me tip for the stitching software Hugin (thanks!)
I looked at it, and it looks really promising … I read up on it, and it looks like it supports commandline processing and it runs on several operating systems. So this piece of software might just be ideal for batch processing. Just what I need
but I cant make heads or tales with it getting to stich a raw image… I found a youtube tutorial, but that seems to be a previous version… I tried to follow the instruction, but it ends in a mess.
oh man, usually i am ok a learning new programs but the first time i tried hugin i spent the best part of an hour trying to figure it out. i couldnt get it to do anything in the end.
i tried again a few months later and managed to stitch an image but i still dont really understand how it works. i spent another hour trying to get the batch part to work but i still cant crack it. maybe third time lucky
My hero there created an assistant (you can download via the link above)
I placed that file here: c:\Users[user]\AppData\Roaming\hugin\
I set interface to ‘expert’
Then I open a raw unstitched image (or simply drag it into the program and drop)
I need set a value for “HFOV” (set something, anything… example => 1 ), press OK
via menu: Edit > User defined assistant > Assistant for dual lens images (vertical) (it’s at the bottom)
In stitcher (last tab) set output image size and set to JPEG
Run it!
I did a few tests, and some didn’t go perfect, got a “black cat eye” (missing part of the image)I juggled around with the settings. In my manual I red that the field of view was 220 (I found 180 in the assistant) also I set the crop a bit larger (95% in stead of 92%)
Here is my custom file (save it to a text file and name it ‘duallens_vertical.assistant’):
When you can get a PTO file for your camera all you have to do is open the unstiched image (if you have a double sphere image like me, you open it twice!)
Then select: File > Apply Template
and you’re golden!
When you don’t have a PTO you use the assistant. When you have a good result you can use the generated PTO file exactly the same way (so you have created your own template!).
I did discover you need to try, and try again sometime with exactly the same assistant you can get different results every time! There is quite a bit of fuzzy logic in there!
But now I have a question the result looks perfect, BUT when I overlay the two there is quite a bit of difference… Is that a problem for Mapillary (SfM)?
It “feels better”, but what is wise? From an optical view the Hugin file is much better, but which is better for Mapillary? Or is that detail/distortion something that Mapillary has no trouble with?
[update]
A side note on “speed”. I created a perl script to process a folder with my created “YI360 hugin template”.
I have a Linux server for company testing purposes. That one isn’t a “cpu monster” (and only has a simple onboard graphics card). That one needs 15.5 seconds on avarage for stitching an image (command line, at 5760 x 2880, including conversion to JPG). I expected that my (Windows 10) workstation with a much faster CPU and a slight monster of a GPU would be faster, so I appended my perl script to generate templates suitable for the batchprocessor of the Windows program. But that one needs over 17.7 seconds on average…
With my camera in “movie mode” I filter out a lot of images… so I could get smart and stitch only the images I need…
But before I start doing that I’dd like to know if this way of stitching poses a problem for the “Mapillary platform”?
For those that want to use the YI 360. With my template file I managed to get a perfect stitch result with my camera with Hugin. The result is (much) better then the original software. You will need a PTO file to use it, Here you can download mine (61 control points!):
I recently took 360 images in a cave, and I’m impressed, that even the ceiling is perfect, I cant find a stitch fault anywhere (at the bottom, me holding the camera, there it gets a bit tricky… naturally)
Well, are these moa artifacts persistent when using original software?
Color-wise, original stitch looks slightly-better to me
I have not noticed any of these on Fusion (using Fusion studio), would be interesting to try Hugin to compare. Wonder if these 'template’s are camera-specific (one that work fine with YI will not work with Fusion)?
I do think they are camera type/brand specific! They may even be camera specific! So if you want to try Hugin do search for a PTO file for your camera!
Depending on how the raw images are stored (mine was a “odd”, two spheres above each other) you can use the assistant and then optimize with manually adding points until you are satisfied …
I am
But I did also get the imperession the GUI (Windows) is able to do batch processing (I didn’t look into it, because I was filled with joy when I found the command line tool)
What is Hugin?
It is a poowerfull program which can stitch (combine) multiple images into one. This can be or become a panorama or a equirectangular.
It does have a bit of a steep learning curve. But once you have figured it out, it produces good results and can be used for batch processing. It’s available for Mac, Windows and Linux.
What is a PTO?
Hugin has assistant which can help you in various ways to get started… Each project you create results in a project file which is the template for your stitching project. The extension of this file is PTO.
How to create your own template?
When you are lucky you can find a PTO file someone else created. When you are even more lucky that person did a great job creating it.
If not, you need to create one yourself. Best is to use a location which fits the general usage of your work (open space, room etc). Use a location with a lot of good identifiable points. I went to the local gym:
And start by matching control points as good as you can. Go for pixel perfect!
How I went for perfection (little trick I thought of…)
I perfected my PTO file the following way:
First, do keep in mind that Hugin uses a sort of “fuzzy logic” in their stitching process! Sometimes a dozen points extra gives a worse result… try and get a feel for it and play around with it!
At certain moment I was almost there but a part just didn’t want to go just right. The trick I did was this. After saving my project I renamed my ‘image.jpg’ to “fase one.jpg” and used an other image I took in the gym and renamed that one to “image.jpg” and re-opened my project (later on I discovered I could just as well have opened that image (twice in my case!) and choose “apply template” and then go to “control points” again and start playing around again by finding those extra control points for the perfect result…
As you can see in the image above my template uses a whopping 61 control points… I know, it’s a bit excessive but I am very, very pleased with the results I get