IDL编程实现图像处理文档格式.docx

上传人:b****6 文档编号:8448485 上传时间:2023-05-11 格式:DOCX 页数:9 大小:17.08KB
下载 相关 举报
IDL编程实现图像处理文档格式.docx_第1页
第1页 / 共9页
IDL编程实现图像处理文档格式.docx_第2页
第2页 / 共9页
IDL编程实现图像处理文档格式.docx_第3页
第3页 / 共9页
IDL编程实现图像处理文档格式.docx_第4页
第4页 / 共9页
IDL编程实现图像处理文档格式.docx_第5页
第5页 / 共9页
IDL编程实现图像处理文档格式.docx_第6页
第6页 / 共9页
IDL编程实现图像处理文档格式.docx_第7页
第7页 / 共9页
IDL编程实现图像处理文档格式.docx_第8页
第8页 / 共9页
IDL编程实现图像处理文档格式.docx_第9页
第9页 / 共9页
亲,该文档总共9页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

IDL编程实现图像处理文档格式.docx

《IDL编程实现图像处理文档格式.docx》由会员分享,可在线阅读,更多相关《IDL编程实现图像处理文档格式.docx(9页珍藏版)》请在冰点文库上搜索。

IDL编程实现图像处理文档格式.docx

tif'

savetif'

