YARP
Yet Another Robot Platform
IntrinsicParams.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_SIG_INTRINSICPARAMS_H
10 #define YARP_SIG_INTRINSICPARAMS_H
11 
12 #include <yarp/os/Log.h>
13 #include <yarp/os/Portable.h>
14 #include <yarp/os/Property.h>
15 #include <yarp/sig/api.h>
16 
17 namespace yarp {
18 namespace sig {
30 enum class YarpDistortion : std::int32_t
31 {
37 };
38 
44 {
50  {
51  double k1;
52  double k2;
53  double t1;
54  double t2;
55  double k3;
57 
58  DistortionModel(): k1(0.0), k2(0.0),
59  t1(0.0), t2(0.0),
60  k3(0.0), type(YarpDistortion::YARP_DISTORTION_NONE) {}
61  };
62 
67 
77  IntrinsicParams(const yarp::os::Property &intrinsic, bool isOptional=false);
78 
83  void toProperty(yarp::os::Property& intrinsic) const;
84 
92  void fromProperty(const yarp::os::Property& intrinsic);
93 
94  bool read(yarp::os::ConnectionReader& reader) override;
95  bool write(yarp::os::ConnectionWriter& writer) const override;
96 
97  double physFocalLength;
98  double principalPointX;
99  double principalPointY;
100  double focalLengthX;
101  double focalLengthY;
104 };
105 
106 } // namespace sig
107 } // namespace yarp
108 
109 
110 
111 #endif // YARP_SIG_INTRINSICPARAMS_H
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
A class for storing options and configuration information.
Definition: Property.h:37
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:656
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:804
YarpDistortion
The YarpDistortion enum to define the type of the distortion model of the camera.
@ YARP_DISTORTION_COUNT
Number of enumeration values.
@ YARP_UNSUPPORTED
Unsupported distortion model.
@ YARP_PLUM_BOB
Plumb bob distortion model.
@ YARP_DISTORTION_NONE
Rectilinear images.
@ YARP_FISH_EYE
Fish eye distortion model.
The main, catch-all namespace for YARP.
Definition: environment.h:18
The DistortionModel struct representing the distortion model of the camera.
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).
double focalLengthY
Result of the product of the physical focal length(mm) and the size sy of the individual imager eleme...
DistortionModel distortionModel
Distortion model of the image.
double focalLengthX
Result of the product of the physical focal length(mm) and the size sx of the individual imager eleme...
double physFocalLength
Physical focal length of the lens (m)
double principalPointX
Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge.
double principalPointY
Vertical coordinate of the principal point of the image, as a pixel offset from the top edge.
#define YARP_sig_API
Definition: api.h:19