help-octave
[Top][All Lists]

Re: Zerocrossings in an image

 From: Etienne Grossmann Subject: Re: Zerocrossings in an image Date: Sun, 17 Apr 2005 13:10:42 -0400 User-agent: Mutt/1.4.2.1i

```Hth

f = 2*kron (randn(4)>0,ones(4))-1

z0 = f<0;                 ## Negative
[R,C] = size(f);
z = zeros(R,C);
z(1:R-1,:) |= z0(2:R,:);  ## Grow
z(2:R,:) |= z0(1:R-1,:);
z(:,1:C-1) |= z0(:,2:C);
z(:,2:C) |= z0(:,1:C-1);

z &= !z0                  ## "Positive zero-crossings"?

On Sun, Apr 17, 2005 at 06:02:02PM +0200, Søren Hauberg wrote:
# Hi
# Does anybody here know a simple way to find the zerocrossings in an
# image in Octave?
# I usually do something like this (where f is the image (or 2d function))
#
# zerocrossings = bwmorph(f>=0, "remove");
#
# but then I depend on bwmorph which only is octave-forge (which I don't
# have at school).
#
# Any help would be great,
# \Søren
#
#
#
# -------------------------------------------------------------
# Octave is freely available under the terms of the GNU GPL.
#
# Octave's home on the web:  http://www.octave.org
# How to fund new projects:  http://www.octave.org/funding.html
# Subscription information:  http://www.octave.org/archive.html
# -------------------------------------------------------------
#

--
Etienne Grossmann ------ http://www.cs.uky.edu/~etienne

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```