Skip to content

Commit da2b256

Browse files
authored
Update proj1.html
1 parent 21fb999 commit da2b256

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

project-1/proj1.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ <h2>NCC & Preprocessing</h2>
2727
<img src="images/equation.png" alt="Description of image 2">
2828
</div>
2929
<p>
30-
for 2 vectors <strong>x</strong> and <strong>y</strong>. Since grayscale images are represented by 2d arrays, we can first flatten the 2 images we want to compare, before using them as the input vectors. A caveat of this method is that is both images should have the same size. However, we can approximate the crop dimensions for just the blue and red plates, and find the best displacements with respect to the green plate. The final step would require us to find the intersection of 3 rectangles, which is given by the following formula:
30+
for 2 vectors <strong>x</strong> and <strong>y</strong>. After normalizing each image with the L<sup>2</sup> norm, the dot product will ensure that the score will be the highest when the features of both images are the most similar. Since grayscale images are represented by 2d arrays, we can first flatten the 2 images we want to compare, before using them as the input vectors. A caveat of this method is that is both images should have the same size. However, we can approximate the crop dimensions for just the blue and red plates, and find the best displacements with respect to the green plate. The final step would require us to find the intersection of 3 rectangles, which is illusrated below:
3131
</p>
3232
<div align="center">
3333
<img src="images/proj1.png" alt="Description of image 2">
@@ -37,7 +37,11 @@ <h2>NCC & Preprocessing</h2>
3737
<!-- Section 3 -->
3838
<h2>Naive Search</h2>
3939
<p>
40-
We can improve the NCC step using edge detection technqiues to find the crop of each image. The easiest way is to use the Sobel kernel
40+
To find the best shift, the simplest way is to compute the NCC for every possible shift within the full image. However, not only is this ineffcient, the best shift would also just be (0, 0) for any image, since the crop would just be a copy of the original crop. To solve this issue, we need to limit how much the height can shift when aligning.<br>
41+
<br>
42+
Assume, for approximations, each image takes up exactly a third of the image. Considering only the top/blue plate, we can start by setting 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 + 1) / 2 = 5H / 6</i>. This means the top edge should be at least be 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>. For the bottom/red plate, the equivalent displacement is just <i>(0, -H/3)</i> with the same search range.<br>
43+
<br>
44+
Using a starting crop of <i>(H/16, </i>
4145
</p>
4246
<div align="center">
4347
<img src="image3.jpg" alt="Description of image 3" width="400">

0 commit comments

Comments
 (0)