Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Belvire
otb
Commits
00af4e34
Commit
00af4e34
authored
19 years ago
by
Thomas Feuvrier
Browse files
Options
Downloads
Patches
Plain Diff
Répertoire pour les FAs
parent
a530037c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Fa/AlignementsQB.cxx
+137
-0
137 additions, 0 deletions
Testing/Fa/AlignementsQB.cxx
Testing/Fa/CMakeLists.txt
+138
-0
138 additions, 0 deletions
Testing/Fa/CMakeLists.txt
with
275 additions
and
0 deletions
Testing/Fa/AlignementsQB.cxx
0 → 100755
+
137
−
0
View file @
00af4e34
#include
"itkImage.h"
#include
"itkImageFileWriter.h"
#include
<iostream>
#include
"itkPolyLineParametricPath.h"
#include
"otbImageFileReader.h"
#include
"otbExtractROI.h"
#include
"otbImageToPathListAlignFilter.h"
#include
"otbDrawPathFilter.h"
//#include "otbColorImageViewer.h"
#include
<stdio.h>
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
3
)
{
std
::
cout
<<
"Usage : "
<<
argv
[
0
]
<<
" inputImage outputImage"
<<
std
::
endl
;
return
1
;
}
const
char
*
inputFilename
=
argv
[
1
];
const
char
*
outputFilename
=
argv
[
2
];
typedef
unsigned
char
InputPixelType
;
typedef
unsigned
char
OutputPixelType
;
const
unsigned
int
Dimension
=
2
;
typedef
itk
::
Image
<
InputPixelType
,
Dimension
>
InputImageType
;
typedef
itk
::
Image
<
OutputPixelType
,
Dimension
>
OutputImageType
;
typedef
otb
::
ImageFileReader
<
InputImageType
>
ReaderType
;
typedef
itk
::
ImageFileWriter
<
OutputImageType
>
WriterType
;
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
WriterType
::
Pointer
writer
=
WriterType
::
New
();
reader
->
SetFileName
(
inputFilename
);
writer
->
SetFileName
(
outputFilename
);
reader
->
Update
();
std
::
cout
<<
"Lecture terminee"
<<
std
::
endl
;
typedef
otb
::
ExtractROI
<
InputPixelType
,
InputPixelType
>
ROIFilterType
;
ROIFilterType
::
Pointer
roiFilter
=
ROIFilterType
::
New
();
roiFilter
->
SetInput
(
reader
->
GetOutput
()
);
roiFilter
->
SetStartX
(
10
);
roiFilter
->
SetStartY
(
0
);
roiFilter
->
SetSizeX
(
256
);
roiFilter
->
SetSizeY
(
256
);
roiFilter
->
Update
();
std
::
cout
<<
"Extraction ROI"
<<
std
::
endl
;
typedef
itk
::
PolyLineParametricPath
<
Dimension
>
PathType
;
typedef
otb
::
ImageToPathListAlignFilter
<
InputImageType
,
PathType
>
ListAlignFilterType
;
ListAlignFilterType
::
Pointer
alignFilter
=
ListAlignFilterType
::
New
();
alignFilter
->
SetInput
(
roiFilter
->
GetOutput
()
);
alignFilter
->
Update
();
std
::
cout
<<
"Alignements termines"
<<
std
::
endl
;
typedef
ROIFilterType
::
OutputImageType
BackgroundImageType
;
typedef
otb
::
DrawPathFilter
<
BackgroundImageType
,
PathType
,
OutputImageType
>
DrawPathFilterType
;
DrawPathFilterType
::
Pointer
drawPathFilter
=
DrawPathFilterType
::
New
();
typedef
ListAlignFilterType
::
OutputPathListType
ListType
;
ListType
*
listePaths
=
alignFilter
->
GetOutput
();
ListType
::
iterator
listIt
=
listePaths
->
begin
();
BackgroundImageType
::
Pointer
backgroundImage
=
roiFilter
->
GetOutput
();
roiFilter
->
Update
();
unsigned
int
color
=
0
;
while
(
listIt
!=
listePaths
->
end
())
{
drawPathFilter
->
SetImageInput
(
backgroundImage
);
drawPathFilter
->
SetPathInput
(
*
(
listIt
)
);
//drawPathFilter->SetPathValue( color );
drawPathFilter
->
Update
();
backgroundImage
=
drawPathFilter
->
GetOutput
();
++
listIt
;
++
color
;
}
writer
->
SetInput
(
drawPathFilter
->
GetOutput
()
);
writer
->
Update
();
/* typedef otb::ColorImageViewer<unsigned char,double> ViewerType;
ViewerType viewer;
viewer.SetLabel( "Input Image" );
viewer.SetImage( drawPathFilter->GetOutput() );
viewer.Show();
Fl::run();
*/
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Testing/Fa/CMakeLists.txt
0 → 100755
+
138
−
0
View file @
00af4e34
# $Id$
IF
(
NOT OTB_DISABLE_CXX_TESTING
)
SET
(
BASELINE
${
OTB_DATA_ROOT
}
/Baseline/Images
)
SET
(
INPUTDATA
${
OTB_DATA_ROOT
}
/Input
)
SET
(
TEMP
${
OTBTesting_BINARY_DIR
}
/Temporary
)
#Images de teledetection (grosses images )
SET
(
IMAGEDATA
${
OTB_DATA_DIR
}
)
#Tolerance sur diff pixel image
SET
(
TOL 0.0
)
# !!!!! Pointe sur un exe gnr dans le repertoire Common
SET
(
COMMON_TESTS
${
CXX_TEST_PATH
}
/otbCommonTests
)
SET
(
IO_TESTS
${
CXX_TEST_PATH
}
/otbIOTests
)
# ------- FAs traitees -----------------------------------
# --- FA 00005 ENVI (GDAL) image multi-canal ---
ADD_TEST
(
FA-00005-io_EnviMultiBande
${
COMMON_TESTS
}
otbMultiChannelExtractROI
-double
${
INPUTDATA
}
/GomaBestScale_w15_50.raw
-double
${
TEMP
}
/FA-00005-io_EnviMultiBande_GomaBestScale_w15_50_100_120_150_200.hd
-startX 100 -startY 150 -sizeX 150 -sizeY 200
-channels 1 2 3
)
# --- FA 00006 ENVI (GDAL) Conversion Type de pixel ---
ADD_TEST
(
FA-00006-io_Poupees_OCT_UChar2Double
${
COMMON_TESTS
}
# --compare-image ${TOL} ${BASELINE}/ioMultiMonoChannelROI_ENVI2PNG_poupees_1canal_302_2_134_330.png
# ${TEMP}/ioMultiMonoChannelROI_ENVI2PNG_poupees_1canal_302_2_134_330.png
otbMultiToMonoChannelExtractROI
-uchar
${
INPUTDATA
}
/poupees_1canal.hd
-double
${
TEMP
}
/FA-00006-io_Poupees_1canal_r8.hd
)
ADD_TEST
(
FA-00006-io_Poupees_OCT_Double2Double
${
COMMON_TESTS
}
--compare-binary
${
TEMP
}
/FA-00006-io_Poupees_1canal_r8.c1
${
TEMP
}
/FA-00006-io_Poupees_1canal_r8_bis.c1
otbMultiToMonoChannelExtractROI
-double
${
INPUTDATA
}
/poupees_1canal.hd
-double
${
TEMP
}
/FA-00006-io_Poupees_1canal_r8_bis.hd
)
ADD_TEST
(
FA-00006-io_Poupees_OCT_Double2UChar
${
COMMON_TESTS
}
--compare-binary
${
INPUTDATA
}
/poupees_1canal.c1
${
TEMP
}
/FA-00006-io_Poupees_1canal_oct.c1
otbMultiToMonoChannelExtractROI
-double
${
INPUTDATA
}
/poupees_1canal.hd
-uchar
${
TEMP
}
/FA-00006-io_Poupees_1canal_oct.hd
)
ADD_TEST
(
FA-00006-io_Poupees_R8_Double2UCharBis
${
COMMON_TESTS
}
--compare-binary
${
INPUTDATA
}
/poupees_1canal.c1
${
TEMP
}
/FA-00006-io_Poupees_1canal_oct_bis.c1
otbMultiToMonoChannelExtractROI
-double
${
TEMP
}
/FA-00006-io_Poupees_1canal_r8.hd
-uchar
${
TEMP
}
/FA-00006-io_Poupees_1canal_oct_bis.hd
)
# ------ RADASAT ------------
ADD_TEST
(
FA-00006-io_Radarsat_UI2_UShort2UShort
${
COMMON_TESTS
}
otbMultiToMonoChannelExtractROI
-ushort
${
IMAGEDATA
}
/RADARSAT1/SCENE01/
-ushort
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_ui2.hd
-startX 2559 -startY 3591 -sizeX 337 -sizeY 280
)
ADD_TEST
(
FA-00006-io_Radarsat_UI2_Int2Int
${
COMMON_TESTS
}
otbMultiToMonoChannelExtractROI
-int
${
IMAGEDATA
}
/RADARSAT1/SCENE01/
-int
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_i4.hd
-startX 2559 -startY 3591 -sizeX 337 -sizeY 280
)
ADD_TEST
(
FA-00006-io_Radarsat_UI2_Double2Double_
${
COMMON_TESTS
}
otbMultiToMonoChannelExtractROI
-double
${
IMAGEDATA
}
/RADARSAT1/SCENE01/
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8.hd
-startX 2559 -startY 3591 -sizeX 337 -sizeY 280
)
ADD_TEST
(
FA-00006-io_Radarsat_I4_Int2Double
${
COMMON_TESTS
}
--compare-binary
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8.c1
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_bis.c1
otbMultiToMonoChannelExtractROI
-int
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_i4.hd
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_bis.hd
)
ADD_TEST
(
FA-00006-io_Radarsat_I4_Double2Double
${
COMMON_TESTS
}
--compare-binary
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8.c1
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_ter.c1
otbMultiToMonoChannelExtractROI
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_i4.hd
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_ter.hd
)
ADD_TEST
(
FA-00006-io_Radarsat_R8_Double2Double
${
COMMON_TESTS
}
--compare-binary
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8.c1
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_4.c1
otbMultiToMonoChannelExtractROI
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8.hd
-double
${
TEMP
}
/FA-00006-io_Radarsat_2559_3591_337_280_r8_4.hd
)
ADD_TEST
(
FA-00012-co_AlignementsQB
${
CXX_TEST_PATH
}
/AlignementsQB
${
INPUTDATA
}
/poupees.hd
${
TEMP
}
/FA-00012-co_AlignementsQB.png
)
# --- FA 00013 : impossible d'crire une image TIFF(CAI) ---
ADD_TEST
(
FA-00013-io_WriteImageTIFF
${
IO_TESTS
}
otbImageFileWriterTest
${
INPUTDATA
}
/sbuv_NB_c1.png
${
TEMP
}
/FA-00013-io_WriteImageTIFF_sbuv_NB_c1.tif
)
ADD_TEST
(
FA-00013-io_WriteImageTIFF_bis
${
COMMON_TESTS
}
otbMultiToMonoChannelExtractROI
${
INPUTDATA
}
/sbuv_NB_c1.png
${
TEMP
}
/FA-00013-io_WriteImageTIFF_sbuv_NB_c1_extrait.tif
-startX 0 -startY 0 -sizeX 60 -sizeY 488
)
# ------- Fin des FAs traitees -----------------------------------
INCLUDE_DIRECTORIES
(
"
${
OTBTesting_BINARY_DIR
}
"
)
ADD_EXECUTABLE
(
AlignementsQB AlignementsQB.cxx
)
TARGET_LINK_LIBRARIES
(
AlignementsQB OTBFeatureExtraction OTBIO OTBCommon
${
CAI_LIBRARY
}
${
GDAL_LIBRARY
}
ITKIO ITKCommon
)
ENDIF
(
NOT OTB_DISABLE_CXX_TESTING
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment