From 6e983d8e8d11bce831e1b9755d306c12ed33fde5 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Tue, 2 May 2017 15:42:10 +0200 Subject: [PATCH] [CCV] Added ability to visualize DoG Signed-off-by: Jim Martens --- ccv/sheet4/lab_pyramid.cpp | 17 ++++++++++++++++- ccv/sheet4/lab_pyramid.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ccv/sheet4/lab_pyramid.cpp b/ccv/sheet4/lab_pyramid.cpp index fc759bc..1427683 100644 --- a/ccv/sheet4/lab_pyramid.cpp +++ b/ccv/sheet4/lab_pyramid.cpp @@ -35,6 +35,7 @@ gauss_pyramid lab_pyramid::get_pyramid(int channel) } void static lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, int number_of_layers) { + _number_of_layers = number_of_layers; // L channel gauss_pyramid center_l = center.get_pyramid(COLOR_L); gauss_pyramid surround_l = surround.get_pyramid(COLOR_L); @@ -82,5 +83,19 @@ void static lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, i } void static lab_pyramid::visualize_dog() { - + for (unsigned long layer = 0; layer < _number_of_layers; layer++) { + cv::namedWindow("CS L"); + cv::namedWindow("SC L"); + cv::namedWindow("CS A"); + cv::namedWindow("SC A"); + cv::namedWindow("CS B"); + cv::namedWindow("SC B"); + cv::imshow("CS L", _cs_contrast_l.at(layer)); + cv::imshow("SC L", _sc_contrast_l.at(layer)); + cv::imshow("CS A", _cs_contrast_a.at(layer)); + cv::imshow("SC A", _cs_contrast_a.at(layer)); + cv::imshow("CS B", _cs_contrast_b.at(layer)); + cv::imshow("SC B", _cs_contrast_b.at(layer)); + cv::waitKey(0); + } } diff --git a/ccv/sheet4/lab_pyramid.h b/ccv/sheet4/lab_pyramid.h index aaf2583..0ae957d 100644 --- a/ccv/sheet4/lab_pyramid.h +++ b/ccv/sheet4/lab_pyramid.h @@ -16,6 +16,7 @@ private: static std::vector _sc_contrast_a; static std::vector _cs_contrast_b; static std::vector _sc_contrast_b; + static int _number_of_layers; public: const static int COLOR_L = 0; const static int COLOR_A = 1;