MATLAB小經驗積累(4):MATLAB常用函數

繪圖與GUI:

%{
常用的二維繪圖函數:
line
plot
subplot
polar(極座標圖)
semilogx
semilogy
loglog
pie
stem
contour
contourf
compass(羅盤圖)
feather
quiver(箭頭)
fplot

hist(概率分佈圖)
rose(極座標下的直方圖)
bar
barh
area


常用的三維繪圖函數:
plot3
mesh
meshc
meshz
meshgrid
surf
surfc
surfl
patch
fill
fill3
isosuface
isocaps
bar3(垂直放置的直方圖)
bar3h(水平放置的直方圖)
cylinder(圓柱體圖)
pie3(餅狀圖)
sphere(球面圖)
contour3(三維等高線)
stem3(三維散列圖)
簡易繪圖:
ezplot3
ezmesh
ezmeshc
ezsurf
ezsurfc

圖形的標註和控制:
lighting
hidden
shading
view
Camera
axis
grid
alpha

clabel
xlabel
ylabel
zlabel
title
text
gtext
legend
colormap
colorbar

手動:
ginput
%}

%{
uimenu          重要屬性:label 和Callback
                callback 回調一般用方括號續行、直接字符串、串變量和架構表示法,m文件調用(這個很常用,將m文件名
                            當做Callback屬性的字符串值),函數句柄調用(這個幾乎和m文件調用雷同), 大同小異

uicontrol       重要屬性:Callback
                     Style 定義控件的類型(pushbutton, radio, frame, check,edit,slider, popupmenu, list, toggle )
                     ButtonDownFcn
                     string
                     Value
uipanel         面板
uibuttongroup   按鈕組 
dialog, helpdlg, msgbox, uisetcolor, questdlg, warndlg, errordlg, inputdlg,
uiputfile, uisetfont, uigetfile

GUI 常改屬性:  String, Tag, 其他就是這幾個函數了:
Callback        激活控件的回調函數
CreateFcn       創建控件的回調函數
ButtonDownFcn   鼠標單擊控件的回調函數
KeyPressFcn     控件上按鍵的回調函數
DeleteFcn       刪除控件的回調函數
還有幾個常用的,不一一列舉了,


MATLAB 通常在這些回調函數後面添加了:
handles.output =hObject;        %選擇默認的命令行輸出(句柄)
guidata(hObject, handles);      %更新句柄結構

%}

圖像處理與計算機視覺:

%圖像處理常用函數
%{
顯示圖像的信息及讀寫顯示圖像:
imfinfo
imread
imwrite
imshow
image
imagesc
colormap
colorbar
subimage
montage(多幀顯示)
immovie
warp(紋理映射)
%
imtool
impixelinfo(圖像像素信息)
imageinfo
imformats
impixel
imdistline
%
grayslice(量化圖像)

圖像的數據轉換:
dither(圖像顏色抖動)
im2single
im2double
im2uint8
mat2gray(矩陣轉換爲一個圖像)
im2java(將圖像轉換成一個Java.Awt.Image實例)
im2java2d(將圖像轉換成一個Java.Awt.Image.BufferedImage)
im2bw
ind2gray
gray2ind
grayslice
rgb2gray
rgb2ind
ind2rgb
hsv2rgb
rgb2hsv
ntsc2rgb
rgb2ntsc
rgb2ycbcr
ycbcr2rgb


圖像算術和邏輯操作:
imadd
imsubstract
immultiply
imdivide
imabsdiff
imcomplement(圖像取反)
imlincomb(計算兩幅或多福圖像的線性組合)
graythresh
roiploy(生成掩膜)
bitand
bitor
bitcmp
bitxor

幾何變換:
imresize
makeform(定義2d空間變換)
imtransform9將變換用於圖像)
imrotate
imcrop(裁剪)
fliplr(左右翻轉)
flipud(上下翻轉)
cpselect(指定控制點)
cpcorr(調整所選控制點)
cp2tform

灰度變換:
intlut

直方圖處理:
imhist
histeq
adapthisteq
imadjust(直方圖伸展和收縮)

鄰域處理及空間濾波:
conv2: full, same, valid
filter2
imfilter
fspecial
nlfilter
colfilt
ordfilt2(用於排序濾波)
imnoise(加噪聲)

頻域濾波:
fft2
ifft2
fftshift
distmartix(各像素與圖像中心的距離)

去模糊:
deconvwnr(維納濾波)
deconvreg
deconvlucy
deconvlind

形態學處理:
strel
getsequence
imdilate
imerode
imopen
imclose
bwhitmiss(擊中擊不中)
bwmorph(很強大)
bwperim
imfill
bwlabel
label2rgb
bwselect
imlabel

邊緣檢測:
edge
hough(霍夫變換)
houghpeaks
houghlines

圖像分割:
blkproc(塊處理技術)
watershed
bwdist

彩色圖像處理:
makecform
applycform
xyz2double
xyz2uint16
lab2double
lab2uint16
lab2uint8
whitepoint
%
iccread
iccfind
iccroot
iccwrite
%
patch
rgb2hsv
hsv2rgb
rgb2ntsc
ntsc2rgb
rgb2ycbcr
ycbcr2rgb
rgb2ind(這個在彩色圖像分割中常用)
grayslice

圖像壓縮編碼:

圖像描述:
regionprops
bwtraceboundary
bwboundaries

視頻處理:
moviein()
getframe
moive
immoive(只適合index圖像)
avifile(avi文件錄製)
movie2avi
aviread
inspect
invoke


%}

數值分析:

%{
factoral 求階乘
prod(m:n)求m到n的乘積

多項式算法:
ploy(p)若p是方陣,得出|p -λE|的特徵多項式
         若p是向量, 則求(x - p1)(x - p2)……(x - pn)的解的係數
poly2str 
polyval  多項式求解
conv    多項式乘法
deconv  除法
polyder 求導
roots   求根
fzero   求函數0點

fsolve  求解方程組(數值解,最小二乘)
solve   解析解


%} 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章