Main Content

Use Neighborhood Processing Subsystem Block Padding Options with Region of Interest

You can configure the Neighborhood Processing Subsystem block to pad values outside the input matrix using different padding methods. Use the parameters of the Neighborhood control block to configure the Neighborhood Processing Subsystem block behavior. This topic explains how the Padding option parameter interacts with other Neighborhood block parameters.

Overview of Parameters

The Neighborhood Processing Subsystem block iterates over elements of a matrix. For each element, it processes a neighborhood of values surrounding that element. The Processing width and Processing offset parameters optionally configure a region of interest (ROI) within the image; the Neighborhood Processing Subsystem block iterates over only this subsection.

Some neighborhoods contain elements that extend beyond the ROI or input matrix. Because the Processing width and Processing offset parameters do not allow an ROI to extend beyond the input matrix, any value outside the input matrix is also outside the ROI. However, neighborhood elements can extend beyond the ROI while remaining inside the input matrix. The Padding option parameter specifies how the Neighborhood Processing Subsystem block populates values outside the input matrix. This parameter does not affect values inside the input matrix, even if those values are outside the ROI.

For more information about each block parameter, see Neighborhood. For an example of using the Processing width and Processing offset parameters to specify an ROI, see Specify Region of Interest for Neighborhood Processing.

Example

Consider this matrix.

5-by-5 matrix containing the numbers from 1 to 25. A blue box marked "ROI" surrounds the top 3-by-5 submatrix. An orange box marked "Neighborhood" surrounds the 3-by-5 region one down and two to the left of the blue box, surrounding the bottom left element of the blue box. Question marks denote values that are inside the orange box but outside the blue box. The sixth value of the orange submatrix is marked with an a, the twelfth value is marked with a b, and the thirteenth value is marked with a c.

The blue region represents a 3-by-5 ROI specified by the Processing width parameter value [3 5] and Processing offset parameter value [0 0]. The orange region represents a 3-by-5 neighborhood, specified by the Neighborhood size parameter value [3 5], around the value 11 in the input matrix. a, b, and c denote values outside the ROI. The Neighborhood Processing Subsystem block determines the values of a, b, and c depending on the padding option you select.

Padding optionValue at aValue at bValue at c
Constant (with Padding constant set to 0)0016
Replicate111616
Symmetric121616
Circular142016

c is always 16 because it corresponds to the value 16 in the input matrix. The Neighborhood Processing Subsystem block uses values from the input matrix when possible, even if those values are outside the ROI. a and b apply the rules of the padding option. If you select a padding option that reuses values from the input matrix, the Neighborhood Processing Subsystem block extrapolates the values of a and b from the full input matrix, even when the source of a reused value lies outside the ROI.

See Also

|

Related Topics