I am trying to create a slide search algorithm in python. I am trying to index the image by iterating over the co-ordinates. Please check the code below. Here I am using 2 FOR LOOPS (which takes lot of time). I want to implement it which will compute very fast. Any better vectorization method for FASTER implementation ?
width,height,depth = img.shape
wind_size = 64
xx = np.arange(0,width,wind_size)
yy = np.arange(0,height,wind_size)
for i in xx[:-1]:
for j in yy[:-1]:
img_w = img[i:i+wind_size,j:j+wind_size,:]
img_w = cv2.cvtColor(img_w,cv2.COLOR_BGR2RGB)
img_lst1.append(img_w/255.0)