Reputation: 31
Using python numpy or scipy I am trying to perform cross-correlation on each pixel of an image using a 3 dimensional kernel. I am more interested in looping into each pixel and applying the kernel and looping in
i am thinking in some way like below, not sure how to complete it
image=cv2.imread("ABC.jpg", cv2.IMREAD_GRAYSCALE)
kernal=(np.ones((3, 3)) / 9)
width, height = image.shape
destinationImg=image
"""to avoid kernal getting out side of image start in 1 and ending """
for x in xrange(1, width-1):
for y in xrange(1, height-1):
destinationImg[x,y]=.............
Upvotes: 0
Views: 2732