Usage: rankfilter in.pgm el.pgm r out.pgm
Description: Let F be the input image, G be the output image, and E the structuring element. Let n be the number of elements of E, and R be the product n.r, then for each pixel p, G[p] is the Rth element of the sorted list (by increasing order) of the pixel values in the set { F[q], q in E[p] }.
Particular cases are the median filter (r = 0.5), the erosion (r = 0), and the dilation (r = 1).
Types supported: byte 2d, byte 3d
Category: morpho