]> Creatis software - CreaPhase.git/blob - octave_packages/image-1.0.15/bwselect.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / image-1.0.15 / bwselect.m
1 ## -*- texinfo -*-
2 ## @deftypefn {Function File} {[@var{imout}, @var{idx}] =} bwselect(@var{im}, @var{cols}, @var{rows}, @var{connect})
3 ## Select connected regions in a binary image.
4 ##
5 ## @table @code
6 ## @item @var{im}
7 ## binary input image
8 ## @item [@var{cols}, @var{rows}]
9 ## vectors of starting points (x,y)
10 ## @item @var{connect}
11 ## connectedness 4 or 8. default is 8
12 ## @item @var{imout}
13 ## the image of all objects in image im that overlap
14 ## pixels in (cols,rows)
15 ## @item @var{idx}
16 ## index of pixels in imout
17 ## @end table
18 ## @end deftypefn
19
20 # Copyright (C) 1999 Andy Adler
21 # This code has no warrany whatsoever.
22 # Do what you like with this code as long as you
23 #     leave this copyright in place.
24 #
25 # $Id: bwselect.m 3011 2007-01-04 23:46:17Z hauberg $
26 function [imout, idx] = bwselect( im, cols, rows, connect )
27
28 if nargin<4
29    connect= 8;
30 end
31
32 [jnk,idx]= bwfill( ~im, cols,rows, connect );
33
34 imout= zeros( size(jnk) );
35 imout( idx ) = 1;
36
37
38 # $Log$
39 # Revision 1.3  2007/01/04 23:41:47  hauberg
40 # Minor changes in help text
41 #
42 # Revision 1.2  2007/01/02 21:58:38  hauberg
43 # Documentation is now in Texinfo (looks better on the website)
44 #
45 # Revision 1.1  2006/08/20 12:59:32  hauberg
46 # Changed the structure to match the package system
47 #
48 # Revision 1.1  2002/03/17 02:38:52  aadler
49 # fill and edge detection operators
50 #
51 # Revision 1.1  1999/06/08 17:06:01  aadler
52 # Initial revision
53 #
54 #
55