Triangular kernel
k = ktriangle(w) is a triangular kernel within a rectangular matrix k. The dimensions k are WxW if w is scalar or w(1) wide and w(2) high. The triangle is isocles and is full width at the bottom row of the kernel and with its apex in the top row.
>> ktriangle(3) ans = |0 1 0| |0 1 0| |1 1 1|
Machine Vision Toolbox for MATLAB © 1990-2014 Peter Corke.