View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Select Connected Components in N-D Array

5.0 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 333 KB File ID: #39135 Version: 1.0
image thumbnail

Select Connected Components in N-D Array



Select objects in binary N-D array. Can replace Matlab's "bwselect" which is limited to 2D matrices.

| Watch this File

File Information

This function selects object(s) in binary N-D array. It can replace Matlab's "bwselect" (minus the interactive mode) which is limited to 2D matrices.

  Xin - input N-D array. Required.
  conn - connectivity definition, can be either a scalar or connectivity array, with same number of dimensions as the input array. If empty or omitted, conn will be set to scalar 3^ndims(Xin)-1.

  I or I1, I2, ... - selected indices (single linear index or series of subscripts for each dimension of the input array.

  Xout - Output N-D array (same size as Xin), with only the connected-components objects which overlap the indices set.

Examples for usage can be seen in the "testSuite.m" file. The image above is the result of running the test suite 2D part.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
14 Mar 2013 Amarjot

Amarjot (view profile)

Thanks for you help!! the codes works. I appreciate your help!

13 Mar 2013 Amarjot

Amarjot (view profile)

I am trying to use your code to remove false edges or unconnected edges in my image but when i am applying the code the output is black. I am not sure if i am doing some thing wrong. can you please suggest? I emailed you regarding the same.


Contact us