latest version v1.9 - last update 10 Apr 2010 |
cityBlock filter kernel More...
#include <ltiBinaryKernels.h>
Public Member Functions | |
cityBlockKernel (const int &size=3, const T &onValue=lti::typeInfo< T >::suggestedNorm()/T(255)) | |
void | generate (const int &size, const T &onValue=lti::typeInfo< T >::suggestedNorm()/T(255)) |
cityBlock filter kernel
This binary filter kernel (values only 0 or onValue
) is used as a structuring element for erosion/dilation operations.
The onValue is important if e.g. erosion::parameters::Gray is used. For Binary mode the exact value of onValue is not relevant. Default is typeInfo<T>::suggestedNorm()/255, i.e. 1 for ubyte and 0.003921 for float.
The possible sizes are all odd values greater/equal 3.
The kernel norm is set to the typeInfo<T>::suggestedNorm() so the result is the expected black and white image.
An example of a city block kernel of size seven:
- - - 1 - - - - - 1 1 1 - - - 1 1 1 1 1 - 1 1 1 1 1 1 1 - 1 1 1 1 1 - - - 1 1 1 - - - - - 1 - - -
lti::cityBlockKernel< T >::cityBlockKernel | ( | const int & | size = 3 , |
|
const T & | onValue = lti::typeInfo< T >::suggestedNorm()/T(255) | |||
) |
constructor
size | is the dimension of the one dimensional part (i.e. the filter kern is a size x size kernel!) This must be an odd value greater/equal 3. If another value is given, the next valid odd value will be assumed. | |
onValue | value different from zero in the kernel. |
void lti::cityBlockKernel< T >::generate | ( | const int & | size, | |
const T & | onValue = lti::typeInfo< T >::suggestedNorm()/T(255) | |||
) |
initialize this kernel with the specified values
size | is the dimension of the one dimensional part (i.e. the filter kern is a size x size kernel!) This must be an odd value greater/equal 3. If another value is given, the next valid odd value will be assumed. | |
onValue | value different from zero in the kernel. |