阅读:2286回复:0
ENVI批处理问题
<P>小弟是envi初学者,idl基本不懂。</P>
<P>最近要处理一批图像数据,想使用envi的批处理功能,看了一些书,尝试按照envi附带的例子改了改,但是运行结果不对,还请大虾指教。</P> <P>主要思想是进行批处理的配准,配准的坐标文件在各自的.pts文件中,配准的投影方式是我新建的(envi中没有)。原始的图像dat文件仅包含灰度信息,并有相应的头文件。</P> <P>编译可以通过,运行也顺利,但是输出的文件test的大小为0。batch.txt文件的内容为:</P> <P>ENVI Error [Thu May 14 09:04:10 2009]</P> <P>envi_register_doit: An error has occurred during processing</P> <P>Error: "Array dimensions must be greater than 0." The result<BR>may be invalid.<BR></P> <P>idl程序如下,我的idl版本为6.4.1:</P> <P>forward_function envi_translate_projection_units, $<BR> envi_proj_create</P> <P>pro example_envi_register_doit<BR> ;<BR> ; First restore all the base save files.<BR> ;<BR> envi, /restore_base_save_files<BR> ;<BR> ; Initialize ENVI and send all errors<BR> ; and warnings to the file batch.txt<BR> ;<BR> envi_batch_init, log_file='batch.txt'<BR> ;<BR> ; Open the input file<BR> ;<BR> envi_open_file, ‘image.dat', r_fid=fid<BR> if (fid eq -1) then begin<BR> envi_batch_exit<BR> return<BR> endif<BR> ;<BR> ; Set the DIMS and POS to keywords<BR> ; to processes all spatial and all<BR> ; spectral data. Output the result<BR> ; to disk.<BR> ;<BR> envi_file_query, fid, ns=ns, nl=nl, nb=nb<BR> dims = [-1, 0, ns-1, 0, nl-1]<BR> pos = lindgen(nb)<BR> out_name = 'test'<BR> ;<BR> ; Setup the points file with the map<BR> ; coordinates for know pixel locations and<BR> ; create projection for the map coordinates.<BR> ; Set the output pixel size to 30 meters.<BR> ;<BR> openr,lun,’image.pts',/get_lun<BR>pts=DblArr(4,nl*2)<BR>readf,lun,pts<BR>free_lun,lun</P> <P> ;<BR> ; Create the projection of the map coordinates<BR> ;</P> <P><BR>; Define the PARAMS values<BR>;<BR>Params =[1737400.0, 1737400.0, -90.000000, 0.000000, 0.0, 0.0]<BR>;<BR>; Define the Datum and projection name<BR>datum = 'Moon'<BR>name = 'Moon South Polar Stereographic'<BR>;<BR>; Create the projection<BR>;<BR>units = envi_translate_projection_units('Meters')</P> <P>proj = envi_proj_create(type=31, $<BR> name=name, datum=datum, params=params)</P> <P><BR>pixel_size = [120., 120.]</P> <P> ;<BR> ; Perform the image-to-map registration.</P> <P><BR> envi_doit, 'envi_register_doit', $<BR> w_fid=fid, w_pos=pos, w_dims=dims, $<BR> method=6, out_name=out_name, $<BR> pts=pts, pixel_size=pixel_size, $<BR> proj=proj, r_fid=r_fid<BR> ;<BR> ; Exit ENVI<BR> ;<BR> envi_batch_exit<BR>end</P> <P>先谢过各位大侠!</P> |
|