Commit 6092f4f118297f51ba388565744ce187efcbde46

Authored by Pierre Lassalle
1 parent 0b58067b
Exists in master

Coherence application name and remove backup files

app/CMakeLists.txt
1   -OTB_CREATE_APPLICATION(NAME GRM
  1 +OTB_CREATE_APPLICATION(NAME otbGRM
2 2 SOURCES otbGRM.cxx
3 3 LINK_LIBRARIES ${${otb-module}_LIBRARIES}
4 4 )
... ...
src/grmGraphOperations.txx~
... ... @@ -1,557 +0,0 @@
1   -/*=========================================================================
2   -
3   - Program: Generic Region Merging Library
4   - Language: C++
5   - author: Lassalle Pierre
6   - contact: lassallepierre34@gmail.com
7   -
8   -
9   -
10   - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved
11   -
12   -
13   - This software is distributed WITHOUT ANY WARRANTY; without even
14   - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15   - PURPOSE. See the above copyright notices for more information.
16   -
17   -=========================================================================*/
18   -#ifndef __GRM_GRAPH_OPERATIONS_TXX
19   -#define __GRM_GRAPH_OPERATIONS_TXX
20   -#include <otbImageFileReader.h>
21   -
22   -namespace grm
23   -{
24   - template<class TSegmenter>
25   - void GraphOperations<TSegmenter>::InitNodes(ImageType * inputImg,
26   - SegmenterType& seg,
27   - CONNECTIVITY mask)
28   - {
29   - unsigned int width, height;
30   -
31   - {
32   - width = inputImg->GetLargestPossibleRegion().GetSize()[0];
33   - height = inputImg->GetLargestPossibleRegion().GetSize()[1];
34   - }
35   -
36   - const long unsigned int num_nodes = width * height;
37   -
38   - seg.m_Graph.m_Nodes.reserve(num_nodes);
39   -
40   - for(long unsigned int i = 0;
41   - i < num_nodes;
42   - ++i)
43   - {
44   - NodePointerType n(new NodeType);
45   - n->m_Id = i;
46   - n->m_Valid = true;
47   - n->m_Expired = false;
48   - n->m_IsMerged = true; // force to compute costs for the first iteration
49   - n->m_Perimeter = 4;
50   - n->m_Area = 1;
51   - n->m_Bbox.m_UX = i % width;
52   - n->m_Bbox.m_UY = i / width;
53   - n->m_Bbox.m_W = 1;
54   - n->m_Bbox.m_H = 1;
55   -
56   - // An initial contour is the one aroun a pixel
57   - ContourOperator::Push1(n->m_Contour);
58   - ContourOperator::Push2(n->m_Contour);
59   - ContourOperator::Push3(n->m_Contour);
60   - ContourOperator::Push0(n->m_Contour);
61   -
62   - seg.m_Graph.m_Nodes.push_back(n);
63   - }
64   -
65   - if(mask == FOUR)
66   - {
67   - for(auto& r : seg.m_Graph.m_Nodes)
68   - {
69   - long int neighborhood[4];
70   - FOURNeighborhood(neighborhood, r->m_Id, width, height);
71   - for(short j = 0; j < 4; ++j)
72   - {
73   - if(neighborhood[j] > -1)
74   - r->m_Edges.push_back(EdgeType( seg.m_Graph.m_Nodes[neighborhood[j]], 0, 1));
75   - }
76   - }
77   - }
78   - else
79   - {
80   - for(auto& r : seg.m_Graph.m_Nodes)
81   - {
82   - long int neighborhood[8];
83   - EIGHTNeighborhood(neighborhood, r->m_Id, width, height);
84   - for(short j = 0; j < 8; ++j)
85   - {
86   - if(neighborhood[j] > -1)
87   - {
88   - if(j % 2 > 0)
89   - r->m_Edges.push_back(EdgeType( seg.m_Graph.m_Nodes[neighborhood[j]], 0, 0));
90   - else
91   - r->m_Edges.push_back(EdgeType( seg.m_Graph.m_Nodes[neighborhood[j]], 0, 1));
92   - }
93   - }
94   - }
95   - }
96   - seg.InitFromImage();
97   - }
98   -
99   - template<class TSegmenter>
100   - void GraphOperations<TSegmenter>::UpdateMergingCosts(SegmenterType& seg)
101   - {
102   - float min_cost;
103   - long unsigned int min_id = 0;
104   - std::size_t idx, min_idx;
105   -
106   - for(auto& r : seg.m_Graph.m_Nodes)
107   - {
108   - for(auto& edge : r->m_Edges)
109   - edge.m_CostUpdated = false;
110   - }
111   -
112   - for(auto& r : seg.m_Graph.m_Nodes)
113   - {
114   - min_cost = std::numeric_limits<float>::max();
115   - idx = 0;
116   - min_idx = 0;
117   -
118   - r->m_Expired = false;
119   - r->m_Valid = true;
120   -
121   - for(auto& edge : r->m_Edges)
122   - {
123   - auto neighborR = edge.GetRegion();
124   -
125   - // Compute the cost if necessary
126   - if(!edge.m_CostUpdated && (neighborR->m_IsMerged || r->m_IsMerged))
127   - {
128   - auto edgeFromNeighborToR = FindEdge(neighborR, r);
129   - edge.m_Cost = seg.ComputeMergingCost(r, neighborR);
130   - edgeFromNeighborToR->m_Cost = edge.m_Cost;
131   - edge.m_CostUpdated = true;
132   - edgeFromNeighborToR->m_CostUpdated = true;
133   - }
134   -
135   - // Check if the cost of the edge is the minimum
136   - if(min_cost > edge.m_Cost)
137   - {
138   - min_cost = edge.m_Cost;
139   - min_id = neighborR->m_Id;
140   - min_idx = idx;
141   - }
142   - else if(min_cost == edge.m_Cost)
143   - {
144   - if(min_id > neighborR->m_Id)
145   - {
146   - min_id = neighborR->m_Id;
147   - min_idx = idx;
148   - }
149   - }
150   - ++idx;
151   - }
152   -
153   - assert(min_idx < r->m_Edges.size());
154   - std::swap(r->m_Edges[0], r->m_Edges[min_idx]);
155   -
156   - }
157   -
158   - // Reset the merge flag for all the regions.
159   - for(auto& r : seg.m_Graph.m_Nodes)
160   - r->m_IsMerged = false;
161   - }
162   -
163   - template<class TSegmenter>
164   - typename GraphOperations<TSegmenter>::NodePointerType
165   - GraphOperations<TSegmenter>::CheckLMBF(NodePointerType a, float t)
166   - {
167   - if(a->m_Valid)
168   - {
169   - float cost = a->m_Edges.front().m_Cost;
170   -
171   - if(cost < t)
172   - {
173   - NodePointerType b = a->m_Edges.front().GetRegion();
174   -
175   - if( b->m_Valid)
176   - {
177   - NodePointerType best_b = b->m_Edges.front().GetRegion();
178   -
179   - if(a == best_b)
180   - {
181   - if(a->m_Id < b->m_Id)
182   - return a;
183   - else
184   - return b;
185   - }
186   - else
187   - return NodePointerType();
188   - }
189   - else
190   - return NodePointerType();
191   - }
192   - else
193   - return NodePointerType();
194   - }
195   - else
196   - return NodePointerType();
197   - }
198   -
199   - template<class TSegmenter>
200   - typename GraphOperations<TSegmenter>::NodePointerType
201   - GraphOperations<TSegmenter>::CheckBF(NodePointerType a, float t)
202   - {
203   - if(a->m_Valid)
204   - {
205   - float cost = a->m_Edges.front().m_Cost;
206   -
207   - if( cost < t )
208   - {
209   - NodePointerType b = a->m_Edges.front().GetRegion();
210   -
211   - if(b->m_Valid)
212   - {
213   - if( a->m_Id < b->m_Id )
214   - return a;
215   - else
216   - return b;
217   - }
218   - else
219   - return NodePointerType();
220   - }
221   - else
222   - return NodePointerType();
223   - }
224   - else
225   - return NodePointerType();
226   - }
227   -
228   - template<class TSegmenter>
229   - typename GraphOperations<TSegmenter>::EdgeIterator
230   - GraphOperations<TSegmenter>::FindEdge(NodePointerType n, NodePointerType target)
231   - {
232   - return std::find_if(n->m_Edges.begin(), n->m_Edges.end(),[&](EdgeType& e)->bool{
233   - return e.GetRegion() == target;
234   - });
235   - }
236   -
237   - template<class TSegmenter>
238   - void
239   - GraphOperations<TSegmenter>::UpdateNeighbors(NodePointerType a, NodePointerType b)
240   - {
241   - unsigned int boundary;
242   -
243   - /* Explore the neighbors of b */
244   - for (auto& edge : b->m_Edges)
245   - {
246   - // Retrieve the edge targeting node b.
247   - auto neigh_b = edge.GetRegion();
248   - auto toB = FindEdge(neigh_b, b);
249   -
250   - /* If the edge tageting to node b is the first then
251   - the corresponding node is not valid anymore. */
252   - if(toB == neigh_b->m_Edges.begin())
253   - neigh_b->m_Valid = false;
254   -
255   - /* Keep in memory the boundary between node b
256   - and node neigh_b */
257   - boundary = edge.m_Boundary;
258   -
259   - /*
260   - We can remove safely the edge from node neigh_b
261   - targeting to node b
262   - */
263   - neigh_b->m_Edges.erase(toB);
264   -
265   - if(neigh_b != a)
266   - {
267   - /* Retrieve the edge targeting to node a. */
268   - auto toA = FindEdge(neigh_b, a);
269   -
270   - if( toA == neigh_b->m_Edges.end() )
271   - {
272   - /* No edge exists between node a and node neigh_b. */
273   -
274   - /* Add an edge from node neigh_b targeting node a. */
275   - neigh_b->m_Edges.push_back(EdgeType(a, 0, boundary));
276   -
277   - /* Add an edge from node a targeting node neigh_b. */
278   - a->m_Edges.push_back(EdgeType(neigh_b, 0, boundary));
279   - }
280   - else
281   - {
282   - /* An edge exists between node a and node neigh_b. */
283   -
284   - /* Increment the boundary of the edge from node neigh_b
285   - targeting to node a. */
286   - toA->m_Boundary += boundary;
287   -
288   - /* Increment the boundary of the edge from node a
289   - targeting to node neigh_b. */
290   - auto toNeighB = FindEdge(a, neigh_b);
291   - toNeighB->m_Boundary += boundary;
292   - }
293   - }
294   -
295   - }
296   -
297   - }
298   -
299   - template<class TSegmenter>
300   - void
301   - GraphOperations<TSegmenter>::UpdateInternalAttributes(NodePointerType a,
302   - NodePointerType b,
303   - const unsigned int width)
304   - {
305   -
306   - lp::BoundingBox mergedBBox;
307   - lp::Contour mergedContour;
308   - ContourOperator::MergeContour(mergedContour, mergedBBox, a->m_Contour,
309   - b->m_Contour, a->m_Bbox, b->m_Bbox,
310   - a->m_Id, b->m_Id, width);
311   -
312   - /* Step 1: update the bounding box */
313   - a->m_Bbox = mergedBBox;//MergeBoundingBoxes(a->m_Bbox, b->m_Bbox);
314   -
315   - /* Step 2: update the contour */
316   - a->m_Contour = mergedContour;
317   -
318   - /* Step 2 : update perimeter and area attributes */
319   - EdgeIterator toB = FindEdge(a, b);
320   - a->m_Perimeter += (b->m_Perimeter - 2 * toB->m_Boundary);
321   - a->m_Area += b->m_Area;
322   -
323   - /* Step 2: update the neighborhood */
324   - UpdateNeighbors(a,b);
325   -
326   - /* Step 3: update the node' states */
327   - a->m_Valid = false;
328   - b->m_Valid = false;
329   - b->m_Expired = true;
330   - a->m_IsMerged = true;
331   - }
332   -
333   - template<class TSegmenter>
334   - void
335   - GraphOperations<TSegmenter>::RemoveExpiredNodes(GraphType& graph)
336   - {
337   - NodeIterator nit = std::remove_if(graph.m_Nodes.begin(), graph.m_Nodes.end(), [](NodePointerType r)->bool{
338   - return r->m_Expired;
339   - });
340   - graph.m_Nodes.erase(nit, graph.m_Nodes.end());
341   - }
342   -
343   - template<class TSegmenter>
344   - bool
345   - GraphOperations<TSegmenter>::PerfomOneIterationWithLMBF(SegmenterType& seg)
346   - {
347   - bool merged = false;
348   -
349   - /* Update the costs of merging between adjacent nodes */
350   - UpdateMergingCosts(seg);
351   -
352   - for(auto& region : seg.m_Graph.m_Nodes)
353   - {
354   -
355   - auto res_node = CheckLMBF(region, seg.GetThreshold());
356   -
357   - if(res_node)
358   - {
359   - seg.UpdateSpecificAttributes(res_node, res_node->m_Edges.front().GetRegion());
360   - UpdateInternalAttributes(res_node, res_node->m_Edges.front().GetRegion(),
361   - seg.GetImageWidth());
362   - merged = true;
363   - }
364   - }
365   -
366   - RemoveExpiredNodes(seg.m_Graph);
367   -
368   - if(seg.m_Graph.m_Nodes.size() < 2)
369   - return false;
370   -
371   - return merged;
372   - }
373   -
374   - template<class TSegmenter>
375   - bool
376   - GraphOperations<TSegmenter>::PerfomAllIterationsWithLMBFAndConstThreshold(SegmenterType& seg)
377   - {
378   - bool merged = true;
379   - unsigned int maxNumberOfIterations;
380   - unsigned int iterations = 0;
381   - unsigned int numberOfIterations = seg.GetNumberOfIterations();
382   -
383   - if(numberOfIterations < 1)
384   - maxNumberOfIterations = 200;
385   - else
386   - maxNumberOfIterations = numberOfIterations;
387   -
388   - while(merged &&
389   - iterations < maxNumberOfIterations &&
390   - seg.m_Graph.m_Nodes.size() > 1)
391   - {
392   - std::cout << "." << std::flush;
393   - ++iterations;
394   -
395   - merged = PerfomOneIterationWithLMBF(seg);
396   - }
397   - std::cout << std::endl;
398   -
399   - if(seg.m_Graph.m_Nodes.size() < 2)
400   - return false;
401   -
402   - return merged;
403   - }
404   -
405   - /* New !!! utilisation of a dither matrix */
406   -
407   - template<class TSegmenter>
408   - bool
409   - GraphOperations<TSegmenter>::PerfomAllDitheredIterationsWithBF(SegmenterType& seg)
410   - {
411   - bool merged = true;
412   - unsigned int maxNumberOfIterations;
413   - unsigned int numberOfIterations = seg.GetNumberOfIterations();
414   -
415   - if(numberOfIterations < 1)
416   - maxNumberOfIterations = 200;
417   - else
418   - maxNumberOfIterations = numberOfIterations;
419   -
420   - unsigned int iterations = 0;
421   -
422   - while(merged &&
423   - iterations < maxNumberOfIterations &&
424   - seg.m_Graph.m_Nodes.size() > 1)
425   - {
426   - std::cout << "." << std::flush;
427   - ++iterations;
428   -
429   - merged = PerfomOneDitheredIterationWithBF(seg);
430   - }
431   - std::cout << std::endl;
432   -
433   - if(seg.m_Graph.m_Nodes.size() < 2)
434   - return false;
435   -
436   - return merged;
437   - }
438   -
439   - template<class TSegmenter>
440   - bool
441   - GraphOperations<TSegmenter>::PerfomOneDitheredIterationWithBF(SegmenterType& seg)
442   - {
443   - bool merged = false;
444   -
445   - std::vector<long unsigned int> randomIndices(seg.m_Graph.m_Nodes.size());
446   - std::iota(randomIndices.begin(), randomIndices.end(), 0);
447   - std::shuffle(randomIndices.begin(), randomIndices.end(), std::mt19937{std::random_device{}()});
448   -
449   - for(const auto& i : randomIndices)
450   - {
451   - if(seg.m_Graph.m_Nodes[i]->m_Valid == true)
452   - {
453   - auto currSeg = seg.m_Graph.m_Nodes[i];
454   -
455   - // This segment is marked as used.
456   - currSeg->m_Valid = false;
457   -
458   - // Compute cost with all its neighbors
459   - ComputeMergingCostsUsingDither(currSeg, seg);
460   -
461   - // Get the most similar segment
462   - auto bestSeg = currSeg->m_Edges.front().GetRegion();
463   -
464   - if(currSeg->m_Edges.front().m_Cost < seg.GetThreshold() && !bestSeg->m_Expired)
465   - {
466   - merged = true;
467   -
468   - if(currSeg->m_Id < bestSeg->m_Id)
469   - {
470   - seg.UpdateSpecificAttributes(currSeg, bestSeg);
471   - UpdateInternalAttributes(currSeg, bestSeg, seg.GetImageWidth());
472   -
473   - for(auto& edge : currSeg->m_Edges)
474   - {
475   - edge.m_CostUpdated = false;
476   - auto toNeigh = FindEdge(edge.GetRegion(), currSeg);
477   - toNeigh->m_CostUpdated = false;
478   - }
479   - }
480   - else
481   - {
482   - seg.UpdateSpecificAttributes(bestSeg, currSeg);
483   - UpdateInternalAttributes(bestSeg, currSeg, seg.GetImageWidth());
484   -
485   - for(auto& edge : bestSeg->m_Edges)
486   - {
487   - edge.m_CostUpdated = false;
488   - auto toNeigh = FindEdge(edge.GetRegion(), bestSeg);
489   - toNeigh->m_CostUpdated = false;
490   - }
491   - }
492   - }
493   - }
494   - }
495   -
496   - RemoveExpiredNodes(seg.m_Graph);
497   -
498   - // Mark all the segments to be valid
499   -
500   - if(seg.m_Graph.m_Nodes.size() < 2)
501   - return false;
502   -
503   - for(auto& r : seg.m_Graph.m_Nodes)
504   - r->m_Valid = true;
505   -
506   - return merged;
507   - }
508   -
509   - template<class TSegmenter>
510   - void GraphOperations<TSegmenter>::ComputeMergingCostsUsingDither(NodePointerType r, SegmenterType& seg)
511   - {
512   -
513   - float min_cost = std::numeric_limits<float>::max();
514   - std::size_t idx = 0, min_idx = 0;
515   -
516   -
517   - for(auto& edge : r->m_Edges)
518   - {
519   - // Compute the cost if the neighbor is not expired and the cost has to be updated
520   - if(!edge.GetRegion()->m_Expired)
521   - {
522   - auto neighborR = edge.GetRegion();
523   -
524   - // Compute the cost if necessary
525   - if(!edge.m_CostUpdated)
526   - {
527   - auto edgeFromNeighborToR = FindEdge(neighborR, r);
528   - edge.m_Cost = seg.ComputeMergingCost(r, neighborR);
529   - edgeFromNeighborToR->m_Cost = edge.m_Cost;
530   - edge.m_CostUpdated = true;
531   - edgeFromNeighborToR->m_CostUpdated = true;
532   - }
533   -
534   - // Check if the cost of the edge is the minimum
535   - if(min_cost > edge.m_Cost)
536   - {
537   - min_cost = edge.m_Cost;
538   - min_idx = idx;
539   - }
540   -
541   - ++idx;
542   - }
543   - }
544   - assert(min_idx < r->m_Edges.size());
545   - std::swap(r->m_Edges[0], r->m_Edges[min_idx]);
546   - }
547   -} // end of namespace grm
548   -
549   -#endif
550   -
551   -
552   -
553   -
554   -
555   -
556   -
557   -
test/CMakeLists.txt
1 1 otb_module_test()
2 2  
3 3 otb_test_application(NAME apGRM_BaatzCriterion
4   - APP GRM
  4 + APP otbGRM
5 5 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
6 6 -out ${TEMP}/apGRMLabeledImage.tif int16
7 7 -criterion bs
... ... @@ -11,7 +11,7 @@ otb_test_application(NAME apGRM_BaatzCriterion
11 11 )
12 12  
13 13 otb_test_application(NAME apGRM_EuclideanDistanceCriterion
14   - APP GRM
  14 + APP otbGRM
15 15 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
16 16 -out ${TEMP}/apGRMLabeledImage.tif int16
17 17 -criterion ed
... ... @@ -19,7 +19,7 @@ otb_test_application(NAME apGRM_EuclideanDistanceCriterion
19 19 )
20 20  
21 21 otb_test_application(NAME apGRM_FullLambdaScheduleCriterion
22   - APP GRM
  22 + APP otbGRM
23 23 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
24 24 -out ${TEMP}/apGRMLabeledImage.tif int16
25 25 -criterion fls
... ... @@ -27,7 +27,7 @@ otb_test_application(NAME apGRM_FullLambdaScheduleCriterion
27 27 )
28 28  
29 29 otb_test_application(NAME apGRM_BaatzCriterionWithSpeed
30   - APP GRM
  30 + APP otbGRM
31 31 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
32 32 -out ${TEMP}/apGRMLabeledImage.tif int16
33 33 -speed 1
... ... @@ -38,7 +38,7 @@ otb_test_application(NAME apGRM_BaatzCriterionWithSpeed
38 38 )
39 39  
40 40 otb_test_application(NAME apGRM_EuclideanDistanceCriterionWithSpeed
41   - APP GRM
  41 + APP otbGRM
42 42 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
43 43 -out ${TEMP}/apGRMLabeledImage.tif int16
44 44 -speed 1
... ... @@ -47,7 +47,7 @@ otb_test_application(NAME apGRM_EuclideanDistanceCriterionWithSpeed
47 47 )
48 48  
49 49 otb_test_application(NAME apGRM_FullLambdaScheduleCriterionWithSpeed
50   - APP GRM
  50 + APP otbGRM
51 51 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
52 52 -out ${TEMP}/apGRMLabeledImage.tif int16
53 53 -speed 1
... ... @@ -56,7 +56,7 @@ otb_test_application(NAME apGRM_FullLambdaScheduleCriterionWithSpeed
56 56 )
57 57  
58 58 otb_test_application(NAME apGRM_BaatzCriterionWithFixedNumberOfIterations
59   - APP GRM
  59 + APP otbGRM
60 60 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
61 61 -out ${TEMP}/apGRMLabeledImage.tif int16
62 62 -niter 75
... ... @@ -67,7 +67,7 @@ otb_test_application(NAME apGRM_BaatzCriterionWithFixedNumberOfIterations
67 67 )
68 68  
69 69 otb_test_application(NAME apGRM_EuclideanDistanceCriterionWithFixedNumberOfIterations
70   - APP GRM
  70 + APP otbGRM
71 71 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
72 72 -out ${TEMP}/apGRMLabeledImage.tif int16
73 73 -niter 75
... ... @@ -76,7 +76,7 @@ otb_test_application(NAME apGRM_EuclideanDistanceCriterionWithFixedNumberOfItera
76 76 )
77 77  
78 78 otb_test_application(NAME apGRM_FullLambdaScheduleCriterionWithFixedNumberOfIterations
79   - APP GRM
  79 + APP otbGRM
80 80 OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
81 81 -out ${TEMP}/apGRMLabeledImage.tif int16
82 82 -niter 75
... ...
test/CMakeLists.txt~
... ... @@ -1,85 +0,0 @@
1   -otb_module_test()
2   -
3   -otb_test_application(NAME apOTBGRM_BaatzCriterion
4   - APP GRM
5   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
6   - -out ${TEMP}/apGRMLabeledImage.tif int16
7   - -criterion bs
8   - -threshold 60
9   - -cw 0.7
10   - -sw 0.3
11   -)
12   -
13   -otb_test_application(NAME apOTBGRM_EuclideanDistanceCriterion
14   - APP GRM
15   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
16   - -out ${TEMP}/apGRMLabeledImage.tif int16
17   - -criterion ed
18   - -threshold 30
19   -)
20   -
21   -otb_test_application(NAME apOTBGRM_FullLambdaScheduleCriterion
22   - APP GRM
23   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
24   - -out ${TEMP}/apGRMLabeledImage.tif int16
25   - -criterion fls
26   - -threshold 500
27   -)
28   -
29   -otb_test_application(NAME apOTBGRM_BaatzCriterionWithSpeed
30   - APP GRM
31   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
32   - -out ${TEMP}/apGRMLabeledImage.tif int16
33   - -speed 1
34   - -criterion bs
35   - -threshold 60
36   - -cw 0.7
37   - -sw 0.3
38   -)
39   -
40   -otb_test_application(NAME apOTBGRM_EuclideanDistanceCriterionWithSpeed
41   - APP GRM
42   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
43   - -out ${TEMP}/apGRMLabeledImage.tif int16
44   - -speed 1
45   - -criterion ed
46   - -threshold 30
47   -)
48   -
49   -otb_test_application(NAME apOTBGRM_FullLambdaScheduleCriterionWithSpeed
50   - APP GRM
51   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
52   - -out ${TEMP}/apGRMLabeledImage.tif int16
53   - -speed 1
54   - -criterion fls
55   - -threshold 500
56   -)
57   -
58   -otb_test_application(NAME apOTBGRM_BaatzCriterionWithFixedNumberOfIterations
59   - APP GRM
60   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
61   - -out ${TEMP}/apGRMLabeledImage.tif int16
62   - -niter 75
63   - -criterion bs
64   - -threshold 60
65   - -cw 0.7
66   - -sw 0.3
67   -)
68   -
69   -otb_test_application(NAME apOTBGRM_EuclideanDistanceCriterionWithFixedNumberOfIterations
70   - APP GRM
71   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
72   - -out ${TEMP}/apGRMLabeledImage.tif int16
73   - -niter 75
74   - -criterion ed
75   - -threshold 30
76   -)
77   -
78   -otb_test_application(NAME apOTBGRM_FullLambdaScheduleCriterionWithFixedNumberOfIterations
79   - APP GRM
80   - OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_XS.tif
81   - -out ${TEMP}/apGRMLabeledImage.tif int16
82   - -niter 75
83   - -criterion fls
84   - -threshold 500
85   -)