?? orient.m
字號:
% Computes the inclination angle of the segmented region.% according to the centroid coordinates (xmean, ymean), and% the segmented region itself.% See reference [5] in the references section for more details.function [theta] = orient(bw,xmean,ymean)[m n] =size(bw);bw=double(bw);a = 0; b = 0; c = 0;for i=1:m, for j=1:n, a = a + (j - xmean)^2 * bw(i,j); b = b + (j - xmean) * (i - ymean) * bw(i,j); c = c + (i - ymean)^2 * bw(i,j); end;end;b = 2 * b;theta = atan(b/(a-c))/2;% change from radians to degrees.theta = theta*(180/pi);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -