I have tried to apply Otsu's within ROIs of an image to get a better output. My current iteration of code is shown below where I apply Otsu's to 45x45 ROI segments of an image. The output is still not the best, especially when compared to Adaptive Thresholding methods. How can I get a clearer and all around better output? Is there another method for applying Otsu's within ROIs that is recommended?
def roiOtsu(image):
size = 45
column, row, result = properties(image)
for i in range(0, column,size):
for j in range (0, row,size):
ret,result[i:i+size, j:j+size] = cv2.threshold(image[i:i+size, j:j+size],0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
return result