kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #717 from pierotofy/georef
Handle bundler files that have invalid/empty camera parameterspull/724/head
commit
293bdfec57
|
@ -190,6 +190,11 @@ Vec3 GeorefCamera::getReferencedPos()
|
||||||
return Vec3(easting_,northing_,altitude_);
|
return Vec3(easting_,northing_,altitude_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GeorefCamera::isValid()
|
||||||
|
{
|
||||||
|
return focalLength_ != 0 && k1_ != 0 && k2_ != 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream &os, const GeorefCamera &cam)
|
std::ostream& operator<<(std::ostream &os, const GeorefCamera &cam)
|
||||||
{
|
{
|
||||||
os << "Focal, k1, k2 : " << cam.focalLength_ << ", " << cam.k1_ << ", " << cam.k2_ << "\n";
|
os << "Focal, k1, k2 : " << cam.focalLength_ << ", " << cam.k1_ << ", " << cam.k2_ << "\n";
|
||||||
|
@ -1059,6 +1064,14 @@ void Georef::createGeoreferencedModelFromExifData()
|
||||||
throw GeorefException("Not enough cameras in \'" + inputCoordFilename_ + "\' coord file.\n");
|
throw GeorefException("Not enough cameras in \'" + inputCoordFilename_ + "\' coord file.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove invalid cameras
|
||||||
|
std::vector<GeorefCamera> goodCameras;
|
||||||
|
for (size_t i = 0; i < cameras_.size(); i++){
|
||||||
|
if (cameras_[i].isValid()) goodCameras.push_back(GeorefCamera(cameras_[i]));
|
||||||
|
}
|
||||||
|
cameras_.clear();
|
||||||
|
cameras_ = goodCameras;
|
||||||
|
|
||||||
// The optimal camera triplet.
|
// The optimal camera triplet.
|
||||||
size_t cam0, cam1, cam2;
|
size_t cam0, cam1, cam2;
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,11 @@ struct GeorefCamera
|
||||||
*/
|
*/
|
||||||
Vec3 getReferencedPos();
|
Vec3 getReferencedPos();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief isValid Whether this camera is valid based on its parameters.
|
||||||
|
*/
|
||||||
|
bool isValid();
|
||||||
|
|
||||||
double focalLength_; /**< The focal length of the camera. */
|
double focalLength_; /**< The focal length of the camera. */
|
||||||
double k1_; /**< The k1 lens distortion parameter. **/
|
double k1_; /**< The k1 lens distortion parameter. **/
|
||||||
double k2_; /**< The k2 lens distortion parameter. **/
|
double k2_; /**< The k2 lens distortion parameter. **/
|
||||||
|
|
Ładowanie…
Reference in New Issue