2D Median Filter Pseudo Code
Code for a simple 2D median filter algorithm might look like this:
allocate outputPixelValue edgex := (window width / 2) rounded down edgey := (window height / 2) rounded down for x from edgex to image width - edgex for y from edgey to image height - edgey allocate colorArray for fx from 0 to window width for fy from 0 to window height colorArray := inputPixelValue sort all entries in colorArray outputPixelValue := colorArrayNote that this algorithm:
- Processes one color channel only,
- Takes the "not processing boundaries" approach (see above discussion about boundary issues).
Read more about this topic: Median Filter
Famous quotes containing the words pseudo and/or code:
“Logic is the last scientific ingredient of Philosophy; its extraction leaves behind only a confusion of non-scientific, pseudo problems.”
—Rudolf Carnap (18911970)
“Wise Draco comes, deep in the midnight roll
Of black artillery; he comes, though late;
In code corroborating Calvins creed
And cynic tyrannies of honest kings;
He comes, nor parlies; and the Town, redeemed,
Gives thanks devout; nor, being thankful, heeds
The grimy slur on the Republics faith implied,
Which holds that Man is naturally good,
Andmoreis Natures Roman, never to be
scourged.”
—Herman Melville (18191891)
Related Phrases
Related Words