I want to mosaic two image together, every image is 5097*5097, and they are declining. So when specify x0 ,y0, xsize, ysize, I calculate them firstly. But my program doesn't work. Could you help me?
My code is below:
////////////////////////////////////////////////////////////////
envi_open_file, 'F:\mosaic\sz02-02.tif', r_fid = sz02_fid
if(sz02_fid eq -1) then begin
envi_batch_exit
return
endif
envi_open_file, 'F:\mosaic\sz03-02.tif', r_fid = sz03_fid
if(sz03_fid eq -1) then begin
envi_bathc_exit
return
endif
envi_file_query, sz02_fid, ns=sz02_ns, nl=sz02_nl
envi_file_query, sz03_fid, ns=sz03_ns, nl=sz03_nl
dims = [[-1,0,sz02_ns-1,0,sz02_nl-1],[-1,0,sz03_ns-1,0,sz03_nl-1]]
fids = [sz02_fid, sz03_fid]
pos = [[0,-1,-1],[0,-1,-1]]
out_ps = [1.,1.]
out_name = 'test.img'
xsize = 5193L
ysize = 10102L
x0=[195,97]
y0=[1,5002]
map_info = envi_get_map_info(fid=sz02_fid)
use_see_through = [[1L],[1]]
see_through_val = [[0L],[0]]
envi_doit, 'mosaic_doit', fid=fid, pos=pos, $
dims=dims, out_name=out_name, xsize=xsize, $
ysize=ysize, x0=x0, y0=y0, /georef, map_info=map_info, $
out_dt=2, pixel_size=out_ps, $
background=255, see_through_val=see_through_val, $
use_see_through=use_see_through
envi_batch_exit
end
/////////////////////////////////////////////////
many thanks
|