YARP
Yet Another Robot Platform
IntrinsicParams.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_SIG_INTRINSICPARAMS_H
7 #define YARP_SIG_INTRINSICPARAMS_H
8 
9 #include <yarp/os/Log.h>
10 #include <yarp/os/Portable.h>
11 #include <yarp/os/Property.h>
12 #include <yarp/sig/api.h>
13 
14 namespace yarp {
15 namespace sig {
27 enum class YarpDistortion : std::int32_t
28 {
35 #ifndef YARP_NO_DEPRECATED // Since YARP 3.5
36  YARP_PLUM_BOB YARP_DEPRECATED_MSG("Use YARP_PLUMB_BOB instead") = YARP_PLUMB_BOB,
37 #endif
38 };
39 
45 {
51  {
52  double k1;
53  double k2;
54  double t1;
55  double t2;
56  double k3;
58 
59  DistortionModel(): k1(0.0), k2(0.0),
60  t1(0.0), t2(0.0),
61  k3(0.0), type(YarpDistortion::YARP_DISTORTION_NONE) {}
62  };
63 
68 
78  IntrinsicParams(const yarp::os::Property &intrinsic, bool isOptional=false);
79 
84  void toProperty(yarp::os::Property& intrinsic) const;
85 
93  void fromProperty(const yarp::os::Property& intrinsic);
94 
95  bool read(yarp::os::ConnectionReader& reader) override;
96  bool write(yarp::os::ConnectionWriter& writer) const override;
97 
98  double physFocalLength;
99  double principalPointX;
101  double focalLengthX;
102  double focalLengthY;
105 };
106 
107 } // namespace sig
108 } // namespace yarp
109 
110 
111 
112 #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:26
A class for storing options and configuration information.
Definition: Property.h:34
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2885
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
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_PLUMB_BOB
Plumb bob distortion model.
@ YARP_PLUM_BOB
Deprecated name for plumb bob distortion model.
@ YARP_DISTORTION_NONE
Rectilinear images.
@ YARP_FISH_EYE
Fish eye distortion model.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
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:18