mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
[CCV] Added orientation channel to system
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
#include <cstdio>
|
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
#include "includes/lab_pyramid.h"
|
#include "includes/lab_pyramid.h"
|
||||||
#include "includes/fusion.h"
|
#include "includes/fusion.h"
|
||||||
|
#include "includes/laplacian_pyramid.h"
|
||||||
|
#include "includes/oriented_pyramid.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point of program
|
* Entry point of program
|
||||||
@ -23,25 +24,36 @@ int main(int argc, char** argv) {
|
|||||||
int layers = 4;
|
int layers = 4;
|
||||||
float sigma_center = 5;
|
float sigma_center = 5;
|
||||||
float sigma_surround = 9;
|
float sigma_surround = 9;
|
||||||
|
float sigma_laplacian = 4;
|
||||||
|
int number_orientations = 4;
|
||||||
|
|
||||||
// create LAB pyramids
|
// create LAB pyramids
|
||||||
lab_pyramid lab_pyr_center = lab_pyramid(image);
|
lab_pyramid lab_pyr_center = lab_pyramid(image);
|
||||||
lab_pyr_center.create_pyramids(sigma_center, layers);
|
lab_pyr_center.create_pyramids(sigma_center, layers);
|
||||||
lab_pyramid lab_pyr_surround = lab_pyramid(image);
|
lab_pyramid lab_pyr_surround = lab_pyramid(image);
|
||||||
lab_pyr_surround.create_pyramids(sigma_surround, layers);
|
lab_pyr_surround.create_pyramids(sigma_surround, layers);
|
||||||
|
// create laplacian pyramid
|
||||||
|
gauss_pyramid c_pyr_L = lab_pyr_center.get_pyramid(lab_pyramid::COLOR_L);
|
||||||
|
laplacian_pyramid laplacian_pyr = laplacian_pyramid(c_pyr_L, sigma_laplacian);
|
||||||
|
// create orientation pyramid
|
||||||
|
oriented_pyramid oriented_pyr = oriented_pyramid(laplacian_pyr, number_orientations);
|
||||||
|
|
||||||
// create contrast maps
|
// create contrast maps
|
||||||
lab_pyramid::compute_dog(lab_pyr_center, lab_pyr_surround, layers);
|
lab_pyramid::compute_dog(lab_pyr_center, lab_pyr_surround, layers);
|
||||||
// create feature maps
|
// create feature maps
|
||||||
lab_pyramid::compute_feature_maps();
|
lab_pyramid::compute_feature_maps();
|
||||||
|
oriented_pyr.compute_feature_maps();
|
||||||
// create conspicuity maps
|
// create conspicuity maps
|
||||||
lab_pyramid::compute_conspicuity_maps();
|
lab_pyramid::compute_conspicuity_maps();
|
||||||
|
oriented_pyr.compute_conspicuity_map();
|
||||||
// get conspicuity maps
|
// get conspicuity maps
|
||||||
cv::Mat C_l = lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_L);
|
std::vector<cv::Mat> conspicuity_maps = std::vector<cv::Mat>();
|
||||||
cv::Mat C_a = lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_A);
|
conspicuity_maps.push_back(lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_L));
|
||||||
cv::Mat C_b = lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_B);
|
conspicuity_maps.push_back(lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_A));
|
||||||
|
conspicuity_maps.push_back(lab_pyramid::get_conspicuity_map(lab_pyramid::COLOR_B));
|
||||||
|
conspicuity_maps.push_back(oriented_pyr.get_conspicuity_map());
|
||||||
// get saliency map
|
// get saliency map
|
||||||
cv::Mat saliency = max_fusion_saliency(C_l, C_a, C_b);
|
cv::Mat saliency = max_fusion_generic(conspicuity_maps);
|
||||||
|
|
||||||
// convert saliency map to correct output format
|
// convert saliency map to correct output format
|
||||||
cv::Mat output_image;
|
cv::Mat output_image;
|
||||||
|
|||||||
Reference in New Issue
Block a user