Skip to content
Snippets Groups Projects
Commit b667fee8 authored by Caroline Ruffel's avatar Caroline Ruffel
Browse files

nomsg

parent 903d3079
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,6 @@
#include "otbImageFileWriter.h"
#include "otbLineRatioDetector.h"
#include "itkLinearInterpolateImageFunction.h"
int otbLineRatioDetector( int argc, char* argv[] )
{
try
......@@ -34,9 +32,9 @@ int otbLineRatioDetector( int argc, char* argv[] )
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
// Width of the linear feature = 2*WidthLine+1
// Largeur de la ligne detecter = 2*WidthLine+1
unsigned int WidthLine((unsigned int)::atoi(argv[3]));
// Length of the linear feature = 2*LengthLine+1
// Longueur de la ligne detecter = 2*LengthLine+1
unsigned int LengthLine((unsigned int)::atoi(argv[4]));
typedef unsigned char InputPixelType;
......@@ -49,8 +47,7 @@ int otbLineRatioDetector( int argc, char* argv[] )
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType;
typedef otb::LineRatioDetector< InputImageType, OutputImageType, InterpolatorType > FilterType;
typedef otb::LineRatioDetector< InputImageType, OutputImageType > FilterType;
FilterType::Pointer FilterLineRatio = FilterType::New();
......
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - C.Ruffel
Language : C++
Date : 14 mars 2006
Version :
Role : Test du filtre de detection de lignes
$Id$
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#define MAIN
#include "itkExceptionObject.h"
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include <iostream>
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbLineRatioDetector.h"
#include "itkLinearInterpolateImageFunction.h"
int otbLineRatioDetectorLinear( int argc, char* argv[] )
{
try
{
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
// Width of the linear feature = 2*WidthLine+1
unsigned int WidthLine((unsigned int)::atoi(argv[3]));
// Length of the linear feature = 2*LengthLine+1
unsigned int LengthLine((unsigned int)::atoi(argv[4]));
typedef unsigned char InputPixelType;
typedef double OutputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image< InputPixelType, Dimension > InputImageType;
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType;
typedef otb::LineRatioDetector< InputImageType, OutputImageType, InterpolatorType > FilterType;
FilterType::Pointer FilterLineRatio = FilterType::New();
FilterLineRatio->SetWidthLine( WidthLine );
FilterLineRatio->SetLengthLine( LengthLine );
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( inputFilename );
writer->SetFileName( outputFilename );
FilterLineRatio->SetInput( reader->GetOutput() );
writer->SetInput( FilterLineRatio->GetOutput() );
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cout << "Exception itk::ExceptionObject levee !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "Exception levee inconnue !" << std::endl;
return EXIT_FAILURE;
}
// Software Guide : EndCodeSnippet
//#endif
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment