ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkCannyEdgeDetectionRecursiveGaussianImageFilter.h>
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.
Definition at line 93 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
Classes | |
struct | CannyThreadStruct |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageSource< TOutputImage > | |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Types | |
using | MultiplyImageFilterType = MultiplyImageFilter< OutputImageType, OutputImageType, OutputImageType > |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TOutputImage > | |
using | InputToOutputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::OutputImageDimension, Self::InputImageDimension > |
using | OutputToInputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::InputImageDimension, Self::OutputImageDimension > |
Private Member Functions | |
void | AllocateUpdateBuffer () |
void | Compute2ndDerivative () |
void | Compute2ndDerivativePos () |
OutputImagePixelType | ComputeCannyEdge (const NeighborhoodType &it, void *globalData) |
void | FollowEdge (IndexType index) |
void | HysteresisThresholding () |
bool | InBounds (IndexType index) |
void | ThreadedCompute2ndDerivative (const OutputImageRegionType &outputRegionForThread, int threadId) |
void | ThreadedCompute2ndDerivativePos (const OutputImageRegionType &outputRegionForThread, int threadId) |
~CannyEdgeDetectionRecursiveGaussianImageFilter () override | |
Static Private Member Functions | |
static ITK_THREAD_RETURN_TYPE | Compute2ndDerivativePosThreaderCallback (void *arg) |
static ITK_THREAD_RETURN_TYPE | Compute2ndDerivativeThreaderCallback (void *arg) |
Private Attributes | |
unsigned long | m_Center |
std::slice | m_ComputeCannyEdgeSlice [ImageDimension] |
GaussianImageFilterType::Pointer | m_GaussianFilter |
OutputImagePixelType | m_LowerThreshold |
ArrayType | m_MaximumError |
MultiplyImageFilterType::Pointer | m_MultiplyImageFilter |
ListPointerType | m_NodeList |
ListNodeStorageType::Pointer | m_NodeStore |
OutputImagePixelType | m_OutsideValue |
SigmaArrayType | m_Sigma |
unsigned long | m_Stride [ImageDimension] |
OutputImagePixelType | m_Threshold |
OutputImageType::Pointer | m_UpdateBuffer1 |
OutputImagePixelType | m_UpperThreshold |
DerivativeOperator < OutputImagePixelType, itkGetStaticConstMacro(ImageDimension)> | m_ComputeCannyEdge1stDerivativeOper |
DerivativeOperator < OutputImagePixelType, itkGetStaticConstMacro(ImageDimension)> | m_ComputeCannyEdge2ndDerivativeOper |
Additional Inherited Members | |
Static Protected Member Functions inherited from itk::ImageSource< TOutputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
Protected Attributes inherited from itk::ImageSource< TOutputImage > | |
bool | m_DynamicMultiThreading |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ArrayType = FixedArray<double, itkGetStaticConstMacro(ImageDimension)> |
Typedef of double containers
Definition at line 148 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 107 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::DefaultBoundaryConditionType = ZeroFluxNeumannBoundaryCondition<OutputImageType> |
The default boundary condition is used unless overridden in the Evaluate() method.
Definition at line 121 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::GaussianImageFilterType = SmoothingRecursiveGaussianImageFilter< InputImageType, OutputImageType> |
Definition at line 115 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::IndexType = typename TInputImage::IndexType |
Definition at line 112 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::InputImagePixelType = typename TInputImage::PixelType |
Define pixel types.
Definition at line 110 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::InputImageType = TInputImage |
Image type alias support
Definition at line 102 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ListNodeStorageType = ObjectStore<ListNodeType> |
Definition at line 130 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ListNodeType = ListNode<IndexType> |
Definition at line 129 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ListPointerType = typename ListType::Pointer |
Definition at line 132 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ListType = SparseFieldLayer<ListNodeType> |
Definition at line 131 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
protected |
Definition at line 221 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::NeighborhoodType = ConstNeighborhoodIterator<OutputImageType, DefaultBoundaryConditionType> |
The type of data structure that is passed to this function object to evaluate at a pixel that does not lie on a data set boundary.
Definition at line 127 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::OutputImagePixelType = typename TOutputImage::PixelType |
Definition at line 111 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::OutputImageRegionType = typename TOutputImage::RegionType |
Typedef to describe the output image region type.
Definition at line 138 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::OutputImageType = TOutputImage |
Definition at line 103 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::Pointer = SmartPointer<Self> |
SmartPointer type alias support
Definition at line 106 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::ScalarRealType = typename GaussianImageFilterType::ScalarRealType |
Definition at line 116 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::Self = CannyEdgeDetectionRecursiveGaussianImageFilter |
Standard "Self" & Superclass type alias.
Definition at line 98 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::SigmaArrayType = typename GaussianImageFilterType::SigmaArrayType |
Definition at line 117 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
using itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::Superclass = ImageToImageFilter<TInputImage, TOutputImage> |
Definition at line 99 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
protected |
Begin concept checking End concept checking
|
inlineprotected |
Definition at line 215 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
inlineoverrideprivate |
Definition at line 224 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
This allocate storage for m_UpdateBuffer, m_UpdateBuffer1
|
private |
Calculate the second derivative of the smoothed image, it writes the result to m_UpdateBuffer using the ThreadedCompute2ndDerivative() method and multithreading mechanism.
|
private |
Calculate the gradient of the second derivative of the smoothed image, it writes the result to m_UpdateBuffer1 using the ThreadedCompute2ndDerivativePos() method and multithreading mechanism.
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire an output region that it passes to ThreadedCompute2ndDerivative for processing.
|
staticprivate |
This callback method uses ImageSource::SplitRequestedRegion to acquire an output region that it passes to ThreadedCompute2ndDerivative for processing.
|
private |
This methos is used to calculate the 2nd derivative for non-boundary pixels. It is called by the ThreadedCompute2ndDerivative method.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
private |
Edge linking funciton
|
overrideprotectedvirtual |
A version of GenerateData() specific for image processing filters. This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling DynamicThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter can be threaded, it should NOT provide a GenerateData() method but should provide a DynamicThreadedGenerateData() instead.
Reimplemented from itk::ImageSource< TOutputImage >.
|
overridevirtual |
CannyEdgeDetectionRecursiveGaussianImageFilter needs a larger input requested region than the output requested region ( derivative operators, etc). As such, CannyEdgeDetectionRecursiveGaussianImageFilter needs to provide an implementation for GenerateInputRequestedRegion() in order to inform the pipeline execution model.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
inline |
Definition at line 183 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
virtual |
ScalarRealType itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::GetSigma | ( | ) | const |
Smoothing parameters for the Gaussian filter.
SigmaArrayType itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::GetSigmaArray | ( | ) | const |
Smoothing parameters for the Gaussian filter.
|
inline |
Definition at line 166 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
virtual |
|
private |
Implement hysteresis thresholding
|
private |
Check if the index is in bounds or not
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
|
virtual |
|
virtual |
void itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::SetSigma | ( | ScalarRealType | sigma | ) |
Smoothing parameters for the Gaussian filter.
void itk::CannyEdgeDetectionRecursiveGaussianImageFilter< TInputImage, TOutputImage >::SetSigmaArray | ( | const SigmaArrayType & | sigmas | ) |
Smoothing parameters for the Gaussian filter.
|
inline |
Definition at line 158 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
virtual |
|
private |
Split the input into "num" pieces, returning region "i" as "splitRegion". This method is called "num" times to return non-overlapping regions. The method returns the number of pieces that the input can be split into by the routine. i.e. return value is less than or equal to "num".
|
private |
Does the actual work of calculating of the 2nd derivative over a region supplied by the multithreading mechanism.
|
static |
ImageDimension constant
Definition at line 144 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Definition at line 341 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Function objects that are used in the inner loops of derivatiVex calculations.
Definition at line 333 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Function objects that are used in the inner loops of derivatiVex calculations.
Definition at line 335 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Definition at line 338 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Gaussian filter to smooth the input image
Definition at line 324 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Lower threshold value for identifying edges.
Definition at line 312 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
The maximum error of the gaussian blurring kernel in each dimensional direction.
Definition at line 306 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Multiply image filter to multiply with the zero crossings of the second derivative.
Definition at line 328 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Definition at line 344 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Definition at line 343 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
"Background" value for use in thresholding.
Definition at line 318 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Standard deviation of the gaussian used for smoothing
Definition at line 302 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Definition at line 340 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Threshold value for identifying edges.
Definition at line 315 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Update buffers used during calculation of multiple steps
Definition at line 321 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
private |
Upper threshold value for identifying edges.
Definition at line 309 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.
|
static |
Definition at line 145 of file itkCannyEdgeDetectionRecursiveGaussianImageFilter.h.