29 x = 2000.0F * x / width - 1000.0F;
32 if (eps) { x = std::round(x / eps) * eps; y = std::round(y / eps) * eps; }
38 x = 2000.0F * x / width - 1000.0F;
39 if (eps) x = std::round(x / eps) * eps;
46 if (eps) y = std::round(y / eps) * eps;
53 w = 2000.0F * w / width;
56 if (eps) { w = std::round(w / eps) * eps;
h = std::round(
h / eps) * eps; }
67 x = (x * 0.0005F + 0.5F) * width;
70 if (eps) { x = std::round(x / eps) * eps; y = std::round(y / eps) * eps; }
77 w = (w * 0.0005F) * width;
80 if (eps) { w = std::round(w / eps) * eps;
h = std::round(
h / eps) * eps; }
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
unsigned int width
Image width in pixels.
unsigned int height
Image height in pixels.
#define JEVOIS_CAMERA_ASPECT
Aspect ratio of the JeVois camera.
void imgToStdX(float &x, unsigned int const width, float const eps=0.1F)
Transform X coordinate in-place from camera to standardized, using given image width and height.
void stdToImg(float &x, float &y, RawImage const &camimg, float const eps=0.1F)
Transform coordinates in-place from standardized to image, using a RawImage to establish image size.
void imgToStdY(float &y, unsigned int const height, float const eps=0.1F)
Transform Y coordinate in-place from camera to standardized, using given image width and height.
void imgToStd(float &x, float &y, RawImage const &camimg, float const eps=0.1F)
Transform coordinates in-place from camera to standardized, using a RawImage to establish image size.
void imgToStdSize(float &w, float &h, unsigned int const width, unsigned int const height, float const eps=0.1F)
Transform size in-place from camera to standardized, using given image width and height.
void stdToImgSize(float &x, float &y, unsigned int const width, unsigned int const height, float const eps=0.1F)
Transform size in-place from standardized to image, using a RawImage to establish image size.