Project 1
Andrei Aiordachioaie
0) Description
1) Bells and whistles
2) Small images
3) Large images
0) Description
I used Matlab's dirty little function corr2 to compute the best alignment between the three color channels. While I also tested extensively the sum of squared differences, I found that the NCC works best. The only catch was that the black margins needed cropping. The margins introduce unneccessary noise in the image and interfere with the correlation.
I wrote 3 Matlab programs:
- colorize1, that creates the color photo for low-resolution images, just by trying out different displacements. Takes as an argument the name of an image in the "data" folder.
- colorize2, that takes a large image, creates an image pyramid, and then searches the best displacement. Takes as arguments the name of the image in the "data" folder, and some tuning parameters (details in the "bells and wistles").
- do_hw, a program that scans the "data" folder and calls the appropriate coloring function.
1) Bells and Whistles
- Pre-processing image cropping... I removed the black edges from the images. For small images, I remove 25 pixels from top and left, and 47 pixels from right and bottom. For large images, i remove 250 pixels from the left, 200 pixels from the top, and 475 from the bottom and right. I found these to be the best values :)
- Post-processing image cropping... Aligning the image channels always results in one-color edges... Since my programs find out the exact displacement between the color channels, I use this information to remove only the colored edges :)
- Parametrized Image Pyramid ... The program scales images in the pyramid according to the parameter SHRINK, which is by default 1/2.
- Variable parametric displacement window... Depending on the current level of the pyramid, my program will modify the displacement window based on two parameters: N0 and INCREASEX. What do they mean? [-N0,N0] is the window used for the maximum resolution image (level 1 of the pyramid), and on each level, N0 = N0*INCREASEX. The default values are N0 = 9, and INCREASEX ~ 0.95
2) Small images
Jump to Top
Displacements are next to the images :)
00017v.jpg
|
|
Green displacement: 2 -2
Red displacement: 2 -3
|
00056v.jpg
|
|
Green displacement: 7 2
Red displacement: 14 2
|
00084v.jpg
|
|
Green displacement: 5 -4
Red displacement: 12 -9
|
00362v.jpg
|
|
Green displacement: 6 0
Red displacement: 12 -5
|
00498v.jpg
|
|
Green displacement: 5 4
Red displacement: 11 4
|
00646v.jpg
|
|
Green displacement: 8 3
Red displacement: 15 5
|
00704v.jpg
|
|
Green displacement: 7 3
Red displacement: 14 4
|
00858v.jpg
|
|
Green displacement: 7 4
Red displacement: 14 5
|
00872v.jpg
|
|
Green displacement: -3 -1
Red displacement: -2 -2
|
01039v.jpg
|
|
Green displacement: 6 3
Red displacement: 12 3
|
3) Large images
Jump to Top
The color channels' displacements are below the actual images. I have rescaled the resulting 60Mb TIFF images and saved them as JPEGs.
00033u.jpg
Green displacement: 54 12
Red displacement: 105 16
|
|
00797u.jpg
Green displacement: 68 13
Red displacement: 145 15
|
|
00153u.jpg
Green displacement: 70 26
Red displacement: 140 46
|
|
00794u.jpg
Green displacement: 54 17
Red displacement: 124 19
|
|
01443u.jpg
Green displacement: 34 22
Red displacement: 80 45
|
|