Here, I have python code which is helping me in selecting 5 by 5 window from upper left corner of a raster (.tif). I want a process to automate through entire image in 5 by 5 convolution window.
import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('class.tif') print(img) kernel = np.ones((5,5),np.float32) print(kernel)
How to loop the kernel which will cover all pixels from a raster in 5 by 5 convolution window for getting all pixel values in this convolution window? I don't want to generate another raster. I want location of abnormal values within each window after statistical tests. How is it possible?