comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Division of two images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Division of two images [message #29257] Fri, 08 February 2002 05:19 Go to next message
David Fanning is currently offline  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
Re: Division of two images [message #29319 is a reply to message #29257] Sun, 10 February 2002 13:23 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.16cd7e552b68a769897f6@news.frii.com...
> Cast one of your arrays to FLOAT before you do
> the division, otherwise you will be doing integer
> division:
>
> result = FLOAT(image1) / image2

Yo, David, what's this "cast" stuff? You've been reading books about C
programming in bed again, haven't you?

---
Mark Hadfield
m.hadfield@niwa.co.nz http://katipo.niwa.co.nz/~hadfield
National Institute for Water and Atmospheric Research
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Tessellate Question--fewest convex polys
Next Topic: Re: Behaviour of REFORM() changed in IDL 5.5?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:43:57 PDT 2025

Total time taken to generate the page: 0.00770 seconds