nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
geom.hpp
Go to the documentation of this file.
1
3// toolboxes/image/include/nk/image/geom/geom.hpp
4//
5// Basic geometric transforms: resize / crop / rotate / translate.
6// All preserve the input element type (uint8, double, …) and accept
7// either H×W (grayscale) or H×W×C (multi-channel) arrays.
8
9#pragma once
10
11#include <memory_resource>
12#include <nk/value/value.hpp>
13#include <string>
14
15namespace nk::image {
16
19
20
31Value imresize(const Value &A, double scale, const std::string &method,
32 std::pmr::memory_resource *mr = nullptr);
33
47Value imresize(const Value &A, size_t outH, size_t outW,
48 const std::string &method,
49 std::pmr::memory_resource *mr = nullptr);
50
65Value imcrop(const Value &A, double xmin, double ymin,
66 double width, double height,
67 std::pmr::memory_resource *mr = nullptr);
68
86Value imcrop3(const Value &V, const Value &cuboid,
87 std::pmr::memory_resource *mr = nullptr);
88
99Value imrotate(const Value &A, double angle, const std::string &method,
100 const std::string &bbox,
101 std::pmr::memory_resource *mr = nullptr);
102
116Value imtranslate(const Value &A, double dx, double dy,
117 std::pmr::memory_resource *mr = nullptr);
118
131Value axes2pix(double n, const Value &extent, const Value &axesCoord,
132 std::pmr::memory_resource *mr = nullptr);
133
161Value imresize3(const Value &V, size_t outR, size_t outC, size_t outD,
162 const std::string &method, bool antialias,
163 std::pmr::memory_resource *mr = nullptr);
164
167Value imresize3(const Value &V, double scale,
168 const std::string &method, bool antialias,
169 std::pmr::memory_resource *mr = nullptr);
170
197Value imrotate3(const Value &V, double angle_deg,
198 double Wx, double Wy, double Wz,
199 const std::string &method, const std::string &bbox,
200 double fill,
201 std::pmr::memory_resource *mr = nullptr);
202
214Value impyramid(const Value &A, const std::string &type,
215 std::pmr::memory_resource *mr = nullptr);
216
217
219} // namespace nk::image
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value imtranslate(const Value &A, double dx, double dy, std::pmr::memory_resource *mr=nullptr)
Shift an image by an arbitrary (dx, dy) translation (B = imtranslate(A, [dx dy])).
Value imrotate(const Value &A, double angle, const std::string &method, const std::string &bbox, std::pmr::memory_resource *mr=nullptr)
Rotate an image counter-clockwise (B = imrotate(A, angle, method, bbox)).
Value imresize3(const Value &V, size_t outR, size_t outC, size_t outD, const std::string &method, bool antialias, std::pmr::memory_resource *mr=nullptr)
Resample a 3-D volume to a new size (B = imresize3(V, scale|[r c d], method, ...)).
Value imresize(const Value &A, double scale, const std::string &method, std::pmr::memory_resource *mr=nullptr)
Resample an image to a new size by a uniform scale factor (B = imresize(A, scale, method)).
Value imrotate3(const Value &V, double angle_deg, double Wx, double Wy, double Wz, const std::string &method, const std::string &bbox, double fill, std::pmr::memory_resource *mr=nullptr)
Rotate a 3-D volume around an arbitrary axis (B = imrotate3(V, angle, W, method, bbox,...
Value imcrop(const Value &A, double xmin, double ymin, double width, double height, std::pmr::memory_resource *mr=nullptr)
Crop a rectangular region (B = imcrop(A, [xmin ymin width height])).
Value imcrop3(const Value &V, const Value &cuboid, std::pmr::memory_resource *mr=nullptr)
Crop a 3-D image volume (VOUT = imcrop3(V, cuboid)).
Value axes2pix(double n, const Value &extent, const Value &axesCoord, std::pmr::memory_resource *mr=nullptr)
World-axis ↔ pixel coordinate mapping (pix = axes2pix(n, extent, axesCoord)).
Value impyramid(const Value &A, const std::string &type, std::pmr::memory_resource *mr=nullptr)
Burt–Adelson image pyramid step (B = impyramid(A, type)).