Histogram equalization improves image contrast by redistributing pixel intensities so they span the full [0, 255] range more uniformly. It is one of the most commonly used image enhancement techniques.
Given a 2D grayscale image with integer pixel values in [0, 255], apply histogram equalization and return the transformed image.
If all pixels have the same value (total_pixels equals cdf_min), map every pixel to 0.
Input: image = [[0, 1], [2, 3]]
Output: [[0, 85], [170, 255]]
Explanation: Four equally frequent intensities are spread across the full output range.
Input: image = [[100, 100], [100, 100]]
Output: [[0, 0], [0, 0]]
Build a 256-bin histogram, then convert it into a cumulative count array.
Use the first positive cumulative count as the lower endpoint of the mapping.
Sign in to take notes on this problem
Accepts: array
Histogram equalization improves image contrast by redistributing pixel intensities so they span the full [0, 255] range more uniformly. It is one of the most commonly used image enhancement techniques.
Given a 2D grayscale image with integer pixel values in [0, 255], apply histogram equalization and return the transformed image.
If all pixels have the same value (total_pixels equals cdf_min), map every pixel to 0.
Input: image = [[0, 1], [2, 3]]
Output: [[0, 85], [170, 255]]
Explanation: Four equally frequent intensities are spread across the full output range.
Input: image = [[100, 100], [100, 100]]
Output: [[0, 0], [0, 0]]
Build a 256-bin histogram, then convert it into a cumulative count array.
Use the first positive cumulative count as the lower endpoint of the mapping.
Sign in to take notes on this problem
Accepts: array