IDL输出影像的快视图

话不多说,直接上代码 

PRO export_quick_image,input_file=input_file,out_ipg=out_jpg
COMPILE_OPT IDL2
e=envi(/headless)
;input_file为输入影像的路径
raster=e.OpenRaster(input_file)
;进行RGB线性拉伸
Task = ENVITask('LinearPercentStretchRaster')
Task.INPUT_RASTER = input_file
Task.PERCENT=[2.0]
Task.Execute
outraster=Task.OUTPUT_RASTER
data=outraster.GetData()
lookup1=indgen(256)
lookup1[0]=255
lookup=[[lookup1],[lookup1],[lookup1]]
data=outraster.GetData(BANDS=[2,1,0]);如果是单波段的影像这边Data=outraster.GetData(BANDS=0)
I=image(data,MARGIN=0,rgb_table=lookup,/buffer,/order);dimensions=[rows,columns]
I.BACKGROUND_COLOR=[255,255,255]
;out_jpg为输出快视图的路径
I.save,out_jpg
END

 

你可能感兴趣的:(IDL)