Commit 3cc01a74 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Update tutorial.

	* doc/Doxyfile.in: Add a new IMAGE_PATH and a new macro expansion in
	PREDEFINED.

	* doc/tutorial/figures/tuto4_genericity_and_algorithms-1.ppm,
	* doc/tutorial/figures/tuto4_genericity_and_algorithms-2.ppm,
	* doc/tutorial/figures/tuto4_genericity_and_algorithms-3.pbm,
	* doc/tutorial/figures/tuto4_genericity_and_algorithms-4.ppm,
	* doc/tutorial/figures/tuto4_genericity_and_algorithms-5.ppm,
	* doc/tutorial/figures/tuto4_genericity_and_algorithms-6.ppm,
	* doc/tutorial/outputs/tuto2_first_image.txt,
	* doc/tutorial/outputs/tuto4_genericity_and_algorithms.txt: Add new
	reference files.

	* doc/tutorial/samples/Makefile.am,
	* doc/tutorial/samples/tuto4_genericity_and_algorithms.cc,
	* doc/tutorial/tutorial.tex: Add step 4
	in tutorial.

	* doc/tutorial/samples/tuto1_first_image.cc: Rename as...
	* doc/tutorial/samples/tuto2_first_image.cc: ... this.

	* mln/core/concept/object.hh: update namespace indexes.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3136 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 888843ef
2009-01-06 Guillaume Lazzara <z@lrde.epita.fr>
Update tutorial.
* doc/Doxyfile.in: Add a new IMAGE_PATH and a new macro expansion in
PREDEFINED.
* doc/tutorial/figures/tuto4_genericity_and_algorithms-1.ppm,
* doc/tutorial/figures/tuto4_genericity_and_algorithms-2.ppm,
* doc/tutorial/figures/tuto4_genericity_and_algorithms-3.pbm,
* doc/tutorial/figures/tuto4_genericity_and_algorithms-4.ppm,
* doc/tutorial/figures/tuto4_genericity_and_algorithms-5.ppm,
* doc/tutorial/figures/tuto4_genericity_and_algorithms-6.ppm,
* doc/tutorial/outputs/tuto2_first_image.txt,
* doc/tutorial/outputs/tuto4_genericity_and_algorithms.txt: Add new
reference files.
* doc/tutorial/samples/Makefile.am,
* doc/tutorial/samples/tuto4_genericity_and_algorithms.cc,
* doc/tutorial/tutorial.tex: Add step 4
in tutorial.
* doc/tutorial/samples/tuto1_first_image.cc: Rename as...
* doc/tutorial/samples/tuto2_first_image.cc: ... this.
* mln/core/concept/object.hh: update namespace indexes.
2009-01-06 Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr>
 
Update rotation.
......@@ -96,7 +96,8 @@ EXAMPLE_PATH = @top_srcdir@/milena/doc/tutorial/samples \
@top_srcdir@/milena/doc/tutorial/outputs
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = @top_srcdir@/milena/doc/tutorial/figures \
IMAGE_PATH = @top_srcdir@/milena/img \
@top_srcdir@/milena/doc/tutorial/figures \
@top_builddir@/milena/doc/tutorial/figures
INPUT_FILTER =
FILTER_PATTERNS =
......@@ -282,7 +283,9 @@ PREDEFINED = "mlc_unqualif(T)=typename mln::metal::unqualif<T>::ret"
"mln_point(T)=typename T::point" \
"mln_point_(T)=T::point" \
"mln_gradient_component(I)=typename mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret" \
"mln_gradient(I)=mln::value::stack_image< I::point::dim, mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret >"
"mln_gradient(I)=mln::value::stack_image< I::point::dim, mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret >" \
"mln_trait_value_sum_product(T, U)=typename mln::trait::value_< mln_trait_op_times(T,U) >::sum" \
"mln_sum_product(T, U)=typename mln::trait::value_< mln_trait_op_times(T,U) >::sum"
......
P4
# Generated by Milena 1.0 http://olena.lrde.epita.fr
# EPITA Research and Development Laboratory (LRDE)
64 64

\ No newline at end of file
- - - - - - - - - - - - - - - - - - - - -
- | - | - | | | - | - - - | - - - - | - -
- | - | - | - - - | - - - | - - - | - | -
- | | | - | | | - | - - - | - - - | - | -
- | - | - | - - - | - - - | - - - | - | -
- | - | - | | | - | | | - | | | - - | - -
- - - - - - - - - - - - - - - - - - - - -
- | - | - - | - - | | - - | - - - | | - -
- | - | - | - | - | - | - | - - - | - | -
- | - | - | - | - | | - - | - - - | - | -
- | | | - | - | - | - | - | - - - | - | -
- | - | - - | - - | - | - | | | - | | - -
- - - - - - - - - - - - - - - - - - - - -
......@@ -44,9 +44,10 @@ noinst_PROGRAMS = \
win-create-1 \
win-create-2
noinst_PROGRAMS += \
tuto1_first_image \
tuto3_rw_image
noinst_PROGRAMS += \
tuto2_first_image \
tuto3_rw_image \
tuto4_genericity_and_algorithms
accu_right_instanciation_SOURCES = accu-right-instanciation.cc
borderthickness_SOURCES = borderthickness.cc
......@@ -88,8 +89,9 @@ predicate_1_SOURCES = predicate-1.cc
win_create_1_SOURCES = win-create-1.cc
win_create_2_SOURCES = win-create-2.cc
tuto1_first_image_SOURCES = tuto1_first_image.cc
tuto2_first_image_SOURCES = tuto2_first_image.cc
tuto3_rw_image_SOURCES = tuto3_rw_image.cc
tuto4_genericity_and_algorithms_SOURCES = tuto4_genericity_and_algorithms.cc
all: clean-figures
mkdir -p $(OUTPUTS_BUILDDIR)
......
#include <mln/essential/2d.hh>
#include <mln/binarization/threshold.hh>
#include <mln/debug/colorize.hh>
#include <tests/data.hh>
#include <doc/tutorial/tools/sample_utils.hh>
struct keep_specific_colors : public mln::Function_v2b<keep_specific_colors>
{
bool operator()(const mln::value::rgb16& v) const
{
return v.green() < 20000 && v.blue() > 10000;
}
};
int main()
{
using namespace mln;
// \{
image2d<value::rgb16> lena;
io::ppm::load(lena, MLN_IMG_DIR "/small.ppm");
// \}
image2d<value::rgb16> lena_bak = duplicate(lena);
// \{
box2d roi = make::box2d(20, 20, 40, 40);
// \}
// \{
data::fill((lena | roi).rw(), literal::green);
// \}
doc::ppmsave(lena, "tuto4_genericity_and_algorithms");
lena = duplicate(lena_bak);
// \{
data::fill((lena | fun::p2b::chess()).rw(), literal::green);
// \}
doc::ppmsave(lena, "tuto4_genericity_and_algorithms");
lena = duplicate(lena_bak);
// \{
image2d<bool> mask;
initialize(mask, lena);
data::fill(mask, false);
data::fill((mask | make::box2d(10, 10, 14, 14)).rw(), true);
data::fill((mask | make::box2d(25, 15, 29, 18)).rw(), true);
data::fill((mask | make::box2d(50, 50, 54, 54)).rw(), true);
// \}
doc::pbmsave(mask, "tuto4_genericity_and_algorithms");
// \{
data::fill((lena | pw::value(mask)).rw(), literal::green);
// \}
doc::ppmsave(lena, "tuto4_genericity_and_algorithms");
lena = duplicate(lena_bak);
// \{
image2d<bool> lena_bw = binarization::binarization(lena, keep_specific_colors());
value::label_16 nlabels;
image2d<value::label_16> label = labeling::blobs(lena_bw, c8(), nlabels);
// \}
doc::ppmsave(debug::colorize(value::rgb16(), label, nlabels), "tuto4_genericity_and_algorithms");
// \{
data::fill((lena | (pw::value(label) == pw::cst(16u))).rw(), literal::green);
// \}
doc::ppmsave(lena, "tuto4_genericity_and_algorithms");
/*
lena = duplicate(lena_bak);
// \{
data::fill(fun::green(lena), literal::max);
// \}
doc::ppmsave(lena, "tuto4_genericity_and_algorithms");
lena = duplicate(lena_bak);
// \{
mln_VAR(object, pw::value(label) == pw::cst(3));
data::fill((fun::green(lena) | object).rw(), literal::max);
// \}
doc::pgmsave(object, "tuto4_genericity_and_algorithms");
doc::ppmsave(label, "tuto4_genericity_and_algorithms");
*/
}
\documentclass{report}
\usepackage{hevea}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{makeidx}
......@@ -408,7 +409,7 @@ After this step you should know how to:
\item display an image in console mode.
\end{itemize}
The full example can be found in \doxyref{tuto1_first_image.cc}.
\doxysee{tuto2_first_image.cc}.
\vspace{2cm}
......@@ -457,7 +458,7 @@ After this step you should know how to:
\end{itemize}
The full example can be found in \doxyref{tuto3_rw_image.cc}.
\doxysee{tuto3_rw_image.cc}.
\vspace{2cm}
First create an empty color image with a \var{box2d} of 40x40 as domain.
......@@ -493,7 +494,7 @@ Likewise, it is possible to paste data from an image to another:
Output:
\doxyfigure[3]{tuto3_rw_image}
More details can be found in section \doxyref{fillop} and \doxyref{pasteop} in
More details can be found in sections \doxyref{imaaccessmodval}, \doxyref{fillop} and \doxyref{pasteop} in
the reference guide.
\vspace{2cm}
......@@ -505,6 +506,73 @@ the reference guide.
%====================================
\doxychapter{tutogenericity}{Step 4: Genericity and algorithms}
After this step you should know how to:
\begin{itemize}
\item take benefit of Olena's genericity,
\item work only on a region of interest in an image.
\end{itemize}
\doxysee{tuto4_genericity_and_algorithms.cc}.
\vspace{2cm}
\doxycode[1]{tuto4_genericity_and_algorithms}
\doxyimg{small-enlarged}
\doxycode[2]{tuto4_genericity_and_algorithms}
\doxycode[3]{tuto4_genericity_and_algorithms}
\begin{center}
\begin{tabular}{c c c}
\doxyimg{small-enlarged} & ~\huge{\rightarrow}~ & \doxyfigure[1]{tuto4_genericity_and_algorithms}{3cm} \\
\multicolumn{3}{c}{Fill with green a region of interest defined by a
\type{box2d}.} \\
\end{tabular}
\end{center}
\doxycode[4]{tuto4_genericity_and_algorithms}
\begin{center}
\begin{tabular}{c c c}
\doxyimg{small-enlarged} & ~\huge{\rightarrow}~ & \doxyfigure[2]{tuto4_genericity_and_algorithms}{3cm} \\
\multicolumn{3}{c}{Fill with green a region of interest defined by a
\type{Function}.} \\
\end{tabular}
\end{center}
\doxycode[5]{tuto4_genericity_and_algorithms}
\doxycode[6]{tuto4_genericity_and_algorithms}
\begin{center}
\begin{tabular}{c c c c}
\doxyimg{small-enlarged} &
\doxyfigure[3]{tuto4_genericity_and_algorithms}{3cm} &
~\huge{\rightarrow}~ &
\doxyfigure[4]{tuto4_genericity_and_algorithms}{3cm} \\
\multicolumn{4}{c}{Fill with green a region of interest defined by a mask
image.} \\
\end{tabular}
\end{center}
\doxycode[7]{tuto4_genericity_and_algorithms}
\doxycode[8]{tuto4_genericity_and_algorithms}
\begin{center}
\begin{tabular}{c c c c}
\doxyimg{small-enlarged} &
\doxyfigure[5]{tuto4_genericity_and_algorithms}{3cm} &
~\huge{\rightarrow}~ &
\doxyfigure[6]{tuto4_genericity_and_algorithms}{3cm} \\
\multicolumn{4}{c}{Fill with green a region of interest defined by its
label.} \\
\end{tabular}
\end{center}
\vspace{2cm}
\begin{center}
\tutotoc{tutochangeimage}{tutoconvimage}
\end{center}
%====================================
\doxychapter{tutoconvimage}{Step 5: Conversion between image values}
......@@ -526,12 +594,65 @@ the reference guide.
%**************************
\doxysection{requirements}{Requirements}
\doxysubsection{compexample}{To compile the user examples}
\begin{itemize}
\item a POSIX shell, like Bash
\item a decent C++ compiler, like GNU C++
\item a `make' utility, like GNU or BSD `make'
\end{itemize}
\doxysubsection{compdoc}{To compile the documentation (Optional)}
\begin{itemize}
\item a LaTeX distribution
\item the `listings' TeX package
\item the utility `convert' from ImageMagick
\item GNU Autogen
\item `hevea', a TeX to HTML conversion tool
\item the `texinfo' utilities from GNU
\end{itemize}
\doxysubsection{devolena}{To develop in Olena}
\begin{itemize}
\item GNU Autotools (Autoconf 2.54, Automake 1.10)
\end{itemize}
%**************************
\doxysection{getolena}{Getting Olena}
The latest version of Olena is available at the following addresses:
\begin{itemize}
\item http://www.lrde.epita.fr/dload/olena/olena.tar.gz
\item http://www.lrde.epita.fr/dload/olena/olena.tar.bz2
\end{itemize}
%**************************
\doxysection{buildingolena}{Building Olena}
First uncompress the archive. According to the downloaded archive, the options
are different.
\begin{verbatim}
$tar zxvf olena.tar.gz
\end{verbatim}
Or
\begin{verbatim}
$tar jxvf olena.tar.bz2
\end{verbatim}
Then follow these steps:
\begin{verbatim}
$mkdir olena-build
$cd olena-build
$../olena-1.0/configure && make
$sudo make install
\end{verbatim}
%====================================
......@@ -2259,7 +2380,7 @@ mln\_bkd\_nixter(I, N) & I : image type, & \\
\end{tabular}
\doxysubsection{macrosbkdit}{Graph iterators}
\doxysubsection{macrosgraphit}{Graph iterators}
\begin{tabular}{l|p{4cm}|p{6cm}}
Name & Arguments & Description \\
\hline
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -70,16 +70,21 @@
* <UL>
* <LI> \ref mln
* <LI> \ref mln::accu
* <LI> \ref mln::algebra
* <LI> \ref mln::arith
* <LI> \ref mln::binarization
* <LI> \ref mln::border
* <LI> \ref mln::canvas
* <LI> \ref mln::convert
* <LI> \ref mln::data
* <LI> \ref mln::debug
* <LI> \ref mln::display
* <LI> \ref mln::draw
* <LI> \ref mln::estim
* <LI> \ref mln::extension
* <LI> \ref mln::fun
* <LI> \ref mln::geom
* <LI> \ref mln::graph
* <LI> \ref mln::histo
* <LI> \ref mln::io
* <LI> \ref mln::labeling
......@@ -92,12 +97,16 @@
* <LI> \ref mln::metal
* <LI> \ref mln::morpho
* <LI> \ref mln::norm
* <LI> \ref mln::opt
* <LI> \ref mln::pw
* <LI> \ref mln::registration
* <LI> \ref mln::set
* <LI> \ref mln::tag
* <LI> \ref mln::test
* <LI> \ref mln::topo
* <LI> \ref mln::trace
* <LI> \ref mln::trait
* <LI> \ref mln::transform
* <LI> \ref mln::util
* <LI> \ref mln::value
* <LI> \ref mln::win
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment