Lagrange
image_filters.h
1/*
2 * Copyright 2023 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/image/ImageView.h>
15
16namespace lagrange {
17namespace image {
18
25void make_box_kernel(size_t size, image::ImageView<float>& kernel);
26
32void make_sobelh_kernel(image::ImageView<float>& kernel);
33
39void make_sobelv_kernel(image::ImageView<float>& kernel);
40
46void make_gaussian_kernel(image::ImageView<float>& kernel);
47
53void make_weighted_avg_xkernel(image::ImageView<float>& kernel);
54
60void make_weighted_avg_ykernel(image::ImageView<float>& kernel);
61
67void make_diff_xkernel(image::ImageView<float>& kernel);
68
74void make_diff_ykernel(image::ImageView<float>& kernel);
75
83void convolve(
84 const image::ImageView<float>& image,
85 const image::ImageView<float>& kernel,
86 image::ImageView<float>& result);
87
94void sobel_x(const image::ImageView<float>& image, image::ImageView<float>& result);
95
102void sobel_y(const image::ImageView<float>& image, image::ImageView<float>& result);
103
110void image_dxx(const image::ImageView<float>& image, image::ImageView<float>& result);
111
118void image_dyy(const image::ImageView<float>& image, image::ImageView<float>& result);
119
120} // namespace image
121} // namespace lagrange
void make_diff_ykernel(image::ImageView< float > &kernel)
Creates a 1 by 3 vertical finite difference kernel with weights (-1, 0, 1).
Definition: image_filters.cpp:95
void make_weighted_avg_xkernel(image::ImageView< float > &kernel)
Creates a 3 by 1 horizontal kernel with weights (1, 2, 1) / 4.
Definition: image_filters.cpp:71
void image_dyy(const image::ImageView< float > &image, image::ImageView< float > &result)
Convolves the given image twice with a vertical Sobel filter.
Definition: image_filters.cpp:180
void make_gaussian_kernel(image::ImageView< float > &kernel)
Creates a 3 by 3 approximation of a Gaussian filter kernel.
Definition: image_filters.cpp:57
void image_dxx(const image::ImageView< float > &image, image::ImageView< float > &result)
Convolves the given image twice with a horizontal Sobel filter.
Definition: image_filters.cpp:174
void make_sobelh_kernel(image::ImageView< float > &kernel)
Creates a 3 by 3 horizontal Sobel filter kernel.
Definition: image_filters.cpp:29
void make_sobelv_kernel(image::ImageView< float > &kernel)
Creates a 3 by 3 vertical Sobel filter kernel.
Definition: image_filters.cpp:43
void make_box_kernel(size_t size, image::ImageView< float > &kernel)
Creates a size by size kernel with all values set to 1 / size.
Definition: image_filters.cpp:19
void convolve(const image::ImageView< float > &image, const image::ImageView< float > &kernel, image::ImageView< float > &result)
Convolves the given image with the specified kernel, using periodic boundary conditions.
Definition: image_filters.cpp:103
void make_weighted_avg_ykernel(image::ImageView< float > &kernel)
Creates a 1 by 3 vertical kernel with weights (1, 2, 1) / 4.
Definition: image_filters.cpp:79
void sobel_y(const image::ImageView< float > &image, image::ImageView< float > &result)
Convolves the given image with a vertical Sobel filter.
Definition: image_filters.cpp:162
void make_diff_xkernel(image::ImageView< float > &kernel)
Creates a 3 by 1 horizontal finite difference kernel with weights (-1, 0, 1).
Definition: image_filters.cpp:87
void sobel_x(const image::ImageView< float > &image, image::ImageView< float > &result)
Convolves the given image with a horizontal Sobel filter.
Definition: image_filters.cpp:150
Main namespace for Lagrange.
Definition: AABBIGL.h:30