CMakeLists.txt 10.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )

SET(BASELINE ${OTB_DATA_ROOT}/Baseline/OTB/Images)
SET(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
SET(INPUTDATA ${OTB_DATA_ROOT}/Input)
SET(SPECTRUM_DB ${OTB_DATA_ROOT}/Input/BD-CNES)
SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary)

SET(SRCLASS0 ${SPECTRUM_DB}/JHU/becknic/manmade/txt)
SET(SRCLASS1 ${SPECTRUM_DB}/JHU/becknic/water/txt)
SET(SRCLASS2 ${SPECTRUM_DB}/JHU/becknic/soils/txt)
SET(SRCLASS3 ${SPECTRUM_DB}/JHU/becknic/vegetation/txt)
SET(SRCLASS4 ${SPECTRUM_DB}/JHU/becknic/rocks/sedimentary/powder/0_75/txt)

#Tolerance sur diff pixel image
SET(TOL 0.0)
SET(EPSILON 0.00001)
19
SET(EPSILON_PROSPECT 0.001)
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
SET(Simulation_TESTS1 ${CXX_TEST_PATH}/otbSimulationTests1)
SET(Simulation_TESTS2 ${CXX_TEST_PATH}/otbSimulationTests2)
SET(Simulation_TESTS3 ${CXX_TEST_PATH}/otbSimulationTests3)
SET(Simulation_TESTS4 ${CXX_TEST_PATH}/otbSimulationTests4)

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbSimulation_TESTS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# -------            otb::reflectancetosurfacereflectance  --------------------------

ADD_TEST(siTuReflectanceToSurfaceReflectanceFilterNew ${Simulation_TESTS1}
        otbSurfaceReflectanceToReflectanceFilterNew )

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbSimulation_TESTS2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ADD_TEST(siTuSpectralResponseNew ${Simulation_TESTS2}
        otbSpectralResponseNew
        )

ADD_TEST(siTuSpectralResponse ${Simulation_TESTS2}
        otbSpectralResponse
        ${SPECTRUM_DB}/JHU/becknic/manmade/txt/0092uuu.txt
        2.5 #lambda
        )

ADD_TEST(siTuSatelliteRSRNew ${Simulation_TESTS2}
        otbSatelliteRSRNew
        )

ADD_TEST(siTuSatelliteRSR ${Simulation_TESTS2}
        otbSatelliteRSR
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb band
        2.5 #lambda
        2 #num band
        )

ADD_TEST(siTuReduceSpectralResponseNew ${Simulation_TESTS2}
        otbReduceSpectralResponseNew
        )

ADD_TEST(siTuReduceSpectralResponse ${Simulation_TESTS2}
        otbReduceSpectralResponse
        ${SPECTRUM_DB}/jpl/beckman/minerals/Arsenate/txt/A01Ac.txt
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb band
        )

ADD_TEST(siTuReduceSpectralResponseClassifierRAndNIR ${Simulation_TESTS2}
        otbReduceSpectralResponseClassifierRAndNIR
        ${SPECTRUM_DB}/JHU/becknic/manmade/txt/0092uuu.txt
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb band
        1 #red index
        2 #NIR index
        )

#FIXME uncomment this test and make it compatible with filters able to read filter function values (rep6S.dat)        
# ADD_TEST(siTuAtmosphericEffects ${Simulation_TESTS2}
#         otbAtmosphericEffects
#         ${SPECTRUM_DB}/JHU/becknic/manmade/txt/0092uuu.txt
#         ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
#         4 #nb band
#         4 #day
#         12 #month
#         27.3 #zenithSolarAngle
#         152.7 #azimutSolarAngle
#         2.5 #viewingZenitalAngle
#         -77.0 #viewingAzimutalAngle
#         1013. #atmoPressure
#         2.48134 #waterVaporAmount
#         0.34400 #ozoneAmount
#         1 #aerosolModelValue
#         0.199854 #aerosolOptical
#         )

ADD_TEST(siTuSpatialisationTest ${Simulation_TESTS2}
        otbSpatialisationTest
        ${TEMP}/SpatialisationTest.tif
        )
        
