Region Adjacency Graph (RAG) (Scripts) Publisher's description
from David Legland
Computes region adjacency graph of a labeled 2D or 3D image
Computes region adjacency graph of a labeled 2D or 3D image.
Two regions are considered as neighbor if they are separated by a background (i. e. with color 0) pixel in the horizontal or vertical direction, as well as depth direction for 3D images.
The result is a N*2 array, containing 2 indices for each couple of neighbor regions.
ADJ = imRAG(IMG);
ADJ has the format [LBL1 LBL2], LBL1 and LBL2 being vertical arrays the same size.
LBL1 is given in ascending order, LBL2 is given in ascending order for each LBL1. Ex :
[NODES, ADJ] = imRAG(IMG);
Return two arrays: the first one is a [N*2] array containing centroids of the N labeled region, and ADJ is the adjacency previously described.
For 3D images, the node array is [N*3].
System Requirements:MATLAB 7.5 (R2007b)
Program Release Status: New Release
Program Install Support: Install and Uninstall