From c5c9d2d95cb90bb172e3a55851ef943239137bcd Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Fri, 12 May 2017 15:17:06 +0200 Subject: [PATCH] [CVV] Added ability to get layers of laplacian pyramid Signed-off-by: Jim Martens --- ccv/sheet5/laplacian_pyramid.cpp | 8 ++++++++ ccv/sheet5/laplacian_pyramid.h | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ccv/sheet5/laplacian_pyramid.cpp b/ccv/sheet5/laplacian_pyramid.cpp index f1b53c0..d622662 100644 --- a/ccv/sheet5/laplacian_pyramid.cpp +++ b/ccv/sheet5/laplacian_pyramid.cpp @@ -9,3 +9,11 @@ laplacian_pyramid::laplacian_pyramid(const gauss_pyramid &pyramid, float sigma) _layers.push_back(pyramid.get(i) - blurred); } } + +cv::Mat laplacian_pyramid::get(int layer) const { + return _layers.at((unsigned long) layer); +} + +unsigned long laplacian_pyramid::get_number_of_layers() const { + return _layers.size(); +} diff --git a/ccv/sheet5/laplacian_pyramid.h b/ccv/sheet5/laplacian_pyramid.h index 0f68e9d..7d873d6 100644 --- a/ccv/sheet5/laplacian_pyramid.h +++ b/ccv/sheet5/laplacian_pyramid.h @@ -14,6 +14,19 @@ public: * @param sigma the blur factor */ laplacian_pyramid(const gauss_pyramid& pyramid, float sigma); + + /** + * Returns the number of layers. + * @return + */ + unsigned long get_number_of_layers() const; + + /** + * Returns the pyramid element at given layer. + * @param layer the requested pyramid layer + * @return pyramid layer + */ + cv::Mat get(int layer) const; };