摘要 |
A histogram is generated. An image is input, and a pixel value is assigned to each pixel of the input image. A set of bin indexes is defined, with each bin index representing one or more possible numerical values for a pixel. A parallel sort is applied to the pixel values in order to generate a set of sorted pixel values. A parallel search is applied to the sorted pixel values for each bin index to find the position of the bin index in the sorted pixel values. A number of pixels in a bin corresponding to each bin index is generated, based on the difference between the position of the bin index in the sorted pixel values and the position of a subsequent bin index in the sorted pixel values. The histogram is generated based on the number of pixels in the bins corresponding to each bin index. |