[Insight-users] SobelEdgeDetectionImageFilter

Andres Munarriz munarriz.a at gmail.com
Sun Apr 3 19:27:23 EDT 2005


Hi again,

Still having problems with Sobel Edge detection.  I've found de
itkSobelEdgeDetectionImageFilter and think I have instatiated an
object of this type correctly, but whenever I call the sobelFilter
method my program crashes.  Here's my preprocesor header and my
method's implementation.  Please show me what I'm doing wrong.

#include <itkImage.h>
#include <itkImageFileReader.h>
#include <itkImageToVTKImageFilter.h>
#include <itkVTKImageExport.h>
#include <itkVTKImageImport.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkBinaryThresholdImageFilter.h>
#include <itkSobelEdgeDetectionImageFilter.h>
#include <itkNeighborhoodInnerProduct.h>

typedef  unsigned char  InputPixelType;
typedef  unsigned char  OutputPixelType;
typedef itk::Image< InputPixelType,  2> InputImageType;
typedef itk::Image< OutputPixelType, 2> OutputImageType;
typedef itk::ImageFileReader<InputImageType> ITKReader;
typedef itk::ImageFileWriter<InputImageType> ITKWriter;
typedef itk::ImageToVTKImageFilter<InputImageType> ITKConnectorFilter;
typedef itk::BinaryThresholdImageFilter<InputImageType,
OutputImageType> ITKBinaryFilter;
typedef itk::SobelEdgeDetectionImageFilter<InputImageType,
OutputImageType> ITKSobelFilter;


ITKConnectorFilter* AikanaroCore::SobelFilter()
{
	itk_sobelFilter = ITKSobelFilter::New();
	itk_sobelFilter->SetInput(itk_reader->GetOutput());
	itk_connector->SetInput(itk_sobelFilter->GetOutput());
	return itk_connector;
}


As usual thank you in advance,
-- 
-æ- Andrés E. Munarriz Soto -æ-


More information about the Insight-users mailing list