-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: Image join issue while stitching using command #27
Comments
Is the image coming from first or second generation of Gear360? For the second generation of Gear360 the template is still far from perfect. And anyway - I would expect the template not to fit all photos properly. |
I suspect that the Gear360 cameras are not 100% exactly same placed in all the cameras. I'm working on making a tutorial to calibrate the .pto for each camera |
Correct. I was also thinking about a tutorial how to tune the There's also a possibility to try make Hugin to automatically adjust the lens' parameters, but I expect the result to be poor. |
Such a tutorial would be great. I sometimes take hundreds of pictures with a car rooftop mount so creating a pto for this purpose would be worthwhile. |
very good! |
Hugin video template generation.txt That is the beginnings of the guide on how to calibrate lenses to your Samsung Gear360. -Evert- |
Can this optimizer step be included in the .cmd? |
Hi, You can't use control points from pto file to get better alignment (1). If you try to do it you would end-up with the same or similar alignment. Think about it that Hugin doesn't know anything about the image(s) behind the control points - all it does it tries its best to transform (think: adjusting some numbers) the_control_points from both images so that they fit well. Generic solution would be to detect control points on both halves of the photo - unfortunately for double circular fish-eye it doesn't work very well (it doesn't work) - so control points have to be placed manually. The pto files are based (mostly) on my camera, I suppose it works well for most of them, but, as someone already mentioned somewhere, every camera will differ a bit and for you the difference. Please use this video as a starting guide: https://www.youtube.com/watch?v=QKQGT8VUN8g using your photo and add more control points, then play with optimise. After your post I will try harder to create a better guide to creation of control points and what effect each parameter has in the optimisation pane. (1) to be 100% correct it is theoretically possible that you could end-up with a better fit, i.e. "better" optimum solution for this optimisation problem. L. |
To extend a bit more the part about the control points, for things to work the way you think you'd have to know how those pieces have to match together to make the alignment better - for human it's easy to say, for machine - that's a pretty hard problem. |
oh yes, that makes a lot of sense what you explained, thank you! |
There are a couple of parameters that can be adjusted and "straighten" the photo (not sure if it is always possible). But it is beyond this commend to explain it (various distortions, rotations, etc.). It looks like one lens needs more "distortion" + slight position adjustment. What you can do - use the video tutorial, stop at the moment when two photos are added (as separate lenses) then select from File "Apply template" and select pto file apprioprate for your camera. L. |
Can I also open the pto in hugin an manually adjust the control points, based on images from my camera? |
Hmm... yes. There are two ways of doing it (sorry, not verified, straight from my memory). Method 1.
Method 2.
L. |
@ultramango i have gotten that far, and adjusted a few control points |
Once you have control points - play with "optimisation" tab/options. Or just find "Optimise" button - this should find new, hopefully, better panorama parameters. |
can I also move the existing ones, by eye? |
Well, best if you removed existing (I mean the "old" ones) datapoints as they apply for a different photo, not yours. |
I moved some of them to better match my image, but the stitched result from your script using the new pto is exactly the same |
Ensure new .pto file is saved. |
Edit: |
Hi there, utack.
Once the control points are adusted, you have to run the optimize
algorithms in Hugin.
Inside the .pto file there are also positions of photos relative to the
anchor photo, and these values are which is used in stitching, and also are
the values that are adjusted when you optimize the .pto.
Kind regards,
-Evert-
…On 12 December 2017 at 18:49, utack ***@***.***> wrote:
Is there some sort of cache somewhere in the chain?
Because I can delete ALL control points in the pto, and it still stitches
the output the same way
But when I delete the .pto itself, it complains it cannot find the pto and
stops
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALfL1avVv75R2UTXNFbXWiKo9Bo8-8voks5s_q6ogaJpZM4OGWH0>
.
--
Evert Vorster
Isometrix Acquistion Superchief
|
Is it possible my lens is poorly shaped? |
Hi there.
I am sorry that you are struggling with this.
My usual method for calibrating is something like this:
1. Go somewhere where there is a lot of space between you and the horizon.
In a pinch a football field will work, but a wide open grasslands with
trees on the horizon works best.
2. Raise the camera on a selfie stick to well above head height.
3. If doing calibrations for photo, take a picture with both lenses at
every 45 degrees. eg. 0, 45, 90, 135, 180, 225, 270, 315.
3. If doing video calibrations, take a video while slowly rotating the
camera. From the raw footage, extract a frame at approximately the same
angles.
4. Using the .pto file as a start, delete the images and associates control
point.
5. Import the 8 images produced in step 3 into hugin twice. Once for the
left lens, and once for the right. Make sure that circular fisheye is
selected as lens type, and that field of view is 360 (don't ask)
6. Selecting the left lens images, modify the lens parameters to shift the
center of the image to the center of the left lens.
7. Create a mask for the left images. It should look like a circle and fit
over the left lens image.
8. Repeat steps 6 & 7 for the right images, but this time make sure the
center of the lens and mask is over the right lens in the image.
9. Modify the positional parameters for the first left hand image: set yaw
to 180 (this makes the stitch look like the ActionDirector)
10. Let Hugin automatically detect control points with CPfind. If this goes
well, you should have a few thousand control points.
11. Run the optimizer, positions only.
12. Select all images, right-click and select clean control points. This
should remove the worst fitting control points automatically.
13. Run the optimizer, positions and view, then clean control points.
14. Run optimizer, positions and barrel distortion. Clean control points.
15. Run optimizer, everything without translation, Clean control points.
16. Keep repeating step 15 until the average error is less than 1.
17. Save your project as "Calibration" or something.
18. Delete all images except the first image for the left and first image
for the right lens.
19. Save your project as "Calibrated_Photo" or video, or whatever.
With a bit of practice, this will take a lot less than the four hours you
already spent tryin to manually find control points.
You can now check the fit but doing a stitch, and if good, you can replace
the default .pto file in the ultramango with yours. I recommend making a
backup of the original, of course.
…-Evert-
On 15 December 2017 at 19:10, utack ***@***.***> wrote:
Is it possible my lens is poorly shaped?
I have tried to set control points and optimize twice, from scratch, and
wasted about 4h with this.
Every time i got a fit that worked perfectly on one stitch side, but had
quite the offset on the other stitch side
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALfL1fzbZbsE8IdTkQjWYhF0borzrr5cks5tAqgRgaJpZM4OGWH0>
.
--
Evert Vorster
Isometrix Acquistion Superchief
|
@evertvorster I finally got it |
Can I just copy and paste my custom viewfield, pitch/roll/yaw and d parameter from my photo .pto into the 4k video.pto, or is it more tricky to adopt that file? |
It's a little more tricky than that.
You first need a .pto that has pictures in it with control points
automatically selected, and the entire .pto fully optimised.
THEN you can modify the Anchor image rotations, and hit optimize positions
again, which will move the other lenses in the .pto accordingly.
Of course, you can just try to modify the rotations in the original .pto
and optimize positions, but your mileage might vary
…-Evert-
On 26 December 2017 at 18:06, utack ***@***.***> wrote:
Can I just copy and paste my custom pitch/roll/yaw and d parameter from my
photo .pto into the 4k video.pto, or is it more tricky to adopt that file?
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALfL1Tdnkgc8wS60H3P8EUGyxh-cmj-Eks5tERl-gaJpZM4OGWH0>
.
--
Evert Vorster
Isometrix Acquistion Superchief
|
When i am trying to stitch gear360 image using command from linux. Image not join properly.
The text was updated successfully, but these errors were encountered: