hough: Hough Transformation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/hough.r

Description

The function implements a Hough transformation for an image.

Usage

1
2
3
4
5
6
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")

Arguments

oData

(matrix) A matrix that contains the image (for the Hough transformation).

mode

(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'.

XYSamples

(integer) Specifies the number of samples on the x-axis (rows) and y-axis (columns) of oData. Defaults to XYSamples=nrow(oData).

DeltaXY

(double) Specifies the sampling distance of both axes in the image. Defaults to DeltaXY=1.

XYmin

(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).

ThetaSamples

(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.

RhoSamples

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.

ThetaMin

(double) Specifies the minimum sample position in the Hough transformation image on the first axis. Defaults to ThetaMin=0.

RhoMin

(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).

DeltaTheta

(double) Angular sampling distance. Defaults to DeltaTheta=pi/ThetaSamples.

DeltaRho

(double) Specifies the sampling distance in rho. The program will center the sampling points around 0. Defaults to DeltaRho=(2*abs(RhoMin)+1)/RhoSamples

DebugLevel

(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.

Details

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.

Value

hData

A matrix, that contains the Hough transformation of oData.

Header

A list of following values:

SignalDim

The dimension of the hData.

XYmin

The minimum x- and y-position in hData.

DeltaXY

Sampling distance on the x- and y-axis in hData.

call

Arguments of the call to hough.

Author(s)

Peter Toft, Joern Schulz jschulz78@web.de.

References

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

See Also

radon, markPoisson

Examples

1
2
3
4
P <- phantom()
hP <- hough(P)
viewData(list(P, hP$hData), list("Phantom", "Hough transformed phantom"))
rm(P,hP)

Example output

Loading required package: adimpro
Loading required package: awsMethods

Use the function setCores() to change the number of CPU cores.

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Reading RAW images requires to install dcraw, see 

    http://cybercom.net/~dcoffin/dcraw/ for LINUX and http://www.insflug.org/raw/ 
    for MAC OS and Windows 


Attaching package: 'PET'

The following object is masked from 'package:base':

    norm

Warning message:
In fun(libname, pkgname) : could not determine path to Imagemagick 

    please set the correct path manually using 

    'Sys.setenv(ImageMagick='path2imagemagick')'
Creation of the source-data --> complete. 
Using Hough1 --> complete 

PET documentation built on May 2, 2019, 2:43 a.m.