Skip to content

Edge detection

Cristel Chandre edited this page Dec 31, 2025 · 22 revisions

Edge Detection

Edge detection identifies cell boundaries and contours where image brightness changes sharply. This allows for the analysis of molecular orientation relative to structural features.

Open the module by clicking the icon. An Edge Detection tab appears on the right of the Advanced tab. The button remains **blue** while the module is active.

Computational Workflow

  1. Detection: Uses a Gaussian blur followed by the Canny Edge Detector.
  2. Filtering: Contours are extracted and filtered by a minimum Length parameter.
  3. Smoothing: A Savitzky-Golay filter (scipy.savgol_filter) is applied to create smooth, differentiable curves.
  4. Relative Analysis: PyPOLAR calculates the local normal to the contour and measures orientation angles $\rho$ relative to these boundaries within a defined Layer width.

Parameters

The following parameters can be adjusted on the Edge Detection tab:

Parameter Type Description
Low threshold Detection Hysteresis lower bound (0-255).
High threshold Detection Hysteresis upper bound (0-255).
Length Filter Minimum pixel number for valid contours.
Smoothing window Smoothing Window size for the Savitzky-Golay filter.
Distance from contour Layer Offset from the detected boundary (in pixels).
Layer width Layer Thickness of the analysis region (in pixels).

Tip

If your edges look "jagged," increase the Smoothing window. If you are picking up too much background noise, increase the Low threshold.

Clone this wiki locally