Adding histogram matching when images are divided into alternate rows