Hello, Carlos! Yes, I can provide some samples of it helps... But the main point here is that I need a way to reproduce what I did in GUI and it is not working. I forgot to mention that in the Optimizer step I selected only y, p, r, TrX, TrY and TrZ for each pair.
There are two images that are almost the same: the anchor and another one that is the exact same images but with a crosshair at some point and even in this case if I run the script I shared these imagens won't be aligned anymore. In some cases even the anchor image is modified... How is it possible? I think the problem happens when autooptimiser is run for each image, it does not work like it does in GUI but I have no idea how to fix it. I was hoping some developer could help here... Regards On Wed, 20 May 2020 at 20:52 Carlos Eduardo G. Carvalho (Cartola) < [email protected]> wrote: > Hi LFOM, > > I've already done a script once for video frames, but I have some doubts > about what you are doing. > > I didn't really understand how you get your images, you said the second is > a projection of the first and so on, but anyway, I also don't know if this > is relevant. Maybe you can make some samples available somewhere. > > Maybe a more important question is: Did the camera move between frames? If > not then you can do a stitch just for the first 4 images and then use the > PTO file as a template for the rest, just doing the final image rendering. > > Bests, > > Carlos E G Carvalho (Cartola) > http://cartola.org/360 > http://www.panoforum.com.br/ > > > Em qua., 20 de mai. de 2020 às 04:12, LF Martins <[email protected]> > escreveu: > >> Hello, there! >> >> I know Hugin since a long time ago and I have used it many times to >> stitch panoramas. This is a great tool very versatile, a big *thank you* to >> all developers that made this possible. >> >> But now I am trying to align some photos, and it works nicely when using >> the GUI (I have latest 2019.02 on Pop!_OS 20.04 that is like Ubuntu 20.04), >> but I cannot reproduce it in a batch script, even if I use the same steps, >> or at least I think so... The pictures aren't common fotos, but frames from >> different videos. One of the videos is the reference, and I use it as >> anchor, the other 2 are projections of the first movie so it shows the same >> image but in a different plane/distance/colors, and the third one is a >> slightly different version of the first that the only difference is that is >> has a crosshair marking the center of the area I want to analyse, and I >> want to align all three images with the first one. And it works if I use >> the GUI: >> >> 1. Load four photos, the reference one is the anchor, use default FOV=50, >> rectilinear lens >> 2. Use Hugin's CPFind to find the control points >> 3. Select all 4 images and use Clean Control Points >> 4. Select Otimize Geometric = Custom Parameters >> 5. Then I go to Optimizer tab, select just Use Only Control Points >> between activated images, select just the anchor image and then the other >> images *one by one*, and click on Optimize Now! (so I do this 3 times, >> of course) >> 6. In Stitcher, select only Remapped Images No Exposure Correction LDR, >> Projection Rectilinear, and then click on Calculate Field of View >> 7. Open Preview OpenGL, Center > Fit > Straighten > HDR Autocrop >> 8 Finally, in Stitcher again, click on Stictch! and the images are saved, >> just like what I need. >> >> But the problem is that I need to do this with thousands of frames, from >> many movies, so I created a script to reproduce this, for each group of >> four frames: >> >> #!/bin/sh >> pto_gen *.png -o align.pto >> pano_modify -o align.pto --projection=0 --fov=50 align.pto >> cpfind --fullscale -o align.pto align.pto >> cpclean -o align.pto align.pto >> pto_var --opt="y1, p1, r1, TrX1, TrY1, TrZ1" -o align.pto align.pto >> autooptimiser -n -o align.pto align.pto >> pto_var --opt="y2, p2, r2, TrX2, TrY2, TrZ2" -o align.pto align.pto >> autooptimiser -n -o align.pto align.pto >> pto_var --opt="y3, p3, r3, TrX3, TrY3, TrZ3" -o align.pto align.pto >> autooptimiser -n -o align.pto align.pto >> pano_modify -o align.pto --projection=0 --fov=AUTO --center --canvas=AUTO >> --crop=AUTOHDR --output-type=REMAPORIG align.pto >> nona -m PNG_m -o aligned align.pto >> >> Should have worked, right? But it doesn't! I have tried many >> combinations, because also optimizing with all the four images at once does >> not work well as they are very different from the view point. I also tried >> to create one pto for each of the two photos, then use pto_merge, and it >> didn't work either. And even if I save the pairs aligned, they will have >> different sizes, so I have to align them again and the same problem happen! >> It is really driving me crazy as it should be a simple thing since it >> works almost perfect using the GUI, but I could not find a way to reproduce >> it in a batch. What I am doing wrong? >> >> Kind regards, >> LFOM >> >> -- >> A list of frequently asked questions is available at: >> http://wiki.panotools.org/Hugin_FAQ >> --- >> > You received this message because you are subscribed to the Google Groups >> "hugin and other free panoramic software" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/hugin-ptx/cab3dcd5-6fbb-4322-abfe-24123e782ea8%40googlegroups.com >> <https://groups.google.com/d/msgid/hugin-ptx/cab3dcd5-6fbb-4322-abfe-24123e782ea8%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > A list of frequently asked questions is available at: > http://wiki.panotools.org/Hugin_FAQ > --- > You received this message because you are subscribed to a topic in the > Google Groups "hugin and other free panoramic software" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/hugin-ptx/t7JxXLf2erc/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/hugin-ptx/CALW1f7gPk-TVqGAehRmDmuDqg3-ozLuZ42E93ApPKAhfkH1h5Q%40mail.gmail.com > <https://groups.google.com/d/msgid/hugin-ptx/CALW1f7gPk-TVqGAehRmDmuDqg3-ozLuZ42E93ApPKAhfkH1h5Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- Sent from Gmail Mobile -- A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ --- You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/CAJKJU7WGc9pkkRNqQRfVBqu8qiE0wvvjMRe%2B76WCxw4gWWPWHQ%40mail.gmail.com.
