Skip to content

Main content

Binary Mask Stencil Required Radius Budget

Budget explicit stencil row/column halo radii and maximum Chebyshev radius without expanding a kernel or inferring physical pixel dimensions.

Loading tool…

Description

Calculate the row, column and Chebyshev halo radii of an explicit stencil in grid cells.

A binary grid represents foreground as numeric one and background as zero. A stencil is a set of integer [rowOffset,columnOffset] positions relative to a cell. Connectivity describes allowed neighbor steps: four-neighbor connectivity uses orthogonal steps, while eight-neighbor connectivity also includes diagonals. Finite image borders and asymmetric stencils affect the result.

Calculate the row, column and Chebyshev halo radii of an explicit stencil in grid cells.

When to use this tool

Use these radii to budget row and column access around a local grid operation.

How to use the tool and how it works

  1. Enter stencil using the definitions below.
  2. Run the operation. Resolve input-format errors before interpreting an output.
  3. Read result.rowRadius, result.columnRadius, result.chebyshevRadius, using the stated boundary, ordering, sign and absence conventions.

Take the largest absolute row offset and largest absolute column offset across the supplied stencil. Report those two radii and their maximum as the Chebyshev radius.1

Input fieldMeaning and unitsAccepted input
stencilNonempty list of distinct integer [rowOffset,columnOffset] pairs, each coordinate -16 through 16; at most 128 offsets.Dense numeric rows, each dimension at most 128; the stated shape rules also apply.
Output fieldInterpretation
resultObject containing the fields below.
result.rowRadiusLargest absolute row offset, in cells.
result.columnRadiusLargest absolute column offset, in cells.
result.chebyshevRadiusMaximum of rowRadius and columnRadius, in cells.
json
{
  "input": {
    "stencil": [
      [
        -2,
        1
      ],
      [
        1,
        3
      ]
    ]
  },
  "output": {
    "result": {
      "rowRadius": 2,
      "columnRadius": 3,
      "chebyshevRadius": 3
    }
  }
}

Limitations and assumptions

  • The budget is in grid cells and describes offset extent, not a padding policy or a proof that a composed filter has the same support.
  • Masks are rectangular dense arrays of numeric 0/1 cells, with at most 64 rows and 64 columns. Empty frames are allowed where no in-bounds seed is required. Stencils are nonempty lists of distinct integer [rowOffset,columnOffset] pairs, each coordinate between -16 and 16. Outside-frame samples are zero at every stage.
  • Every declared outer field is required and unknown outer fields are rejected. Strings and JSON text have size limits, lists are bounded to 128 entries, and JSON nesting/node counts are bounded. Tighter operation-specific bounds stated above take precedence.
  • Numeric outputs must remain finite and within safe-integer magnitude. Original record indexes and cell coordinates are zero-based; stated half-open ranges exclude their end.

Alternative or Complementary methods

Choose a component operation for connected regions and an explicit stencil for local shape tests. Fix connectivity and border policy before comparing masks; convert cell counts to physical area separately when pixel spacing is known.

References

  1. Tool behavior and example: Binary Mask Stencil Required Radius Budget — tool.io

Similar or alternative tools