stitch overlapping screenshots

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

stitch overlapping screenshots

Nils Holmberg
Hi, I'm wondering if panotools can be used to stitch multiple images with overlapping identical pixels, e.g. screenshots? The question is explained in this stack overflow post: Stitch together images with exactly matching (pixel to pixel) overlaps

Best wishes
Nils

|
|
|
|  |  |

 |

 |
|
|  |
Stitch together images with exactly matching (pixel to pixel) overlaps

I have a bunch of images in a folder that are effectively just pieces of one image that was broken into overlapp...
 |

 |

 |



[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

Erik Krause
Administrator
Am 01.04.2020 um 08:06 schrieb Nils Holmberg:

> Hi, I'm wondering if panotools can be used to stitch multiple images
> with overlapping identical pixels, e.g. screenshots? The question is
> explained in this stack overflow post: Stitch together images with
> exactly matching (pixel to pixel) overlaps

Yes, could work. Since the images don't have any perspective distortion
this is the same situation like for scanned images are a long mural shot
from different viewpoints. This is called orthographic projection. You
would need to choose a very long focal length to simulate orthographic
projection and set control points on identical features between images.
Overlap should be more than only a few pixels for this to work.

Please note that current GUIs have extended old original panotools to
allow the direct use of multi-viewpoint images. In Hugin this is called
Mosaic Mode, in PTGui Viewpoint Correction.

See: https://wiki.panotools.org/Stitching_a_photo-mosaic or
https://www.ptgui.com/support.html#6_5


--
Erik Krause
http://www.erik-krause.de
Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

keith
In reply to this post by Nils Holmberg
Thanks for the links Eric, a useful reminder.


Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

Nils Holmberg
In reply to this post by Erik Krause
Hi again, thank you for relevant info, and apologies for late reply. I get the point that panotools was not originally designed for the simpler mosaic use case. Unfortunately, my application environment does not provide the PTGUI to perform these settings:
- Go to the Lens Settings tab and set the Lens type to Rectilinear. Set the Focal Length to a high value (e.g. 1000mm).
- In the Control Points menu choose 'Generate Control Points'
- Go to the Optimizer tab. Deselect the 'Optimize lens focal length' checkbox. At 'Minimize lens distortion', choose 'Heavy'.
So using the bash commands from the wiki (https://wiki.panotools.org/Panorama_scripting_in_a_nutshell#Example_work_flow_similar_to_assistant_in_Hugin_GUI), would it be possible for you to indicate where and how the commands would need to modified to reflect the PTGUI settings above?

# install dependencies#sudo apt install hugin-tools enblend
# convert screen recording to framesffmpeg -i vid/fb.mp4 -vf fps=2 img/frame-%04d.png
# rotate images for panorama row
mogrify -rotate -90 img/frame-00*
# hugin project, page 7 in tmp/moz.pdf
pto_gen -o tmp/project.pto img/*.png
# find control points
cpfind -o tmp/project.pto tmp/project.pto
# clean control points
cpclean -o tmp/project.pto tmp/project.pto
# find vertical lines
linefind -o tmp/project.pto tmp/project.pto
# position, photometric optimization
autooptimiser -a -m -l -s -o tmp/project.pto tmp/project.pto
# calculate optimal crop, size
pano_modify --canvas=AUTO --crop=AUTO -o tmp/project.pto tmp/project.pto
# create output
hugin_executor --stitching --prefix=fb- tmp/project.pto
# remap, render images
nona -m TIFF_m -o tmp/fb- tmp/project.pto
# blend remapped images
enblend -o img/project.tif tmp/fb-00*.tif
# remove overlapping images
rm tmp/fb-0000.tif
enblend -o img/project.tif tmp/fb-00*.tif
# no working result
Best wishesNils


[hidden email]
 

    On Wednesday, April 1, 2020, 10:27:15 AM GMT+2, Erik Krause [hidden email] [PanoToolsNG] <[hidden email]> wrote:  
 
    
Am 01.04.2020 um 08:06 schrieb Nils Holmberg:

> Hi, I'm wondering if panotools can be used to stitch multiple images
> with overlapping identical pixels, e.g. screenshots? The question is
> explained in this stack overflow post: Stitch together images with
> exactly matching (pixel to pixel) overlaps

Yes, could work. Since the images don't have any perspective distortion
this is the same situation like for scanned images are a long mural shot
from different viewpoints. This is called orthographic projection. You
would need to choose a very long focal length to simulate orthographic
projection and set control points on identical features between images.
Overlap should be more than only a few pixels for this to work.

Please note that current GUIs have extended old original panotools to
allow the direct use of multi-viewpoint images. In Hugin this is called
Mosaic Mode, in PTGui Viewpoint Correction.

See: https://wiki.panotools.org/Stitching_a_photo-mosaic or
https://www.ptgui.com/support.html#6_5

--
Erik Krause
http://www.erik-krause.de

  #yiv9460662179 #yiv9460662179 -- #yiv9460662179ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv9460662179 #yiv9460662179ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv9460662179 #yiv9460662179ygrp-mkp #yiv9460662179hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv9460662179 #yiv9460662179ygrp-mkp #yiv9460662179ads {margin-bottom:10px;}#yiv9460662179 #yiv9460662179ygrp-mkp .yiv9460662179ad {padding:0 0;}#yiv9460662179 #yiv9460662179ygrp-mkp .yiv9460662179ad p {margin:0;}#yiv9460662179 #yiv9460662179ygrp-mkp .yiv9460662179ad a {color:#0000ff;text-decoration:none;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ygrp-lc {font-family:Arial;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ygrp-lc #yiv9460662179hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ygrp-lc .yiv9460662179ad {margin-bottom:10px;padding:0 0;}#yiv9460662179 #yiv9460662179actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv9460662179 #yiv9460662179activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv9460662179 #yiv9460662179activity span {font-weight:700;}#yiv9460662179 #yiv9460662179activity span:first-child {text-transform:uppercase;}#yiv9460662179 #yiv9460662179activity span a {color:#5085b6;text-decoration:none;}#yiv9460662179 #yiv9460662179activity span span {color:#ff7900;}#yiv9460662179 #yiv9460662179activity span .yiv9460662179underline {text-decoration:underline;}#yiv9460662179 .yiv9460662179attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv9460662179 .yiv9460662179attach div a {text-decoration:none;}#yiv9460662179 .yiv9460662179attach img {border:none;padding-right:5px;}#yiv9460662179 .yiv9460662179attach label {display:block;margin-bottom:5px;}#yiv9460662179 .yiv9460662179attach label a {text-decoration:none;}#yiv9460662179 blockquote {margin:0 0 0 4px;}#yiv9460662179 .yiv9460662179bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv9460662179 .yiv9460662179bold a {text-decoration:none;}#yiv9460662179 dd.yiv9460662179last p a {font-family:Verdana;font-weight:700;}#yiv9460662179 dd.yiv9460662179last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv9460662179 dd.yiv9460662179last p span.yiv9460662179yshortcuts {margin-right:0;}#yiv9460662179 div.yiv9460662179attach-table div div a {text-decoration:none;}#yiv9460662179 div.yiv9460662179attach-table {width:400px;}#yiv9460662179 div.yiv9460662179file-title a, #yiv9460662179 div.yiv9460662179file-title a:active, #yiv9460662179 div.yiv9460662179file-title a:hover, #yiv9460662179 div.yiv9460662179file-title a:visited {text-decoration:none;}#yiv9460662179 div.yiv9460662179photo-title a, #yiv9460662179 div.yiv9460662179photo-title a:active, #yiv9460662179 div.yiv9460662179photo-title a:hover, #yiv9460662179 div.yiv9460662179photo-title a:visited {text-decoration:none;}#yiv9460662179 div#yiv9460662179ygrp-mlmsg #yiv9460662179ygrp-msg p a span.yiv9460662179yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv9460662179 .yiv9460662179green {color:#628c2a;}#yiv9460662179 .yiv9460662179MsoNormal {margin:0 0 0 0;}#yiv9460662179 o {font-size:0;}#yiv9460662179 #yiv9460662179photos div {float:left;width:72px;}#yiv9460662179 #yiv9460662179photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv9460662179 #yiv9460662179photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv9460662179 #yiv9460662179reco-category {font-size:77%;}#yiv9460662179 #yiv9460662179reco-desc {font-size:77%;}#yiv9460662179 .yiv9460662179replbq {margin:4px;}#yiv9460662179 #yiv9460662179ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv9460662179 #yiv9460662179ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv9460662179 #yiv9460662179ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv9460662179 #yiv9460662179ygrp-mlmsg select, #yiv9460662179 input, #yiv9460662179 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv9460662179 #yiv9460662179ygrp-mlmsg pre, #yiv9460662179 code {font:115% monospace;}#yiv9460662179 #yiv9460662179ygrp-mlmsg * {line-height:1.22em;}#yiv9460662179 #yiv9460662179ygrp-mlmsg #yiv9460662179logo {padding-bottom:10px;}#yiv9460662179 #yiv9460662179ygrp-msg p a {font-family:Verdana;}#yiv9460662179 #yiv9460662179ygrp-msg p#yiv9460662179attach-count span {color:#1E66AE;font-weight:700;}#yiv9460662179 #yiv9460662179ygrp-reco #yiv9460662179reco-head {color:#ff7900;font-weight:700;}#yiv9460662179 #yiv9460662179ygrp-reco {margin-bottom:20px;padding:0px;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ov li a {font-size:130%;text-decoration:none;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv9460662179 #yiv9460662179ygrp-sponsor #yiv9460662179ov ul {margin:0;padding:0 0 0 8px;}#yiv9460662179 #yiv9460662179ygrp-text {font-family:Georgia;}#yiv9460662179 #yiv9460662179ygrp-text p {margin:0 0 1em 0;}#yiv9460662179 #yiv9460662179ygrp-text tt {font-size:120%;}#yiv9460662179 #yiv9460662179ygrp-vital ul li:last-child {border-right:none !important;}#yiv9460662179  
Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

Erik Krause
Administrator
Am 21.04.2020 um 13:55 schrieb Nils Holmberg:
> So using the bash commands from the wiki
> (https://wiki.panotools.org/Panorama_scripting_in_a_nutshell#Example_work_flow_similar_to_assistant_in_Hugin_GUI),
> would it be possible for you to indicate where and how the commands
> would need to modified to reflect the PTGUI settings above?

Better to use the GUI instead. Here is a tutorial:
http://hugin.sourceforge.net/tutorials/scans/en.shtml

--
Erik Krause


------------------------------------

------------------------------------

--
<*> Wiki: http://wiki.panotools.org
<*> User Guidelines: http://wiki.panotools.org/User_Guidelines
<*> Nabble (Web) http://panotoolsng.586017.n4.nabble.com/
<*> NG Member Map http://www.panomaps.com/ng
<*> Moderators/List Admins: [hidden email]

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/PanoToolsNG/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/PanoToolsNG/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

Nils Holmberg
Thanks a lot for your help. I need a stitching process that can be automated and scaled up. Can the hugin GUI be scripted or can it output settings as command line code?

Best wishesNils


[hidden email]
 

    On Tuesday, April 21, 2020, 4:15:12 PM GMT+2, Erik Krause [hidden email] [PanoToolsNG] <[hidden email]> wrote:  
 
 Am 21.04.2020 um 13:55 schrieb Nils Holmberg:
> So using the bash commands from the wiki
> (https://wiki.panotools.org/Panorama_scripting_in_a_nutshell#Example_work_flow_similar_to_assistant_in_Hugin_GUI),
> would it be possible for you to indicate where and how the commands
> would need to modified to reflect the PTGUI settings above?

Better to use the GUI instead. Here is a tutorial:
http://hugin.sourceforge.net/tutorials/scans/en.shtml

--
Erik Krause


------------------------------------

------------------------------------

--
------------------------------------

Yahoo Groups Links



 
Reply | Threaded
Open this post in threaded view
|

Re: stitch overlapping screenshots

Erik Krause
Administrator
Am 22.04.2020 um 09:15 schrieb Nils Holmberg:
> Thanks a lot for your help. I need a stitching process that can be
> automated and scaled up. Can the hugin GUI be scripted or can it
> output settings as command line code?

See https://wiki.panotools.org/Panorama_scripting_in_a_nutshell

--
Erik Krause
http://www.erik-krause.de