Ricardo Cabral (rcabral).

15-862 Computational Photography, Fall 2010.

Project 0.

15-862 Computational Photography, Fall 2010.

Project 0.

For the first part, what i did was apply the Fourier transform (using FFT) to Lena and then multiply it by the proposed Kernel, albeit rotated by 90 degrees in each quadrant. The frequency response as it is shown would make no sense for a low pass filter, but the twist is that if we don't use fftshift we won't see the response centered in the image. By doing so, we notice that this is equivalent to a box filter, which zeroes out the higher frequencies in all directions (if you think the fft2 result with regards to the magnitude and phase axis rather than the x and y axis, this interpretation comes immediately).
Doing this multiplication in the frequency domain gives the result:

Applying an inverse fourier transform gives us a blurred picture of lena, as expected (notice the ringing effect due to the discontinuity present in the box filter, which implies its counterpart representation in time domain will have a representation spanning the whole x,y space, as an infinite number of sinusoids. The clipping of the number of sinusoids induced by the fact that we cannot represent anything with subpixel accuracy results in the aliasing effect):

The second method does not involve the frequency domain. Instead, i just performa a convolution of Lena (using conv2) with a gaussian kernel (using fspecial).
The result is this:

The Fourier transform of the result looks like this:

As can be seen from both Fourier transforms, the behavior is the same (aside from the differences in using a box filter vs. using a gaussian kernel, since the latter is more smooth): high frequencies are zeroed out and the image is blurred.

The result using the kernel from fspecial is this (i tried different parameters, but they seemed pretty much the same):

Note that the edges (e.g., the branches in the tree and the road) are now more well defined.

1) I overlayed a ghost in another image and 2) I got inspired by Dali's painting shown in class to build my own version automatically. For the first part, i mainly played around with saturation values in the HSV space and motion blurs to obtain the ghostly effect. The result is here:

For the second one, what i did was replace each pixel of the (subsampled) image in the logo by an image whose average value matched the value of the pixel. For simplicity, each image is drawn from two clases, red (1, 2, 3, 4) and greyscale (1, 2, 3, 4, 5), with the latter being mean shifted to the average value of the pixel. The obtained result is this (click the image for higher res):

For comparison purpose, i downloaded a specific software that does these mosaics and the (much better) result i obtained is this:

Instead of just matching average values, one could also leverages on a technique called pointillism, which originated in arts on late 19th century. For representing green, for instance, one might pick several yellow and blue images and juxtapose them as opposed to just green images.

Although the result is quite visually unappealing (lots of pixelization), it reveals trees both on the left and right of the picture which were not previously discernible by a naked eye:

Worthy of note here is the fact that histeq works only on greyscale images, so i apply it to each channel individually.