This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch apps-camera-process has been created
at 7a4d07ddeeeb760fafbb1881f6375f36914f0f3f (commit)
- Log -----------------------------------------------------------------
7a4d07d configure.ac: Configure milena/apps/camera-process/Makefile.
fcb3403 New app: camera stream processing (using OpenCV for capture).
32a8927 Ask configure to try to find OpenCV.
f0064c0 Have configure find an archiver.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
* milena/apps/camera-process/camprocess.cc,
* milena/apps/camera-process/process.hh,
* milena/apps/camera-process/process.cc,
* milena/apps/camera-process/Makefile.am:
New.
* milena/apps/Makefile.am (SUBDIRS): Add camera-process.
---
milena/ChangeLog | 11 ++
milena/apps/Makefile.am | 5 +-
.../Makefile.am | 29 ++++--
.../camera-process/camprocess.cc} | 109 ++++++++------------
milena/apps/camera-process/process.cc | 71 +++++++++++++
.../camera-process/process.hh} | 14 ++--
6 files changed, 157 insertions(+), 82 deletions(-)
copy milena/apps/{constrained-connectivity => camera-process}/Makefile.am (50%)
copy milena/{sandbox/theo/mln/walue/rgb_3xn.hh => apps/camera-process/camprocess.cc} (50%)
create mode 100644 milena/apps/camera-process/process.cc
copy milena/{mln/extract/essential.hh => apps/camera-process/process.hh} (80%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c1289de..77113b3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
2012-09-25 Roland Levillain <roland(a)lrde.epita.fr>
+ New app: camera stream processing (using OpenCV for capture).
+
+ * milena/apps/camera-process/camprocess.cc,
+ * milena/apps/camera-process/process.hh,
+ * milena/apps/camera-process/process.cc,
+ * milena/apps/camera-process/Makefile.am:
+ New.
+ * milena/apps/Makefile.am (SUBDIRS): Add camera-process.
+
+2012-09-25 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix file names in apps/morphers/recorder-bft.
* apps/morphers/recorder-bft.cc,
diff --git a/milena/apps/Makefile.am b/milena/apps/Makefile.am
index 465f1db..30e5575 100644
--- a/milena/apps/Makefile.am
+++ b/milena/apps/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+# Copyright (C) 2008, 2009, 2011, 2012 EPITA Research and Development
# Laboratory (LRDE).
#
# This file is part of Olena.
@@ -19,5 +19,8 @@
# Applied examples of Milena.
SUBDIRS = mesh-segm-skel graph-morpho constrained-connectivity morphers
+# Video stream processing (using OpenCV for capture).
+SUBDIRS += camera-process
+
# Examples from papers.
SUBDIRS += papers
diff --git a/milena/apps/constrained-connectivity/Makefile.am b/milena/apps/camera-process/Makefile.am
similarity index 50%
copy from milena/apps/constrained-connectivity/Makefile.am
copy to milena/apps/camera-process/Makefile.am
index c0dfb0d..7b05864 100644
--- a/milena/apps/constrained-connectivity/Makefile.am
+++ b/milena/apps/camera-process/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -14,17 +14,30 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+# Camera stream processing.
+
# Find Milena headers.
AM_CPPFLAGS = -I$(top_srcdir)/milena -I$(top_builddir)/milena
-# Produce fast code.
+# Produce fast code (by default).
APPS_CXXFLAGS = @APPS_CXXFLAGS@
AM_CXXFLAGS = $(APPS_CXXFLAGS)
-noinst_PROGRAMS = constrained-connectivity
-constrained_connectivity_SOURCES = constrained-connectivity.cc
-constrained_connectivity_CXXFLAGS = $(AM_CXXFLAGS) $(STRICT_ALIASING_CXXFLAGS)
-TESTS = test-constrained-connectivity
+if HAVE_OPENCV
+
+noinst_PROGRAMS = camprocess
+camprocess_SOURCES = camprocess.cc
+# Do not use optimization, as it does not seem to please OpenCV.
+camprocess_CPPFLAGS = $(AM_CPPFLAGS) $(OPENCV_CPPFLAGS)
+camprocess_CXXFLAGS = -O0
+camprocess_LDADD = libprocess.la
+camprocess_LDFLAGS = $(AM_LDFLAGS) $(OPENCV_LDFLAGS)
+
+# Convenience library to compile process.cc with optimizations turned on.
+noinst_LTLIBRARIES = libprocess.la
+libprocess_la_SOURCES = process.hh process.cc
+libprocess_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENCV_CPPFLAGS)
+# Force static linking.
+libprocess_la_LDFLAGS = -static
-# The sample image form Pierre Soille's PAMI 2008 article.
-EXTRA_DIST = soille.pgm
+endif HAVE_OPENCV
diff --git a/milena/sandbox/theo/mln/walue/rgb_3xn.hh b/milena/apps/camera-process/camprocess.cc
similarity index 50%
copy from milena/sandbox/theo/mln/walue/rgb_3xn.hh
copy to milena/apps/camera-process/camprocess.cc
index 62487ad..2a10fa6 100644
--- a/milena/sandbox/theo/mln/walue/rgb_3xn.hh
+++ b/milena/apps/camera-process/camprocess.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,76 +23,53 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_WALUE_RGB_3XN_HH
-# define MLN_WALUE_RGB_3XN_HH
-
/// \file
-/// \brief FIXME
-
-# include <mln/walue/internal/rgb_base.hh>
-# include <mln/walue/gl.hh>
-
-
-namespace mln
+/// \brief Frame-by-frame processing of a camera stream.
+///
+/// Inspired by:
+/// http://www.geckogeek.fr/lire-le-flux-dune-webcam-camera-video-avec-opencv.h…
+///
+/// Iplimage format description:
+/// http://opencv.willowgarage.com/documentation/basic_structures.html#iplimage
+///
+/// Hints on manipulating OpenCV:
+/// http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html
+///
+
+#include <opencv/highgui.h>
+#include <opencv/cv.h>
+
+#include "process.hh"
+
+int main()
{
-
- namespace walue
- {
-
- // Forward declaration.
- template <unsigned n> class rgb_3xn;
-
-
- // FIXME...
-
-
- /// \brief FIXME
- //
- template <unsigned n>
- class rgb_3xn : public internal::rgb_base< gl<n>, gl<n>, gl<n>,
- rgb_3xn<n> >
- {
- typedef internal::rgb_base< gl<n>, gl<n>, gl<n>,
- rgb_3xn<n> > super_;
- public:
-
- // Constructor without argument.
- rgb_3xn();
-
- rgb_3xn(float r, float g, float b);
-
- template <typename T>
- rgb_3xn(const internal::encoding<T,T,T>& e)
- : super_(set_encoding(e.t0),
- set_encoding(e.t1),
- set_encoding(e.t2))
- {
- }
-
- };
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- template <unsigned n>
- inline
- rgb_3xn<n>::rgb_3xn()
+ // Capture camera stream.
+ CvCapture* capture = cvCreateCameraCapture(CV_CAP_ANY);
+ if (!capture)
{
+ std::cerr << "Cannot open camera stream." << std::endl;
+ exit(1);
}
- template <unsigned n>
- inline
- rgb_3xn<n>::rgb_3xn(float r, float g, float b)
- : super_(r, g, b)
+ // Create a GUI window.
+ cvNamedWindow("Window", CV_WINDOW_AUTOSIZE);
+
+ // Loop until `q' or `Q' is pressed.
+ char key;
+ while(key != 'q' && key != 'Q')
{
+ // Grab a frame from the stream...
+ IplImage* image = cvQueryFrame(capture);
+ // ...process it with Milena...
+ process(image);
+ // ...and display it.
+ cvShowImage("Window", image);
+
+ // Wait for the user to press a key for 10 ms.
+ key = cvWaitKey(10);
}
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace mln::walue
-
-} // end of namespace mln
-
-
-#endif // ! MLN_WALUE_RGB_3XN_HH
+ // Release ressources.
+ cvReleaseCapture(&capture);
+ cvDestroyWindow("Window");
+}
diff --git a/milena/apps/camera-process/process.cc b/milena/apps/camera-process/process.cc
new file mode 100644
index 0000000..8cf2446
--- /dev/null
+++ b/milena/apps/camera-process/process.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/opt/at.hh>
+
+#include <mln/value/int_u8.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
+
+#include "process.hh"
+
+
+/* FIXME: Hide OpenCV-Milena conversion operations; or better, wrap
+ the `Iplimage' data structure in a Milena image so that it can be
+ processed directly. */
+
+void process(IplImage* cv_ima)
+{
+ using namespace mln;
+
+ // Convert `cv_ima' into a Milena image...
+ image2d<value::rgb8> mln_ima(cv_ima->height, cv_ima->width);
+ for (int row = 0; row < cv_ima->height; ++row)
+ for (int col = 0; col < cv_ima->width; ++col)
+ for (int chan = 0; chan < cv_ima->nChannels; ++chan)
+ {
+ opt::at(mln_ima, row, col).comp(chan) =
+ (unsigned char) cv_ima->imageData[row * cv_ima->widthStep
+ + col * cv_ima->nChannels
+ + chan];
+ }
+
+ // ...do something with it...
+ mln_piter_(image2d<value::rgb8>) p(mln_ima.domain());
+ for_all(p)
+ convert::from_to(fun::v2v::rgb_to_int_u<8>()(mln_ima(p)), mln_ima(p));
+
+ // ...and paste `mln_ima' back into the OpenCV image `cv_ima'.
+ for (int row = 0; row < cv_ima->height; ++row)
+ for (int col = 0; col < cv_ima->width; ++col)
+ for (int chan = 0; chan < cv_ima->nChannels; ++chan)
+ {
+ cv_ima->imageData[row * cv_ima->widthStep
+ + col * cv_ima->nChannels
+ + chan] =
+ (char) opt::at(mln_ima, row, col).comp(chan);
+ }
+}
diff --git a/milena/mln/extract/essential.hh b/milena/apps/camera-process/process.hh
similarity index 80%
copy from milena/mln/extract/essential.hh
copy to milena/apps/camera-process/process.hh
index 3a3c8d0..d0eebff 100644
--- a/milena/mln/extract/essential.hh
+++ b/milena/apps/camera-process/process.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,14 +23,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_EXTRACT_ESSENTIAL_HH
-# define MLN_EXTRACT_ESSENTIAL_HH
+#ifndef APPS_CAMERA_PROCESS_PROCESS_HH
+# define APPS_CAMERA_PROCESS_PROCESS_HH
/// \file
-///
-/// File that includes all sub-data extraction related routines.
+/// \brief Process an OpenCV image with Milena.
-# include <mln/extract/all.hh>
+#include <opencv/cv.h>
+void process(IplImage* image);
-#endif // ! MLN_EXTRACT_ESSENTIAL_HH
+#endif // ! APPS_CAMERA_PROCESS_PROCESS_HH
--
1.7.2.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch next has been updated
via cffe62e5cff26c4b5dbdc5d2d598ffbada51d9eb (commit)
via 13174eafba2824096b4916382075b98085208e85 (commit)
via b4ca8d4c88354e1577271f6103b13e1ab1f285c6 (commit)
via 08bc024b524e8e1c89b9baa4070eb562715f0b03 (commit)
via 72ee021ea66c1cb31d559c7803596199c11dea02 (commit)
via 3864857f85d254caf232b2a9fb4c547d7bf8f11a (commit)
via f8e2ffe537bc8dc29cc432ef21462dee8046d0dc (commit)
via bc142a16b5a6963f43b63f286e4f201a69ad9211 (commit)
via 3363574ac18e8b13b42f21d354a1901a511c513d (commit)
via bd2670fbf582fc5c238507bdb3d9543d5bcb0577 (commit)
via 849c13701f8eb2e08d838979c7b3539332cf099a (commit)
via dcad6adc4a6b9469f79c055f1c2a5138c74e6f29 (commit)
via 21c2800d395c87adb3e456adb3a2f1ece83fe0fd (commit)
via 558a2abb439427e9f267698ce3f1541bda95b395 (commit)
via 6b931cc6d218c25448e7bf3479c98c16acd7daa1 (commit)
via 1e58a782ca5f922f685e967dd35a570c7b6dd16e (commit)
from b654f0d48265b56eda78f0df27cb1a414f7f7e5a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
cffe62e Merge branch 'apps-morphers' into next
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +
configure.ac | 1 +
milena/ChangeLog | 154 +++++++++++++++++
milena/apps/Makefile.am | 5 +-
milena/apps/morphers/Makefile.am | 76 +++++++++
milena/apps/morphers/image2d-skel.hh | 137 +++++++++++++++
milena/apps/morphers/iz.cc | 173 +++++++++++++++++++
milena/apps/morphers/iz_input.pbm | Bin 0 -> 21890 bytes
milena/apps/morphers/lazy_recorder.cc | 62 +++++++
milena/apps/morphers/lazy_recorder.hh | 206 +++++++++++++++++++++++
milena/apps/morphers/mask+channel.cc | 67 ++++++++
milena/apps/morphers/mask+recorder.cc | 65 +++++++
milena/apps/morphers/recorder-bft.cc | 114 +++++++++++++
milena/apps/morphers/recorder-wst.cc | 106 ++++++++++++
milena/apps/morphers/recorder.cc | 61 +++++++
milena/apps/morphers/recorder.hh | 182 ++++++++++++++++++++
milena/mln/core/image/imorph/decorated_image.hh | 26 +++
milena/mln/tag/init.hh | 3 +
18 files changed, 1440 insertions(+), 2 deletions(-)
create mode 100644 milena/apps/morphers/Makefile.am
create mode 100644 milena/apps/morphers/image2d-skel.hh
create mode 100644 milena/apps/morphers/iz.cc
create mode 100644 milena/apps/morphers/iz_input.pbm
create mode 100644 milena/apps/morphers/lazy_recorder.cc
create mode 100644 milena/apps/morphers/lazy_recorder.hh
create mode 100644 milena/apps/morphers/mask+channel.cc
create mode 100644 milena/apps/morphers/mask+recorder.cc
create mode 100644 milena/apps/morphers/recorder-bft.cc
create mode 100644 milena/apps/morphers/recorder-wst.cc
create mode 100644 milena/apps/morphers/recorder.cc
create mode 100644 milena/apps/morphers/recorder.hh
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch apps-morphers has been updated
via 13174eafba2824096b4916382075b98085208e85 (commit)
from b4ca8d4c88354e1577271f6103b13e1ab1f285c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
No new revisions were added by this update.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 8 ++++++++
milena/apps/morphers/Makefile.am | 2 +-
milena/apps/morphers/recorder-bft.cc | 24 ++++++++++++------------
3 files changed, 21 insertions(+), 13 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform