CMakeLists.txt 6.25 KB
Newer Older
1
PROJECT(LearningExamples)
Jordi Inglada's avatar
Jordi Inglada committed
2
3
4
5
6
INCLUDE_REGULAR_EXPRESSION("^.*$")

ADD_EXECUTABLE(GenerateTrainingImageExample GenerateTrainingImageExample.cxx )
TARGET_LINK_LIBRARIES(GenerateTrainingImageExample OTBCommon OTBIO OTBLearning ITKCommon ITKIO)

Jordi Inglada's avatar
Jordi Inglada committed
7
ADD_EXECUTABLE(SVMPointSetExample SVMPointSetExample.cxx )
Jordi Inglada's avatar
Jordi Inglada committed
8
TARGET_LINK_LIBRARIES(SVMPointSetExample ITKIO OTBIO OTBCommon
9
ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
10
11
12
13


ADD_EXECUTABLE(SVMPointSetModelEstimatorExample SVMPointSetModelEstimatorExample.cxx )
TARGET_LINK_LIBRARIES(SVMPointSetModelEstimatorExample ITKIO OTBIO
14
OTBCommon ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
15
16
17

ADD_EXECUTABLE(SVMImageModelEstimatorExample SVMImageModelEstimatorExample.cxx )
TARGET_LINK_LIBRARIES(SVMImageModelEstimatorExample ITKIO OTBIO
18
OTBCommon ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
19
20
21

ADD_EXECUTABLE(SVMPointSetClassificationExample SVMPointSetClassificationExample.cxx )
TARGET_LINK_LIBRARIES(SVMPointSetClassificationExample ITKIO OTBIO
22
OTBCommon ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
23
24
25

ADD_EXECUTABLE(SVMImageClassificationExample SVMImageClassificationExample.cxx )
TARGET_LINK_LIBRARIES(SVMImageClassificationExample ITKIO OTBIO
26
OTBCommon ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
27
28
29

ADD_EXECUTABLE(SVMImageEstimatorClassificationMultiExample SVMImageEstimatorClassificationMultiExample.cxx )
TARGET_LINK_LIBRARIES(SVMImageEstimatorClassificationMultiExample ITKIO OTBIO
30
OTBCommon ITKCommon  OTBLearning  gdal)
Jordi Inglada's avatar
Jordi Inglada committed
31

Jordi Inglada's avatar
Jordi Inglada committed
32
33
34
ADD_EXECUTABLE(SOMExample SOMExample.cxx )
TARGET_LINK_LIBRARIES(SOMExample ITKIO OTBIO OTBCommon ITKCommon  OTBLearning  gdal)

Jordi Inglada's avatar
Jordi Inglada committed
35
36
37
ADD_EXECUTABLE(SOMClassifierExample SOMClassifierExample.cxx )
TARGET_LINK_LIBRARIES(SOMClassifierExample ITKIO OTBIO OTBCommon ITKCommon  OTBLearning  gdal)

38
39
40
ADD_EXECUTABLE(SEMModelEstimatorExample SEMModelEstimatorExample.cxx )
TARGET_LINK_LIBRARIES(SEMModelEstimatorExample ITKIO OTBIO OTBCommon ITKCommon  OTBLearning  gdal)

Jordi Inglada's avatar
Jordi Inglada committed
41
42
43
44
45
46
47
ADD_EXECUTABLE(SVMGenericKernelImageModelEstimatorExample SVMGenericKernelImageModelEstimatorExample.cxx)
TARGET_LINK_LIBRARIES(SVMGenericKernelImageModelEstimatorExample otbsvm OTBCommon OTBIO ITKCommon)

ADD_EXECUTABLE(SVMGenericKernelImageClassificationExample SVMGenericKernelImageClassificationExample.cxx)
TARGET_LINK_LIBRARIES(SVMGenericKernelImageClassificationExample otbsvm OTBCommon OTBIO ITKCommon)


Julien Michel's avatar
Julien Michel committed
48

49
IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
Julien Michel's avatar
Julien Michel committed
50
51
52
53
54
55
56
57
58

SET(BASELINE ${OTB_DATA_ROOT}/Baseline/Examples/Learning)

SET(INPUTDATA ${OTB_SOURCE_DIR}/Examples/Data)
SET(TEMP ${OTB_BINARY_DIR}/Testing/Temporary)

SET(EXE_TESTS ${CXX_TEST_PATH}/otbLearningExamplesTests)

SET(TOL 0.0)
Emmanuel Christophe's avatar
Emmanuel Christophe committed
59
60
#Tolerance sur la difference des valeurs numeriques dans le --compare-ascii
SET(EPS 0.001)
Julien Michel's avatar
Julien Michel committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

# ------- SVMImageClassificationExampleTest----------

ADD_TEST(SVMImageClassificationExampleTest ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ROI_QB_MUL_1_SVN_CLASS.png
	${TEMP}/ROI_QB_MUL_1_SVN_CLASS.png
	SVMImageClassificationExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${TEMP}/ROI_QB_MUL_1_SVN_CLASS.png
    ${OTB_SOURCE_DIR}/Examples/Data/svm_image_model.svm
)

# ------- SVMImageEstimatorClassificationMultiExampleTest----------

ADD_TEST(SVMImageEstimatorClassificationMultiExampleTest ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
	${TEMP}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
	SVMImageEstimatorClassificationMultiExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${INPUTDATA}/ROI_mask_multi.png
	${TEMP}/ROI_QB_MUL_1_SVN_CLASS_MULTI.png
84
	${TEMP}/ROI_QB_MUL_1_SVN_CLASS_MULTI_Rescaled.png
Julien Michel's avatar
Julien Michel committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
)

# ------- GenerateTrainingImageExampleTest----------

ADD_TEST(GenerateTrainingImageExampleTest ${EXE_TESTS}
	--compare-n-images ${TOL} 1
	${BASELINE}/ROI_QB_MUL_4_training.png
	${TEMP}/ROI_QB_MUL_4_training.png
	GenerateTrainingImageExampleTest
	${INPUTDATA}/ROI_QB_MUL_4.tif
	${INPUTDATA}/LearningROIs.txt
	${TEMP}/ROI_QB_MUL_4_training.png
)

# ------- SVMImageModelEstimatorExampleTest----------

ADD_TEST(SVMImageModelEstimatorExampleTest ${EXE_TESTS}
Emmanuel Christophe's avatar
Emmanuel Christophe committed
102
	--compare-ascii ${EPS}
Julien Michel's avatar
Julien Michel committed
103
104
105
106
107
108
109
110
111
	${BASELINE}/svm_image_model.svn
	${TEMP}/svm_image_model.svn
	SVMImageModelEstimatorExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${INPUTDATA}/ROI_mask.png
	${TEMP}/svm_image_model.svn
)


Thomas Feuvrier's avatar
Thomas Feuvrier committed
112
113
114
115
116
117
118
119
120
121
122
123
# ------- SOMExampleTest----------

ADD_TEST(SOMExampleTest ${EXE_TESTS}
	--compare-n-images ${TOL} 2
	${BASELINE}/ROI_QB_MUL_SOM.png
	${TEMP}/ROI_QB_MUL_SOM.png
	${BASELINE}/ROI_QB_MUL_SOMACT.png
	${TEMP}/ROI_QB_MUL_SOMACT.png
	SOMExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${TEMP}/ROI_QB_MUL_SOM.png
	${TEMP}/ROI_QB_MUL_SOMACT.png
Cyrille Valladeau's avatar
nomsg    
Cyrille Valladeau committed
124
	4 4 4 4 15 1.0 0.1 128
Thomas Feuvrier's avatar
Thomas Feuvrier committed
125
126
127
128
129
130
)

# ------- SOMClassifierExampleTest----------

ADD_TEST(SOMClassifierExampleTest ${EXE_TESTS}
	--compare-image ${TOL} 
131
132
	${BASELINE}/ROI_QB_MUL_extractSOMCLASS.tif
	${TEMP}/ROI_QB_MUL_extractSOMCLASS.tif
Thomas Feuvrier's avatar
Thomas Feuvrier committed
133
	SOMClassifierExampleTest
134
135
136
	${INPUTDATA}/ROI_QB_MUL_1_extract.tif
	${INPUTDATA}/ROI_QB_MUL_extractSOM.tif
	${TEMP}/ROI_QB_MUL_extractSOMCLASS.tif
Thomas Feuvrier's avatar
Thomas Feuvrier committed
137
138
)

139
140
141
142
143
144
145
146
147
148
149
150
# ------- SEMModelEstimatorExampleTest----------

ADD_TEST(SEMModelEstimatorExampleTest ${EXE_TESTS}
#	--compare-image ${TOL} 
#	${BASELINE}/ROI_QB_MUL_SEMMODEL_ESTIMATOR.png
#	${TEMP}/ROI_QB_MUL_SEMMODEL_ESTIMATOR.png
	SEMModelEstimatorExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.tif
	${TEMP}/ROI_QB_MUL_SEMMODEL_ESTIMATOR.png
        4 40 5
)

Thomas Feuvrier's avatar
Thomas Feuvrier committed
151
152
153
# ------- SVMGenericKernelImageModelEstimatorExampleTest----------

ADD_TEST(SVMGenericKernelImageModelEstimatorExampleTest ${EXE_TESTS}
Emmanuel Christophe's avatar
Emmanuel Christophe committed
154
	--compare-ascii ${EPS}
Thomas Feuvrier's avatar
Thomas Feuvrier committed
155
156
157
158
159
160
161
162
163
164
165
	${BASELINE}/svm_image_model_generic_kernel.svn
	${TEMP}/svm_image_model_generic_kernel.svn
	SVMGenericKernelImageModelEstimatorExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${INPUTDATA}/ROI_mask_multi.png
	${TEMP}/svm_image_model_generic_kernel.svn
)

# ------- SVMGenericKernelImageClassificationExampleTest----------

ADD_TEST(SVMGenericKernelImageClassificationExampleTest ${EXE_TESTS}
Emmanuel Christophe's avatar
Emmanuel Christophe committed
166
	--compare-ascii ${EPS}
Thomas Feuvrier's avatar
Thomas Feuvrier committed
167
168
169
170
171
172
173
	${BASELINE}/svm_image_model_generic_kernel.svn
	${TEMP}/svm_image_model_generic_kernel.svn
	SVMGenericKernelImageClassificationExampleTest
	${INPUTDATA}/ROI_QB_MUL_1.png
	${TEMP}/ROI_QB_MUL_GENERIC_KERNEL_IMAGE_CLASSIF.png
	${INPUTDATA}/svm_image_model_generic_kernel.svn
)
Thomas Feuvrier's avatar
Thomas Feuvrier committed
174
175


Julien Michel's avatar
Julien Michel committed
176
177
178
ADD_EXECUTABLE(otbLearningExamplesTests otbLearningExamplesTests.cxx)
TARGET_LINK_LIBRARIES(otbLearningExamplesTests gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction  OTBLearning  OTBMultiScale)

179
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )