資源簡介
用來計算Hough變換的函數,他可以幫助我們探討基于hough變換的線檢測
代碼片段和文件信息
function?[h?theta?rho]?=?hough(f?dtheta?drho)
%HOUGH?Hough?transform.
%???[H?THETA?RHO]?=?HOUGH(F?DTHETA?DRHO)?computes?the?Hough
%???transform?of?the?image?F.??DTHETA?specifies?the?spacing?(in
%???degrees)?of?the?Hough?transform?bins?along?the?theta?axis.??DRHO
%???specifies?the?spacing?of?the?Hough?transform?bins?along?the?rho
%???axis.??H?is?the?Hough?transform?matrix.??It?is?NRHO-by-NTHETA
%???where?NRHO?=?2*ceil(norm(size(F))/DRHO)?-?1?and?NTHETA?=
%???2*ceil(90/DTHETA).??Note?that?if?90/DTHETA?is?not?an?integer?the
%???actual?angle?spacing?will?be?90?/?ceil(90/DTHETA).
%
%???THETA?is?an?NTHETA-element?vector?containing?the?angle?(in
%???degrees)?corresponding?to?each?column?of?H.??RHO?is?an
%???NRHO-element?vector?containing?the?value?of?rho?corresponding?to
%???each?row?of?H.?
%
%???[H?THETA?RHO]?=?HOUGH(F)?computes?the?Hough?transform?using
%???DTHETA?=?1?and?DRHO?=?1.?
%???Copyright?2002-2004?R.?C.?Gonzalez?R.?E.?Woods?&?S.?L.?Eddins
%???Digital?Image?Processing?Using?MATLAB?Prentice-Hall?2004
%???$Revision:?1.4?$??$Date:?2003/10/26?22:33:44?$
if?nargin?3
???drho?=?1;
end
if?nargin?2
???dtheta?=?1;
end
f?=?double(f);
[MN]?=?size(f);
theta?=?linspace(-90?0?ceil(90/dtheta)?+?1);
theta?=?[theta?-fliplr(theta(2:end?-?1))];
ntheta?=?length(theta);
D?=?sqrt((M?-?1)^
- 上一篇:高斯混合模型matlab實現
- 下一篇:基于HSV非均勻量化直方圖的圖像檢索
評論
共有 條評論