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 {
32  YARP_DISTORTION_NONE,
33  YARP_PLUM_BOB,
34  YARP_FISH_EYE,
35  YARP_UNSUPPORTED,
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
yarp::sig::IntrinsicParams::principalPointY
double principalPointY
Vertical coordinate of the principal point of the image, as a pixel offset from the top edge.
Definition: IntrinsicParams.h:99
yarp::os::Portable
This is a base class for objects that can be both read from and be written to the YARP network.
Definition: Portable.h:29
yarp::sig::file::read
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:827
api.h
yarp::sig::IntrinsicParams::DistortionModel::t2
double t2
Definition: IntrinsicParams.h:54
Portable.h
yarp::sig::IntrinsicParams::physFocalLength
double physFocalLength
Physical focal length of the lens (m)
Definition: IntrinsicParams.h:97
yarp::sig::IntrinsicParams::DistortionModel::type
YarpDistortion type
Definition: IntrinsicParams.h:56
yarp::sig::IntrinsicParams::focalLengthY
double focalLengthY
Result of the product of the physical focal length(mm) and the size sy of the individual imager eleme...
Definition: IntrinsicParams.h:101
Log.h
yarp::sig::IntrinsicParams::DistortionModel::k1
double k1
Definition: IntrinsicParams.h:51
yarp::sig::IntrinsicParams::DistortionModel
The DistortionModel struct representing the distortion model of the camera.
Definition: IntrinsicParams.h:50
yarp::sig::IntrinsicParams::principalPointX
double principalPointX
Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge.
Definition: IntrinsicParams.h:98
Property.h
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::sig::IntrinsicParams::focalLengthX
double focalLengthX
Result of the product of the physical focal length(mm) and the size sx of the individual imager eleme...
Definition: IntrinsicParams.h:100
yarp::sig::IntrinsicParams::DistortionModel::DistortionModel
DistortionModel()
Definition: IntrinsicParams.h:58
yarp::sig::YarpDistortion
YarpDistortion
The YarpDistortion enum to define the type of the distortion model of the camera.
Definition: IntrinsicParams.h:31
yarp::sig::IntrinsicParams::DistortionModel::k3
double k3
Definition: IntrinsicParams.h:55
YARP_sig_API
#define YARP_sig_API
Definition: api.h:19
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::sig::IntrinsicParams::distortionModel
DistortionModel distortionModel
Distortion model of the image.
Definition: IntrinsicParams.h:102
yarp::sig::IntrinsicParams::DistortionModel::t1
double t1
Definition: IntrinsicParams.h:53
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::sig::IntrinsicParams::DistortionModel::k2
double k2
Definition: IntrinsicParams.h:52
yarp::sig::file::write
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:971
yarp::sig::IntrinsicParams::isOptional
bool isOptional
Definition: IntrinsicParams.h:103
yarp::sig::IntrinsicParams
The IntrinsicParams struct to handle the intrinsic parameter of cameras(RGB and RGBD either).
Definition: IntrinsicParams.h:44
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
yarp::sig::YarpDistortion::YARP_DISTORTION_NONE
@ YARP_DISTORTION_NONE
Rectilinear images.