Region Adjacency Graph (RAG)
by David Legland
17 Oct 2007
(Updated 29 Jul 2010)
Computes the graph of adjacent regions in a labeled image
|
Watch this File
|
| File Information |
| Description |
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.
usage:
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 :
[1 2]
[1 3]
[1 4]
[2 3]
[2 5]
[3 4]
Alternative syntax:
[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].
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
image processing toolbox is not required to run the function, but is required to run the example code. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (3) |
| 14 Mar 2008 |
Perrine Paul
|
|
|
| 31 May 2010 |
Joao Henriques
|
|
|
| 20 Apr 2011 |
Ryan
|
|
|
| Updates |
| 29 Jul 2010 |
removed dependencies to image processing toolbox, updated doc |
|
Contact us at files@mathworks.com