How can to split image in parts, apply histogram equalization, compose an image form the parts and display it I am trying to figure a way to split an image into defined number of parts, meaning the image is split into a number of rectangeles that when combined form the whole image. Then to each of the parts I want to apply histogram equalization. After that I want to be able to form a new image from the parts of the first image that have the histogram equalization already applied
## so far I know how to apply the histogram equalization to the entire image
import cv2
import numpy as np
from matplotlib import pyplot as plt
## load image
img = cv2.imread('/home/pi/Downloads/bear.bmp',0)
## equalize
equ = cv2.equalizeHist(img)
plt.subplot(111),plt.imshow(equ, cmap = "gray"),plt.title('Equalized')
plt.xticks([]), plt.yticks([])
plt.show()