AlgoPlus v0.1.0
Loading...
Searching...
No Matches
sharpening_filter.h
1#ifndef SHARPENING_FILTER_H
2#define SHARPENING_FILTER_H
3
4#ifdef __cplusplus
5#include <iostream>
6#include <vector>
7#include "../image.h"
8#endif
9
21inline std::vector<std::vector<int32_t>>
22apply_sharpening_filter(const std::vector<std::vector<int32_t>>& image) {
23 Image img(image);
24 std::vector<std::vector<int32_t>> kernel = {{0, -1, 0}, {-1, 5, -1}, {0, -1, 0}};
25 return img.apply_filter2d(kernel).get_2d_array();
26}
27} // namespace sharpening_filter
28
29#endif
Definition image.h:13
std::vector< std::vector< int32_t > > get_2d_array() const
get_2d_array function
Definition image.h:63
Image apply_filter2d(std::vector< std::vector< T > > &filter) const
apply_filter2d function
Definition image.h:207
sharpening_filter namespace
Definition sharpening_filter.h:13
std::vector< std::vector< int32_t > > apply_sharpening_filter(const std::vector< std::vector< int32_t > > &image)
apply_sharpening_filter function: applies a 3x3 laplacian filter to image img
Definition sharpening_filter.h:22