
Niels van Vliet <van-vl_n@lrde.epita.fr> writes: [...]
Il reste a lire cette partie de la news. | | V
@@ -41,6 +41,7 @@ # include <ntg/basics.hh> # include <ntg/all.hh> # include <oln/basics2d.hh> +# include <oln/morpher/piece_morpher.hh>
namespace oln {
@@ -485,6 +486,84 @@ }
/*! + ** \brief Shift zero-frequency component of discrete Fourier transform + ** to center of spectrum. + ** + ** \param T1 The data type of the image returned. + ** + ** The zero-frequency component of discrete Fourier transform are moved + ** to center of the image : + ** + ** \htmlonly + ** <table> + ** <tr><td>1</td><td>2</td></tr> + ** <tr><td>3</td><td>4</td></tr> + ** </table> + ** becomes + ** <table> + ** <tr><td>4</td><td>3</td></tr> + ** <tr><td>2</td><td>1</td></tr> + ** </table> + ** \endhtmlonly + ** + */ + template <class T1> + image2d<T1> shift_transform_inv() + { + image2d<T1> t = transform_inv<T1>(); + image2d<T1> st(t.size()); + + // We have to exchange t_1 with t_1_dest and not directly t_3 because + // they have not he same size. + typedef morpher::piece_morpher< image2d<T1> > piece_t; + piece_t t_1(t, dpoint2d(0, 0), + image2d_size((t.size().nrows() - 1) / 2, + (t.size().ncols() - 1) / 2, + t.border())); + piece_t t_1_dest(st, dpoint2d(t.nrows() - t_1.nrows(), + t.ncols() - t_1.ncols()), + image2d_size(t_1.nrows(), t_1.ncols(), + t.border())); + piece_t t_2(t, dpoint2d(0, (t.size().ncols() - 1) / 2), + image2d_size((t.size().nrows() - 1) / 2, + t.size().ncols() - (t.size().ncols() - 1) / 2, + t.border())); + piece_t t_2_dest(st, dpoint2d(t.nrows() - t_2.nrows(), 0), + image2d_size(t_2.nrows(), t_2.ncols(), + t.border())); + piece_t t_3(t, dpoint2d((t.size().nrows() - 1) / 2, 0), + image2d_size(t.size().nrows() - (t.size().nrows() - 1) / 2, + (t.size().ncols() - 1) / 2, + t.border())); + piece_t t_3_dest(st, dpoint2d(0, t.ncols() - t_3.ncols()), + image2d_size(t_3.nrows(), t_3.ncols(), + t.border())); + piece_t t_4(t, dpoint2d((t.size().nrows() - 1) / 2, + (t.size().ncols() - 1) / 2), + image2d_size(t.size().nrows() - (t.size().nrows() - 1) / 2, + t.size().ncols() - (t.size().ncols() - 1) / 2, + t.border())); + piece_t t_4_dest(st, dpoint2d(0, 0), + image2d_size(t_4.nrows(), t_4.ncols(), + t.border())); + + oln_iter_type(piece_t) i1(t_1); + for_all(i1) + t_1_dest[i1] = t_1[i1]; + oln_iter_type(piece_t) i2(t_2); + for_all(i2) + t_2_dest[i2] = t_2[i2]; + oln_iter_type(piece_t) i3(t_3); + for_all(i3) + t_3_dest[i3] = t_3[i3]; + oln_iter_type(piece_t) i4(t_4); + for_all(i4) + t_4_dest[i4] = t_4[i4]; + + return st; + } + + /*! ** \brief Compute and return the invert transform. */ image2d<T> transform_inv() @@ -492,6 +571,15 @@ return transform_inv<T>(); }
+ /*! + ** \brief Shift zero-frequency component of discrete Fourier transform + ** to center of spectrum. + */ + image2d<T> shift_transform_inv() + { + return shift_transform_inv<T>(); + } + };
/*!
Index: olena/tests/convol/Makefile.am --- olena/tests/convol/Makefile.am Tue, 05 Aug 2003 21:39:33 +0200 burrus_n (oln/f/38_Makefile.a 1.13 600) +++ olena/tests/convol/Makefile.am Mon, 14 Jun 2004 07:24:23 +0200 odou_s (oln/f/38_Makefile.a 1.13 600) @@ -1,4 +1,7 @@ include ../check/Makefile.runtests
+LDADD_RUNTESTS += $(FFTW_LDFLAGS) +CXXFLAGS_RUNTESTS += $(FFTW_CFLAGS) + EXTRA_DIST += sum_on_random.pgm CLEANFILES += lena-sobel.pgm Index: olena/tests/convol/tests/slow_sum_2d_1
--- doc/ref/out/exdoc.config.in Fri, 09 Apr 2004 16:53:44 +0200 thivol_d (oln/k/7_exdoc.conf 1.7 600) +++ doc/ref/out/exdoc.config.in Mon, 14 Jun 2004 07:03:20 +0200 odou_s (oln/k/7_exdoc.conf 1.7 600) @@ -4,7 +4,8 @@ TAG_CLOSE = endcode CAPTIONS = cxx # We want to run cxx on the extracted files (see line below) ALIAS cxx = @CXX@ # Here, cxx means g++ but you can choose other compilers - OPTIONS = @DOC_CPPFLAGS@ @CXXFLAGS_OPTIMIZE@ @CXXFLAGS_STRICT_ERRORS@ -I@top_srcdir@/integre -I@top_builddir@/olena -I@top_srcdir@/olena -I@top_srcdir@/metalic $1 -o $2 -DIMG_OUT=\"../img/\" -DIMG_IN=\"@top_srcdir@/olena/img/\" # tell how to use the soft, i.e. where to put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME: $* should have explicit name, chek flags + # FIXME: we should write the compilation line in the source file (for libs). + OPTIONS = -lz -lfftw -lrfftw @DOC_CPPFLAGS@
c'est pas deduit du configure ca ? ordre ? assigne moi une geforgerie pour gerer le cas ou il n'y a pas les bonnes variables.
@CXXFLAGS_OPTIMIZE@ @CXXFLAGS_STRICT_ERRORS@ -I@top_srcdir@/integre -I@top_builddir@/olena -I@top_srcdir@/olena -I@top_srcdir@/metalic -I@top_builddir@ $1 -o $2 -DIMG_OUT=\"../img/\" -DIMG_IN=\"@top_srcdir@/olena/img/\" -DHAVE_CONFIG_H # tell how to use the soft, i.e. where to put input and output arguments (default if not overriden) ($1: input, $2: output) FIXME: $* should have explicit name, chek flags OUT = out # FIXME: should be obsolete EXT = cc # Extension of generated file STD_OUT_EXT = std # Extension of generated file standard output Index: olena/oln/makefile.src
Ne poste plus des patchs comme ca on a pas le temps :-( ou alors fais des patch sans pb :-) -- Giovanni Palma EPITA - promo 2005 - membre d'EpX - LRDE Mob. : +33 (0)6 60 97 31 74