diff --git a/src/aliceVision/camera/IntrinsicBase.hpp b/src/aliceVision/camera/IntrinsicBase.hpp index 31b6ff088b..522e024798 100644 --- a/src/aliceVision/camera/IntrinsicBase.hpp +++ b/src/aliceVision/camera/IntrinsicBase.hpp @@ -105,14 +105,30 @@ class IntrinsicBase */ inline bool operator==(const IntrinsicBase& other) const { + if(getParams().size() != other.getParams().size()) + { + return false; + } + for(int i = 0; i < getParams().size(); i++) + { + const double diff = getParams()[i] - other.getParams()[i]; + if(std::abs(diff) > 1e-8) + { + return false; + } + } return _w == other._w && _h == other._h && _sensorWidth == other._sensorWidth && _sensorHeight == other._sensorHeight && _serialNumber == other._serialNumber && _initializationMode == other._initializationMode && - getType() == other.getType() && - getParams() == other.getParams(); + getType() == other.getType(); + } + + inline bool operator!=(const IntrinsicBase& other) const + { + return !(*this == other); } /**