Next: , Previous: , Up: Top   [Contents][Index]


3 Using the BSLTL package

3.1 Example code of installation method 1 and 2 - Getting the AVD value of line 240

The next code load 129 images from the directory pointed by the variable IMAGES_DIR; the images are called 'img001.bmp', 'img002.bmp', ..., 'img128.bmp' and 'img129.bmp'. The images are joined in a 3D matrix called DATA.

IMAGES_DIR = '/home/user/data/speckle/test1';
DATA = datapack(IMAGES_DIR,'img%03d',1,129,'bmp');

THSP = thsp(DATA,'line',240);   % Getting the time history speckle pattern.
COM  = coom(THSP);              % Getting the co-occurrence matrix.
AVD  = avd(COM);                % Getting the AVD value.

Finally are calculated the time history speckle pattern (of pixels in the line number 240 of DATA),the co-occurrence matrix and the AVD value, and your values are stored in the variables THSP, COM and AVD respectively.

3.2 Example code of installation method 3 - Getting the AVD value of column 100

The next code load to octave enviroment all the code functions located in the address pointed by the variable BSLTL_DIR, including subdirectories.

Later the code load 129 images from the directory pointed by the variable IMAGES_DIR; the images are called 'img1.bmp', 'img2.bmp', ..., 'img128.bmp' and 'img129.bmp'. The images are joined in a 3D matrix called DATA.

BSLTL_DIR = '/home/user/lib/octmat/bsltl';
addpath(genpath(BSLTL_DIR));

IMAGES_DIR = '/home/user/data/speckle/test1';
DATA = datapack(IMAGES_DIR,'img%d',1,129,'bmp');

THSP = thsp(DATA,'column',100); % Getting the time history speckle pattern.
COM  = coom(THSP);              % Getting the co-occurrence matrix.
AVD  = avd(COM);                % Getting the AVD value.

Finally are calculated the time history speckle pattern (of pixels in the column number 100 of DATA), the co-occurrence matrix and the AVD value, and your values are stored in the variables THSP, COM and AVD respectively.

3.3 More code examples

Many code examples can be found in the examples page of BSLTL library.


Next: , Previous: , Up: Top   [Contents][Index]