Nbh_Access

Nbh_Access

new Nbh_Access(IA_instance, xc, yc, nx, ny, paddingopt)

Returns a new object that can be used to access the specified neighbourhood of the image without creating a new image. This is mainly used by the ImageAccess.getNbh method
Source:
Parameters:
Name Type Attributes Default Description
IA_instance ImageAccess The image of which the neighbourhood will be extracted
xc Integer The horizontal (x) center of the neighbourhood
yc Integer The vertical (y) center of the neighbourhood
nx Integer The width of the neighbourhood
ny Integer The height of the neighbourhood
padding String <optional>
'mirror' The boundary condition to apply ('mirror', 'repeat' or 'zero')

Methods

getColumn(x) → {ImageAccess}

Returns the column at position x of the neighbourhood
Source:
Parameters:
Name Type Description
x Integer The horizontal (x) position of the column
Returns:
Type:
ImageAccess
The column at position x

getPixel(x, y) → {Number}

Returns the pixel value at location (x,y) of the neighbourhood
Source:
Parameters:
Name Type Description
x Integer The horizontal (x) location of the pixel
y Integer The vertical (y) location of the pixel
Returns:
Type:
Number
The value of the pixel at location (x,y)

getRow(y) → {ImageAccess}

Returns the row at position y of the neighbourhood
Source:
Parameters:
Name Type Description
y Integer The vertical (y) position of the row
Returns:
Type:
ImageAccess
The row at position y

sort(bopt) → {ImageAccess}

Returns the pixel values in ascending order
Source:
Parameters:
Name Type Attributes Description
b ImageAccess <optional>
The kernel. It should be the same size as the neighbourhood and contain 0s and 1s (or any other number), specifying which pixels are used during the sorting. By default, all pixels are used
Returns:
Type:
ImageAccess
The sorted pixels in ascending order

visualize(decimalsopt) → {String}

Returns a formatted string that can be used to display the neighbourhood in the console
Source:
Parameters:
Name Type Attributes Default Description
decimals Integer <optional>
3 The number of maximal decimals to use
Returns:
Type:
String
The neighourhood as a formatted string