Re: Division of two images [message #29257] |
Fri, 08 February 2002 05:19  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Carsten Liess (carsten@rad.uni-kiel.de) writes:
> I am a complete newbie to IDL, and here's probably a very easy
> question for you guys;
> I am trying to divide one image by another (i.e. pixel by pixel),
> where the pixel intensity is quite similar in both pictures. I then
> want to create a thrid image as the result of the division.
> I read in the two images and define a fltarr for the division. The
> result I get is an image with either 0.00000 or 1.00000 intensity. For
> some reason it seems that the result of the division is an integer
> number. Can someone help?
Cast one of your arrays to FLOAT before you do
the division, otherwise you will be doing integer
division:
result = FLOAT(image1) / image2
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|