annotate bwselect.m @ 6:f048aaec1b2d

fill and edge detection operators
author aadler
date Sun, 17 Mar 2002 02:38:52 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
1 function [imout, idx] = bwselect( im, cols, rows, connect )
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
2 # BWSELECT: select connected regions in a binary image
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
3 # [imout, idx] = bwselect( im, cols, rows, connect )
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
4 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
5 # im -> binary input image
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
6 # [cols,rows] -> vectors of starting points (x,y)
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
7 # connect -> connectedness 4 or 8. default is 8
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
8 # imout -> the image of all objects in image im that overlap
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
9 # pixels in (cols,rows)
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
10 # idx -> index of pixels in imout
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
11
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
12 # Copyright (C) 1999 Andy Adler
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
13 # This code has no warrany whatsoever.
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
14 # Do what you like with this code as long as you
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
15 # leave this copyright in place.
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
16 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
17 # $Id$
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
18
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
19 if nargin<4
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
20 connect= 8;
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
21 end
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
22
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
23 [jnk,idx]= bwfill( ~im, cols,rows, connect );
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
24
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
25 imout= zeros( size(jnk) );
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
26 imout( idx ) = 1;
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
27
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
28 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
29 # $Log$
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
30 # Revision 1.1 2002/03/17 02:38:52 aadler
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
31 # fill and edge detection operators
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
32 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
33 # Revision 1.1 1999/06/08 17:06:01 aadler
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
34 # Initial revision
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
35 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
36 #
f048aaec1b2d fill and edge detection operators
aadler
parents:
diff changeset
37