DepthInpainter.hpp 745 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef XYZ_INPAINTER_HPP_
  2. #define XYZ_INPAINTER_HPP_
  3. #include <opencv2/opencv.hpp>
  4. #include "ImageSpeckleFilter.hpp"
  5. //#warn("DepthInpainter this design no longer supported by new opencv version, using opencv inpaint api for alternative")
  6. class DepthInpainter
  7. {
  8. public:
  9. int _kernelSize;
  10. int _maxInternalHoleToBeFilled;
  11. double _inpaintRadius;
  12. bool _fillAll;
  13. DepthInpainter()
  14. : _kernelSize(5)
  15. , _maxInternalHoleToBeFilled(50)
  16. , _inpaintRadius(1)
  17. , _fillAll(true)
  18. {
  19. }
  20. void inpaint(const cv::Mat& inputDepth, cv::Mat& out, const cv::Mat& mask);
  21. private:
  22. cv::Mat genValidMask(const cv::Mat& depth);
  23. };
  24. #endif