|
@@ -13,6 +13,7 @@
|
|
|
|
|
|
#include "core/basics/Timer.h"
|
|
|
#include "core/basics/vectorio.h"
|
|
|
+#include "core/image/FilterT.h"
|
|
|
|
|
|
#include <omp.h>
|
|
|
#include <iostream>
|
|
@@ -677,6 +678,31 @@ void SemSegContextTree::train ( const MultiDataset *md )
|
|
|
}
|
|
|
|
|
|
allfeats[imgcounter] = ColorSpace::rgbtolab ( allfeats[imgcounter] );
|
|
|
+
|
|
|
+ allfeats[imgcounter].addChannel(3);
|
|
|
+
|
|
|
+ ImageT<double> tmp(xsize, ysize);
|
|
|
+ ImageT<double> tmp2(xsize, ysize);
|
|
|
+
|
|
|
+ for(int c = 0; c < 3; c++)
|
|
|
+ {
|
|
|
+ for(int y = 0; y < ysize; y++)
|
|
|
+ {
|
|
|
+ for(int x = 0; x < xsize; x++)
|
|
|
+ {
|
|
|
+ tmp(x,y) = allfeats[imgcounter](x,y,c);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ NICE::FilterT<double>::sobel(tmp, tmp2);
|
|
|
+ for(int y = 0; y < ysize; y++)
|
|
|
+ {
|
|
|
+ for(int x = 0; x < xsize; x++)
|
|
|
+ {
|
|
|
+ allfeats[imgcounter](x,y,c+3) = tmp2(x,y);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
// getting groundtruth
|
|
@@ -1180,6 +1206,33 @@ void SemSegContextTree::semanticseg ( CachedExample *ce, NICE::Image & segresult
|
|
|
}
|
|
|
|
|
|
feats = ColorSpace::rgbtolab ( feats );
|
|
|
+
|
|
|
+ feats.addChannel(3);
|
|
|
+
|
|
|
+ ImageT<double> tmp(xsize, ysize);
|
|
|
+ ImageT<double> tmp2(xsize, ysize);
|
|
|
+
|
|
|
+ for(int c = 0; c < 3; c++)
|
|
|
+ {
|
|
|
+ for(int y = 0; y < ysize; y++)
|
|
|
+ {
|
|
|
+ for(int x = 0; x < xsize; x++)
|
|
|
+ {
|
|
|
+ tmp(x,y) = feats(x,y,c);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ NICE::FilterT<double>::sobel(tmp, tmp2);
|
|
|
+ for(int y = 0; y < ysize; y++)
|
|
|
+ {
|
|
|
+ for(int x = 0; x < xsize; x++)
|
|
|
+ {
|
|
|
+ feats(x,y,c+3) = tmp2(x,y);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
bool allleaf = false;
|