Save5=widget_button(fileopt2,value='

dat'

savedat'

fileopt3=widget_button(filemenu,value='

Exit'

exit_event'

/separator)

editmenu=widget_button(mbar,value='

Edit'

processopt1=widget_button(editmenu,value='

K-LTransform'

event_pro='

K_L_event'

processopt2=widget_button(editmenu,value='

HistogramEqualization'

HistogramEqualization_event'

processopt3=widget_button(editmenu,value='

NDVI'

NDVI_event'

processopt5=widget_button(editmenu,value='

ImageSmoothing'

IS_event'

processopt4=widget_button(editmenu,value='

edgeenhancement'

imageopt1=widget_button(processopt4,value='

robort'

robort_event'

imageopt2=widget_button(processopt4,value='

sobel'

sobel_event'

imageopt3=widget_button(processopt4,value='

prewitt'

prewitt_event'

helpmenu=widget_button(mbar,value='

Help'

idlhelp=widget_button(helpmenu,value='

IDLhelp'

help_event'

iconbase=widget_base(tlb,row=1,/frame)

subdir='

resource/bitmaps'

mapfile=filepath('

open.bmp'

subdir=subdir)

iconopt1=widget_button(iconbase,value=mapfile,/bitmap,event_pro='

save.bmp'

iconopt2=widget_button(iconbase,value=mapfile,/bitmap,event_pro='

Save_event'

button5=widget_button(iconbase,value='

new.bmp'

/bitmap,event_pro='

new_event'

button3=widget_button(iconbase,value='

zoom_in.bmp'

/bitmap,uvalue='

suoxiao'

button4=widget_button(iconbase,value='

zoom_out.bmp'

fangda'

help=widget_button(iconbase,value=filepath('

help.bmp'

subdirectory=['

resource'

'

bitmaps'

]),/bitmap,event_pro='

draw=widget_draw(tlb,x_scroll_size=780,y_scroll_size=550,xsize=1000,ysize=1000,xoffset=200,/button_events)

file='

'

data=BYTARR(2,2,2)

pdata=bytarr(2,2,2)

status=0

pstate=ptr_new({draw:

draw,file:

file,data:

ptr_new(data),pdata:

ptr_new(pdata)})

widget_control,tlb,set_uvalue=pstate

widget_control,tlb,/realize

XMANAGER,'

tlb,/no_block

end

proopen_event,event

compile_optIDL2

envi,/restore_base_save_files

envi_batch_init

widget_control,event.top,get_uvalue=pstate

filters=['

*.jpg'

*.bmp'

*.img'

*.tif'

*.jpeg'

*.png'

]

file=DIALOG_PICKFILE(/READ,FILTER=filters)

envi_open_file,file,r_fid=fid

iffideq-1thenreturn

envi_file_query,fid,dims=dims,nb=nb,nl=nl,ns=ns,bnames=bnames

pos=indgen(nb)

(*pstate).file=file

basename=file_basename(file)

f1=strpos(basename,'

.'

type=strmid(basename,f1+1,strlen(basename)-f1)

type=strupcase(type)

widget_control,(*pstate).draw,get_value=draw

wset,draw

CASETYPEOF

'

JPEG'

:

BEGIN

READ_JPEG,FILE,DATA

TV,DATA,/TRUE

*((*PSTATE).DATA)=DATA

END

PNG'

:

READ_PNG,FILE,DATA

JPG'

BMP'

DATA=READ_BMP(FILE)

DAT'

DATA=BYTARR(NS,NL,NB)

OPENR,LUN,FILE,/GET_LUN

READU,LUN,DATA

TVSCL,DATA

FREE_LUN,LUN

END

IMG'

data=bytarr(ns,nl,nb)

data=ENVI_GET_DATA(fid=fid,dims=dims,pos=pos)

WIDGET_CONTROL,(*pstate).draw,GET_VALUE=draw

WSET,draw

tvscl,data,/order

*((*pstate).data)=data

TIF'

DATA=BYTARR(NS,NL,NB)

DATA=ENVI_GET_DATA(FID=FID,DIMS=DIMS,POS=POS)

TVSCL,DATA,/ORDER

TIFF'

ENDCASE

prosave_event,event

file=(*pstate).file

savefile=dialog_pickfile(title='

save'

path='

D:

ifsavefileeq'

thenbegin

void=dialog_message('

Nofile!

/error)

return

endif

a=strpos(savefile,'

b=strlen(savefile)

type=strmid(savefile,a+1,b-a)

casetypeof

begin

file=(*pstate).fname

ENVI_OPEN_FILE,file,r_fid=fid

iffideq-1thenbegin

void=DIALOG_MESSAGE('

fileinputederror'

/information)

ENVI_BATCH_EXIT

return

endif

filename=DIALOG_PICKFILE(title='

choosefilesavedposition'

filter='

write_jpeg,filename+'

.jpg'

*((*pstate).data),/true

end

begin

write_JPEG,savefile,data

png'

write_png,savefile,data

write_bmp,savefile,data

end

write_tiff,savefile,data

openw,lun,binary,/get_lun

writeu,savefile,data

endcase

help,event,/struct

IFevent.SELECTTHENWIDGET_CONTROL,event.TOP,/DESTROY

prohelp_event,evevt

compile_optIDL2

envi,/restore_base_save_files

envi_batch_init

ONLINE_HELP

END

proexit_event,event

help,event,/struct

IFevent.SELECTTHENWIDGET_CONTROL,event.TOP,/DESTROY

proK_L_event,event

envi_batch_init

iffideq-1thenbegin

envi_file_query,fid,dims=dims,nb=nb

pos=lindgen(nb)

envi_doit,'

envi_stats_doit'

fid=fid,pos=pos,dims=dims,mean=avg,eval=eval,evec=evec,comp_flag=5

pc_rotate'

$

fid=fid,pos=pos,dims=dims,mean=avg,eval=eval,evec=evec,$

out_dt=4,out_name=out_name,out_nb=nb,r_fid=r_fid,/forward,/in_memory

envi_file_query,r_fid,dims=dims,nb=nb,ns=ns,nl=nl

data=bytarr(ns,nl,nb)

data=envi_get_data(fid=fid,dims=dims,pos=pos)

window,1,xsize=ns,ysize=nl,title='

spatialprincipalcomponentanalysis'

tv,data,/order

prondvi_event,event

data=*((*pstate).data)

envi_open_file,file,r_fid=fid

envi_file_query,fid,dims=dims,nb=nb,ns=ns,nl=nl

pos=[4,3]-1

envi_doit,'

ndvi_doit'

fid=fid,pos=pos,dims=dims,/check,o_min=0,o_max=255,r_fid=r_fid,/inme_mory

envi_file_query,r_fid,dims=dims,nb=nb,ns=ns,nl=nl

data=BYTARR(ns,nl,nb)

data=ENVI_GET_DATA(fid=r_fid,dims=dims,pos=pos)

window,3,title='

TVSCL,data,/order

proHistogramEqualization_event,event

envi_file_query,fid,dims=dims,nb=nb,ns=ns,nl=nl

WINDOW,1,TITLE='

Theoriginalimagehistogram'

plot,HISTOGRAM(data)

result=HIST_EQUAL(data);

ADAPT_

WINDOW,2,xsize=ns,ysize=nl,TITLE='

histogrammatching'

TV,result,/order

WINDOW,3,TITLE='

Aftertheimagehistogrammatching'

plot,HISTOGRAM(result)

proIS_event,event

data=smooth(*((*pstate).data),3)

smoothing'

tvscl,data,/order

prorobort_event,event

DATA=DATA(*,*,1)

DATA=ROBERTS(DATA)

roberts'

prosobel_event,event

DATA=*((*PSTATE).DATA)

DATA=SOBEL(DATA)

window,1,xsize=ns,ysize=nl,title='

TVSCL,data,/ORDER

proprewitt_event,event

ENVI_OPEN_FILE,file,r_fid=fid

ENVI_FILE_QUERY,fid,dims=dims,nb=nb,ns=ns,nl=nl

IFfidEQ-1THENBEGIN

void=DIALOG_MESSAGE('

window'

ENVI_BATCH_EXIT

RETURN

result=prewitt(*((*pstate).data))

TVSCL,result,/order

*((*pstate).pdata)=result

WIDGET_CONTROL,ev.top,get_Uvalue=pstate

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 人力资源管理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2