Package org.itk.simple
Class CannyEdgeDetectionImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.CannyEdgeDetectionImageFilter
This filter is an implementation of a Canny edge detector for scalar-
valued images.
Based on John Canny's paper "A Computational Approach to Edge
Detection"(IEEE Transactions on Pattern Analysis and Machine
Intelligence, Vol. PAMI-8, No.6, November 1986), there are four major
steps used in the edge-detection scheme: (1) Smooth the input image
with Gaussian filter. (2) Calculate the second directional derivatives
of the smoothed image. (3) Non-Maximum Suppression: the zero-crossings
of 2nd derivative are found, and the sign of third derivative is used
to find the correct extrema. (4) The hysteresis thresholding is
applied to the gradient magnitude (multiplied with zero-crossings) of
the smoothed image to find and link edges.
Inputs and Outputs
The input to this filter should be a scalar, real-valued Itk image of
arbitrary dimension. The output should also be a scalar, real-value
Itk image of the same dimensionality.
Parameters
There are four parameters for this filter that control the sub-filters
used by the algorithm.
Variance and Maximum error are used in the Gaussian smoothing of the
input image. See itkDiscreteGaussianImageFilter for information on
these parameters.
Threshold is the lowest allowed value in the output image. Its data
type is the same as the data type of the output image. Any values
below the Threshold level will be replaced with the OutsideValue
parameter value, whose default is zero.
TodoEdge-linking will be added when an itk connected component
labeling algorithm is available.
See:
DiscreteGaussianImageFilter
ZeroCrossingImageFilter
ThresholdImageFilter
itk::simple::CannyEdgeDetection for the procedural interface
itk::CannyEdgeDetectionImageFilter for the Doxygen on the original ITK class.
C++ includes: sitkCannyEdgeDetectionImageFilter.h
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::CannyEdgeDetectionImageFilter::CannyEdgeDetectionImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
CannyEdgeDetectionImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::CannyEdgeDetectionImageFilter::~CannyEdgeDetectionImageFilter() DestructorImage itk::simple::CannyEdgeDetectionImageFilter::Execute(const Image &image1) Execute the filter on the input imageprotected void
finalize()
protected static long
double
double itk::simple::CannyEdgeDetectionImageFilter::GetLowerThreshold() conststd::vector<double> itk::simple::CannyEdgeDetectionImageFilter::GetMaximumError() const Set/Get the maximum error of the Gaussian smoothing kernel in each dimensional direction.getName()
std::string itk::simple::CannyEdgeDetectionImageFilter::GetName() const Name of this classdouble
double itk::simple::CannyEdgeDetectionImageFilter::GetUpperThreshold() conststd::vector<double> itk::simple::CannyEdgeDetectionImageFilter::GetVariance() const Set/Get the variance of the Gaussian smoothing filter.void
setLowerThreshold
(double LowerThreshold) Self& itk::simple::CannyEdgeDetectionImageFilter::SetLowerThreshold(double LowerThreshold) Set the lower threshold value for detected edges.void
setMaximumError
(double value) Self& itk::simple::CannyEdgeDetectionImageFilter::SetMaximumError(std::vector< double > MaximumError) Set/Get the MaximumError parameter used by the Gaussian smoothing filter in this algorithmvoid
setMaximumError
(VectorDouble MaximumError) Self& itk::simple::CannyEdgeDetectionImageFilter::SetMaximumError(std::vector< double > MaximumError) Set/Get the MaximumError parameter used by the Gaussian smoothing filter in this algorithmvoid
setUpperThreshold
(double UpperThreshold) Self& itk::simple::CannyEdgeDetectionImageFilter::SetUpperThreshold(double UpperThreshold) Set the upper threshold value for detected edges.void
setVariance
(double value) Self& itk::simple::CannyEdgeDetectionImageFilter::SetVariance(std::vector< double > Variance) Set/Get the variance of the Gaussian smoothing filter.void
setVariance
(VectorDouble Variance) Self& itk::simple::CannyEdgeDetectionImageFilter::SetVariance(std::vector< double > Variance) Set/Get the variance of the Gaussian smoothing filter.protected static long
toString()
std::string itk::simple::CannyEdgeDetectionImageFilter::ToString() const Print ourselves outMethods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
CannyEdgeDetectionImageFilter
protected CannyEdgeDetectionImageFilter(long cPtr, boolean cMemoryOwn) -
CannyEdgeDetectionImageFilter
public CannyEdgeDetectionImageFilter()itk::simple::CannyEdgeDetectionImageFilter::CannyEdgeDetectionImageFilter() Default Constructor that takes no arguments and initializes default parameters
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::CannyEdgeDetectionImageFilter::~CannyEdgeDetectionImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setLowerThreshold
public void setLowerThreshold(double LowerThreshold) Self& itk::simple::CannyEdgeDetectionImageFilter::SetLowerThreshold(double LowerThreshold) Set the lower threshold value for detected edges. -
getLowerThreshold
public double getLowerThreshold()double itk::simple::CannyEdgeDetectionImageFilter::GetLowerThreshold() const -
setUpperThreshold
public void setUpperThreshold(double UpperThreshold) Self& itk::simple::CannyEdgeDetectionImageFilter::SetUpperThreshold(double UpperThreshold) Set the upper threshold value for detected edges. TODO: Document in the ITKv4 migration guide that the SetThreshold member function was removed from the CannyEdgeDetectionImageFilter , and that both UpperThreshold and LowerThreshold need to be set. To get the same results as with the SetThreshold method change "myfilter->SetThrehsold" to "myfilter->SetUpperThreshold", and add "myfilter->SetLowerThreshold(GetUpperThreshold()/2.0)". -
getUpperThreshold
public double getUpperThreshold()double itk::simple::CannyEdgeDetectionImageFilter::GetUpperThreshold() const -
setVariance
Self& itk::simple::CannyEdgeDetectionImageFilter::SetVariance(std::vector< double > Variance) Set/Get the variance of the Gaussian smoothing filter. -
setVariance
public void setVariance(double value) Self& itk::simple::CannyEdgeDetectionImageFilter::SetVariance(std::vector< double > Variance) Set/Get the variance of the Gaussian smoothing filter. -
getVariance
std::vector<double> itk::simple::CannyEdgeDetectionImageFilter::GetVariance() const Set/Get the variance of the Gaussian smoothing filter. -
setMaximumError
Self& itk::simple::CannyEdgeDetectionImageFilter::SetMaximumError(std::vector< double > MaximumError) Set/Get the MaximumError parameter used by the Gaussian smoothing filter in this algorithm -
setMaximumError
public void setMaximumError(double value) Self& itk::simple::CannyEdgeDetectionImageFilter::SetMaximumError(std::vector< double > MaximumError) Set/Get the MaximumError parameter used by the Gaussian smoothing filter in this algorithm -
getMaximumError
std::vector<double> itk::simple::CannyEdgeDetectionImageFilter::GetMaximumError() const Set/Get the maximum error of the Gaussian smoothing kernel in each dimensional direction. -
getName
std::string itk::simple::CannyEdgeDetectionImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::CannyEdgeDetectionImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::CannyEdgeDetectionImageFilter::Execute(const Image &image1) Execute the filter on the input image
-