comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: HELP: replace missing value with closest good pixel

Re: HELP: replace missing value with closest good pixel
type: item
description: In article <3rkser$sf3@llnews.ll.mit.edu>, knight@ll.mit.edu writes: |> |> I have 2-D images with flaws, i.e., missing pixels. I want to replace each |> missing pixel with the closest good pixel. Does anybody have a routine to do |> this? For example, |> |> new = replace(image,missing=99) |> |> where |> image = 2-D array |> missing = keyword to specify the value which is to be replaced |> new = image with each pixel having value 99 replaced by closest pixel |> with a value not equal to 99. |> |> Thanks for any help, |> Fred |> |> |> -- |> =Fred Knight (knight@ll.mit.edu) (617) 981-2027 |> C-483\\MIT Lincoln Laboratory\\244 Wood Street\\Lexington, MA 02173 -- try this: pro fill_image,a,ii,niter=niter,view=view,flick=flick,omega=omeg a,tol=tol,po=po ;+ ; ROUTINE: fill_image ; ; USEAGE: fill_image,a,ii ; fill_image,a,ii,niter=niter,view=view,flick=flick,$ ; omega=omega,tol=tol,po=po ; ; PURPOSE: fill in undefined regions of a 2-d array by interpolation ; ; INPUT: ; a image array with some undefined points ; ii index array of bad image points, ; E.G., ii=where(aa eq 999) ; KEYWORD INPUT ; tol maximum tolerance to achieve before stopping iteration ; (default=0.001) ; niter number of smoothing iterations (default=100) ; view if set, TV current array every VIEW iterations ; po if set print diagnostic print out every PO iterations ; flick if set, display comparison of input and output arrays ; omega over-relaxation parameter (default=1.0) ; a value of omega slightly greater than 1 may speed up ; convergence (too large and the iteration will fail). ; ; OUTPUT: ; a image array with initially undefined points replaced ; with values that vary smoothly in both the horizontal and ; vertical directions. Initially defined points are ; unchanged. ; ; PROCEDURE: In the undefined regions, the image field is assumed ; to have minimal curvature. Hence the image field obeys ; Laplace's equation: ; ; div.div(a)=0 ; ; This equation is solved by the method of successive over ; relaxation ov…
creator: paul
date: 1995-06-14T07:00:00-00:00

Re: HELP: replace missing value with closest good pixel
type: item
description: knight@ll.mit.edu writes: > I have 2-D images with flaws, i.e., missing pixels. I want to replace each > missing pixel with the closest good pixel. Does anybody have a routine to do > this? For example, > new = replace(image,missing=99) > where > image = 2-D array > missing = keyword to specify the value which is to be replaced > new = image with each pixel having value 99 replaced by closest pixel > with a value not equal to 99. Here's a simple technique that seems to work well. new = image w = where(new eq missing) m = median(new,3) new(w) = m(w) The median filter does a nice job filling in the missing pixels (if the missing value is outside the range for good pixels). The size of the filter can be adjusted for the severity of the missing data. Only the missing pixels are modified, the rest of the image is untouched. Ray Sterner sterner@tesla.jhuapl.edu The Johns Hopkins University North latitude 39.16 degrees. Applied Physics Laboratory West longitude 76.90 degrees. Laurel, MD 20723-6099 WWW Home page: ftp://fermi.jhuapl.edu/www/s1r/people/res/res.html
creator: sterner
date: 1995-06-14T07:00:00-00:00