The function implements a Hough transformation for an image.
hough(oData, mode=1, XYSamples=nrow(oData), DeltaXY=1.0,
XYmin=-0.5*DeltaXY*(XYSamples-1), ThetaSamples=181,
RhoSamples=2*round(sqrt(sum((dim(oData))^2))/2)+1, ThetaMin=0,
RhoMin=-0.5*((2*round(sqrt(sum((dim(oData))^2))/2)+1)-1),
DeltaTheta=pi/ThetaSamples, DeltaRho=(2*abs(RhoMin)+1)/RhoSamples,
DebugLevel = "Normal")
(matrix) A matrix that contains the image (for the Hough transformation).
(integer) The optimization strategy for the Hough transformation. Default is mode=1
for no optimization. Also implemented are mode=2
for 'vector mapping', mode=3
for 'avoid limit check and use vector mapping' and mode=4
for 'avoid limit check and use matrix mapping'.
(integer) Specifies the number of samples on the x-axis (rows) and y-axis (columns) of oData
. Defaults to XYSamples=nrow(oData)
.
(double) Specifies the sampling distance of both axes in the image. Defaults to DeltaXY=1
.
(double) Specifies the minimum sample position in the image on the first and second axis. If not given, the image is centered around the middle. Defaults to XYmin=-0.5*DeltaXY*(XYSamples-1)
.
(integer) Specifies the number of samples in the angular parameter \(\theta\) in the Hough transformation image. It is sampled linearly from \(0\) to (approximately) \(\pi\) radians. Defaults to ThetaSamples=181
.
Specifies the number of samples in the distance parameter \(\rho\) in the Hough transformation image.
Defaults to RhoSamples=2*round(sqrt(sum((dim(oData))^2))/2)+1
.
(double) Specifies the minimum sample position in the Hough transformation image on the first axis. Defaults to ThetaMin=0
.
(double) Specifies the minimum sample position in the Hough transformation image on the second axis.
Defaults to RhoMin=-0.5*((2*round(sqrt(sum((dim(oData))^2))/2)+1)-1)
.
(double) Angular sampling distance. Defaults to DeltaTheta=pi/ThetaSamples
.
(double) Specifies the sampling distance in \(\rho\). The program will center the sampling points around \(0\). Defaults to DeltaRho=(2*abs(RhoMin)+1)/RhoSamples
(character) This parameter controls the level of output. Defaults to DebugLevel="Normal"
for a standard level output. Alternative implementations are "Detail"
if it is desirable to show almost all output on screen or "HardCore"
for no information at all.
A matrix, that contains the Hough transformation of oData
.
A list of following values:
The dimension of the hData
.
The minimum x- and y-position in hData
.
Sampling distance on the x- and y-axis in hData
.
Arguments of the call to hough
.
It is shown in the paper of P.Toft that the Hough transformation can be defined in a way that gives exactly the same discrete parameter domain as found with the nearest neighbour approximation of the discrete Radon transformation. The Hough transformation does not have the same property. It is also shown that the Hough transformation behaves very differently when changing the sampling intervals in the discrete parameter domain, compared to the discrete Radon transformation. Furthermore different optimization schemes for the Hough transformation are described there.
Toft, Peter, Ph.D. Thesis, The Radon Transform - Theory and Implementation, Department of Mathematical Modelling Section for Digital Signal Processing, Technical University of Denmark, 1996. http://eivind.imm.dtu.dk/staff/ptoft/ptoft_papers.html
# NOT RUN {
P <- phantom()
hP <- hough(P)
viewData(list(P, hP$hData), list("Phantom", "Hough transformed phantom"))
rm(P,hP)
# }
Run the code above in your browser using DataLab