Loading...
Searching...
No Matches
image_processing.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 Artificial Intelligence Techniques, S.L. and Roberto López González
3
4#pragma once
5
7
8namespace opennn
9{
10
11Tensor3 load_image(const filesystem::path&);
12
13bool is_supported_image_file(const filesystem::path&);
14
15void load_image(const filesystem::path&,
16 float*,
17 Index,
18 Index,
19 Index);
20
21Tensor3 resize_image(const Tensor3&, Index, Index);
22
23template <typename Pixel>
24inline float bilinear_blend(Pixel v00, Pixel v01, Pixel v10, Pixel v11, float dx, float dy)
25{
26 const float top = float(v00) * (1.0f - dx) + float(v01) * dx;
27 const float bottom = float(v10) * (1.0f - dx) + float(v11) * dx;
28 return top * (1.0f - dy) + bottom * dy;
29}
30
33void rotate_image(const TensorMap3&, TensorMap3&, float);
36}
Definition configuration.h:10
void reflect_image_vertical(TensorMap3 &)
float bilinear_blend(Pixel v00, Pixel v01, Pixel v10, Pixel v11, float dx, float dy)
Definition image_processing.h:24
void translate_image_x(TensorMap3 &, Index)
void translate_image_y(TensorMap3 &, Index)
void reflect_image_horizontal(TensorMap3 &)
bool is_supported_image_file(const filesystem::path &)
void rotate_image(const TensorMap3 &, TensorMap3 &, float)
Tensor3 load_image(const filesystem::path &)
Tensor3 resize_image(const Tensor3 &, Index, Index)
Eigen::Tensor< float, 3, Layout|Eigen::AlignedMax > Tensor3
Definition opennn_types.h:352
Eigen::TensorMap< Eigen::Tensor< float, 3, Layout|Eigen::AlignedMax >, Eigen::AlignedMax > TensorMap3
Definition opennn_types.h:358