Deconstructing Deep Learning + δeviations

Format : Date | Title
TL; DR

Index page

# Image kernels

Image kernels are fun as filters, so let us just look at a few of them and maybe try something else?

Where do I get the numbers from? Awesome blog

# Filters

## Blur

kernel_blur = [
0.0625 0.125 0.0625;
0.125 0.25 0.125;
0.0625 0.125 0.0625
]


## Bottom Sobel

kernel_blur = [
-1 -2 -1 ;
0 0 0 ;
1 2 1
]


## Emboss

kernel_blur = [
-2 -1 0 ;
-1 1 1 ;
0 1 2
]


## Identify

kernel_blur = [
0 0 0 ;
0 1 0;
0  0 0
]


## Left Sobel

kernel_blur = [
-1 0 -1 ;
-2 0 -2;
1 0 -1
]


## Outline

kernel_blur = [
-1 -1 -1 ;
-1 8 -1 ;
-1 -1 -1
]


## Right sobel

kernel_blur = [
-1 0 1 ;
-2 0 2 ;
-1 0 1
]


## Sharpen

kernel_blur = [
0 -1 0 ;
-1 5 -1 ;
0 -1 0
]


## Top sobel

kernel_blur = [
1 2 1 ;
0 0 0 ;
-1 -2 -1
]


# Experiments!!

## What happens when you convolve two images of the same size??

tmp_cm =  channelview(Gray.(testimage("house")));
tmp_cm2 = channelview(Gray.(testimage("mandrill")));
imshow(conv2d(tmp_cm2,tmp_cm))


I get a fully white image... Is it because the images are of the same size? Since these convolutions are only in black and white.. I cheated a bit for the purpose of this experiment and used a library. (Obviously I will do it from scratch later or atleast try to).

using DSP
imshow(DSP.conv(channelview(tmp_cm),tmp_cm2))


I want to analyze a bit more. Here are the two images

So I get this.

I am not sure why? I can't visualize it atleast.

## Different size?

So the largest realistic kernel size I have seen is 15. So let us take this house and resize it to that and try and see what happens.

Man I have to take a second to actually appreciate the fact that we can understand this as a house. So this is what we get.

Wow! That actually did something. You know, I am actually enjoying this detour. I should add more experiment sections whenever I can.