Hi all,
I've been working with a marine radar, which produces an images of sea
ice. I am trying to georeference the images, and I can do it
successfully by hand using the envi gui, but I've written an IDL code
to try and automate the process. I am calling ENVI_REGISTER_DOIT, to
do image to map registration based on some GPS points I have. I think
there is something wrong related to the pixel size and the output size
of my image.
Currently, when I set the dimensions of my output warped image to be
the same as the input image, and I set the pixel size to be 10.8
meters (estimated acutal pixel size), it only plots 1/4 of the
original image. I also experimented with the image size and cant get
the right dimensions.
If I leave the pixel size at 30 (unrealistic) it will plot the entire
image, but the georeferenced coordinates dont compare well with actual
values.
My question is, why would this work with the gui but not with the
code? The only thing I can see that is different, is that when using
the gui, envi automatically calculates the pixel dimensions (x,y) for
the resampled image, whereas when calling envi_register_doit I have to
give the dimensions. But even when supplying the dimensions that the
gui had for 10.8 meters, I still only get a subset of my image in the
end.
Any suggestions would definitly be appreciated!!
Thanks,
Christina
Here is the portion of my code:
pro envi_geoloc_rdr
compile_opt idl2
envi, /restore_base_save_files
envi_batch_init, log_file='batch.txt'
envi_open_file, 'SIR20060725_0601.png', r_fid=fid
; Get dimensions of input image
envi_file_query, fid, ns=ns, nl=nl, nb=nb,
dims = [-1, 0, ns-1, 0, nl-1]
pos = lindgen(nb)
;GPS points and pixel location:
pts = [[583695.9901, 7911358.9359, 720.00, 514.00], $
[582018.7661, 7914627.4129, 638.00, 365.00], $
[578079.7761, 7910047.9329, 465.00, 582.00], $
[578374.0861, 7909281.7329, 478.00, 623.00], $
[583118.377, 7911923.053, 688.00, 487.00], $
[581074.1161, 7913623.7529, 599.00, 414.00], $
[577392.7161, 7908451.1629, 433.00, 660.00]]
UNITS = envi_translate_projection_units('Meters')
PROJ = envi_proj_create(/utm, datum='North America 1927', zone=4,
units=units)
;pixel_size = [30., 30.]
pixel_size = [10.8, 10.8]
; Perform the image-to-map registration.
envi_doit, 'envi_register_doit', $
w_fid=fid, w_pos=pos, w_dims=dims, $
method=4, /IN_MEMORY, $
pts=pts, pixel_size=pixel_size, $
proj=proj, r_fid=use_fileID
; Save as geotiff
envi_output_to_external_format, /TIFF, out_name='/space2/williams/
Radar_Imgs/test_tiff5.tif', fid=use_fileID, pos=pos, dims=dims
envi_batch_exit
end
---------------------------
Christina Williams
Geophysical Institute
University of Alaska, Fairbanks
---------------------------
|