# struct utils::IntrinsicParams

## Overview

Holds camera intrinsic projection parameters. More…

    #include <IntrinsicParams.h>

    struct IntrinsicParams: public utils::SerializableJson {
        // fields

        float fx { 0.0f };
        float fy { 0.0f };
        float cx { 0.0f };
        float cy { 0.0f };

        // construction

        IntrinsicParams();
        IntrinsicParams(float t_fx, float t_fy, float t_cx, float t_cy);

        // methods

        float GetFovX() const;
        float GetFovY() const;
        virtual void AddToJsonNode(nlohmann::json& node) const;
        virtual bool ReadFromJsonNode(const nlohmann::json& node);
    };

### Inherited Members

    public:
        // methods

        std::string Serialize() const;
        bool Deserialize(const std::string& json_string);
        virtual void AddToJsonNode(nlohmann::json& parent_node) const = 0;
        virtual bool ReadFromJsonNode(const nlohmann::json& parent_node) = 0;

## Detailed Documentation

Holds camera intrinsic projection parameters.

More information about intrinsic camera parameters can be found on Wikipedia https://en.wikipedia.org/wiki/Camera_resectioning and distortion coefficients at https://docs.opencv.org/2.4/doc/tutorials/calib3d/camera_calibration/camera_calibration.html

### Fields

    float fx { 0.0f }

Focal length in terms of pixels.

    float cx { 0.0f }

Principal point coordinates. Ideally in the center of the image.

### Methods

    float GetFovX() const

Calculates horizontal field of view. In radians.

    float GetFovY() const

Calculates vertical field of view. In radians.

    virtual void AddToJsonNode(nlohmann::json& node) const

Fill data of this to json node.

    virtual bool ReadFromJsonNode(const nlohmann::json& node)

Read json node and initialize this.

Parameters:

nlohmann::json::exception | when required keys are missing.