-
Notifications
You must be signed in to change notification settings - Fork 0
/
linear_panorama.html
496 lines (423 loc) · 16.8 KB
/
linear_panorama.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<!DOCTYPE html>
<html lang="en">
<head>
<!-- 2022-07-23 Sat 05:11 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Linear Panorama</title>
<meta name="generator" content="Org mode">
<meta name="author" content="ivanaf">
<link rel="stylesheet" type="text/css" href="css/org.css"/>
<link rel="icon" href="ico/favicon.ico" type="image/x- icon">
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="content">
<div class="head">
<div class="title">
<p>
<a href="index.html">Ivanaf</a>
</p>
</div>
<menu>
<ul class="org-ul">
<li><a href="index.html">Home</a></li>
<li><a href="journal.html">Journal</a></li>
<li><a href="about.html">About</a></li>
<li><a href="resume.html">Resume</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="projects_ideas.html">Messy Ideas</a></li>
</ul>
</menu>
</div>
<p>
</p><h1>
Linear Panorama
</h1><p>
</p>
<p>
<span class=page-date> <small>
2015-12-13, updated 2020-07-26 — <a href='journal.html#projects' class='projects tagbutton'>projects</a> <a href='journal.html#photography' class='photography tagbutton'>photography</a> <a href='journal.html#tech' class='tech tagbutton'>tech</a> <a href='journal.html#blog' class='blog tagbutton'>blog</a>   <a href="led_panel.html">⇦Led Panel</a> – <a href="hello_world.html">Hello world!⇨</a>
</small> </span>
</p>
<nav id="table-of-contents">
<input id="toggle-toc" style="display: none; visibility: hidden;" type="checkbox">
<label for="toggle-toc">
<h2> <b> Table of Contents </b> </h2>
</label>
<div id="text-table-of-contents">
<ul>
<li><a href="#summary-photographing-linear-panoramas-of-murals-in-a-place-with-poor-light-conditions-and-short-distance-to-the-wall.">1. Summary:</a></li>
<li><a href="#intro">2. Intro</a></li>
<li><a href="#hardware">3. Hardware</a></li>
<li><a href="#software">4. Software</a></li>
<li><a href="#work-flow">5. Work Flow</a>
<ul>
<li><a href="#calibrate-the-lens.">5.1. Calibrate the Lens.</a></li>
<li><a href="#taking-the-pictures.">5.2. Taking the pictures.</a></li>
<li><a href="#fusing_the_images">5.3. Fusing the images</a></li>
<li><a href="#straightening-the-images.">5.4. Straightening the images.</a></li>
<li><a href="#taking-the-other-pictures">5.5. Taking the other pictures</a></li>
<li><a href="#stitching">5.6. Stitching</a></li>
<li><a href="#adding-masks">5.7. Adding masks</a></li>
<li><a href="#stitching-1">5.8. Stitching</a></li>
<li><a href="#common-problems">5.9. Common Problems</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div id="outline-container-summary" class="outline-2">
<h2 id="summary-photographing-linear-panoramas-of-murals-in-a-place-with-poor-light-conditions-and-short-distance-to-the-wall."><span class="section-number-2">1</span> Summary:</h2>
<div class="outline-text-2" id="text-summary-photographing-linear-panoramas-of-murals-in-a-place-with-poor-light-conditions-and-short-distance-to-the-wall.">
<p>
Photographing linear panoramas of murals, in a place with poor light conditions, and short distance to the wall.
</p>
</div>
</div>
<div id="outline-container-intro" class="outline-2">
<h2 id="intro"><span class="section-number-2">2</span> Intro</h2>
<div class="outline-text-2" id="text-intro">
<p>
Photographing the murals in my dorm is a really challenging task. The
distance between the walls in the corridor is between 1.5m to 1.7m and
the height of the murals is approximately 2m.
</p>
<p>
Besides this, I don't have any special device to illuminate the walls,
besides a simple octopus floor lamp with yellowish incandescent lights.
</p>
<p>
Given these constrains I photographed the murals, and made the following
linear panoramas (click for full size)
<a href="http://slugwiki.mit.edu/images/5/5e/BS.jpg"><img src="http://slugwiki.mit.edu/images/thumb/5/5e/BS.jpg/798px-BS.jpg" alt="798px-BS.jpg"></a>
</p>
<figure>
<a href="http://slugwiki.mit.edu/images/5/5b/BC.jpg"><img src="http://slugwiki.mit.edu/images/thumb/5/5b/BC.jpg/800px-BC.jpg" alt="800px-BC.jpg"></a>
</figure>
</div>
</div>
<div id="outline-container-hardware" class="outline-2">
<h2 id="hardware"><span class="section-number-2">3</span> Hardware</h2>
<div class="outline-text-2" id="text-hardware">
<ul class="org-ul">
<li>Canon T2i with <a href="http://www.magiclantern.fm/"><i>Magic Lantern</i></a>
installed</li>
<li>Opteka 6.5mm (Also known as Samyang 8mm, it is the same lens sold by
a different company)</li>
<li>Octopus floor lamp (any floor lamp would work)</li>
<li>Tripod (set to around 1m)</li>
</ul>
</div>
</div>
<div id="outline-container-software" class="outline-2">
<h2 id="software"><span class="section-number-2">4</span> Software</h2>
<div class="outline-text-2" id="text-software">
<ul class="org-ul">
<li>Enfuse</li>
<li>Macrofusion</li>
<li>Hugin</li>
</ul>
</div>
</div>
<div id="outline-container-work_flow" class="outline-2">
<h2 id="work-flow"><span class="section-number-2">5</span> Work Flow</h2>
<div class="outline-text-2" id="text-work-flow">
</div>
<div id="outline-container-calibrate_the_lens" class="outline-3">
<h3 id="calibrate-the-lens."><span class="section-number-3">5.1</span> Calibrate the Lens.</h3>
<div class="outline-text-3" id="text-calibrate-the-lens.">
<p>
If your lens are not calibrated, this should be the first step, if not,
skip this session. At first, take a picture of a mural in a way that
there are many clear straight lines in the image. Load the image in
Hugin. The follow the
<a href="http://hugin.sourceforge.net/tutorials/calibration/en.shtml"><i>instruction on Hugin to calibrate your lens</i></a>. Instead of using a diagonal line,
which might be hard to find, you can use multiple horizontal and
vertical lines. However, do not choose horizontal line on the options.
</p>
<p>
If you are using a non standard lens, such as the Samyang 8mm, it is
sometimes better to calibrate the lens for the approximate distance that
you are gonna take the pictures from.
</p>
</div>
</div>
<div id="outline-container-taking_the_pictures" class="outline-3">
<h3 id="taking-the-pictures."><span class="section-number-3">5.2</span> Taking the pictures.</h3>
<div class="outline-text-3" id="text-taking-the-pictures.">
<p>
Set your tripod to be about half of the right of the wall your are
photographing (in case it is very near you). If it is farther, or you
are not using fish-eye lens this won't affect you much.
</p>
<p>
Set your camera to fully manual mode, set the ISO to the lowest setting
(in order to minimize noise), set the focus to manual mode, and also set
the white balance to manual mode. It doesn't matter what setting you
choose for the white balance.
</p>
<p>
Take multiple pictures, moving the position of the lights between each
picture, but do not move the camera. This will assure you that you have
the whole scene well illuminated. Besides this, by having your light
coming from multiple directions, the end result will have even light,
which considerably improves the quality of the image (It makes it look
like a scanner)
</p>
<p>
In order to not move the camera, you should use a shutter cable, or
using the <a href="http://wiki.magiclantern.fm/userguide"><i>LCDsensor Remote</i></a>
shoot on shooting preferences of Magic Lantern, if you use a canon dlsr.
</p>
<figure>
<a href="./jpg/mural_1.jpg"><img src="./jpg/mural_1.jpg" alt="mural_1.jpg"></a>
</figure>
<figure>
<a href="./jpg/mural_2.jpg"><img src="./jpg/mural_2.jpg" alt="mural_2.jpg"></a>
</figure>
<figure>
<a href="./jpg/mural_3.jpg"><img src="./jpg/mural_3.jpg" alt="mural_3.jpg"></a>
</figure>
</div>
</div>
<div id="outline-container-fusing_the_images" class="outline-3">
<h3 id="fusing_the_images"><span class="section-number-3">5.3</span> Fusing the images</h3>
<div class="outline-text-3" id="text-5-3">
<p>
:CUSTOM_ID: fusing-the-images
</p>
<p>
To fuse the images, you should use
<a href="http://wiki.panotools.org/Enfuse">Enfuse</a>. Enfuse is a command line
tool for exposure fusing (it can also )
</p>
<p>
In order to better enfuse the pictures I recommend
<a href="http://sourceforge.net/projects/macrofusion/"><i>Macrofusion</i></a>.
Macrofusion is a fast, simple and responsive GUI for Enfuse. Macrofusion
makes it easy to choose the weights of exposure, contrast and saturation
when fusing the images.
</p>
<figure>
<a href="./jpg/mural_enfused.jpg"><img src="./jpg/mural_enfused.jpg" alt="mural_enfused.jpg"></a>
<figcaption><span class="figure-number">Figure 5: </span>Mural enfused </figcaption>
</figure>
</div>
</div>
<div id="outline-container-straightening_the_images" class="outline-3">
<h3 id="straightening-the-images."><span class="section-number-3">5.4</span> Straightening the images.</h3>
<div class="outline-text-3" id="text-straightening-the-images.">
<p>
Open the image in Hugin, and load the lens configuration for your lens.
</p>
<p>
Choose a rectilinear projection in Hugin's fast preview window.
</p>
<figure>
<a href="./png/hugin_options.png"><img src="./png/hugin_options.png" alt="hugin_options.png"></a>
</figure>
<p>
This should have straightened up the image. But there should still be
perspective problems. Set the horizon and vertical lines in the control
points tab and optimize the lens parameters. A full tutorial can be seen
on
<a href="http://hugin.sourceforge.net/tutorials/perspective/en.shtml"><i>Hugin's
SourceForge page</i></a>
</p>
<p>
Most of the times, Hugin white balance correction in the preview window
is enough to fix the image colors. And you just need to stitch the
image.
</p>
<figure>
<a href="./jpg/mural_final.jpg"><img src="./jpg/mural_final.jpg" alt="mural_final.jpg"></a>
<figcaption><span class="figure-number">Figure 7: </span>Mural final </figcaption>
</figure>
</div>
</div>
<div id="outline-container-taking_the_other_pictures" class="outline-3">
<h3 id="taking-the-other-pictures"><span class="section-number-3">5.5</span> Taking the other pictures</h3>
<div class="outline-text-3" id="text-taking-the-other-pictures">
<p>
Move the camera to a new position and leave some overlap between the
images. It doesn't matter how much overlap you are leaving between the
images, in general, what matters is that the images overlap in a line
that can contain small errors.
</p>
</div>
</div>
<div id="outline-container-stitching" class="outline-3">
<h3 id="stitching"><span class="section-number-3">5.6</span> Stitching</h3>
<div class="outline-text-3" id="text-stitching">
<p>
The images of the linear panorama should be added one at a time,
therefore, you should start with a image that would be in the middle and
then move to the corners. Since this is a tutorial I will stitch only 2
images.
</p>
<figure>
<a href="./jpg/mural2_final.jpg"><img src="./jpg/mural2_final.jpg" alt="mural2_final.jpg"></a>
<figcaption><span class="figure-number">Figure 8: </span>Second Mural </figcaption>
</figure>
<p>
Load both of the images in Hugin, choosing the type of lens to be
rectilinear and choose some small value for the focal length, such as
10mm.
</p>
<p>
Set the control points between the images (you can also add lines) and
choose custom parameters for the geometric optimization. You should
probably set them by hand.
</p>
<figure>
<a href="./png/hugin_options2.png"><img src="./png/hugin_options2.png" alt="hugin_options2.png"></a>
<figcaption><span class="figure-number">Figure 9: </span>Hugin Rectilinear </figcaption>
</figure>
<p>
All but one picture parameters should be constant, because we are always
adding one image at a time. For the picture that you are optimizing, you
should optimize X, Y and HFOV. Since the pictures are already straight,
you shouldn't need to optimize roll.
</p>
<p>
If this optimization is not enough, you can optimize for other
parameters, but it is usually not necessary.
</p>
<p>
If there are areas between the images that don't match very well in
their intersection, it is generally better to add a mas in order to use
the result from a single image.
</p>
<p>
Choose custom parameters for photometric optimization. Again, always
change only one image at a time. The parameters that you should optimize
are EV, Er and Eb. Optimizing the lens parameters usually result in poor
blending for linear panoramas.
</p>
</div>
</div>
<div id="outline-container-adding_masks" class="outline-3">
<h3 id="adding-masks"><span class="section-number-3">5.7</span> Adding masks</h3>
<div class="outline-text-3" id="text-adding-masks">
<p>
If the images don't perfectly match on top of each other, you have 2
options:
</p>
<ul class="org-ul">
<li>Try to optimize other lens parameters</li>
<li>Add masks to include certain parts of an image or remove it from
others.</li>
</ul>
<p>
Generally adding masks is faster and results in fewer problems.
</p>
<p>
You should also use masks to force Hugin to choose the image that has
the best resolution for areas where the details are important.
</p>
</div>
</div>
<div id="outline-container-stitching.1" class="outline-3">
<h3 id="stitching-1"><span class="section-number-3">5.8</span> Stitching</h3>
<div class="outline-text-3" id="text-stitching-1">
<p>
After you've added all the images it is time to stitch. If you are
stitching to JPG, you should keep the canvas size's dimensions below
2<sup>32</sup>-1.
</p>
<p>
Choose exposure fused from any arrangement, click in calculate optimal
size if you simply want the largest resolution possible, and stitch!
</p>
<p>
<a href="./jpg/mural_stitched.jpg"><img src="./jpg/mural_stitched640x640.jpg" alt="mural_stitched640x640.jpg"></a>
<small>
Mural stitched using only 2 control points</small>
</p>
<p>
Congratulations! You've finished your linear panorama.
</p>
</div>
</div>
<div id="outline-container-common_problems" class="outline-3">
<h3 id="common-problems"><span class="section-number-3">5.9</span> Common Problems</h3>
<div class="outline-text-3" id="text-common-problems">
<p>
The horizon might start to bend. In order to fix this, create a horizon
line accross pictures, by adding control points for the horizon line
across different images.
</p>
</div></div>
<br>
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'ivanaf'; // Required - Replace '<example>' with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
var showComments = function() {
var button = document.getElementById('comment-button')
button.style.display = 'none'
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
};
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<button id="comment-button" onclick="showComments()">Show comments</button>
</div>
<div><div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Ivan Tadeu Ferreira Antunes Filho</p>
<p class="date">Date: 2022-07-23 Sat 05:11</p>
<p class="author">Github: <a href="https://github.com/itf/">github.com/itf</a></p>
<p class="creator">Made with <a href="https://www.gnu.org/software/emacs/">Emacs</a> 27.1 (<a href="https://orgmode.org">Org</a> mode 9.3) and <a href="https://github.com/itf/org-export-head">Org export head</a> </p>
</div>
</body>
</html>