ADD_TEST(siTuLabelMapToSimulatedImageFilterTest ${Simulation_TESTS2}
        otbLabelMapToSimulatedImageFilterTest
        ${INPUTDATA}/Simulation/Shapefile/culturesWithAndWithoutPath.shp
#         /home2/arnaud/PROJETS/SimuCapteur/data/largeInput.shp
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb bands
        ${SPECTRUM_DB}/jpl/beckman/minerals/ #root path of spectrum
        ${TEMP}/LabelMapToSimulatedImageFilterTest.tif
        )
        
ADD_TEST(siTuImageSimulationMethodWithVectorDataTest ${Simulation_TESTS2}
        otbImageSimulationMethodWithVectorDataTest
        ${INPUTDATA}/Simulation/Shapefile/stickPolygons.shp
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb bands
        ${SPECTRUM_DB}/ #root path of spectrum
        3 #prolate radius
        ${TEMP}/ImageSimulationMethodTest.tif
        ${TEMP}/LabelImageSimulationMethodTest.tif
        )
        
ADD_TEST(siTuImageSimulationMethodWithSpatialisationTest ${Simulation_TESTS2}
        otbImageSimulationMethodWithSpatialisationTest
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb bands
        ${SPECTRUM_DB}/ #root path of spectrum
        3 #prolate radius
        ${TEMP}/ImageSimulationMethodWithSpatialisationTest.tif
        ${TEMP}/LabelImageSimulationMethodWithSpatialisationTest.tif
        )



# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbSimulation_TESTS3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#FIXME The tolerance is set to 0.01
#need to investigate differences between matlab baselines and otb implementation
ADD_TEST(siTvProspectReflTest ${Simulation_TESTS3}
   --compare-ascii ${EPSILON_PROSPECT} ${BASELINE_FILES}/siTvProspectReflTest.txt
                   ${TEMP}/siTvProspectReflTest.txt
        otbProspectReflTest
        30.0 #cab
        10.0 #car
        0.0 #CBrown 
        0.015 #Cw
        0.009 #Cm
        1.2 #N
        ${TEMP}/siTvProspectReflTest.txt
        )

#FIXME The tolerance is set to 0.01
#need to investigate differences between matlab baselines and otb implementation
157
158
159
160
161
162
163
164
165
166
167
168
ADD_TEST(siTvProspectTransTest ${Simulation_TESTS3}
   --compare-ascii ${EPSILON_PROSPECT} ${BASELINE_FILES}/siTvProspectTransTest.txt
                   ${TEMP}/siTvProspectTransTest.txt
        otbProspectTransTest
        30.0 #cab
        10.0 #car
        0.0 #CBrown 
        0.015 #Cw
        0.009 #Cm
        1.2 #N
        ${TEMP}/siTvProspectTransTest.txt
        )
169
170

ADD_TEST(siTvSailReflHTest ${Simulation_TESTS3}
171
   --compare-ascii ${EPSILON_PROSPECT} ${BASELINE_FILES}/siTvSailReflHTest.txt
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
                   ${TEMP}/siTvSailReflHTest.txt
        otbSailReflHTest
        30.0 #cab
        10.0 #car
        0.0 #CBrown 
        0.015 #Cw
        0.009 #Cm
        1.2 #N
        2 #LAI
        50 #Angl
        1 #PSoil 
        70 #Skyl
        0.2 #HSpot
        30 #TTS
        0 #TTO
        0 #PSI
        ${TEMP}/siTvSailReflHTest.txt
        )
        
ADD_TEST(siTvSailReflVTest ${Simulation_TESTS3}
192
   --compare-ascii ${EPSILON_PROSPECT} ${BASELINE_FILES}/siTvSailReflVTest.txt
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
                   ${TEMP}/siTvSailReflVTest.txt
        otbSailReflVTest
        30.0 #cab
        10.0 #car
        0.0 #CBrown 
        0.015 #Cw
        0.009 #Cm
        1.2 #N
        2 #LAI
        50 #Angl
        1 #PSoil 
        70 #Skyl
        0.2 #HSpot
        30 #TTS
        0 #TTO
        0 #PSI
        ${TEMP}/siTvSailReflVTest.txt
        )        
        

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbSimulation_TESTS4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


