【正文】
時,把x數(shù)據(jù)進(jìn)行部分提取,x1=x(1:10:256)。salt amp。3 4],經(jīng)過該函數(shù)處理后,原矩陣變?yōu)閇3 4。執(zhí)行該操作,調(diào)節(jié)滑動條到上圖所示位置,結(jié)果如下圖截圖在MATLAB中,用函數(shù)imcrop實現(xiàn)對圖像的剪切操作。由于imadjust函數(shù)有五個參數(shù),所以原則上需要設(shè)計五個滑動條來調(diào)節(jié)對比度,這對用戶來說顯然比較麻煩,因此在設(shè)計的時候固定其中的三個參數(shù),通過調(diào)節(jié)兩個參數(shù)的值來改變亮度和對比度。,39。input parameter 239。程序為:y=rgb2gray()。 執(zhí)行后效果圖如下:如果沒有保存彈出錯誤對話框:退出程序如下所示:clc。(4)、分析一個圖像的頻譜特征,利用傅里葉變換,將圖像從空間域變換到頻域,然后進(jìn)行各種處理,經(jīng)過高通濾波器或是低通濾波器。四. 程序需求和功能模塊分析在設(shè)計過程中出滿足了一般的數(shù)字圖像處理功能。然后按照自己擬定的功能要求進(jìn)行程序設(shè)計和調(diào)試。 1)圖像的讀取和保存。例如讀取圖像、保存圖像、圖像的旋轉(zhuǎn)變換、加噪聲去噪聲、彩色圖像直方圖統(tǒng)計、頻譜分析、灰度圖像處理和彩色圖像的顏色轉(zhuǎn)換模型等基本功能。(5)、為了科學(xué)地定量描述和使用顏色,人們提出了各種顏色模型,按用途可分為三類:計算顏色模型,視覺顏色模型和工業(yè)顏色模型。close all。 imshow(y)。,39。139。 [0 ],[0 1],,滑動條設(shè)計如下圖:亮度調(diào)整的tag名為ld,取值范圍0~1,gamma值的tag名為gamma,取值范圍為0~5。該操作剪切的是圖像中的一個矩形子圖,用戶可以通過參數(shù)指定這個矩形四個頂點的坐標(biāo),也可以交互地用鼠標(biāo)選取這個矩形。1 2]。 pepper39。horz=1:10:256。this is a color image ,can not convert 39。 % 數(shù)據(jù)類型轉(zhuǎn)換k=fft2(f)。 % 計算高通濾波器傳遞函數(shù) if d=d0 h=0。x=()。 pepper39。 %截止頻率為10m=fix(M/2)。imshow(y3)。,39。sobel39。再例如同一個操作對灰度圖像可以使用,當(dāng)用戶選擇的是彩色圖像時,該操作就會出錯?這是由于設(shè)計程序時,本身程序是有針對性的,有些程序只能對灰度圖像有效,有些對彩色圖像有效,但是用戶并不清楚這些,所以在設(shè)計的過程中就要考慮全面,要分開設(shè)計。例如邊緣檢測函數(shù)的實現(xiàn),在建立了BUTTON GROUP之后,添加RADIO BUTTON按鈕,然后右鍵調(diào)用SelectionChangeF,彈出M文件,在相應(yīng)的地方編寫。imshow(y)。prewitt39。canny39。通過本次課程設(shè)計,使自己對MATLAB GUI設(shè)計流程有了比較深刻的體會,同時也了解了一般軟件設(shè)計的過程。no file selected39。 =y。,39。end%function exit_Callback(hObject, eventdata, handles)% hObject handle to exit (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)clc。,39。input parametergamma39。}。 x=()。)。defans={39。nearest39。39。)。 imshow(y)。end% function left90_Callback(hObject, eventdata, handles)% hObject handle to left90 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()。function other_Callback(hObject, eventdata, handles)% hObject handle to other (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()。input parameter39。,39。 p=inputdlg(prompt,39。imshow(y)。}。salt amp。input parameter1:39。p1=str2num(p{1})。HandleVisibility39。bar(horz,x1)。)。,0:50:255)。,39。axis([0 255 0 150000])。This is already a gray level image39。 imshow(log(abs(y)),[])。,39。 g=fft2(f)。 h=1/(1+*(d/d0)^(2*nn))。if isrgb(x) msgbox(39。 f=double(y1)。for i=1:M for j=1:N d=sqrt((im)^2+(jn)^2)。 end灰度圖像處理欄:%function huiduchuli_Callback(hObject, eventdata, handles)% hObject handle to huiduchuli (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%function erzhituxiang_Callback(hObject, eventdata, handles)% hObject handle to erzhituxiang (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes()。imshow(j)。elsej=im2bw(x)。if isrgb(x) msgbox(39。end%function tuxianglunkuo_Callback(hObject, eventdata, handles)% hObject handle to tuxianglunkuo (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)顏色轉(zhuǎn)換模型菜單欄:%function yansemoxing_Callback(hObject, eventdata, handles)% hObject handle to yansemoxing (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%function RGB_Callback(hObject, eventdata, handles)% hObject handle to RGB (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%function NTSC_Callback(hObject, eventdata, handles)% hObject handle to NTSC (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%RGBNTSCaxes()。)。error39。,39。原圖39。 case 39。 BW=edge(y,39。)。 BW=edge(y,39。 case 39。)。end%function YCBCR_Callback(hObject, eventdata, handles)% hObject handle to YCBCR (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA