MATLAB中regionprops的一些屬性

2021-09-29 14:54:47 字數 1036 閱讀 2867

matlab中regionprops一般用在標記連通區域後,用來獲得被標記的連通區域的一些屬性:

[img_label,n]=bwlabel(img_bw_open,4);

props=regionprops(img_label);

props是乙個結構體,如果寫成regionprops(img_label)或regionprops(img_label,'basic')時,props中只獲得連通區域的三個基本屬性:area,centroid,boundingbox(區分大小寫):

area:每個連通區域畫素點的總個數,是乙個標量。

centroid:每個連通區域重心座標(注意不是中心)。

boundingbox:包圍每個連通區域的最小的矩形,其形式為[x,y,x_width,y_width],分別表示[左上角橫座標,左上角縱座標,矩形寬,矩形高]。

boundingbox常與rectangle連用:rectangle('position',[x,y,w,h]),其[x,y,w,h]正好對應boundingbox得到的[x,y,x_width,y_width]。

如果想要獲得連通區域的全部屬性,需要輸入以下**:

props=regionprops(img_label,'all');
regionprops獲得的全部屬性

area

equivdiameter

majoraxislength

boundingbox

eulernumber

minoraxislength

centroid

extent

orientation

convexarea

extrema

pixelidxlist

convexhull

filledarea

pixellist

conveximage

filledimage

solidity

eccentricity

image

Matlab 在Matlab中如何畫圓

rectangle函式功能 建立二維矩形物件。1.1 rectangle position x,y,w,h 其中以x,y為起始座標開始,畫出長為w,寬為h的矩形。1.2 rectangle curvature a,b 指定矩陣邊的曲率,可以使它從矩形到橢圓不同變化,水平曲率x為矩形寬度的分數,是沿著...

Matlab中的括號()

matlab中經常會用到括號去引用某array或者是cel l的內容,但三者有什麼具體區別呢?中括號用來構建向量 vectors 或者是矩陣 matrices 如 6.9 9.64 sqrt 1 就是乙個有三個元素的向量。11 12 13 21 22 23 是乙個二乘三的矩陣.分號 用來結束一行。中...

MATLAB中fopen fprintf函式的用法

matlab中fopen函式在指定檔案開啟的例項如下 1 fopen 開啟檔案,賦予檔案代號。語法1 fid fopen filename,permission 用指定的方式開啟檔案 fid n n是正整數 表示檔案開啟成功,檔案代號是n.fid 1 表示檔案開啟不成功。fid在此次檔案關閉前總是有...