ADD_TEST(siTuRSRSVMClassifier ${Simulation_TESTS4}
        otbReduceSpectralResponseSVMClassifier
        ${SRCLASS0} 
        ${SRCLASS1} 
        ${SRCLASS2} 
        ${SRCLASS3} 
        ${SRCLASS4} 
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nbBands
        0.1 #percentage of validation files
        )
        
# ADD_TEST(siTuatmosphericCorrectionsRSRSVMClassifier ${Simulation_TESTS4}
#         otbAtmosphericCorrectionsRSRSVMClassifier
#         ${SRCLASS0} 
#         ${SRCLASS1} 
#         ${SRCLASS2} 
#         ${SRCLASS3} 
#         ${SRCLASS4} 
#         ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
#         4 #nbBands
#         4 #day
#         12 #month
#         27.3 #elevation et azimuth solaire
#         152.7 #solar azimutal angle
#         2.5 #viewing zenithal angle
#         -77.0 #viewing azimutal angle
#         1013. #atmo pressure
#         2.48134 #water vapour amount
#         0.34400 #ozone amount
#         1 #aerosol model type 
#         0.199854 #aerosol optical
#         0.2 #percentage of validation files
#         )

ADD_TEST(siTuImageSimulationMethodKMeansClassif ${Simulation_TESTS4}
        otbImageSimulationMethodKMeansClassif
        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
        4 #nb bands
        ${SPECTRUM_DB}/ #root path of spectrum
        3 #prolate radius
        ${TEMP}/siTuImageSimulationMethodKMeansClassif.tif
        ${TEMP}/siTuKMeansClassifLabelImage.tif
        )

#warning the svm model estimation does not converge.
264
265
266
267
268
269
270
271
272
#ADD_TEST(siTuImageSimulationMethodSVMClassif ${Simulation_TESTS4}
#        otbImageSimulationMethodSVMClassif
#        ${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
#        4 #nb bands
#        ${SPECTRUM_DB}/ #root path of spectrum
#        3 #prolate radius
#        ${TEMP}/siTuImageSimulationMethodSVMClassif.tif
#        ${TEMP}/siTuSVMClassifLabelImage.tif
#        )
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323

# atmospheric corrections tests 
SET(Simulation_SRCS1
otbSimulationTests1.cxx
otbSurfaceReflectanceToReflectanceFilterNew.cxx
)

# exploitation tests
SET(Simulation_SRCS2
otbSimulationTests2.cxx
otbSpectralResponseNew.cxx
otbSpectralResponse.cxx
otbSatelliteRSRNew.cxx
otbSatelliteRSR.cxx
otbReduceSpectralResponseNew.cxx
otbReduceSpectralResponse.cxx
otbReduceSpectralResponseClassifierRAndNIR.cxx
otbAtmosphericEffects.cxx
otbSpatialisationTest.cxx
otbLabelMapToSimulatedImageFilterTest.cxx
otbImageSimulationMethodWithVectorDataTest.cxx
otbImageSimulationMethodWithSpatialisationTest.cxx
)

# Prosail tests
SET(Simulation_SRCS3
otbSimulationTests3.cxx
otbProspectReflTest.cxx
otbProspectTransTest.cxx
otbSailReflHTest.cxx
otbSailReflVTest.cxx
)

# performance tests
SET(Simulation_SRCS4
otbSimulationTests4.cxx
otbReduceSpectralResponseSVMClassifier.cxx
otbAtmosphericCorrectionsRSRSVMClassifier.cxx
otbImageSimulationMethodKMeansClassif.cxx
otbImageSimulationMethodSVMClassif.cxx
)

OTB_ADD_EXECUTABLE(otbSimulationTests1 "${Simulation_SRCS1}" "OTBSimulation;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbSimulationTests2 "${Simulation_SRCS2}" "OTBSimulation;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbSimulationTests3 "${Simulation_SRCS3}" "OTBSimulation;OTBIO;OTBTesting")
OTB_ADD_EXECUTABLE(otbSimulationTests4 "${Simulation_SRCS4}" "OTBSimulation;OTBIO;OTBLearning;OTBTesting")




#ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )