AlgoPlus
v0.1.0
Loading...
Searching...
No Matches
src
machine_learning
image
filters
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
13
namespace
sharpening_filter
{
21
inline
std::vector<std::vector<int32_t>>
22
apply_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
Image
Definition
image.h:13
Image::get_2d_array
std::vector< std::vector< int32_t > > get_2d_array() const
get_2d_array function
Definition
image.h:63
Image::apply_filter2d
Image apply_filter2d(std::vector< std::vector< T > > &filter) const
apply_filter2d function
Definition
image.h:207
sharpening_filter
sharpening_filter namespace
Definition
sharpening_filter.h:13
sharpening_filter::apply_sharpening_filter
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
Generated by
1.13.2