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

[CCV] Added oriented and laplacian pyramid

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-05-30 17:29:48 +02:00
parent 9dbe8ce79c
commit 447567a870
4 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#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);
/**
* 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;
};
#endif //SHEET5_LAPLACIAN_PYRAMID_H

View File

@ -0,0 +1,57 @@
#ifndef SHEET5_ORIENTED_PYRAMID_H
#define SHEET5_ORIENTED_PYRAMID_H
#include <opencv2/opencv.hpp>
#include "laplacian_pyramid.h"
class oriented_pyramid {
private:
std::vector<std::vector<cv::Mat>> _orientation_maps;
std::vector<cv::Mat> _gabor_filters;
std::vector<cv::Mat> _feature_maps;
cv::Mat _C;
/**
* Initializes the Gabor filters.
* @param num_orientations the number of orientations to use
*/
void initialize_gabor_filters(float num_orientations);
public:
/**
* Initializes the oriented pyramid.
* @param pyramid the laplacian pyramid
* @param num_orientations the number of Gabor filters to apply
*/
oriented_pyramid(const laplacian_pyramid& pyramid, int num_orientations);
/**
* Computes the feature maps.
*/
void compute_feature_maps();
/**
* Computes the conspicuity map.
*/
void compute_conspicuity_map();
/**
* Returns the conspicuity map.
* Has to be called after compute_conspicuity_map.
*
* @return conspicuity map
*/
cv::Mat get_conspicuity_map();
/**
* Returns the feature map for the nth orientation.
*
* compute_feature_maps must be called first.
*
* @param orientation the nth orientation
* @return the feature map
*/
cv::Mat get_feature_map(int orientation);
};
#endif //SHEET5_ORIENTED_PYRAMID_H