def getNeighbors(img, i, j):
	"""
		Computes the 4 visted neighbors of a pixel(i,j)
		Returns a list of neighbors
	"""
	H, W = img.shape
	neighbors = []
	if i-1 >= 0:
		neighbors.append(img[i-1][j])
	if j-1 >= 0:
		neighbors.append(img[i][j-1])
	if j-1 >= 0 and i-1 >= 0:
		neighbors.append(img[i-1][j-1])
	if j+1 < W and i-1 >= 0:
		neighbors.append(img[i-1][j+1])
	return neighbors