1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 11:26:25 +02:00

[CCV] Fixed compile issues

Signed-off-by: Jim Martens <github@2martens>
This commit is contained in:
2017-05-02 15:54:31 +02:00
parent 6e983d8e8d
commit b8eb2c108f

View File

@ -1,5 +1,13 @@
#include "lab_pyramid.h" #include "lab_pyramid.h"
int lab_pyramid::_number_of_layers = 0;
std::vector<cv::Mat> lab_pyramid::_cs_contrast_l = std::vector<cv::Mat>();
std::vector<cv::Mat> lab_pyramid::_sc_contrast_l = std::vector<cv::Mat>();
std::vector<cv::Mat> lab_pyramid::_cs_contrast_a = std::vector<cv::Mat>();
std::vector<cv::Mat> lab_pyramid::_sc_contrast_a = std::vector<cv::Mat>();
std::vector<cv::Mat> lab_pyramid::_cs_contrast_b = std::vector<cv::Mat>();
std::vector<cv::Mat> lab_pyramid::_sc_contrast_b = std::vector<cv::Mat>();
lab_pyramid::lab_pyramid(cv::String image_filename) { lab_pyramid::lab_pyramid(cv::String image_filename) {
cv::Mat image_rgb = cv::imread(image_filename, cv::IMREAD_COLOR); cv::Mat image_rgb = cv::imread(image_filename, cv::IMREAD_COLOR);
cv::cvtColor(image_rgb, _inputImage_lab, cv::COLOR_RGB2Lab); cv::cvtColor(image_rgb, _inputImage_lab, cv::COLOR_RGB2Lab);
@ -34,8 +42,9 @@ gauss_pyramid lab_pyramid::get_pyramid(int channel)
} }
} }
void static lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, int number_of_layers) { void lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, int number_of_layers) {
_number_of_layers = number_of_layers; _number_of_layers = number_of_layers;
// L channel // L channel
gauss_pyramid center_l = center.get_pyramid(COLOR_L); gauss_pyramid center_l = center.get_pyramid(COLOR_L);
gauss_pyramid surround_l = surround.get_pyramid(COLOR_L); gauss_pyramid surround_l = surround.get_pyramid(COLOR_L);
@ -58,7 +67,7 @@ void static lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, i
_cs_contrast_l.push_back(dog_final); _cs_contrast_l.push_back(dog_final);
dog_raw = surround_layer_mat - center_layer_mat; dog_raw = surround_layer_mat - center_layer_mat;
cv::threshold(dog_raw, dog_final, 0, 1, cv::THRESH_TOZERO); cv::threshold(dog_raw, dog_final, 0, 1, cv::THRESH_TOZERO);
_sc_contrast_l.push_back(dog_final); _cs_contrast_l.push_back(dog_final);
// A channel // A channel
center_layer_mat = center_a.get(layer); center_layer_mat = center_a.get(layer);
@ -82,7 +91,7 @@ void static lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, i
} }
} }
void static lab_pyramid::visualize_dog() { void lab_pyramid::visualize_dog() {
for (unsigned long layer = 0; layer < _number_of_layers; layer++) { for (unsigned long layer = 0; layer < _number_of_layers; layer++) {
cv::namedWindow("CS L"); cv::namedWindow("CS L");
cv::namedWindow("SC L"); cv::namedWindow("SC L");