ordfilt2

Implementation

OpenCL

Usage

output=ordf_ATI(input, order)

Class Support

float is supported for input, output. order is double type

Algorithm

Since the algorithm is to sort the values from 3X3 input pixels and output the middle value, we use float4 as data unit and put x,w component into share memory. Thus for one thread, it will read float4 from global memory and left pixel's w and right pixel' x from share memory to reduce global memory access. We also use one thread to compute some neighbor thread in the same column to reduce global memory access.