CMakeLists.txt 4.22 KB
Newer Older
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
1

Thomas Feuvrier's avatar
Thomas Feuvrier committed
2
IF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
3

4
5
6
SET(BASELINE ${OTB_DATA_ROOT}/Baseline/OTB/Images)
SET(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
SET(INPUTDATA ${OTB_DATA_ROOT}/Input)
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
7
8
9
10
11
SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary)


#Tolerance sur diff pixel image
SET(TOL 0.0)
12
SET(EPSILON 0.0000000001)
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
13

14
15
SET(CHANGEDETECTION_TESTS1 ${CXX_TEST_PATH}/otbChangeDetectionTests1)
SET(CHANGEDETECTION_TESTS2 ${CXX_TEST_PATH}/otbChangeDetectionTests2)
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
16
17
18

# -------            otb::CBAMI   ------------------------------

19
ADD_TEST(cdTvCBAMI ${CHANGEDETECTION_TESTS1}  
20
21
  --compare-image ${TOL}   ${BASELINE}/cdCBAMIImage.png
                    ${TEMP}/cdCBAMIImage.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
22
        otbCBAMIChangeDetectionTest
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
23
24
	 ${INPUTDATA}/GomaAvant.png 
	 ${INPUTDATA}/GomaApres.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
25
	 2 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
26
	 ${TEMP}/cdCBAMIImage.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
27
28
	 )
	 
29
ADD_TEST(cdTvCorrel ${CHANGEDETECTION_TESTS1}
30
31
  --compare-image ${TOL}   ${BASELINE}/cdCorrelImage.png
                    ${TEMP}/cdCorrelImage.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
32
	otbCorrelChangeDetectionTest 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
33
34
	 ${INPUTDATA}/GomaAvant.png 
	 ${INPUTDATA}/GomaApres.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
35
	 2 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
36
	 ${TEMP}/cdCorrelImage.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
37
38
	 )

39
ADD_TEST(cdTvMeanDiff ${CHANGEDETECTION_TESTS1}
40
41
42
  --compare-image ${EPSILON} 
		  ${BASELINE}/cdMeanDiffImage.hdr
		  ${TEMP}/cdMeanDiffImage.hdr
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
43
	otbMeanDiffChangeDetectionTest 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
44
45
	 ${INPUTDATA}/GomaAvant.png 
	 ${INPUTDATA}/GomaApres.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
46
	 2 
Julien Michel's avatar
Julien Michel committed
47
	 ${TEMP}/cdMeanDiffImage.hdr 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
48
49
	 )

50
ADD_TEST(cdTvMeanRatio ${CHANGEDETECTION_TESTS1}
51
52
  --compare-image ${TOL}   ${BASELINE}/cdMeanRatioImage.png
                    ${TEMP}/cdMeanRatioImage.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
53
	otbMeanRatioChangeDetectionTest 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
54
55
	 ${INPUTDATA}/GomaAvant.png 
	 ${INPUTDATA}/GomaApres.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
56
	 2 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
57
	 ${TEMP}/cdMeanRatioImage.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
58
59
	 )
	 
60
ADD_TEST(cdTvLHMI ${CHANGEDETECTION_TESTS1}
61
62
#  --compare-image ${TOL}   ${BASELINE}/cdLHMIImage.png
#                    ${TEMP}/cdLHMIImage.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
63
	otbLHMIChangeDetectionTest 
64
65
	 ${INPUTDATA}/GomaAvantSousEch.png 
	 ${INPUTDATA}/GomaApresSousEch.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
66
	 2 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
67
	 ${TEMP}/cdLHMIImage.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
68
69
	 )

70
ADD_TEST(cdTvJHMI ${CHANGEDETECTION_TESTS1}
71
72
73
  --compare-image ${TOL}   
		  ${BASELINE}/cdJHMIImage.png
                  ${TEMP}/cdJHMIImage.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
74
	otbJHMIChangeDetectionTest 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
75
76
	 ${INPUTDATA}/GomaAvant.png 
	 ${INPUTDATA}/GomaApres.png
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
77
	 2 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
78
	 ${TEMP}/cdJHMIImage.png 
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
79
80
	 )

81
ADD_TEST(cdTuKullbackLeiblerDistanceImageFilterNew ${CHANGEDETECTION_TESTS1}
82
83
         otbKullbackLeiblerDistanceImageFilterNew)

84
ADD_TEST(cdTvKullbackLeiblerDistanceImageFilter ${CHANGEDETECTION_TESTS1}
85
86
87
88
89
90
91
92
         --compare-image ${EPSILON}
			 ${BASELINE}/cdTVKullbackLeiblerDistanceImageFilterOutput.hdr
			 ${TEMP}/cdTVKullbackLeiblerDistanceImageFilterOutput.hdr
	 otbKullbackLeiblerDistanceImageFilter
			${INPUTDATA}/GomaAvant.png 
			${INPUTDATA}/GomaApres.png
			${TEMP}/cdTVKullbackLeiblerDistanceImageFilterOutput.hdr
			35)
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
93

94
ADD_TEST(cdTuKullbackLeiblerProfileImageFilterNew ${CHANGEDETECTION_TESTS1}
95
96
         otbKullbackLeiblerProfileImageFilterNew)

97
ADD_TEST(cdTvKullbackLeiblerProfileImageFilter ${CHANGEDETECTION_TESTS1}
98
99
100
101
102
103
104
105
106
         --compare-image ${EPSILON}
			 ${BASELINE}/cdTVKullbackLeiblerProfileImageFilterOutput.hdr
			 ${TEMP}/cdTVKullbackLeiblerProfileImageFilterOutput.hdr
	 otbKullbackLeiblerProfileImageFilter
			${INPUTDATA}/GomaAvant.png 
			${INPUTDATA}/GomaApres.png
			${TEMP}/cdTVKullbackLeiblerProfileImageFilterOutput.hdr
			5 51)

Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
107
108

# -------       Fichiers sources CXX -----------------------------------
109
SET(BasicChangeDetection_SRCS1
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
110
111
112
113
114
115
otbCBAMIChangeDetectionTest.cxx
otbCorrelChangeDetectionTest.cxx
otbMeanDiffChangeDetectionTest.cxx
otbMeanRatioChangeDetectionTest.cxx
otbLHMIChangeDetectionTest.cxx
otbJHMIChangeDetectionTest.cxx
116
117
otbKullbackLeiblerDistanceImageFilterNew.cxx
otbKullbackLeiblerDistanceImageFilter.cxx
118
119
otbKullbackLeiblerProfileImageFilterNew.cxx
otbKullbackLeiblerProfileImageFilter.cxx
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
120
121
)

122
123
124
125
126
# -------       Fichiers sources CXX -----------------------------------
SET(BasicChangeDetection_SRCS2
)


Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
127
128
129

INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")

130
ADD_EXECUTABLE(otbChangeDetectionTests1 otbChangeDetectionTests1.cxx ${BasicChangeDetection_SRCS1})
131
TARGET_LINK_LIBRARIES(otbChangeDetectionTests1 OTBChangeDetection OTBIO)
132
133

ADD_EXECUTABLE(otbChangeDetectionTests2 otbChangeDetectionTests2.cxx ${BasicChangeDetection_SRCS2})
134
TARGET_LINK_LIBRARIES(otbChangeDetectionTests2 OTBChangeDetection OTBIO)
Caroline Ruffel's avatar
nomsg    
Caroline Ruffel committed
135

Thomas Feuvrier's avatar
Thomas Feuvrier committed
136
ENDIF( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )