* green/mln/demo/annoting/bic/Makefile: New Makefile.
* green/mln/demo/annoting/bic/bic.cc: New impl. of the bic descriptor.
* green/mln/demo/annoting/lep/Makefile: New Makefile.
* green/mln/demo/annoting/lep/lep.cc: New impl. of the lep descriptor.
* green/mln/demo/annoting/project/Makefile: New Makefile.
* green/mln/demo/annoting/project/project.cc: New impl. of the project
descriptor.
* green/mln/demo/annoting/rgb_64/Makefile: New Makefile.
* green/mln/demo/annoting/rgb_64/rgb_64.cc: New impl. of the rgb_64
descriptor.
* green/mln/demo/annoting/rgb_64_9/Makefile: New Makefile.
* green/mln/demo/annoting/rgb_64_9/rgb_64_9.cc: New impl. of the
rgb_64_9 descriptor.
* green/mln/demo/annoting/class.txt: New notes on fax class.
---
milena/sandbox/ChangeLog | 25 +++
milena/sandbox/green/demo/annoting/bic/Makefile.am | 150 ++++++++++++++
milena/sandbox/green/demo/annoting/bic/bic.cc | 87 ++++++++
milena/sandbox/green/demo/annoting/class.txt | 33 +++
milena/sandbox/green/demo/annoting/lep/Makefile.am | 150 ++++++++++++++
milena/sandbox/green/demo/annoting/lep/lep.cc | 92 +++++++++
.../green/demo/annoting/project/Makefile.am | 150 ++++++++++++++
.../sandbox/green/demo/annoting/project/project.cc | 210 ++++++++++++++++++++
.../sandbox/green/demo/annoting/rgb_64/Makefile.am | 150 ++++++++++++++
.../sandbox/green/demo/annoting/rgb_64/rgb_64.cc | 47 +++++
.../green/demo/annoting/rgb_64_9/Makefile.am | 150 ++++++++++++++
.../green/demo/annoting/rgb_64_9/rgb_64_9.cc | 97 +++++++++
12 files changed, 1341 insertions(+), 0 deletions(-)
create mode 100644 milena/sandbox/green/demo/annoting/bic/Makefile.am
create mode 100644 milena/sandbox/green/demo/annoting/bic/bic.cc
create mode 100644 milena/sandbox/green/demo/annoting/class.txt
create mode 100644 milena/sandbox/green/demo/annoting/lep/Makefile.am
create mode 100644 milena/sandbox/green/demo/annoting/lep/lep.cc
create mode 100644 milena/sandbox/green/demo/annoting/project/Makefile.am
create mode 100644 milena/sandbox/green/demo/annoting/project/project.cc
create mode 100644 milena/sandbox/green/demo/annoting/rgb_64/Makefile.am
create mode 100644 milena/sandbox/green/demo/annoting/rgb_64/rgb_64.cc
create mode 100644 milena/sandbox/green/demo/annoting/rgb_64_9/Makefile.am
create mode 100644 milena/sandbox/green/demo/annoting/rgb_64_9/rgb_64_9.cc
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 56cfd22..f032fcf 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -77,6 +77,31 @@
2009-12-02 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
+ Works on Millet2008 descriptors.
+
+ * green/mln/demo/annoting/bic/Makefile: New Makefile.
+ * green/mln/demo/annoting/bic/bic.cc: New impl. of the bic descriptor.
+
+ * green/mln/demo/annoting/lep/Makefile: New Makefile.
+ * green/mln/demo/annoting/lep/lep.cc: New impl. of the lep descriptor.
+
+ * green/mln/demo/annoting/project/Makefile: New Makefile.
+ * green/mln/demo/annoting/project/project.cc: New impl. of the project
+ descriptor.
+
+ * green/mln/demo/annoting/rgb_64/Makefile: New Makefile.
+ * green/mln/demo/annoting/rgb_64/rgb_64.cc: New impl. of the rgb_64
+ descriptor.
+
+ * green/mln/demo/annoting/rgb_64_9/Makefile: New Makefile.
+ * green/mln/demo/annoting/rgb_64_9/rgb_64_9.cc: New impl. of the
+ rgb_64_9 descriptor.
+
+ * green/mln/demo/annoting/class.txt: New notes on fax class.
+
+
+2009-12-02 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
+
Extend the test image database.
* green/mln/img_path.hh: Add annoting directories to experiment
diff --git a/milena/sandbox/green/demo/annoting/bic/Makefile.am
b/milena/sandbox/green/demo/annoting/bic/Makefile.am
new file mode 100644
index 0000000..96eafb4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/bic/Makefile.am
@@ -0,0 +1,150 @@
+#
+# Generic Makefile
+#
+
+#########
+# TOOLS #
+#########
+
+INCLUDES= -I$(HOME)/svn/oln/trunk/milena/sandbox/green
+#CXXFLAGS= -ggdb -O0 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+CXXFLAGS= -DNDEBUG -O1 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+#CXXFLAGS= -DNDEBUG -O3 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+ECHO= echo
+RM= rm
+MKDIR= mkdir -p
+CP= cp
+
+SOURCE_PATTERN= green/demo
+BUILD__PATTERN= green/build/demo
+
+
+ifeq ($(findstring $(BUILD__PATTERN),$(PWD)), $(BUILD__PATTERN))
+# Case where make is done from build directory.
+SOURCE_DIR= $(subst $(BUILD__PATTERN),$(SOURCE_PATTERN),$(PWD))
+BUILD__DIR= $(PWD)/
+else
+# Case where make is done from source directory.
+SOURCE_DIR= $(PWD)/
+BUILD__DIR= $(subst $(SOURCE_PATTERN),$(BUILD__PATTERN),$(PWD))
+endif
+
+SRC= $(notdir $(wildcard $(SOURCE_DIR)/*.cc))
+OLD= $(notdir $(wildcard $(SOURCE_DIR)/*~))
+OBJ= $(patsubst %.cc,%.o,$(SRC))
+SOURCE_MAKEFILE=Makefile.am
+BUILD__MAKEFILE=Makefile
+TARGET_FILE= $(notdir $(PWD))
+SOURCE_FILES= $(notdir $(wildcard $(SOURCE_DIR)/*.*))
+BUILD__FILES= $(filter-out $(SRC) $(SOURCE_MAKEFILE), $(SOURCE_FILES))
+
+BUILD__F_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__FILES))
+SOURCE_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
+
+BUILD__M_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__MAKEFILE))
+SOURCE_M_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_MAKEFILE))
+
+TARGET_F_PATH= $(addprefix $(BUILD__DIR)/,$(TARGET_FILE))
+OBJ_F_PATH= $(addprefix $(BUILD__DIR)/,$(OBJ))
+SRC_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SRC))
+OLD_F_PATH= $(addprefix $(SOURCE_DIR)/,$(OLD))
+
+#############
+# BOOTSTRAP #
+#############
+
+
+bootstrap: $(BUILD__DIR) $(BUILD__F_PATH) $(BUILD__M_PATH)
+
+# Create, if nessary, the destination directory
+$(BUILD__DIR):
+ $(MKDIR) $(BUILD__DIR)
+
+# Copy, if nessary, all the files, except the Makefile.am
+$(BUILD__F_PATH): $(SOURCE_F_PATH)
+ $(CP) $(addprefix $(SOURCE_DIR),$(@F)) $@
+
+# Copy if nessary, the Makefile.am into Makefile
+$(BUILD__M_PATH): $(SOURCE_M_PATH)
+ $(CP) $(SOURCE_M_PATH) $(BUILD__M_PATH)
+
+
+#######
+# ALL #
+#######
+
+# We assume that the call is done from the build directory.
+# With the directive vpath, hidden files are found in the source directory.
+
+all: $(TARGET_F_PATH)
+
+
+$(TARGET_F_PATH): $(OBJ_F_PATH)
+ $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@
+
+$(OBJ_F_PATH):$(SRC_F_PATH)
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+
+#########
+# CLEAN #
+#########
+
+# Force every time the deletion
+clean: clean_target clean_obj clean_dst clean_old #clean_make
+
+
+clean_target:
+ -@$(RM) $(TARGET_F_PATH) &> /dev/null
+
+clean_obj:
+ -@$(RM) $(OBJ_F_PATH) &> /dev/null
+
+clean_dst:
+ -@$(RM) $(BUILD_F_PATH) &> /dev/null
+
+clean_make:
+ -@$(RM) $(BUILD_M_PATH) &> /dev/null
+
+clean_old:
+ -@$(RM) $(OLD_F_PATH) &> /dev/null
+
+
+#########
+# PRINT #
+#########
+
+print: print_tools print_bootstrap
+
+print_tools:
+ @$(ECHO) "HOME = $(HOME)"
+ @$(ECHO) "INCLUDES = $(INCLUDES)"
+ @$(ECHO) "CXXFLAGS = $(CXXFLAGS)"
+ @$(ECHO) "ECHO = $(ECHO)"
+ @$(ECHO) "RM = $(RM)"
+ @$(ECHO) "MKDIR = $(MKDIR)"
+ @$(ECHO) "CP = $(CP)"
+ @$(ECHO)
+
+print_bootstrap:
+ @$(ECHO) "PWD = $(PWD)"
+ @$(ECHO) "SOURCE_PATTERN = $(SOURCE_PATTERN)"
+ @$(ECHO) "BUILD__PATTERN = $(BUILD__PATTERN)"
+ @$(ECHO) "SOURCE_DIR = $(SOURCE_DIR)"
+ @$(ECHO) "BUILD__DIR = $(BUILD__DIR)"
+ @$(ECHO) "SOURCE_MAKEFILE = $(SOURCE_MAKEFILE)"
+ @$(ECHO) "BUILD__MAKEFILE = $(BUILD__MAKEFILE)"
+ @$(ECHO) "TARGET_FILE = $(TARGET_FILE)"
+ @$(ECHO) "SOURCE_FILES = $(SOURCE_FILES)"
+ @$(ECHO) "SOURCE_F_PATH = $(SOURCE_F_PATH)"
+ @$(ECHO) "BUILD__FILES = $(BUILD__FILES)"
+ @$(ECHO) "BUILD__F_PATH = $(BUILD__F_PATH)"
+ @$(ECHO) "BUILD__M_PATH = $(BUILD__M_PATH)"
+ @$(ECHO) "SOURCE_M_PATH = $(SOURCE_M_PATH)"
+ @$(ECHO) "SRC = $(SRC)"
+ @$(ECHO) "OBJ = $(OBJ)"
+ @$(ECHO) "OLD = $(OLD)"
+ @$(ECHO) "SRC_F_PATH = $(SRC_F_PATH)"
+ @$(ECHO) "OBJ_F_PATH = $(OBJ_F_PATH)"
+ @$(ECHO) "OLD_F_PATH = $(OLD_F_PATH)"
+ @$(ECHO)
diff --git a/milena/sandbox/green/demo/annoting/bic/bic.cc
b/milena/sandbox/green/demo/annoting/bic/bic.cc
new file mode 100644
index 0000000..7e15970
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/bic/bic.cc
@@ -0,0 +1,87 @@
+// Test de l'opérateur de Millet BIC
+// Composante RGB sur 6 bits, puis on distingue les points intérieurs des points
+// extérieurs. Les points intérieurs ont la même couleur que leur 4-voisinage.
+// Puis on construit les 2 histogrammes (intérieur/extérieur)
+#include <iostream>
+
+#include <mln/accu/stat/histo3d_rgb.hh>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/core/routine/initialize.hh>
+#include <mln/core/var.hh>
+
+#include <mln/data/compute.hh>
+#include <mln/data/convert.hh>
+#include <mln/data/transform.hh>
+#include <mln/data/fill.hh>
+
+#include <mln/debug/println.hh>
+
+#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+
+#include <mln/img_path.hh>
+
+#include <mln/io/ppm/load.hh>
+#include <mln/io/ppm/save.hh>
+#include <mln/io/plot/save_image_sh.hh>
+
+#include <mln/literal/colors.hh>
+
+#include <mln/value/rgb.hh>
+#include <mln/value/rgb8.hh>
+
+int main()
+{
+ typedef mln::value::rgb<3> t_rgb3;
+ typedef mln::value::rgb8 t_rgb8;
+ typedef mln::neighb2d t_neighb2d;
+ typedef mln::image2d<t_rgb3> t_image2d_rgb3;
+ typedef mln::image2d<t_rgb8> t_image2d_rgb8;
+ typedef mln::image3d<unsigned> t_histo3d;
+ typedef mln::fun::v2v::rgb8_to_rgbn<3> t_rgb8_to_rgb3;
+ typedef mln::accu::meta::stat::histo3d_rgb t_histo3d_fun;
+
+ t_image2d_rgb8 input_rgb8;
+ t_image2d_rgb3 input_rgb3;
+ t_image2d_rgb3 interior_rgb3;
+ t_image2d_rgb3 exterior_rgb3;
+ t_histo3d histo_exterior;
+ t_histo3d histo_interior;
+
+ // IMAGE LOADING PHASE
+ std::cout << "Image loading phase ..." << std::endl;
+ mln::io::ppm::load(input_rgb8, SCRIBO_PPM_IMG_PATH"/mp00082c_50p.ppm");
+ input_rgb3 = mln::data::transform(input_rgb8, t_rgb8_to_rgb3());
+
+ mln::initialize(interior_rgb3, input_rgb3);
+ mln::initialize(exterior_rgb3, input_rgb3);
+
+ mln::data::fill(interior_rgb3, mln::literal::black);
+ mln::data::fill(exterior_rgb3, mln::literal::black);
+
+ mln_piter_(t_image2d_rgb3) p(input_rgb3.domain());
+ mln_niter_(t_neighb2d) n(mln::c4(), p);
+
+ for_all(p)
+ {
+ bool is_interior = true;
+
+ for_all(n)
+ is_interior = is_interior && (input_rgb3(p) == input_rgb3(n));
+
+ if (is_interior)
+ interior_rgb3(p) = input_rgb3(p);
+ else
+ exterior_rgb3(p) = input_rgb3(p);
+ }
+
+ histo_interior = mln::data::compute(t_histo3d_fun(), interior_rgb3);
+ histo_exterior = mln::data::compute(t_histo3d_fun(), exterior_rgb3);
+
+ //mln::io::plot::save_image_sh(histo, "histo.sh");
+
+ // PRINTING PHASE
+ mln::debug::println(histo_interior);
+ mln::debug::println(histo_exterior);
+}
diff --git a/milena/sandbox/green/demo/annoting/class.txt
b/milena/sandbox/green/demo/annoting/class.txt
new file mode 100644
index 0000000..ec7e92e
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/class.txt
@@ -0,0 +1,33 @@
+Dans scribo les classes de documents sont:
+
+- image seule (photo)
+- courrier manuscrit
+- courrier dactylographié
+- facture ou feuille organisée sous forme de tableau
+- article de journal
+- document composite
+- infographie (logo, carte, dessin vectoriel)
+- slide (copie d'écran ou sauvegarde au format image)
+
+
+Où se situent les faxes ?
+
+
+Description d'un fax:
+- ratio l/L assimilable à du A4 ou US Letter
+- nombre de couleurs très petit, < 1000
+- plutôt du N & B, mais quelques faxes sont en couleurs
+- généralement un % élevé de blanc (la page vierge)
+
+
+Description d'un article de journal:
+- nombre élevés de couleurs (> 10 000) en général
+- quelques articles de conférences autour de 5000
+
+
+Description des photos:
+- un nombre très élevé de couleurs
+- ratio non A4, non US Letter
+
+
+
diff --git a/milena/sandbox/green/demo/annoting/lep/Makefile.am
b/milena/sandbox/green/demo/annoting/lep/Makefile.am
new file mode 100644
index 0000000..96eafb4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/lep/Makefile.am
@@ -0,0 +1,150 @@
+#
+# Generic Makefile
+#
+
+#########
+# TOOLS #
+#########
+
+INCLUDES= -I$(HOME)/svn/oln/trunk/milena/sandbox/green
+#CXXFLAGS= -ggdb -O0 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+CXXFLAGS= -DNDEBUG -O1 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+#CXXFLAGS= -DNDEBUG -O3 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+ECHO= echo
+RM= rm
+MKDIR= mkdir -p
+CP= cp
+
+SOURCE_PATTERN= green/demo
+BUILD__PATTERN= green/build/demo
+
+
+ifeq ($(findstring $(BUILD__PATTERN),$(PWD)), $(BUILD__PATTERN))
+# Case where make is done from build directory.
+SOURCE_DIR= $(subst $(BUILD__PATTERN),$(SOURCE_PATTERN),$(PWD))
+BUILD__DIR= $(PWD)/
+else
+# Case where make is done from source directory.
+SOURCE_DIR= $(PWD)/
+BUILD__DIR= $(subst $(SOURCE_PATTERN),$(BUILD__PATTERN),$(PWD))
+endif
+
+SRC= $(notdir $(wildcard $(SOURCE_DIR)/*.cc))
+OLD= $(notdir $(wildcard $(SOURCE_DIR)/*~))
+OBJ= $(patsubst %.cc,%.o,$(SRC))
+SOURCE_MAKEFILE=Makefile.am
+BUILD__MAKEFILE=Makefile
+TARGET_FILE= $(notdir $(PWD))
+SOURCE_FILES= $(notdir $(wildcard $(SOURCE_DIR)/*.*))
+BUILD__FILES= $(filter-out $(SRC) $(SOURCE_MAKEFILE), $(SOURCE_FILES))
+
+BUILD__F_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__FILES))
+SOURCE_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
+
+BUILD__M_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__MAKEFILE))
+SOURCE_M_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_MAKEFILE))
+
+TARGET_F_PATH= $(addprefix $(BUILD__DIR)/,$(TARGET_FILE))
+OBJ_F_PATH= $(addprefix $(BUILD__DIR)/,$(OBJ))
+SRC_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SRC))
+OLD_F_PATH= $(addprefix $(SOURCE_DIR)/,$(OLD))
+
+#############
+# BOOTSTRAP #
+#############
+
+
+bootstrap: $(BUILD__DIR) $(BUILD__F_PATH) $(BUILD__M_PATH)
+
+# Create, if nessary, the destination directory
+$(BUILD__DIR):
+ $(MKDIR) $(BUILD__DIR)
+
+# Copy, if nessary, all the files, except the Makefile.am
+$(BUILD__F_PATH): $(SOURCE_F_PATH)
+ $(CP) $(addprefix $(SOURCE_DIR),$(@F)) $@
+
+# Copy if nessary, the Makefile.am into Makefile
+$(BUILD__M_PATH): $(SOURCE_M_PATH)
+ $(CP) $(SOURCE_M_PATH) $(BUILD__M_PATH)
+
+
+#######
+# ALL #
+#######
+
+# We assume that the call is done from the build directory.
+# With the directive vpath, hidden files are found in the source directory.
+
+all: $(TARGET_F_PATH)
+
+
+$(TARGET_F_PATH): $(OBJ_F_PATH)
+ $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@
+
+$(OBJ_F_PATH):$(SRC_F_PATH)
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+
+#########
+# CLEAN #
+#########
+
+# Force every time the deletion
+clean: clean_target clean_obj clean_dst clean_old #clean_make
+
+
+clean_target:
+ -@$(RM) $(TARGET_F_PATH) &> /dev/null
+
+clean_obj:
+ -@$(RM) $(OBJ_F_PATH) &> /dev/null
+
+clean_dst:
+ -@$(RM) $(BUILD_F_PATH) &> /dev/null
+
+clean_make:
+ -@$(RM) $(BUILD_M_PATH) &> /dev/null
+
+clean_old:
+ -@$(RM) $(OLD_F_PATH) &> /dev/null
+
+
+#########
+# PRINT #
+#########
+
+print: print_tools print_bootstrap
+
+print_tools:
+ @$(ECHO) "HOME = $(HOME)"
+ @$(ECHO) "INCLUDES = $(INCLUDES)"
+ @$(ECHO) "CXXFLAGS = $(CXXFLAGS)"
+ @$(ECHO) "ECHO = $(ECHO)"
+ @$(ECHO) "RM = $(RM)"
+ @$(ECHO) "MKDIR = $(MKDIR)"
+ @$(ECHO) "CP = $(CP)"
+ @$(ECHO)
+
+print_bootstrap:
+ @$(ECHO) "PWD = $(PWD)"
+ @$(ECHO) "SOURCE_PATTERN = $(SOURCE_PATTERN)"
+ @$(ECHO) "BUILD__PATTERN = $(BUILD__PATTERN)"
+ @$(ECHO) "SOURCE_DIR = $(SOURCE_DIR)"
+ @$(ECHO) "BUILD__DIR = $(BUILD__DIR)"
+ @$(ECHO) "SOURCE_MAKEFILE = $(SOURCE_MAKEFILE)"
+ @$(ECHO) "BUILD__MAKEFILE = $(BUILD__MAKEFILE)"
+ @$(ECHO) "TARGET_FILE = $(TARGET_FILE)"
+ @$(ECHO) "SOURCE_FILES = $(SOURCE_FILES)"
+ @$(ECHO) "SOURCE_F_PATH = $(SOURCE_F_PATH)"
+ @$(ECHO) "BUILD__FILES = $(BUILD__FILES)"
+ @$(ECHO) "BUILD__F_PATH = $(BUILD__F_PATH)"
+ @$(ECHO) "BUILD__M_PATH = $(BUILD__M_PATH)"
+ @$(ECHO) "SOURCE_M_PATH = $(SOURCE_M_PATH)"
+ @$(ECHO) "SRC = $(SRC)"
+ @$(ECHO) "OBJ = $(OBJ)"
+ @$(ECHO) "OLD = $(OLD)"
+ @$(ECHO) "SRC_F_PATH = $(SRC_F_PATH)"
+ @$(ECHO) "OBJ_F_PATH = $(OBJ_F_PATH)"
+ @$(ECHO) "OLD_F_PATH = $(OLD_F_PATH)"
+ @$(ECHO)
diff --git a/milena/sandbox/green/demo/annoting/lep/lep.cc
b/milena/sandbox/green/demo/annoting/lep/lep.cc
new file mode 100644
index 0000000..24ee7b4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/lep/lep.cc
@@ -0,0 +1,92 @@
+// Test de l'opérateur de Millet LEP
+// Composante RGB sur 6 bits, puis sobel 3x3, puis identification configuration
+// L'image histogramme des configurations est la résultante
+
+#include <iostream>
+
+#include <mln/accu/stat/histo1d.hh>
+
+#include <mln/binarization/threshold.hh>
+
+#include <mln/core/alias/w_window2d_int.hh>
+#include <mln/core/image/image2d.hh>
+
+#include <mln/data/compute.hh>
+#include <mln/data/convert.hh>
+#include <mln/data/transform.hh>
+
+#include <mln/debug/println.hh>
+
+#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+
+#include <mln/img_path.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/io/plot/save_image_sh.hh>
+
+#include <mln/linear/ch_convolve.hh>
+#include <mln/linear/convolve.hh>
+#include <mln/linear/sobel_2d.hh>
+
+#include <mln/make/w_window2d.hh>
+
+#include <mln/value/rgb.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/value/int_u8.hh>
+
+#include <mln/core/var.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef mln::w_window2d_int t_win2d;
+ typedef mln::value::int_u8 t_int_u8;
+ typedef mln::value::int_u<9> t_int_u9;
+ typedef mln::image2d<t_int_u8> t_image2d_int_u8;
+ typedef mln::image2d<t_int_u9> t_image2d_int_u9;
+ typedef mln::image2d<int> t_image2d_int;
+ typedef mln::image2d<unsigned> t_image2d_unsigned;
+ typedef mln::image2d<float> t_image2d_float;
+ typedef mln::image2d<double> t_image2d_double;
+ typedef mln::image2d<bool> t_image2d_bool;
+ typedef mln::image1d<unsigned> t_histo1d;
+ typedef mln::accu::meta::stat::histo1d t_histo1d_fun;
+
+ t_image2d_int_u8 input_int_u8;
+ t_image2d_int input_int;
+ t_image2d_unsigned input_unsigned;
+ t_image2d_float sobel;
+ t_image2d_bool thresh_bool;
+ t_image2d_int_u8 thresh_int_u8;
+ t_image2d_float conf_float;
+ t_image2d_int_u9 conf_int_u9;
+ t_histo1d histo;
+
+ // IMAGE LOADING PHASE
+ std::cout << "Image loading phase ..." << std::endl;
+
mln::io::pgm::load(input_int_u8,SCRIBO_PGM_IMG_PATH"/mp00082c_50p_8bits.pgm");
+
+ sobel = mln::linear::sobel_2d_l1_norm(input_int_u8);
+
+ //mln::io::plot::save_image_sh(sobel, "sobel.sh");
+ thresh_bool = mln::binarization::threshold(sobel, 100);
+ thresh_int_u8 = mln::data::convert(mln::value::int_u8(), thresh_bool);
+ //mln::io::plot::save_image_sh(thresh, "thresh.sh");
+
+ int ws[] = { 1, 2, 4,
+ 8, 256, 16,
+ 32, 64, 128 };
+
+ t_win2d win2d = mln::make::w_window2d(ws);
+ conf_float = mln::linear::convolve(thresh_int_u8, win2d);
+ conf_int_u9 = mln::data::convert(t_int_u9(), conf_float);
+ histo = mln::data::compute(t_histo1d_fun(), conf_int_u9);
+
+ mln::io::plot::save_image_sh(histo, "histo.sh");
+
+ // PRINTING PHASE
+ mln::debug::println(histo);
+}
diff --git a/milena/sandbox/green/demo/annoting/project/Makefile.am
b/milena/sandbox/green/demo/annoting/project/Makefile.am
new file mode 100644
index 0000000..96eafb4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/project/Makefile.am
@@ -0,0 +1,150 @@
+#
+# Generic Makefile
+#
+
+#########
+# TOOLS #
+#########
+
+INCLUDES= -I$(HOME)/svn/oln/trunk/milena/sandbox/green
+#CXXFLAGS= -ggdb -O0 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+CXXFLAGS= -DNDEBUG -O1 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+#CXXFLAGS= -DNDEBUG -O3 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+ECHO= echo
+RM= rm
+MKDIR= mkdir -p
+CP= cp
+
+SOURCE_PATTERN= green/demo
+BUILD__PATTERN= green/build/demo
+
+
+ifeq ($(findstring $(BUILD__PATTERN),$(PWD)), $(BUILD__PATTERN))
+# Case where make is done from build directory.
+SOURCE_DIR= $(subst $(BUILD__PATTERN),$(SOURCE_PATTERN),$(PWD))
+BUILD__DIR= $(PWD)/
+else
+# Case where make is done from source directory.
+SOURCE_DIR= $(PWD)/
+BUILD__DIR= $(subst $(SOURCE_PATTERN),$(BUILD__PATTERN),$(PWD))
+endif
+
+SRC= $(notdir $(wildcard $(SOURCE_DIR)/*.cc))
+OLD= $(notdir $(wildcard $(SOURCE_DIR)/*~))
+OBJ= $(patsubst %.cc,%.o,$(SRC))
+SOURCE_MAKEFILE=Makefile.am
+BUILD__MAKEFILE=Makefile
+TARGET_FILE= $(notdir $(PWD))
+SOURCE_FILES= $(notdir $(wildcard $(SOURCE_DIR)/*.*))
+BUILD__FILES= $(filter-out $(SRC) $(SOURCE_MAKEFILE), $(SOURCE_FILES))
+
+BUILD__F_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__FILES))
+SOURCE_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
+
+BUILD__M_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__MAKEFILE))
+SOURCE_M_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_MAKEFILE))
+
+TARGET_F_PATH= $(addprefix $(BUILD__DIR)/,$(TARGET_FILE))
+OBJ_F_PATH= $(addprefix $(BUILD__DIR)/,$(OBJ))
+SRC_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SRC))
+OLD_F_PATH= $(addprefix $(SOURCE_DIR)/,$(OLD))
+
+#############
+# BOOTSTRAP #
+#############
+
+
+bootstrap: $(BUILD__DIR) $(BUILD__F_PATH) $(BUILD__M_PATH)
+
+# Create, if nessary, the destination directory
+$(BUILD__DIR):
+ $(MKDIR) $(BUILD__DIR)
+
+# Copy, if nessary, all the files, except the Makefile.am
+$(BUILD__F_PATH): $(SOURCE_F_PATH)
+ $(CP) $(addprefix $(SOURCE_DIR),$(@F)) $@
+
+# Copy if nessary, the Makefile.am into Makefile
+$(BUILD__M_PATH): $(SOURCE_M_PATH)
+ $(CP) $(SOURCE_M_PATH) $(BUILD__M_PATH)
+
+
+#######
+# ALL #
+#######
+
+# We assume that the call is done from the build directory.
+# With the directive vpath, hidden files are found in the source directory.
+
+all: $(TARGET_F_PATH)
+
+
+$(TARGET_F_PATH): $(OBJ_F_PATH)
+ $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@
+
+$(OBJ_F_PATH):$(SRC_F_PATH)
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+
+#########
+# CLEAN #
+#########
+
+# Force every time the deletion
+clean: clean_target clean_obj clean_dst clean_old #clean_make
+
+
+clean_target:
+ -@$(RM) $(TARGET_F_PATH) &> /dev/null
+
+clean_obj:
+ -@$(RM) $(OBJ_F_PATH) &> /dev/null
+
+clean_dst:
+ -@$(RM) $(BUILD_F_PATH) &> /dev/null
+
+clean_make:
+ -@$(RM) $(BUILD_M_PATH) &> /dev/null
+
+clean_old:
+ -@$(RM) $(OLD_F_PATH) &> /dev/null
+
+
+#########
+# PRINT #
+#########
+
+print: print_tools print_bootstrap
+
+print_tools:
+ @$(ECHO) "HOME = $(HOME)"
+ @$(ECHO) "INCLUDES = $(INCLUDES)"
+ @$(ECHO) "CXXFLAGS = $(CXXFLAGS)"
+ @$(ECHO) "ECHO = $(ECHO)"
+ @$(ECHO) "RM = $(RM)"
+ @$(ECHO) "MKDIR = $(MKDIR)"
+ @$(ECHO) "CP = $(CP)"
+ @$(ECHO)
+
+print_bootstrap:
+ @$(ECHO) "PWD = $(PWD)"
+ @$(ECHO) "SOURCE_PATTERN = $(SOURCE_PATTERN)"
+ @$(ECHO) "BUILD__PATTERN = $(BUILD__PATTERN)"
+ @$(ECHO) "SOURCE_DIR = $(SOURCE_DIR)"
+ @$(ECHO) "BUILD__DIR = $(BUILD__DIR)"
+ @$(ECHO) "SOURCE_MAKEFILE = $(SOURCE_MAKEFILE)"
+ @$(ECHO) "BUILD__MAKEFILE = $(BUILD__MAKEFILE)"
+ @$(ECHO) "TARGET_FILE = $(TARGET_FILE)"
+ @$(ECHO) "SOURCE_FILES = $(SOURCE_FILES)"
+ @$(ECHO) "SOURCE_F_PATH = $(SOURCE_F_PATH)"
+ @$(ECHO) "BUILD__FILES = $(BUILD__FILES)"
+ @$(ECHO) "BUILD__F_PATH = $(BUILD__F_PATH)"
+ @$(ECHO) "BUILD__M_PATH = $(BUILD__M_PATH)"
+ @$(ECHO) "SOURCE_M_PATH = $(SOURCE_M_PATH)"
+ @$(ECHO) "SRC = $(SRC)"
+ @$(ECHO) "OBJ = $(OBJ)"
+ @$(ECHO) "OLD = $(OLD)"
+ @$(ECHO) "SRC_F_PATH = $(SRC_F_PATH)"
+ @$(ECHO) "OBJ_F_PATH = $(OBJ_F_PATH)"
+ @$(ECHO) "OLD_F_PATH = $(OLD_F_PATH)"
+ @$(ECHO)
diff --git a/milena/sandbox/green/demo/annoting/project/project.cc
b/milena/sandbox/green/demo/annoting/project/project.cc
new file mode 100644
index 0000000..e6b25e3
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/project/project.cc
@@ -0,0 +1,210 @@
+// Test de l'opérateur de Millet PROJECT
+// subsampling the image sur 100x100
+// Sobel, puis seuillage à 100
+// division horizontale de l'image, puis projection verticale des pixels
+// division verticale puis projection horizontale
+// assemblage des 4 vecteurs de taille 100
+
+#include <iostream>
+#include <sstream>
+
+#include <mln/accu/image/init.hh>
+#include <mln/accu/image/take.hh>
+#include <mln/accu/image/to_result.hh>
+#include <mln/accu/stat/mean.hh>
+
+#include <mln/binarization/threshold.hh>
+
+#include <mln/core/alias/box2d.hh>
+#include <mln/core/alias/point2d.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/image1d.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/core/routine/initialize.hh>
+#include <mln/core/image/dmorph/unproject_image.hh>
+
+
+
+#include <mln/data/compute.hh>
+#include <mln/data/convert.hh>
+#include <mln/data/paste.hh>
+#include <mln/data/transform.hh>
+
+#include <mln/debug/println.hh>
+
+#include <mln/fun/v2v/projection.hh>
+
+#include <mln/img_path.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/io/pbm/save.hh>
+
+#include <mln/linear/sobel_2d.hh>
+
+#include <mln/opt/at.hh>
+
+const char *get_name(const char *base, const unsigned i, const unsigned j)
+{
+ std::ostringstream name;
+
+ name << base;
+ name << i;
+ name << "_";
+ name << j;
+ name << ".ppm";
+
+ return name.str().c_str();
+}
+
+
+mln::image1d<mln::value::int_u8>
+project_row(const mln::image2d<mln::value::int_u8>& img)
+{
+ typedef mln::accu::math::sum<mln::value::int_u8,mln::value::int_u8> t_sum;
+ typedef mln::fun::v2v::projection<mln::point2d,0> t_projection;
+
+ mln::image1d<t_sum> img_accu(img.ncols());
+
+ mln::accu::image::init(img_accu);
+
+ mln::accu::image::take(unproject(img_accu,
+ img.domain(),
+ t_projection()).rw(),
+ img);
+
+ return mln::accu::image::to_result(img_accu);
+}
+
+mln::image1d<mln::value::int_u8>
+project_col(const mln::image2d<mln::value::int_u8>& img)
+{
+ typedef mln::accu::math::sum<mln::value::int_u8,mln::value::int_u8> t_sum;
+ typedef mln::fun::v2v::projection<mln::point2d,1> t_projection;
+
+ mln::image1d<t_sum> img_accu(img.nrows());
+
+ mln::accu::image::init(img_accu);
+
+ mln::accu::image::take(unproject(img_accu,
+ img.domain(),
+ t_projection()).rw(),
+ img);
+
+ return mln::accu::image::to_result(img_accu);
+}
+
+
+int main()
+{
+ typedef mln::value::int_u8 t_int_u8;
+ typedef mln::algebra::vec<3,float> t_vec3f;
+ typedef mln::algebra::vec<3,unsigned> t_vec3u;
+ typedef mln::image2d<float> t_image2d_float;
+ typedef mln::image2d<bool> t_image2d_bool;
+ typedef mln::image2d<t_int_u8> t_image2d_int_u8;
+ typedef mln::accu::meta::stat::mean t_mean_fun;
+ typedef mln::accu::math::sum<t_int_u8,t_int_u8> t_sum;
+ typedef mln::image1d<t_int_u8> t_image1d_int_u8;
+
+ t_image2d_int_u8 input_int_u8;
+ t_image2d_float sobel;
+ t_image2d_bool thresh_bool;
+ t_image2d_int_u8 thresh_int_u8;
+
+ // IMAGE LOADING PHASE
+ std::cout << "Image loading phase ..." << std::endl;
+
mln::io::pgm::load(input_int_u8,SCRIBO_PGM_IMG_PATH"/mp00082c_50p_8bits.pgm");
+
+
+ // IMAGE SPLITTING PHASE
+ t_image2d_int_u8 subimg_int_u8(mln::box2d(mln::point2d(0,0),
+ mln::point2d(100,100)));
+
+ mln::box2d domain = input_int_u8.domain();
+ mln::point2d pmin = domain.pmin();
+ mln::point2d pmax = domain.pmax();
+
+ unsigned sz_row = (pmax.row() - pmin.row())/ 100;
+ unsigned sz_col = (pmax.col() - pmin.col())/ 100;
+
+ std::cout << domain << std::endl;
+
+ // Subsampling in 100x100
+ // FIXME Test that is it a subsampling, not a upsampling!
+ for (unsigned i = 0; i < 100; ++i)
+ for (unsigned j = 0; j < 100; ++j)
+ {
+ mln::point2d min(pmin.row()+sz_row*i,pmin.col()+sz_col*j);
+ mln::point2d max(pmin.row()+sz_row*(i+1),pmin.col()+sz_col*(j+1));
+ mln::box2d dom(min,max);
+
+ std::cout << dom << std::endl;
+
+ // Save it
+ t_image2d_int_u8 input_part_int_u8(dom);
+
+ mln::data::paste(input_int_u8 | dom, input_part_int_u8);
+ //mln::io::pgm::save(input_part_int_u8, get_name("output",i,j));
+ float mean = mln::data::compute(t_mean_fun(), input_part_int_u8);
+ t_int_u8 val = static_cast<t_int_u8>(mean);
+ mln::opt::at(subimg_int_u8, i,j) = val;
+ }
+
+ mln::io::pgm::save(subimg_int_u8, "subimg.pgm");
+
+ sobel = mln::linear::sobel_2d_l1_norm(subimg_int_u8);
+ thresh_bool = mln::binarization::threshold(sobel, 100);
+ thresh_int_u8 = mln::data::convert(t_int_u8(), thresh_bool);
+
+ mln::io::pbm::save(thresh_bool, "subimg.pbm");
+
+ // Define img_up, img_down, img_left, img_right
+ t_image2d_int_u8 img_up(mln::box2d(mln::point2d(0,0),
+ mln::point2d(49,99)));
+
+ mln::data::paste(thresh_int_u8 | img_up.domain(), img_up);
+
+
+ t_image2d_int_u8 img_down(mln::box2d(mln::point2d(50,0),
+ mln::point2d(99,99)));
+
+ mln::data::paste(thresh_int_u8 | img_down.domain(), img_down);
+
+ t_image2d_int_u8 img_left(mln::box2d(mln::point2d(0,0),
+ mln::point2d(99,49)));
+
+ mln::data::paste(thresh_int_u8 | img_left.domain(), img_left);
+
+
+ t_image2d_int_u8 img_right(mln::box2d(mln::point2d(0,50),
+ mln::point2d(99,99)));
+
+ mln::data::paste(thresh_int_u8 | img_right.domain(), img_right);
+
+
+ // Define project_up, project_down, project_left, project_right
+ t_image1d_int_u8 project_up = project_row(img_up);
+ t_image1d_int_u8 project_down = project_row(img_down);
+ t_image1d_int_u8 project_left = project_col(img_left);
+ t_image1d_int_u8 project_right = project_col(img_right);
+
+ mln::io::pgm::save(img_up, "up.pgm");
+ mln::io::pgm::save(img_down, "down.pgm");
+ mln::io::pgm::save(img_left, "left.pgm");
+ mln::io::pgm::save(img_right, "right.pgm");
+
+ // PRINTING PHASE
+
+ std::cout << std::endl << "UP" << std::endl;
+ mln::debug::println(project_up);
+
+ std::cout << std::endl << "DOWN" << std::endl;
+ mln::debug::println(project_down);
+
+ std::cout << std::endl << "LEFT" << std::endl;
+ mln::debug::println(project_left);
+
+ std::cout << std::endl << "RIGHT" << std::endl;
+ mln::debug::println(project_right);
+}
diff --git a/milena/sandbox/green/demo/annoting/rgb_64/Makefile.am
b/milena/sandbox/green/demo/annoting/rgb_64/Makefile.am
new file mode 100644
index 0000000..96eafb4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/rgb_64/Makefile.am
@@ -0,0 +1,150 @@
+#
+# Generic Makefile
+#
+
+#########
+# TOOLS #
+#########
+
+INCLUDES= -I$(HOME)/svn/oln/trunk/milena/sandbox/green
+#CXXFLAGS= -ggdb -O0 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+CXXFLAGS= -DNDEBUG -O1 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+#CXXFLAGS= -DNDEBUG -O3 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+ECHO= echo
+RM= rm
+MKDIR= mkdir -p
+CP= cp
+
+SOURCE_PATTERN= green/demo
+BUILD__PATTERN= green/build/demo
+
+
+ifeq ($(findstring $(BUILD__PATTERN),$(PWD)), $(BUILD__PATTERN))
+# Case where make is done from build directory.
+SOURCE_DIR= $(subst $(BUILD__PATTERN),$(SOURCE_PATTERN),$(PWD))
+BUILD__DIR= $(PWD)/
+else
+# Case where make is done from source directory.
+SOURCE_DIR= $(PWD)/
+BUILD__DIR= $(subst $(SOURCE_PATTERN),$(BUILD__PATTERN),$(PWD))
+endif
+
+SRC= $(notdir $(wildcard $(SOURCE_DIR)/*.cc))
+OLD= $(notdir $(wildcard $(SOURCE_DIR)/*~))
+OBJ= $(patsubst %.cc,%.o,$(SRC))
+SOURCE_MAKEFILE=Makefile.am
+BUILD__MAKEFILE=Makefile
+TARGET_FILE= $(notdir $(PWD))
+SOURCE_FILES= $(notdir $(wildcard $(SOURCE_DIR)/*.*))
+BUILD__FILES= $(filter-out $(SRC) $(SOURCE_MAKEFILE), $(SOURCE_FILES))
+
+BUILD__F_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__FILES))
+SOURCE_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
+
+BUILD__M_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__MAKEFILE))
+SOURCE_M_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_MAKEFILE))
+
+TARGET_F_PATH= $(addprefix $(BUILD__DIR)/,$(TARGET_FILE))
+OBJ_F_PATH= $(addprefix $(BUILD__DIR)/,$(OBJ))
+SRC_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SRC))
+OLD_F_PATH= $(addprefix $(SOURCE_DIR)/,$(OLD))
+
+#############
+# BOOTSTRAP #
+#############
+
+
+bootstrap: $(BUILD__DIR) $(BUILD__F_PATH) $(BUILD__M_PATH)
+
+# Create, if nessary, the destination directory
+$(BUILD__DIR):
+ $(MKDIR) $(BUILD__DIR)
+
+# Copy, if nessary, all the files, except the Makefile.am
+$(BUILD__F_PATH): $(SOURCE_F_PATH)
+ $(CP) $(addprefix $(SOURCE_DIR),$(@F)) $@
+
+# Copy if nessary, the Makefile.am into Makefile
+$(BUILD__M_PATH): $(SOURCE_M_PATH)
+ $(CP) $(SOURCE_M_PATH) $(BUILD__M_PATH)
+
+
+#######
+# ALL #
+#######
+
+# We assume that the call is done from the build directory.
+# With the directive vpath, hidden files are found in the source directory.
+
+all: $(TARGET_F_PATH)
+
+
+$(TARGET_F_PATH): $(OBJ_F_PATH)
+ $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@
+
+$(OBJ_F_PATH):$(SRC_F_PATH)
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+
+#########
+# CLEAN #
+#########
+
+# Force every time the deletion
+clean: clean_target clean_obj clean_dst clean_old #clean_make
+
+
+clean_target:
+ -@$(RM) $(TARGET_F_PATH) &> /dev/null
+
+clean_obj:
+ -@$(RM) $(OBJ_F_PATH) &> /dev/null
+
+clean_dst:
+ -@$(RM) $(BUILD_F_PATH) &> /dev/null
+
+clean_make:
+ -@$(RM) $(BUILD_M_PATH) &> /dev/null
+
+clean_old:
+ -@$(RM) $(OLD_F_PATH) &> /dev/null
+
+
+#########
+# PRINT #
+#########
+
+print: print_tools print_bootstrap
+
+print_tools:
+ @$(ECHO) "HOME = $(HOME)"
+ @$(ECHO) "INCLUDES = $(INCLUDES)"
+ @$(ECHO) "CXXFLAGS = $(CXXFLAGS)"
+ @$(ECHO) "ECHO = $(ECHO)"
+ @$(ECHO) "RM = $(RM)"
+ @$(ECHO) "MKDIR = $(MKDIR)"
+ @$(ECHO) "CP = $(CP)"
+ @$(ECHO)
+
+print_bootstrap:
+ @$(ECHO) "PWD = $(PWD)"
+ @$(ECHO) "SOURCE_PATTERN = $(SOURCE_PATTERN)"
+ @$(ECHO) "BUILD__PATTERN = $(BUILD__PATTERN)"
+ @$(ECHO) "SOURCE_DIR = $(SOURCE_DIR)"
+ @$(ECHO) "BUILD__DIR = $(BUILD__DIR)"
+ @$(ECHO) "SOURCE_MAKEFILE = $(SOURCE_MAKEFILE)"
+ @$(ECHO) "BUILD__MAKEFILE = $(BUILD__MAKEFILE)"
+ @$(ECHO) "TARGET_FILE = $(TARGET_FILE)"
+ @$(ECHO) "SOURCE_FILES = $(SOURCE_FILES)"
+ @$(ECHO) "SOURCE_F_PATH = $(SOURCE_F_PATH)"
+ @$(ECHO) "BUILD__FILES = $(BUILD__FILES)"
+ @$(ECHO) "BUILD__F_PATH = $(BUILD__F_PATH)"
+ @$(ECHO) "BUILD__M_PATH = $(BUILD__M_PATH)"
+ @$(ECHO) "SOURCE_M_PATH = $(SOURCE_M_PATH)"
+ @$(ECHO) "SRC = $(SRC)"
+ @$(ECHO) "OBJ = $(OBJ)"
+ @$(ECHO) "OLD = $(OLD)"
+ @$(ECHO) "SRC_F_PATH = $(SRC_F_PATH)"
+ @$(ECHO) "OBJ_F_PATH = $(OBJ_F_PATH)"
+ @$(ECHO) "OLD_F_PATH = $(OLD_F_PATH)"
+ @$(ECHO)
diff --git a/milena/sandbox/green/demo/annoting/rgb_64/rgb_64.cc
b/milena/sandbox/green/demo/annoting/rgb_64/rgb_64.cc
new file mode 100644
index 0000000..9ff2300
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/rgb_64/rgb_64.cc
@@ -0,0 +1,47 @@
+// Test de l'opérateur de Millet RGB-64
+// Composante RGB sur 2 bits, puis histogramme de 64 composantes
+// L'image est la résultante
+
+#include <iostream>
+
+#include <mln/accu/stat/histo3d_rgb.hh>
+
+#include <mln/core/image/image2d.hh>
+
+#include <mln/data/compute.hh>
+#include <mln/data/transform.hh>
+
+#include <mln/debug/println.hh>
+
+#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+
+#include <mln/img_path.hh>
+
+#include <mln/io/ppm/load.hh>
+
+#include <mln/value/rgb.hh>
+#include <mln/value/rgb8.hh>
+
+int main()
+{
+ typedef mln::fun::v2v::rgb8_to_rgbn<2> t_rgb8_to_rgb2;
+ typedef mln::value::rgb8 t_rgb8;
+ typedef mln::value::rgb<2> t_rgb2;
+ typedef mln::image2d<t_rgb8> t_image2d_rgb8;
+ typedef mln::image2d<t_rgb2> t_image2d_rgb2;
+ typedef mln::image3d<unsigned> t_histo3d;
+ typedef mln::accu::meta::stat::histo3d_rgb t_histo3d_fun;
+
+ t_image2d_rgb8 input_rgb8;
+ t_image2d_rgb2 input_rgb2;
+ t_histo3d histo;
+
+ // IMAGE LOADING PHASE
+ std::cout << "Image loading phase ..." << std::endl;
+ mln::io::ppm::load(input_rgb8, SCRIBO_PPM_IMG_PATH"/mp00082c_50p.ppm");
+ input_rgb2 = mln::data::transform(input_rgb8, t_rgb8_to_rgb2());
+ histo = mln::data::compute(t_histo3d_fun(), input_rgb2);
+
+ // PRINTING PHASE
+ mln::debug::println(histo);
+}
diff --git a/milena/sandbox/green/demo/annoting/rgb_64_9/Makefile.am
b/milena/sandbox/green/demo/annoting/rgb_64_9/Makefile.am
new file mode 100644
index 0000000..96eafb4
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/rgb_64_9/Makefile.am
@@ -0,0 +1,150 @@
+#
+# Generic Makefile
+#
+
+#########
+# TOOLS #
+#########
+
+INCLUDES= -I$(HOME)/svn/oln/trunk/milena/sandbox/green
+#CXXFLAGS= -ggdb -O0 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+CXXFLAGS= -DNDEBUG -O1 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+#CXXFLAGS= -DNDEBUG -O3 -Wall -W -pedantic -ansi -pipe $(INCLUDES)
+ECHO= echo
+RM= rm
+MKDIR= mkdir -p
+CP= cp
+
+SOURCE_PATTERN= green/demo
+BUILD__PATTERN= green/build/demo
+
+
+ifeq ($(findstring $(BUILD__PATTERN),$(PWD)), $(BUILD__PATTERN))
+# Case where make is done from build directory.
+SOURCE_DIR= $(subst $(BUILD__PATTERN),$(SOURCE_PATTERN),$(PWD))
+BUILD__DIR= $(PWD)/
+else
+# Case where make is done from source directory.
+SOURCE_DIR= $(PWD)/
+BUILD__DIR= $(subst $(SOURCE_PATTERN),$(BUILD__PATTERN),$(PWD))
+endif
+
+SRC= $(notdir $(wildcard $(SOURCE_DIR)/*.cc))
+OLD= $(notdir $(wildcard $(SOURCE_DIR)/*~))
+OBJ= $(patsubst %.cc,%.o,$(SRC))
+SOURCE_MAKEFILE=Makefile.am
+BUILD__MAKEFILE=Makefile
+TARGET_FILE= $(notdir $(PWD))
+SOURCE_FILES= $(notdir $(wildcard $(SOURCE_DIR)/*.*))
+BUILD__FILES= $(filter-out $(SRC) $(SOURCE_MAKEFILE), $(SOURCE_FILES))
+
+BUILD__F_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__FILES))
+SOURCE_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
+
+BUILD__M_PATH= $(addprefix $(BUILD__DIR)/,$(BUILD__MAKEFILE))
+SOURCE_M_PATH= $(addprefix $(SOURCE_DIR)/,$(SOURCE_MAKEFILE))
+
+TARGET_F_PATH= $(addprefix $(BUILD__DIR)/,$(TARGET_FILE))
+OBJ_F_PATH= $(addprefix $(BUILD__DIR)/,$(OBJ))
+SRC_F_PATH= $(addprefix $(SOURCE_DIR)/,$(SRC))
+OLD_F_PATH= $(addprefix $(SOURCE_DIR)/,$(OLD))
+
+#############
+# BOOTSTRAP #
+#############
+
+
+bootstrap: $(BUILD__DIR) $(BUILD__F_PATH) $(BUILD__M_PATH)
+
+# Create, if nessary, the destination directory
+$(BUILD__DIR):
+ $(MKDIR) $(BUILD__DIR)
+
+# Copy, if nessary, all the files, except the Makefile.am
+$(BUILD__F_PATH): $(SOURCE_F_PATH)
+ $(CP) $(addprefix $(SOURCE_DIR),$(@F)) $@
+
+# Copy if nessary, the Makefile.am into Makefile
+$(BUILD__M_PATH): $(SOURCE_M_PATH)
+ $(CP) $(SOURCE_M_PATH) $(BUILD__M_PATH)
+
+
+#######
+# ALL #
+#######
+
+# We assume that the call is done from the build directory.
+# With the directive vpath, hidden files are found in the source directory.
+
+all: $(TARGET_F_PATH)
+
+
+$(TARGET_F_PATH): $(OBJ_F_PATH)
+ $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@
+
+$(OBJ_F_PATH):$(SRC_F_PATH)
+ $(COMPILE.cc) $(OUTPUT_OPTION) $<
+
+
+#########
+# CLEAN #
+#########
+
+# Force every time the deletion
+clean: clean_target clean_obj clean_dst clean_old #clean_make
+
+
+clean_target:
+ -@$(RM) $(TARGET_F_PATH) &> /dev/null
+
+clean_obj:
+ -@$(RM) $(OBJ_F_PATH) &> /dev/null
+
+clean_dst:
+ -@$(RM) $(BUILD_F_PATH) &> /dev/null
+
+clean_make:
+ -@$(RM) $(BUILD_M_PATH) &> /dev/null
+
+clean_old:
+ -@$(RM) $(OLD_F_PATH) &> /dev/null
+
+
+#########
+# PRINT #
+#########
+
+print: print_tools print_bootstrap
+
+print_tools:
+ @$(ECHO) "HOME = $(HOME)"
+ @$(ECHO) "INCLUDES = $(INCLUDES)"
+ @$(ECHO) "CXXFLAGS = $(CXXFLAGS)"
+ @$(ECHO) "ECHO = $(ECHO)"
+ @$(ECHO) "RM = $(RM)"
+ @$(ECHO) "MKDIR = $(MKDIR)"
+ @$(ECHO) "CP = $(CP)"
+ @$(ECHO)
+
+print_bootstrap:
+ @$(ECHO) "PWD = $(PWD)"
+ @$(ECHO) "SOURCE_PATTERN = $(SOURCE_PATTERN)"
+ @$(ECHO) "BUILD__PATTERN = $(BUILD__PATTERN)"
+ @$(ECHO) "SOURCE_DIR = $(SOURCE_DIR)"
+ @$(ECHO) "BUILD__DIR = $(BUILD__DIR)"
+ @$(ECHO) "SOURCE_MAKEFILE = $(SOURCE_MAKEFILE)"
+ @$(ECHO) "BUILD__MAKEFILE = $(BUILD__MAKEFILE)"
+ @$(ECHO) "TARGET_FILE = $(TARGET_FILE)"
+ @$(ECHO) "SOURCE_FILES = $(SOURCE_FILES)"
+ @$(ECHO) "SOURCE_F_PATH = $(SOURCE_F_PATH)"
+ @$(ECHO) "BUILD__FILES = $(BUILD__FILES)"
+ @$(ECHO) "BUILD__F_PATH = $(BUILD__F_PATH)"
+ @$(ECHO) "BUILD__M_PATH = $(BUILD__M_PATH)"
+ @$(ECHO) "SOURCE_M_PATH = $(SOURCE_M_PATH)"
+ @$(ECHO) "SRC = $(SRC)"
+ @$(ECHO) "OBJ = $(OBJ)"
+ @$(ECHO) "OLD = $(OLD)"
+ @$(ECHO) "SRC_F_PATH = $(SRC_F_PATH)"
+ @$(ECHO) "OBJ_F_PATH = $(OBJ_F_PATH)"
+ @$(ECHO) "OLD_F_PATH = $(OLD_F_PATH)"
+ @$(ECHO)
diff --git a/milena/sandbox/green/demo/annoting/rgb_64_9/rgb_64_9.cc
b/milena/sandbox/green/demo/annoting/rgb_64_9/rgb_64_9.cc
new file mode 100644
index 0000000..29e90f3
--- /dev/null
+++ b/milena/sandbox/green/demo/annoting/rgb_64_9/rgb_64_9.cc
@@ -0,0 +1,97 @@
+// Test de l'opérateur de Millet RGB-64
+// Composante RGB sur 2 bits, puis histogramme de 64 composantes
+// L'image est la résultante
+
+#include <iostream>
+#include <sstream>
+
+#include <mln/accu/stat/histo3d_rgb.hh>
+
+#include <mln/core/alias/box2d.hh>
+#include <mln/core/alias/point2d.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/dmorph/image_if.hh>
+#include <mln/core/routine/initialize.hh>
+
+#include <mln/data/compute.hh>
+#include <mln/data/paste.hh>
+#include <mln/data/transform.hh>
+
+#include <mln/debug/println.hh>
+
+#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+
+#include <mln/img_path.hh>
+
+#include <mln/io/ppm/load.hh>
+#include <mln/io/ppm/save.hh>
+
+#include <mln/value/rgb.hh>
+#include <mln/value/rgb8.hh>
+
+const char *get_name(const char *base, const unsigned i, const unsigned j)
+{
+ std::ostringstream name;
+
+ name << base;
+ name << i;
+ name << "_";
+ name << j;
+ name << ".ppm";
+
+ return name.str().c_str();
+}
+
+int main()
+{
+ typedef mln::fun::v2v::rgb8_to_rgbn<2> t_rgb8_to_rgb2;
+ typedef mln::value::rgb8 t_rgb8;
+ typedef mln::value::rgb<2> t_rgb2;
+ typedef mln::image2d<t_rgb8> t_image2d_rgb8;
+ typedef mln::image2d<t_rgb2> t_image2d_rgb2;
+ typedef mln::image3d<unsigned> t_histo3d;
+ typedef mln::accu::meta::stat::histo3d_rgb t_histo3d_fun;
+
+ t_image2d_rgb8 input_rgb8;
+ t_image2d_rgb2 input_rgb2;
+ t_histo3d histo;
+
+ // IMAGE LOADING PHASE
+ std::cout << "Image loading phase ..." << std::endl;
+ mln::io::ppm::load(input_rgb8, SCRIBO_PPM_IMG_PATH"/mp00082c_50p.ppm");
+
+ input_rgb2 = mln::data::transform(input_rgb8, t_rgb8_to_rgb2());
+
+ // IMAGE SPLITTING PHASE
+ mln::box2d domain = input_rgb2.domain();
+ mln::point2d pmin = domain.pmin();
+ mln::point2d pmax = domain.pmax();
+
+ unsigned sz_row = (pmax.row() - pmin.row())/ 3;
+ unsigned sz_col = (pmax.col() - pmin.col())/ 3;
+
+ std::cout << domain << std::endl;
+
+ // Divide the domain in nine sub-domains.
+ for (unsigned i = 0; i < 3; ++i)
+ for (unsigned j = 0; j < 3; ++j)
+ {
+ mln::point2d min(pmin.row()+sz_row*i,pmin.col()+sz_col*j);
+ mln::point2d max(pmin.row()+sz_row*(i+1),pmin.col()+sz_col*(j+1));
+ mln::box2d dom(min,max);
+
+ std::cout << dom << std::endl;
+
+ // Save it
+ t_image2d_rgb2 input_1o9_rgb2(dom);
+
+ mln::data::paste(input_rgb2 | dom, input_1o9_rgb2);
+ mln::io::ppm::save(input_1o9_rgb2, get_name("output",i,j));
+
+ histo = mln::data::compute(t_histo3d_fun(), input_1o9_rgb2);
+
+ // PRINTING PHASE
+ mln::debug::println(histo);
+ }
+
+}
--
1.5.6.5