[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: thresholding/color question
- Subject: Re: thresholding/color question
- From: Alex Schuster <alex(at)pet.mpin-koeln.mpg.de>
- Date: Mon, 07 Feb 2000 15:50:23 +0100
- Newsgroups: comp.lang.idl-pvwave
- Organization: Regional Computing Center, University of Cologne
- References: <38987058.E939BEAE@larc.nasa.gov> <MPG.13067cbeb6837c8b989a0c@news.frii.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:18301
David Fanning wrote:
> Then, I'd scale my image data like this:
>
> scaledImage = BytScl(image, Top=!D.Table_Size-4)
>
> I'd find the red pixels and assign them like this:
>
> redPixels = Where(image GT threshold, count)
> IF count GT 0 THEN scaledImage[redPixels] = !D.Table_Size-2
Isn"t the usage of WHERE discouraged because of being slow? I always use
direct matrix operation for this, like:
redmask = scaledImage GT threshold
scaledImage = scaled_Image * (1B-redmask) + byte(!D.Table_Size-2) *
redmask
Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de