Claims
- 1. A method for applying a median filter to a plurality of pixel values associated with a sliding window, comprising:
defining a merge tree associated with columns corresponding to a sliding window at a first location; determining a median of a plurality of pixel values defined by the sliding window at the first location; shifting the sliding window to a second location; and modifying the merge tree to correspond to values associated with the second location of the sliding window.
- 2. The method of claim 1, wherein the method operation of defining a merge tree associated with columns corresponding to a sliding window at a first location includes,
creating a root node; determining a size associated with the merge tree, wherein the size is indicative of a number of branches of the merge tree; and constructing the merge tree having the determined size.
- 3. The method of claim 2, wherein the merge tree is defined in a recursive manner.
- 4. The method of claim 1, further comprising:
initializing leaf nodes associated with the merge tree.
- 5. The method of claim 4, wherein each of the leaf nodes is associated with a column of the sliding window.
- 6. The method of claim 1, wherein the method operation of modifying the merge tree to correspond to values associated with the second location of the sliding window includes,
locating an oldest column; determining if the oldest column is associated with a sibling; if the oldest column is associated with a sibling, then the method includes,
switching columns associated with a sibling and a rightmost node of the merge tree; and replacing the oldest column with a next column; if the oldest column is not associated with a sibling, then the method includes,
replacing the oldest column with the next column.
- 7. A method for efficiently filtering pixel values associated with a frame of image data, comprising:
establishing a first region corresponding to a portion of pixel values associated with a frame of image data; defining a merge tree associated with the portion of pixel values of the first region; determining a median value of the portion of pixel values of the first region through the merge tree; establishing a second region, the second region partially overlapping the first region; and updating the merge tree such that data associated with the first region is reused to calculate a median value of the second region.
- 8. The method of claim 7, wherein the method operation of defining a merge tree associated with the portion of pixel values of the first region includes,
determining a number of leaf nodes associated with the merge tree.
- 9. The method of claim 8, wherein the number of leaf nodes corresponds to a number of columns of the first region.
- 10. The method of claim 7, wherein the method operation of determining a median value of the portion of pixel values of the first region includes,
defining two arrays associated with the merge tree; calculating the median value from the two arrays.
- 11. The method of claim 7, wherein the method operation of updating the merge tree such that data associated with the first region is reused to calculate a median value of the second region includes,
storing sorted data associated with the first region for use in determining the median value of the second region.
- 12. A method for determining a median value in a sliding window environment, comprising:
creating a merge tree defining leaf nodes associated with columns corresponding to a first position of a sliding window.
- 13. The method of claim 12, further comprising:
determining a value of a median associated with the first position of the sliding window.
- 14. The method of claim 12, further comprising:
merging the leaf nodes in a manner such to define two sorted arrays; determining a median value of the two sorted arrays; and applying the median value to data associated with the sliding window.
- 15. The method of claim 14, wherein the data associated with the sliding window includes pixel values corresponding to digital image data.
- 16. The method of claim 12, wherein the merge tree is created in a recursive manner.
- 17. The method of claim 12, further comprising:
defining a median value from the merge tree; shifting the sliding window to a second position; updating the merge tree such that data common to the first position of the sliding window and the second position of the sliding window is reused.
- 18. The method of claim 12, further comprising:
storing data associated with the merge tree in memory.
- 19. A computer readable medium having program instructions for determining a median value in a sliding window environment, comprising:
program instructions for creating a merge tree defining a median associated with a first position of a sliding window.
- 20. The computer readable medium of claim 19, further comprising:
program instructions for determining a value of a median associated with the first position of the sliding window.
- 21. The computer readable medium of claim 19, further comprising:
program instructions for merging the leaf nodes in a manner such to define two sorted arrays; program instructions for determining a median value of the two sorted arrays; and program instructions for applying the median value to data associated with the sliding window.
- 22. The computer readable medium of claim 19, further comprising:
program instructions for defining a median value from the merge tree; program instructions for shifting the sliding window to a second position; program instructions for updating the merge tree such that data common to the first position of the sliding window and the second position of the sliding window is reused.
- 23. The computer readable medium of claim 19, further comprising:
program instructions for storing data associated with the merge tree in memory.
- 24. A display controller having circuitry for determining a median value for filtering pixel values associated with a frame of image data, comprising:
circuitry for storing data associated with a merge tree, the merge tree based on a number of columns in a window region of the frame of image data; circuitry for calculating a median value from the data associated with the merge tree; circuitry for identifying a next window region partially overlapping the window region; and circuitry for calculating a median value from data associated with an updated merge tree, the data associated with the updated merge tree including a portion of the stored data from the merge tree.
- 25. The display controller of claim 24, wherein both the number of columns and a number of rows are odd integers.
- 26. The display controller of claim 24, wherein the next window region is shifted over by one column relative to the window region.
- 27. The display controller of claim 24, wherein the portion of the stored data from the merge tree is common to both the next window region and the next window region.
- 28. The display controller of claim 24, wherein the display controller is incorporated into a handheld electronic device.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application is related to U.S. patent application Ser. No. 10/368,234 (Attorney Docket No. AP148HO), filed on Feb. 18, 2003 and entitled “METHOD AND SYSTEM FOR FINDING A K ORDER STATISTIC IN A UNION OF SORTED SETS.” This application is hereby incorporated by reference in its entirety for all purposes.