mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 19:36:26 +02:00
[CVV] Added laplacian pyramid
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -5,5 +5,5 @@ set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
find_package( OpenCV REQUIRED )
|
||||
|
||||
add_executable(sheet5 main.cpp)
|
||||
add_executable(sheet5 gauss_pyramid.cpp laplacian_pyramid.cpp main.cpp)
|
||||
target_link_libraries(sheet5 ${OpenCV_LIBS})
|
||||
|
||||
11
ccv/sheet5/laplacian_pyramid.cpp
Normal file
11
ccv/sheet5/laplacian_pyramid.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "laplacian_pyramid.h"
|
||||
|
||||
laplacian_pyramid::laplacian_pyramid(const gauss_pyramid &pyramid, float sigma) {
|
||||
_layers = std::vector<cv::Mat>();
|
||||
unsigned long number_of_layers = pyramid.get_number_of_layers();
|
||||
for (int i = 0; i < number_of_layers; i++) {
|
||||
cv::Mat blurred;
|
||||
cv::GaussianBlur(pyramid.get(i), blurred, cv::Size(), sigma, sigma, cv::BORDER_CONSTANT);
|
||||
_layers.push_back(blurred);
|
||||
}
|
||||
}
|
||||
20
ccv/sheet5/laplacian_pyramid.h
Normal file
20
ccv/sheet5/laplacian_pyramid.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef SHEET5_LAPLACIAN_PYRAMID_H
|
||||
#define SHEET5_LAPLACIAN_PYRAMID_H
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include "gauss_pyramid.h
|
||||
|
||||
class laplacian_pyramid {
|
||||
private:
|
||||
std::vector<cv::Mat> _layers;
|
||||
public:
|
||||
/**
|
||||
* Initializes the laplacian pyramid.
|
||||
* @param pyramid the gaussian pyramid
|
||||
* @param sigma the blur factor
|
||||
*/
|
||||
laplacian_pyramid(const gauss_pyramid& pyramid, float sigma);
|
||||
};
|
||||
|
||||
|
||||
#endif //SHEET5_LAPLACIAN_PYRAMID_H
|
||||
Reference in New Issue
Block a user