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

[CCV] Added across scale addition method

Signed-off-by: Jim Martens <github@2martens>
This commit is contained in:
2017-05-07 15:49:07 +02:00
parent 57eaab1aa0
commit 3003bf5338
2 changed files with 19 additions and 0 deletions

View File

@ -96,6 +96,17 @@ void lab_pyramid::compute_dog(lab_pyramid center, lab_pyramid surround, int numb
} }
} }
cv::Mat lab_pyramid::across_scale_addition(const std::vector<cv::Mat> &scale_images) {
cv::Mat result = scale_images.front();
cv::Size original_size = scale_images.front().size();
for (unsigned long i = 1; i < scale_images.size(); i++) {
cv::Mat resized_image;
cv::resize(scale_images.at(i), resized_image, original_size, 0, 0, cv::INTER_CUBIC);
result += resized_image;
}
return result;
}
void 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");

View File

@ -61,6 +61,14 @@ public:
*/ */
void static compute_dog(lab_pyramid center, lab_pyramid surround, int number_of_layers); void static compute_dog(lab_pyramid center, lab_pyramid surround, int number_of_layers);
/**
* Takes the scale images, adds them up and returns the result.
*
* @param scale_images the scale images
* @return the sum of the scale images
*/
cv::Mat static across_scale_addition(const std::vector<cv::Mat>& scale_images);
/** /**
* Visualizes the center-surround and surround-center contrasts. They have to be computed first. * Visualizes the center-surround and surround-center contrasts. They have to be computed first.
*/ */