Herror ::texture_laws (
    Hobject Image,
    Hobject *ImageTexture,
    const HTuple &FilterTypes,
    const HTuple &Shift,
    const HTuple &FilterSize
)
HImage HImage::TextureLaws (
    const HTuple &FilterTypes,
    const HTuple &Shift,
    const HTuple &FilterSize
) const
HImageArray HImageArray::TextureLaws (
    const HTuple &FilterTypes,
    const HTuple &Shift,
    const HTuple &FilterSize
) const

Filter an image using a Laws texture filter.

::texture_laws applies one or more texture transformations (according to Laws) to an image. This is done by convolving the input image with one (or more) filter masks. The filters are:

9 different 3x3 matrices obtainable from the following three vectors:

    l      =       [  1     2       1  ],
    e      =       [ -1     0       1  ],
    s      =       [ -1     2      -1  ]
25 different 5x5 matrices obtainable from the following five vectors: l = [ 1 4 6 4 1 ], e = [ -1 -2 0 2 1 ], s = [ -1 0 2 0 -1 ], r = [ 1 -4 6 -4 1 ], w = [ -1 2 0 -2 1 ] 36 different 7x7 matrices obtainable from the following six vectors:
    l      =       [  1     6      15      20      15      6      1  ],
    e      =       [ -1    -4      -5       0       5      4      1  ],
    s      =       [ -1    -2       1       4       1     -2     -1  ],
    r      =       [ -1    -2      -1       4      -1     -2      1  ],
    w      =       [ -1     0       3       0      -3      0      1  ],
    o      =       [ -1     6     -15      20     -15      6     -1  ]
For most of the filters the resulting gray values must be modified by a Shift. This makes the different textures in the output image more comparable to each other, provided suitable filters are used.

The name of the filter is composed of the letters of the two vectors used, where the first letter denotes convolution in the column direction while the second letter denotes convolution in the row direction.

If more than one filter type is passed, a multi-channel image is returned for each (single-channel) input image, with each channel corresponding to a particular filter.


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int2 )
Images to which the texture transformation is to be applied.

ImageTexture (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte )
Texture images.

FilterTypes (input_control)
string(-array) -> HTuple.char *
Desired filters (name or number).
Default value: 'el'
Suggested values: 'll', 'le', 'ls', 'lr', 'lw', 'lo', 'el', 'ee', 'es', 'er', 'ew', 'eo', 'sl', 'se', 'ss', 'sr', 'sw', 'so', 'rl', 're', 'rs', 'rr', 'rw', 'ro', 'wl', 'we', 'ws', 'wr', 'ww', 'wo', 'ol', 'oe', 'os', 'or', 'ow', 'oo'

Shift (input_control)
integer -> HTuple.long
Shift to reduce the gray value dynamics.
Default value: 2
List of values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

FilterSize (input_control)
integer -> HTuple.long
Size of the filter kernel.
Default value: 5
List of values: 3, 5, 7


Example
/* 2 dimensional pixel classification */
read_image(&Image,"combine");
open_window(0,0,-1,-1,"root","visible","",&WindowHandle);
disp_image(Image,WindowHandle);
texture_laws(Image,&Texture1,"es",2,5);
texture_laws(Image,&Texture2,"le",2,5);
mean_image(Texture1,&H1,51,51);
mean_image(Texture2,&H2,51,51);
fwrite_string(FileId,"mark desired image section");
fnew_line(FileId);
set_color(WindowHandle,"green");
draw_region(&Region,WindowHandle);
reduce_domain(H1,Region,&Foreground1); 
reduce_domain(H2,Region&,Foreground2); 
histo_2dim(Region,Foreground1,Foreground2,&Histo);
threshold(Histo,&Characteristic_area,1.0,1000000.0);
set_color(WindowHandle,"blue");
disp_region(Characteristic_area,WindowHandle);
class_2dim_sup(H1,H2,Characteristic_area,&Seg,4,5:);
set_color(WindowHandle,"red");
disp_region(Seg,WindowHandle); 

Result

::texture_laws returns H_MSG_TRUE if all parameters are correct. If the input is empty the behaviour can be set via ::set_system('no_object_result',<Result>). If necessary, an exception handling is raised.


Possible Successors

::mean_image, ::gauss_image, ::median_image, ::histo_2dim, ::learn_ndim_norm, ::learn_ndim_box, ::threshold


Alternatives

::convol_image


See also

::class_2dim_sup, ::class_ndim_norm


References

Laws, K.I. ``Textured image segmentation''; Ph.D. dissertation, Dept. of Engineering, Univ. Southern California, 1980


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH