Filter an image using a Laws texture filter.
laws_byte 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.
Image (input_object) |
image(-array) -> object : byte |
Images to which the texture transformation is to be applied. |
ImageTexture (output_object) |
image(-array) -> object : byte |
Texture images. |
FilterTypes (input_control) |
string(-array) -> string |
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 -> integer |
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 -> integer |
Size of the filter kernel. | |
Default value: 5 | |
List of values: 3, 5, 7 |
/* 2-Dimensionale Pixelklassifikation */ read_image(:Image:'combine':) > open_window(::0,0,-1,-1,'root','visible','':) > disp_image(Image:::) > laws_byte(Image:Texture1:'es',2,5:) > laws_byte(Image:Texture2:'le',2,5:) > mean__(Texture1:H1:51,51:) > mean__(Texture2:H2:51,51:) > fwrite_string(::'mark desired image section':) > fnew_line(:::) > set_color(::'green':) > draw_region(:Region::) > reduce_domain(H1,Region:Foreground1::) > reduce_domain(H2,Region:Foreground2::) > histo_2dim__(Region,Foreground1,Foreground2:Histo::) > threshold__(Histo:Characteristic_area:1,1000000:) > set_color(::'blue':) > disp_region(Characteristic_area:::) > class_2dim(H1,H2,Characteristic_area:Seg:4,5:) > set_color(::'red':) > disp_region(Seg:::).
laws_byte returns 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 is raised.
mean__, gauss__, median, histo_2dim__, learn_ndim1__, learn_ndim2__, threshold__
laws_int2, laws_int4, convol__
Laws, K.I. "Textured image segmentation"; Ph.D. dissertation, Dept. of Engineering, Univ. Southern California, 1980