Open3D (C++ API)  0.18.0+5c982c7
IPPImage.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 #pragma once
8 
9 #ifdef WITH_IPPICV
10 #define IPP_CALL(ipp_function, ...) ipp_function(__VA_ARGS__);
11 
12 // Required by IPPICV headers, defined here to keep other compile commands clean
13 #define ICV_BASE
14 #define IW_BUILD
15 #include <iw++/iw_core.hpp>
16 
17 #include "open3d/core/Dtype.h"
18 #include "open3d/core/Tensor.h"
20 
21 namespace open3d {
22 namespace t {
23 namespace geometry {
24 namespace ipp {
25 
26 inline ::ipp::IppDataType ToIppDataType(core::Dtype dtype) {
27  if (dtype == core::UInt8 || dtype == core::Bool) {
28  return ipp8u;
29  } else if (dtype == core::UInt16) {
30  return ipp16u;
31  } else if (dtype == core::Int16) {
32  return ipp16s;
33  } else if (dtype == core::Int32) {
34  return ipp32s;
35  } else if (dtype == core::Int64) {
36  return ipp64s;
37  } else if (dtype == core::Float32) {
38  return ipp32f;
39  } else if (dtype == core::Float64) {
40  return ipp64f;
41  } else {
42  return ippUndef;
43  }
44 }
45 
46 void To(const core::Tensor &src_im,
47  core::Tensor &dst_im,
48  double scale,
49  double offset);
50 
51 void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im);
52 
53 void Dilate(const open3d::core::Tensor &srcim,
54  open3d::core::Tensor &dstim,
55  int kernel_size);
56 
57 void Resize(const open3d::core::Tensor &srcim,
58  open3d::core::Tensor &dstim,
59  t::geometry::Image::InterpType interp_type);
60 
61 void Filter(const open3d::core::Tensor &srcim,
62  open3d::core::Tensor &dstim,
63  const open3d::core::Tensor &kernel);
64 
65 void FilterBilateral(const open3d::core::Tensor &srcim,
66  open3d::core::Tensor &dstim,
67  int kernel_size,
68  float value_sigma,
69  float distance_sigma);
70 
71 void FilterGaussian(const open3d::core::Tensor &srcim,
72  open3d::core::Tensor &dstim,
73  int kernel_size,
74  float sigma);
75 
76 void FilterSobel(const open3d::core::Tensor &srcim,
77  open3d::core::Tensor &dstim_dx,
78  open3d::core::Tensor &dstim_dy,
79  int kernel_size);
80 } // namespace ipp
81 } // namespace geometry
82 } // namespace t
83 } // namespace open3d
84 
85 #else
86 #define IPP_CALL(ipp_function, ...) \
87  utility::LogError("Not built with IPP-IW, cannot call " #ipp_function);
88 #endif // WITH_IPPICV
Definition: Tensor.h:32
InterpType
Image interpolation algorithms.
Definition: Image.h:172
int offset
Definition: FilePCD.cpp:45
const Dtype Int64
Definition: Dtype.cpp:47
const Dtype UInt16
Definition: Dtype.cpp:49
const Dtype Bool
Definition: Dtype.cpp:52
const Dtype Int32
Definition: Dtype.cpp:46
const Dtype Int16
Definition: Dtype.cpp:45
const Dtype UInt8
Definition: Dtype.cpp:48
const Dtype Float64
Definition: Dtype.cpp:43
const Dtype Float32
Definition: Dtype.cpp:42
void Filter(const open3d::core::Tensor &src_im, open3d::core::Tensor &dst_im, const open3d::core::Tensor &kernel)
Definition: IPPImage.cpp:156
void FilterBilateral(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float value_sigma, float distance_sigma)
Definition: IPPImage.cpp:188
void FilterSobel(const core::Tensor &src_im, core::Tensor &dst_im_dx, core::Tensor &dst_im_dy, int kernel_size)
Definition: IPPImage.cpp:247
void Resize(const open3d::core::Tensor &src_im, open3d::core::Tensor &dst_im, t::geometry::Image::InterpType interp_type)
Definition: IPPImage.cpp:79
void Dilate(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size)
Definition: IPPImage.cpp:119
void To(const core::Tensor &src_im, core::Tensor &dst_im, double scale, double offset)
Definition: IPPImage.cpp:27
void FilterGaussian(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float sigma)
Definition: IPPImage.cpp:219
void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im)
Definition: IPPImage.cpp:56
Definition: PinholeCameraIntrinsic.cpp:16