void load( Archive & ar) { IntrinsicBase::load(ar); double focal_length; ar(cereal::make_nvp("focal_length", focal_length )); std::vector<double> pp(2); ar(cereal::make_nvp("principal_point", pp)); *this = Pinhole_Intrinsic(_w, _h, focal_length, pp[0], pp[1]); }
// Data wrapper for non linear optimization (update from data) virtual bool updateFromParams(const std::vector<double> & params) { if (params.size() == 3) { *this = Pinhole_Intrinsic(_w, _h, params[0], params[1], params[2]); return true; } else { return false; } }
/** * @brief Data wrapper for non linear optimization (update from data) * @param params List of params used to update this intrinsic * @retval true if update is correct * @retval false if there was an error during update */ bool updateFromParams(const std::vector<double> & params) override { if ( params.size() == 3 ) { *this = Pinhole_Intrinsic( w_, h_, params[0], params[1], params[2] ); return true; } else { return false; } }