Optimal histogram matching by monotone gray level transformation

This paper investigates the problem of optimal histogram matching using monotone gray level transformation, which always assigns all picture points of a given gray level <italic>i</italic> to another gray level <italic>T</italic>(<italic>i</italic>) such that if <italic>i</italic> ≥ <italic>j</italic>, then <italic>T</italic>(<italic>i</italic>) ≥ <italic>T</italic>(<italic>j</italic>). The objective is to find a transformed digital picture of a given picture such that the sum of absolute errors between the gray level histogram of the transformed picture and that of a reference picture is minimized. This is equivalent to placing <italic>k</italic>1 linearly ordered objects of different sizes one by one into <italic>k</italic>2 linearly ordered boxes of assorted sizes, such that the accumulated error of space underpacked or overpacked in the boxes is minimized; the placement function is monotonic, which ensures a polynomial time solution to this problem. A tree search algorithm for optimal histogram matching is presented which has time complexity <italic>O</italic>(<italic>k</italic>1 × <italic>k</italic>2). If the monotone property is dropped, then the problem becomes <italic>NP</italic>-complete, even if it is restricted to <italic>k</italic>2 = 2.