I am working on image breast cancer classification using Deep learning. I want to divide the region of interest (ROI) in the image into multiple blocks. The dataset contains 1000 images of the right and the left breast as show in Figure 1. First, I want to detect the region of interest of the image then divide the region into blocks. I have tried to do that by dividing the whole image without ROI, but it didn't work well as shown in Figure 2. Any idea on how to detect the region of interest then dividing the ROI into blocks.
Figure 1
Figure 2
Code:
img = cv2.imread(a)
#First we should convert RGB image into grey image
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
#Enhance the image to be clear not Fuzzy using Histogram Equalizer
eq_img=cv2.equalizeHist(gray)
plt.imshow(eq_img)
plt.show()
print("Raw Enhancement Image")
# Define the window size
windowsize_r = 240
windowsize_c = 320
# Crop out the window and calculate the histogram
i=0
for r in range(0,eq_img.shape[0] - windowsize_r, windowsize_r):
for c in range(0,eq_img.shape[1] - windowsize_c, windowsize_c):
window = eq_img[r:r+windowsize_r,c:c+windowsize_c]
print("Block"+str(i))
plt.imshow(window)
plt.show()
i+=1