Volume Cartographer 2.27.0
ScaleMarkerGenerator.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <opencv2/core.hpp>
6
8
9namespace volcart::texturing
10{
23{
24public:
26 enum class Type { Metric = 0, Imperial, ReferenceImage };
27
30
32 void setScaleType(Type t) { type_ = t; }
33
35 void setInputImage(const cv::Mat& i) { inputImg_ = i; }
36
39
45 void setScaleBarColor(const Color& c) { scaleBarColor_ = c; }
46
52 void setReferenceImage(const cv::Mat& i) { refImg_ = i; }
53
56
62 cv::Mat compute();
63
69 cv::Mat getOutputImg() { return outputImg_; }
70
76 cv::Mat getOutputScaleImage() { return scaleImg_; }
77
78private:
80 Type type_{Type::Metric};
81
83 cv::Mat inputImg_;
85 double inputImgPixSize_{1.0};
86
88 cv::Mat scaleImg_;
90 cv::Mat outputImg_;
91
93 Color scaleBarColor_{volcart::color::WHITE};
94
96 cv::Mat refImg_;
98 double refImgPixSize_{1.0};
99
101 double scaleFactor_{1.0};
103 std::string scaleUnit_{"cm"};
104
107
110
113 cv::Mat img, const std::string& value, const cv::Point& position);
114};
115} // namespace volcart::texturing
Add a scale marker (ruler or reference image) to a Texture image.
void setScaleType(Type t)
Set the scale marker type.
void setReferenceImagePixelSize(double s)
Set the reference image pixel size (in microns)
void draw_tick_label_(cv::Mat img, const std::string &value, const cv::Point &position)
void setScaleBarColor(const Color &c)
Set the scale bar (ruler) color.
void setInputImagePixelSize(double s)
Set the input texture image pixel size (in microns)
cv::Mat getOutputScaleImage()
Get the computed scale marker image.
cv::Mat compute()
Compute scale marker and combine with input texture image.
cv::Mat getOutputImg()
Get the computed output image.
void setReferenceImage(const cv::Mat &i)
Set the scale reference image.
void setInputImage(const cv::Mat &i)
Set the input texture image.
Texturing and parameterization algorithms and utilities library.
cv::Vec3b Color
Color type.
Definition: Color.hpp:18