[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thresholding/color question

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) *

  Alex Schuster     Wonko@weird.cologne.de          PGP Key available