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

Re: findng array[3] in array[3,n]




"tbowers" <tbowers@nrlssc.navy.mil> writes:
>
... long description deleted ...
> colorIndex = where(eucDist EQ min(eucDist), count)
> 
> ;set the alpha channel indices = 0 where theres black
> rgbaImage[3,colorIndex] = 0
> 
> ;now it's readt for my IDLgrImage
> sState.oMapImage->setProperty, DATA=rgbaImage, HIDE=0
> 
> Problem is is that my black is still opaque. I still can't see my objects
> behind it. Is it my misunderstanding of bringing this to 3D that's illing
> me?

Before you blame oMapImage, are you sure you actually got the alpha
channel you were hoping for?

One cool thing about the Euclidean distance thing is that you don't
have to take just the minimum distance.  If you know that "black" can
be several nearby colors then you can say 

 colorIndex = where((eucDist-min(eucDist)) LT tol^2, count)

where tol is the number of deviant color levels you are willing to
accept.  This helps especially in photographic pictures where solid
swatches are rarely a single color value.

Craig

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------