# -*- coding: utf-8 -*-
"""
Created on Wed May 02 15:08:01 2018
@author: Diko
"""
import numpy
from skimage import io ,data
def conv2d_v0010(f_, g_):
g = g_[::-1, ::-1]
f = f_
h = numpy.vstack([numpy.zeros(f_.shape[1] + g_.shape[1] - 1)] * (g_.shape[0] + f_.shape[0] -1))
f_up_and_dowm = numpy.vstack([numpy.zeros(f.shape[1])]*g.shape[0])
f = numpy.vstack((f_up_and_dowm,f,f_up_and_dowm))
f_left_and_right = numpy.vstack([numpy.zeros(g.shape[1])] * f.shape[0])
f = numpy.hstack((f_left_and_right, f, f_left_and_right))
for i in xrange(f_.shape[0] + g_.shape[0] - 1):
for j in xrange(f_.shape[1] + g_.shape[1] -1):
h[i, j]=(f[i+1:i+1+g_.shape[0],j+1:j+1+g_.shape[1]] *g).sum()
print "f=\n", f
print "g=\n", g
print "h=\n",