| 135 | } |
| 136 | |
| 137 | std::vector<double> CameraModelInitializeParams(const CameraModelId model_id, |
| 138 | const double focal_length, |
| 139 | const size_t width, |
| 140 | const size_t height) { |
| 141 | // Assuming that image measurements are within [0, dim], i.e. that the |
| 142 | // upper left corner is the (0, 0) coordinate (rather than the center of |
| 143 | // the upper left pixel). This complies with the default SiftGPU convention. |
| 144 | switch (model_id) { |
| 145 | #define CAMERA_MODEL_CASE(CameraModel) \ |
| 146 | case CameraModel::model_id: \ |
| 147 | return CameraModel::InitializeParams(focal_length, width, height); \ |
| 148 | break; |
| 149 | |
| 150 | CAMERA_MODEL_SWITCH_CASES |
| 151 | |
| 152 | #undef CAMERA_MODEL_CASE |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | const std::string& CameraModelParamsInfo(const CameraModelId model_id) { |
| 157 | switch (model_id) { |
no outgoing calls