libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/cvd vision.h


From: Gerhard Reitmayr
Subject: [libcvd-members] libcvd/cvd vision.h
Date: Wed, 06 Dec 2006 15:53:29 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Gerhard Reitmayr <gerhard>      06/12/06 15:53:29

Modified files:
        cvd            : vision.h 

Log message:
        added repeated halfsampling function

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/vision.h?cvsroot=libcvd&r1=1.20&r2=1.21

Patches:
Index: vision.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/vision.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- vision.h    28 Nov 2006 11:08:29 -0000      1.20
+++ vision.h    6 Dec 2006 15:53:29 -0000       1.21
@@ -113,13 +113,28 @@
 /// @throw IncompatibleImageSizes if out does not have half the dimensions of 
in
 /// @ingroup gVision
 template <class T>
-Image<T> halfSample(const BasicImage<T>& in)
+inline Image<T> halfSample(const BasicImage<T>& in)
 {
        Image<T> out(in.size()/2);
        halfSample(in, out);
        return out;
 }
 
+/// subsamples an image repeatedly by half its size by averaging 2x2 pixel 
blocks.
+/// This version will not create a copy for 0 octaves because it receives 
already
+/// an Image and will reuse the data.
+/// @param in input image
+/// @param octaves number of halfsamplings 
+/// @return The output image
+/// @throw IncompatibleImageSizes if out does not have half the dimensions of 
in
+/// @ingroup gVision
+template <class T>
+inline Image<T> halfSample( Image<T> in, unsigned int octaves){
+    for( ;octaves > 0; --octaves){
+        in = halfSample(in);
+    }
+    return in;
+}
 
 /// thresholds an image by setting all pixel values below a minimum to 0 and 
all values above to a given maximum
 /// @param im input image changed in place




reply via email to

[Prev in Thread] Current Thread [Next in Thread]