Skip to main content

Edge detection is an important task in many data processing procedures. For example, edges may indicate a transition between states or the occurrence of interesting events. Here, we look at a MATLAB application that detects edges in 1D data.

Data Set and Source

Download Edge Detector 1D
Download sample data

The Edge Detector 1D application comes with a sample data set. The data comes from a Fluorescence Resonance Energy Transfer (FRET) experiment conducted by Lauryn Sass at Dorothy Erie’s lab at the University of North Carolina. Extra noise has been added to the sample data. In this experiment two fluorescing particles are attached to a protein. The ratio of the fluorescent signals changes when the protein changes structure. Edge Detector 1D finds the precise transition events within the noisy signal data.

Download the application from the link above and unzip the archive to a directory on your computer. Launch MATLAB, and change MATLAB’s current directory to the edge_detector_1d directory that was created when you unpacked the archive. To view the dataset, type in the MATLAB command window:

load sample-fret.mat;
plot(fret);

Recommended Analysis Procedure

Edge Detector 1D is composed of several MATLAB scripts that perform multiresolution edge detection. Type in the MATLAB command window:

[deriv, minmax, stats] = AnalyzeEdges(fret);

This command performs edge analysis on the sample fret data at a set of default scales (the defaults work well for this example). Type help AnalyzeEdges for a complete description of all parameters. Three display windows will appear showing the edges detected in the data and some intermediate analysis results. Five edges are found, which divide the sample data into six regions; the ending index, mean, and standard deviation of each region are printed to the MATLAB console.

The edges (red) detected in the FRET sample data (left) and the scale-space data used during edge analysis (right).
The edges (red) detected in the FRET sample data (left) and the scale-space data used during edge analysis (right).