39 class PinholeCameraIntrinsic;
47 typedef std::vector<std::shared_ptr<Image>>
ImagePyramid;
91 Image &Clear()
override;
92 bool IsEmpty()
const override;
93 Eigen::Vector2d GetMinBound()
const override;
94 Eigen::Vector2d GetMaxBound()
const override;
104 bool TestImageBoundary(
double u,
double v,
double inner_margin = 0.0)
const;
109 return width_ > 0 && height_ > 0 &&
110 data_.size() ==
size_t(height_ * BytesPerLine());
117 int bytes_per_channel) {
120 num_of_channels_ = num_of_channels;
121 bytes_per_channel_ = bytes_per_channel;
122 AllocateDataBuffer();
128 return width_ * num_of_channels_ * bytes_per_channel_;
136 std::pair<bool, double> FloatValueAt(
double u,
double v)
const;
145 static std::shared_ptr<Image>
146 CreateDepthToCameraDistanceMultiplierFloatImage(
150 std::shared_ptr<Image> CreateFloatImage(
152 Image::ColorToIntensityConversionType::Weighted)
const;
155 template <
typename T>
156 T *PointerAt(
int u,
int v)
const;
159 template <
typename T>
160 T *PointerAt(
int u,
int v,
int ch)
const;
166 if (
sizeof(T) != bytes_per_channel_) {
168 sizeof(T), bytes_per_channel_);
170 return (T *)(data_.data());
173 std::shared_ptr<Image> ConvertDepthToFloatImage(
174 double depth_scale = 1000.0,
double depth_trunc = 3.0)
const;
176 std::shared_ptr<Image> Transpose()
const;
179 std::shared_ptr<Image> FlipHorizontal()
const;
181 std::shared_ptr<Image> FlipVertical()
const;
187 std::shared_ptr<Image> Filter(
const std::vector<double> &dx,
188 const std::vector<double> &dy)
const;
190 std::shared_ptr<Image> FilterHorizontal(
191 const std::vector<double> &kernel)
const;
194 std::shared_ptr<Image> Downsample()
const;
197 std::shared_ptr<Image> Dilate(
int half_kernel_size = 1)
const;
201 Image &LinearTransform(
double scale = 1.0,
double offset = 0.0);
207 Image &ClipIntensity(
double min = 0.0,
double max = 1.0);
212 template <
typename T>
213 std::shared_ptr<Image> CreateImageFromFloatImage()
const;
216 static ImagePyramid FilterPyramid(
const ImagePyramid &input,
220 ImagePyramid CreatePyramid(
size_t num_of_levels,
221 bool with_gaussian_filter =
true)
const;
224 std::shared_ptr<Image> CreateDepthBoundaryMask(
225 double depth_threshold_for_discontinuity_check = 0.1,
226 int half_dilation_kernel_size_for_discontinuity_map = 3)
const;
230 data_.resize(width_ * height_ * num_of_channels_ * bytes_per_channel_);
239 int num_of_channels_ = 0;
241 int bytes_per_channel_ = 0;
std::vector< std::shared_ptr< Image > > ImagePyramid
Typedef and functions for ImagePyramid.
Definition: Image.h:44
The base geometry class.
Definition: Geometry.h:37
int offset
Definition: FilePCD.cpp:64
void LogError(const char *format, const Args &... args)
Definition: Console.h:176
Contains the pinhole camera intrinsic parameters.
Definition: PinholeCameraIntrinsic.h:51
Image & Prepare(int width, int height, int num_of_channels, int bytes_per_channel)
Prepare Image properties and allocate Image buffer.
Definition: Image.h:114
~Image() override
Definition: Image.h:88
T * PointerAs() const
Definition: Image.h:165
The base geometry class for 2D geometries.
Definition: Geometry2D.h:41
Image()
Default Constructor.
Definition: Image.h:87
virtual bool HasData() const
Returns true if the Image has valid data.
Definition: Image.h:108
void AllocateDataBuffer()
Definition: Image.h:229
char type
Definition: FilePCD.cpp:60
std::vector< uint8_t > data_
Image storage buffer.
Definition: Image.h:243
FilterType
Specifies the Image filter type.
Definition: Image.h:72
Definition: PinholeCameraIntrinsic.cpp:35
int BytesPerLine() const
Returns data size per line (row, or the width) in bytes.
Definition: Image.h:127
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
int height
Definition: FilePCD.cpp:72
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t int32_t int32_t int32_t k4a_color_control_mode_t default_mode value const const k4a_calibration_t calibration char size_t
Definition: K4aPlugin.cpp:721
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53
ColorToIntensityConversionType
Specifies whether R, G, B channels have the same weight when converting to intensity. Only used for Image with 3 channels.
Definition: Image.h:62
int width
Definition: FilePCD.cpp:71