摘要 |
The present invention is of a method and apparatus for processing an image comprising a data set of size M (more generally, for determining the median of any data set of size M), comprising receiving each value of the data set as a weighted set of binary digits; adding together a first constant and binary digits of greatest weight of each value of the data set; dividing the result of the adding step by a second constant to generate a binary digit of greatest weight of a median of the data set; calculating for each value a remaining value clamp function for a next lower weight of binary digits; employing results of the calculating step to repeat adding and dividing steps for the next lower weight of binary digits to generate a binary digit of next lower weight of a median of the data set; and repeating the calculating and employing steps, if necessary, for each lower weight of binary digits of the values. The first constant is preferably 2<SUP>N-</SUP>-1-M, where N is the least power of 2 that exceeds M, with the second constant being 2<SUP>N-1</SUP>.
|