ReUseX  0.0.1
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
norm.hpp
Go to the documentation of this file.
1#pragma once
3
4enum class NormType : int { None = 0, MeanStd = 1, AlphaBeta = 2 };
5
6enum class ChannelType : int { None = 0, SwapRB = 1 };
7
8struct Norm {
9 float mean[3];
10 float std[3];
11 float alpha, beta;
14
15 // out = (x * alpha - mean) / std
16 static Norm mean_std(const float mean[3], const float std[3],
17 float alpha = 1 / 255.0f,
19
20 // out = x * alpha + beta
21 static Norm alpha_beta(float alpha, float beta = 0,
23
24 // None
25 static Norm None();
26};
27
28} // namespace ReUseX::vision::tensor_rt::norm_image
static Norm alpha_beta(float alpha, float beta=0, ChannelType channel_type=ChannelType::None)
static Norm mean_std(const float mean[3], const float std[3], float alpha=1/255.0f, ChannelType channel_type=ChannelType::None)