@@ -47,27 +47,27 @@ <h2>Naive Search</h2>
4747< br >
4848Define < i > W</ i > and < i > H</ i > to be the width and height of the full image, and assume, for approximations, that each plate takes up exactly a third of the full image. Considering only the top/blue plate, we can start by setting the upper limit for the top edge to be < i > (0 + H/3) / 2 = H/6</ i > , and the bottom edge to be < i > (2H / 3 + H) / 2 = 5H / 6</ i > . This means the top edge should be at least shifted down by < i > H/6 - 0 = H/6</ i > , and the bottom edge by < i > 5H / 6 - H/3 = H/2</ i > . Therefore, a good place to start is a displacement of < i > (0, (H/6 + H/2) / 2) = (0, H/3)</ i > with a search range of [< i > -H/6</ i > , < i > H/6</ i > ]. For the bottom/red plate, the equivalent displacement is just < i > (0, -H/3)</ i > with the same search range. Any shifts that bring the crop outside the original image will be ignored.< br >
4949< br >
50- Using a starting crop of {< i > (W/16, H/16), (W - W/16, H/3 - H/16)</ i > } for the blue plate and {< i > (W/16, 2H / 3 + H/16), (W - W/16, H - H/16)</ i > } for the red plate, where the tuples are the upper left and lower right corner pixels in (< i > x</ i > , < i > y</ i > ) coordinates, we can obtain the following best shifts (B, R) :
50+ Using a starting crop of {< i > (W/16, H/16), R (W - W/16, H/3 - H/16)</ i > } for the blue plate and {< i > (W/16, 2H / 3 + H/16), R (W - W/16, H - H/16)</ i > } for the red plate, where the tuples are the upper left and lower right corner pixels in (< i > x</ i > , < i > y</ i > ) coordinates, we can obtain the following best shifts:
5151</ p >
5252
5353< div style ="display:flex; flex-wrap:wrap; justify-content:center; text-align:center; ">
5454
5555< figure style ="flex: 1 0 20%; margin:12px; ">
5656< figcaption style ="margin-bottom:6px; "> cathedralNaive.jpg</ figcaption >
5757< img src ="images/cathedralNaive.jpg " alt ="cathedralNaive.jpg " width ="50% ">
58- < figcaption style ="margin-bottom:6px; "> Best shift: (-2, 336), (1, -334)< br > 5.070914s</ figcaption >
58+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-2, 336), R (1, -334)< br > 5.070914s</ figcaption >
5959</ figure >
6060
6161< figure style ="flex: 1 0 20%; margin:12px; ">
6262< figcaption style ="margin-bottom:6px; "> monasteryNaive.jpg</ figcaption >
6363< img src ="images/monasteryNaive.jpg " alt ="monasteryNaive.jpg " width ="50% ">
64- < figcaption style ="margin-bottom:6px; "> Best shift: (-2, 344), (1, -335)< br > 5.107604s</ figcaption >
64+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-2, 344), R (1, -335)< br > 5.107604s</ figcaption >
6565</ figure >
6666
6767< figure style ="flex: 1 0 20%; margin:12px; ">
6868< figcaption style ="margin-bottom:6px; "> tobolskNaive.jpg</ figcaption >
6969< img src ="images/tobolskNaive.jpg " alt ="tobolskNaive.jpg " width ="50% ">
70- < figcaption style ="margin-bottom:6px; "> Best shift: (-3, 338), (1, -337)< br > 5.857907s</ figcaption >
70+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-3, 338), R (1, -337)< br > 5.857907s</ figcaption >
7171</ figure >
7272
7373</ div >
@@ -95,97 +95,97 @@ <h2>Image Pyramid</h2>
9595< figure style ="flex: 1 0 20%; margin:12px; ">
9696< figcaption style ="margin-bottom:6px; "> cathedral.jpg</ figcaption >
9797< img src ="images/cathedral.jpg " alt ="cathedral.jpg " width ="50% ">
98- < figcaption style ="margin-bottom:6px; "> Best shift: (-2, 336), (1, -334)< br > 0.033945s</ figcaption >
98+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-2, 336), R (1, -334)< br > 0.033945s</ figcaption >
9999</ figure >
100100
101101< figure style ="flex: 1 0 20%; margin:12px; ">
102102< figcaption style ="margin-bottom:6px; "> church.tif</ figcaption >
103103< img src ="images/church.jpg " alt ="church.jpg " width ="50% ">
104- < figcaption style ="margin-bottom:6px; "> Best shift: (-4, 3177), (-8, -3169)< br > 3.423309s</ figcaption >
104+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-4, 3177), R (-8, -3169)< br > 3.423309s</ figcaption >
105105</ figure >
106106
107107< figure style ="flex: 1 0 20%; margin:12px; ">
108108< figcaption style ="margin-bottom:6px; "> emir.tif</ figcaption >
109109< img src ="images/emir.jpg " alt ="emir.jpg " width ="50% ">
110- < figcaption style ="margin-bottom:6px; "> Best shift: (-24, 3160), (17, -3152)< br > 3.36728s</ figcaption >
110+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-24, 3160), R (17, -3152)< br > 3.36728s</ figcaption >
111111</ figure >
112112
113113< figure style ="flex: 1 0 20%; margin:12px; ">
114114< figcaption style ="margin-bottom:6px; "> harvesters.tif</ figcaption >
115115< img src ="images/harvesters.jpg " alt ="harvesters.jpg " width ="50% ">
116- < figcaption style ="margin-bottom:6px; "> Best shift: (-17, 3159), (-3, -3153)< br > 3.393377s</ figcaption >
116+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-17, 3159), R (-3, -3153)< br > 3.393377s</ figcaption >
117117</ figure >
118118
119119< figure style ="flex: 1 0 20%; margin:12px; ">
120120< figcaption style ="margin-bottom:6px; "> icon.tif</ figcaption >
121121< img src ="images/icon.jpg " alt ="icon.jpg " width ="50% ">
122- < figcaption style ="margin-bottom:6px; "> Best shift: (-17, 3204), (5, -3196)< br > 3.401831s</ figcaption >
122+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-17, 3204), R (5, -3196)< br > 3.401831s</ figcaption >
123123</ figure >
124124
125125< figure style ="flex: 1 0 20%; margin:12px; ">
126126< figcaption style ="margin-bottom:6px; "> italil.tif</ figcaption >
127127< img src ="images/italil.jpg " alt ="italil.jpg " width ="50% ">
128- < figcaption style ="margin-bottom:6px; "> Best shift: (-21, 3193), (15, -3192)< br > 3.3279s</ figcaption >
128+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-21, 3193), R (15, -3192)< br > 3.3279s</ figcaption >
129129</ figure >
130130
131131< figure style ="flex: 1 0 20%; margin:12px; ">
132132< figcaption style ="margin-bottom:6px; "> lastochikino.tif</ figcaption >
133133< img src ="images/lastochikino.jpg " alt ="lastochikino.jpg " width ="50% ">
134- < figcaption style ="margin-bottom:6px; "> Best shift: (2, 3244), (-7, -3163)< br > 3.270373s</ figcaption >
134+ < figcaption style ="margin-bottom:6px; "> Best shift: B (2, 3244), R (-7, -3163)< br > 3.270373s</ figcaption >
135135</ figure >
136136
137137< figure style ="flex: 1 0 20%; margin:12px; ">
138138< figcaption style ="margin-bottom:6px; "> lugano.tif</ figcaption >
139139< img src ="images/lugano.jpg " alt ="lugano.jpg " width ="50% ">
140- < figcaption style ="margin-bottom:6px; "> Best shift: (16, 3203), (-13, -3192)< br > 3.317115s</ figcaption >
140+ < figcaption style ="margin-bottom:6px; "> Best shift: B (16, 3203), R (-13, -3192)< br > 3.317115s</ figcaption >
141141</ figure >
142142
143143< figure style ="flex: 1 0 20%; margin:12px; ">
144144< figcaption style ="margin-bottom:6px; "> melons.tif</ figcaption >
145145< img src ="images/melons.jpg " alt ="melons.jpg " width ="50% ">
146- < figcaption style ="margin-bottom:6px; "> Best shift: (-11, 3159), (3, -3145)< br > 3.387267s</ figcaption >
146+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-11, 3159), R (3, -3145)< br > 3.387267s</ figcaption >
147147</ figure >
148148
149149< figure style ="flex: 1 0 20%; margin:12px; ">
150150< figcaption style ="margin-bottom:6px; "> monastery.jpg</ figcaption >
151151< img src ="images/monastery.jpg " alt ="monastery.jpg " width ="50% ">
152- < figcaption style ="margin-bottom:6px; "> Best shift: (-2, 344), (1, -335)< br > 0.032784s</ figcaption >
152+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-2, 344), R (1, -335)< br > 0.032784s</ figcaption >
153153</ figure >
154154
155155< figure style ="flex: 1 0 20%; margin:12px; ">
156156< figcaption style ="margin-bottom:6px; "> self_portrait.tif</ figcaption >
157157< img src ="images/self_portrait.jpg " alt ="self_portrait.jpg " width ="50% ">
158- < figcaption style ="margin-bottom:6px; "> Best shift: (-29, 3172), (8, -3153)< br > 3.446271s</ figcaption >
158+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-29, 3172), R (8, -3153)< br > 3.446271s</ figcaption >
159159</ figure >
160160
161161< figure style ="flex: 1 0 20%; margin:12px; ">
162162< figcaption style ="margin-bottom:6px; "> siren.tif</ figcaption >
163163< img src ="images/siren.jpg " alt ="siren.jpg " width ="50% ">
164- < figcaption style ="margin-bottom:6px; "> Best shift: (6, 3201), (-18, -3203)< br > 3.37681s</ figcaption >
164+ < figcaption style ="margin-bottom:6px; "> Best shift: B (6, 3201), R (-18, -3203)< br > 3.37681s</ figcaption >
165165</ figure >
166166
167167< figure style ="flex: 1 0 20%; margin:12px; ">
168168< figcaption style ="margin-bottom:6px; "> three_generations.tif</ figcaption >
169169< img src ="images/three_generations.jpg " alt ="three_generations.jpg " width ="50% ">
170- < figcaption style ="margin-bottom:6px; "> Best shift: (-14, 3157), (-3, -3150)< br > 3.285443s</ figcaption >
170+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-14, 3157), R (-3, -3150)< br > 3.285443s</ figcaption >
171171</ figure >
172172
173173< figure style ="flex: 1 0 20%; margin:12px; ">
174174< figcaption style ="margin-bottom:6px; "> tobolsk.jpg</ figcaption >
175175< img src ="images/tobolsk.jpg " alt ="tobolsk.jpg " width ="50% ">
176- < figcaption style ="margin-bottom:6px; "> Best shift: (-3, 338), (1, -337)< br > 0.031668s</ figcaption >
176+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-3, 338), R (1, -337)< br > 0.031668s</ figcaption >
177177</ figure >
178178
179179< figure style ="flex: 1 0 20%; margin:12px; ">
180180< figcaption style ="margin-bottom:6px; "> < a href ="https://www.loc.gov/item/2018681257 "> canal.tif</ a > </ figcaption >
181181< img src ="images/canal.jpg " alt ="canal.jpg " width ="50% ">
182- < figcaption style ="margin-bottom:6px; "> Best shift: (-18, 3156), (6, -3147)< br > 3.386601s</ figcaption >
182+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-18, 3156), R (6, -3147)< br > 3.386601s</ figcaption >
183183</ figure >
184184
185185< figure style ="flex: 1 0 20%; margin:12px; ">
186186< figcaption style ="margin-bottom:6px; "> < a href ="https://www.loc.gov/item/2018679143 "> capri.tif</ a > </ figcaption >
187187< img src ="images/capri.jpg " alt ="capri.jpg " width ="50% ">
188- < figcaption style ="margin-bottom:6px; "> Best shift: (16, 3206), (-8, -3192)< br > 3.325347s</ figcaption >
188+ < figcaption style ="margin-bottom:6px; "> Best shift: B (16, 3206), R (-8, -3192)< br > 3.325347s</ figcaption >
189189</ figure >
190190
191191</ div >
@@ -263,26 +263,26 @@ <h2>Cropping with Sobel</h2>
263263< figure style ="flex: 1 0 20%; margin:12px; ">
264264< figcaption style ="margin-bottom:6px; "> cathedral.jpg</ figcaption >
265265< img src ="images/cathedralCrop.jpg " alt ="cathedralCrop.jpg " width ="50% ">
266- < figcaption style ="margin-bottom:6px; "> Best shift: (-2, 336), (1, -334)
266+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-2, 336), R (1, -334)
267267< br > 0.054221s</ figcaption >
268268</ figure >
269269
270270< figure style ="flex: 1 0 20%; margin:12px; ">
271271< figcaption style ="margin-bottom:6px; "> church.tif</ figcaption >
272272< img src ="images/churchCrop.jpg " alt ="churchCrop.jpg " width ="50% ">
273- < figcaption style ="margin-bottom:6px; "> Best shift: (-4, 3177), (-8, -3169)< br > 6.210625s</ figcaption >
273+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-4, 3177), R (-8, -3169)< br > 6.210625s</ figcaption >
274274</ figure >
275275
276276< figure style ="flex: 1 0 20%; margin:12px; ">
277277< figcaption style ="margin-bottom:6px; "> canal.tif</ figcaption >
278278< img src ="images/canalCrop.jpg " alt ="canalCrop.jpg " width ="50% ">
279- < figcaption style ="margin-bottom:6px; "> Best shift: (-16, 3155), (6, -3147)< br > 6.660678s</ figcaption >
279+ < figcaption style ="margin-bottom:6px; "> Best shift: B (-16, 3155), R (6, -3147)< br > 6.660678s</ figcaption >
280280</ figure >
281281
282282</ div >
283283
284284< p >
285- The title image was computed with a best displacement of (-23, 3159), (17, -3152) in 6.26317s.
285+ The title image was computed with a best shift of B (-23, 3159), R (17, -3152) in 6.26317s.
286286</ p >
287287< hr >
288288
0 commit comments