37 const float PI = std::atan(1) * 4;
44 float angle_deg = (std::atan2(
float(gy[i]),
float(gx[i])) / PI) * 180.0f;
45 phase[i] = (angle_deg < 0.0f) ? 180.f + angle_deg : angle_deg;
52 float angle_pi = std::atan2(gy[i], gx[i]) / PI;
53 angle_pi = (angle_pi < 0.0f) ? 2 + angle_pi : angle_pi;
54 phase[i] = lround(angle_pi * 128) & 0xFFu;
PhaseType
Phase calculation type.
1 channel, 1 U8 per channel
SimpleTensor< uint8_t > phase(const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, PhaseType phase_type)
TensorShape shape() const override
Shape of the tensor.
Copyright (c) 2017-2021 Arm Limited.
int num_elements() const override
Number of elements of the tensor.