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

Home » Public Forums » archive » Image subtraction values
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
Image subtraction values [message #71574] Sat, 03 July 2010 22:00
beardown911 is currently offline  beardown911
Messages: 21
Registered: March 2007
Junior Member
Dear all,

I've been trying to calculate deviation of each image from the mean at
pixel by pixel basis.
When I checked pixel values, they look to be way high.
I've trying to figure it out, but due to my short knowledge of IDL,
problem solving doesn't seem to progress.
For your better understanding, I would like to show what I wrote.
I really appreciate for your comments and advice.

;----------------------------------------------------------- --------------------------------------
pro deviation

file = File_Search('C:\DataProcessing\Images\*.tif', Count=count)

nImages = n_elements(file)

OK = QUERY_TIFF(file[0], info)
print, info.dimensions

imageSize = info.dimensions
ns = imageSize[0]
nl = imageSize[1]

Volume = fltarr(ns, nl, nImages)
imageMean = fltarr(ns, nl) ; stacked image mean
imageDev = fltarr(ns, nl) ; image difference
imageFloat = fltarr(ns, nl) ; converting floating point


FOR i=0, count-1 DO BEGIN

Image = READ_TIFF(file[i])
imageFloat = float(reform(Image))

Volume[*,*,i] = imageFloat
imageMean = total(Volume, 3)/nImages
imageDev = imageFloat - imageMean

FILE_MKDIR, 'C:\DataProcessing\Images\Temp\'
outdir = 'C:\DataProcessing\Images\Temp\'
basename = File_BaseName(file, '.tif')
outfile = outdir + basename + '.dev.dat'

OPENW, LUN, (outfile[i]), /GET_LUN
WRITEU, LUN, imageDev
FREE_LUN, LUN

ENDFOR

END
;----------------------------------------------------------- -----------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Build Projects from IDL Workbench
Next Topic: FDL for IA64/linux architecture?

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

Current Time: Fri Oct 10 12:52:01 PDT 2025

Total time taken to generate the page: 4.32146 seconds