- Normal Image :
- Converted into black and white image
- Image with only bright pixels (white mask) :
- Image with only dark pixels (black mask) :
- In both images, the average pixel is calculated
- Output Image :
- In above image the Green dot indicates the white mask average pixel and the Blue dot indicates average pixel of the black mask