43 const std::string& model,
44 double* sensor_width) {
46 std::string cleaned_make = make;
47 std::string cleaned_model = model;
56 cleaned_model =
StringReplace(cleaned_model, cleaned_make,
"");
60 size_t spec_matches = 0;
61 for (
const auto& make_elem : specs_) {
64 for (
const auto& model_elem : make_elem.second) {
67 *sensor_width = model_elem.second;
68 if (cleaned_model == model_elem.first) {
73 if (spec_matches > 1) {
82 return spec_matches == 1;
bool QuerySensorWidth(const std::string &make, const std::string &model, double *sensor_width)
std::unordered_map< std::string, camera_make_specs_t > camera_specs_t
std::string StringReplace(const std::string &str, const std::string &old_str, const std::string &new_str)
void StringToLower(std::string *str)
camera_specs_t InitializeCameraSpecs()
bool StringContains(const std::string &str, const std::string &sub_str)