| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef COLMAP_SRC_UI_COLORMAPS_H_ |
| | #define COLMAP_SRC_UI_COLORMAPS_H_ |
| |
|
| | #include <Eigen/Core> |
| |
|
| | #include "base/reconstruction.h" |
| | #include "util/alignment.h" |
| | #include "util/types.h" |
| |
|
| | namespace colmap { |
| |
|
| | |
| | class PointColormapBase { |
| | public: |
| | PointColormapBase(); |
| | virtual ~PointColormapBase() = default; |
| |
|
| | virtual void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) = 0; |
| |
|
| | virtual Eigen::Vector4f ComputeColor(const point3D_t point3D_id, |
| | const Point3D& point3D) = 0; |
| |
|
| | void UpdateScale(std::vector<float>* values); |
| | float AdjustScale(const float gray); |
| |
|
| | float scale; |
| | float min; |
| | float max; |
| | float range; |
| | float min_q; |
| | float max_q; |
| | }; |
| |
|
| | |
| | class PointColormapPhotometric : public PointColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | Eigen::Vector4f ComputeColor(const point3D_t point3D_id, |
| | const Point3D& point3D) override; |
| | }; |
| |
|
| | |
| | class PointColormapError : public PointColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | Eigen::Vector4f ComputeColor(const point3D_t point3D_id, |
| | const Point3D& point3D) override; |
| | }; |
| |
|
| | |
| | class PointColormapTrackLen : public PointColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | Eigen::Vector4f ComputeColor(const point3D_t point3D_id, |
| | const Point3D& point3D) override; |
| | }; |
| |
|
| | |
| | class PointColormapGroundResolution : public PointColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | Eigen::Vector4f ComputeColor(const point3D_t point3D_id, |
| | const Point3D& point3D) override; |
| |
|
| | private: |
| | std::unordered_map<point3D_t, float> resolutions_; |
| | }; |
| |
|
| | |
| | class ImageColormapBase { |
| | public: |
| | ImageColormapBase(); |
| | virtual ~ImageColormapBase() = default; |
| |
|
| | virtual void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) = 0; |
| |
|
| | virtual void ComputeColor(const Image& image, Eigen::Vector4f* plane_color, |
| | Eigen::Vector4f* frame_color) = 0; |
| |
|
| | const static Eigen::Vector4f kDefaultPlaneColor; |
| | const static Eigen::Vector4f kDefaultFrameColor; |
| | }; |
| |
|
| | |
| | class ImageColormapUniform : public ImageColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | void ComputeColor(const Image& image, Eigen::Vector4f* plane_color, |
| | Eigen::Vector4f* frame_color) override; |
| |
|
| | Eigen::Vector4f uniform_plane_color = kDefaultPlaneColor; |
| | Eigen::Vector4f uniform_frame_color = kDefaultFrameColor; |
| | }; |
| |
|
| | |
| | class ImageColormapNameFilter : public ImageColormapBase { |
| | public: |
| | void Prepare(EIGEN_STL_UMAP(camera_t, Camera) & cameras, |
| | EIGEN_STL_UMAP(image_t, Image) & images, |
| | EIGEN_STL_UMAP(point3D_t, Point3D) & points3D, |
| | std::vector<image_t>& reg_image_ids) override; |
| |
|
| | void AddColorForWord(const std::string& word, |
| | const Eigen::Vector4f& plane_color, |
| | const Eigen::Vector4f& frame_color); |
| |
|
| | void ComputeColor(const Image& image, Eigen::Vector4f* plane_color, |
| | Eigen::Vector4f* frame_color) override; |
| |
|
| | private: |
| | |
| | std::vector< |
| | std::pair<std::string, std::pair<Eigen::Vector4f, Eigen::Vector4f>>> |
| | image_name_colors_; |
| | }; |
| |
|
| | } |
| |
|
| | #endif |
| |
|