19 class PinholeCameraIntrinsic;
78 virtual ccBBox getOwnBB(
bool withGLFeatures =
false)
override;
83 virtual void onDeletionOf(
const ccHObject *obj)
override;
87 inline virtual bool IsEmpty()
const override {
return !HasData(); }
88 virtual Eigen::Vector2d GetMin2DBound()
const override;
89 virtual Eigen::Vector2d GetMax2DBound()
const override;
99 bool TestImageBoundary(
double u,
double v,
double inner_margin = 0.0)
const;
104 return width_ > 0 && height_ > 0 &&
105 data_.size() == size_t(height_ * BytesPerLine());
112 int bytes_per_channel) {
115 num_of_channels_ = num_of_channels;
116 bytes_per_channel_ = bytes_per_channel;
117 AllocateDataBuffer();
123 return width_ * num_of_channels_ * bytes_per_channel_;
131 std::pair<bool, double> FloatValueAt(
double u,
double v)
const;
140 static std::shared_ptr<Image>
141 CreateDepthToCameraDistanceMultiplierFloatImage(
145 std::shared_ptr<Image> CreateFloatImage(
150 template <
typename T>
151 T *PointerAt(
int u,
int v)
const;
154 template <
typename T>
155 T *PointerAt(
int u,
int v,
int ch)
const;
157 std::shared_ptr<Image> ConvertDepthToFloatImage(
158 double depth_scale = 1000.0,
double depth_trunc = 3.0)
const;
160 std::shared_ptr<Image> Transpose()
const;
163 std::shared_ptr<Image> FlipHorizontal()
const;
165 std::shared_ptr<Image> FlipVertical()
const;
171 std::shared_ptr<Image>
Filter(
const std::vector<double> &dx,
172 const std::vector<double> &dy)
const;
174 std::shared_ptr<Image> FilterHorizontal(
175 const std::vector<double> &kernel)
const;
178 std::shared_ptr<Image> Downsample()
const;
181 std::shared_ptr<Image>
Dilate(
int half_kernel_size = 1)
const;
185 Image &LinearTransform(
double scale = 1.0,
double offset = 0.0);
191 Image &ClipIntensity(
double min = 0.0,
double max = 1.0);
196 template <
typename T>
197 std::shared_ptr<Image> CreateImageFromFloatImage()
const;
205 bool with_gaussian_filter =
true)
const;
208 std::shared_ptr<Image> CreateDepthBoundaryMask(
209 double depth_threshold_for_discontinuity_check = 0.1,
210 int half_dilation_kernel_size_for_discontinuity_map = 3)
const;
214 data_.resize(width_ * height_ * num_of_channels_ * bytes_per_channel_);
223 int num_of_channels_ = 0;
225 int bytes_per_channel_ = 0;
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Hierarchical CLOUDVIEWER Object.
Contains the pinhole camera intrinsic parameters.
The Image class stores image with customizable width, height, num of channels and bytes per channel.
void AllocateDataBuffer()
virtual bool IsEmpty() const override
ColorToIntensityConversionType
Specifies whether R, G, B channels have the same weight when converting to intensity....
@ Weighted
Weighted R, G, B channels: I = 0.299 * R + 0.587 * G + 0.114 * B.
Image & Prepare(int width, int height, int num_of_channels, int bytes_per_channel)
Prepare Image properties and allocate Image buffer.
Image(const char *name="Image")
Default Constructor.
int BytesPerLine() const
Returns data size per line (row, or the width) in bytes.
virtual bool isSerializable() const override
Returns whether object is serializable of not.
virtual bool HasData() const
Returns true if the Image has valid data.
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
std::vector< uint8_t > data_
Image storage buffer.
FilterType
Specifies the Image filter type.
virtual CV_CLASS_ENUM getClassID() const override
Returns unique class ID.
std::vector< std::shared_ptr< Image > > ImagePyramid
Typedef and functions for ImagePyramid.
void Dilate(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size)
void Filter(const core::Tensor &src_im, core::Tensor &dst_im, const core::Tensor &kernel)
Generic file read and write utility for python interface.