Mercurial > hg > octave-image
changeset 360:99f847fb0cc3
Actually use threshold variable instead of second input
author | hauberg |
---|---|
date | Wed, 18 Mar 2009 19:14:04 +0000 |
parents | 262afafd9d88 |
children | f98f6c57bd17 |
files | inst/im2bw.m |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/inst/im2bw.m +++ b/inst/im2bw.m @@ -51,17 +51,17 @@ endif ## Do the thresholding - if (isscalar (a)) - if (a < 0 || a > 1) + if (isscalar (t)) + if (t < 0 || t > 1) error("im2bw: threshold must be in the interval [0, 1]"); endif switch (class(img)) - case {"double", "single"} % octave doesn't support single yet, but it shouldn't hurt... - BW = (img >= a); + case {"double", "single"} + BW = (img >= t); case {"uint8"} - BW = (img >= 255*a); + BW = (img >= 255*t); case {"uint16"} - BW = (img >= 65535*a); + BW = (img >= 65535*t); otherwise error("im2bw: unsupport image class"); endswitch