Open3D (C++ API)  0.19.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IPPImage.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 #pragma once
8 
9 #ifdef WITH_IPP
10 // Not available for Remap
11 // Auto-enable multi-threaded implementations
12 // #define IPP_ENABLED_THREADING_LAYER_REDEFINITIONS 1
13 #define IPP_CALL(ipp_function, ...) ipp_function(__VA_ARGS__);
14 
15 #if IPP_VERSION_INT < \
16  20211000 // macOS IPP v2021.9.11 uses old directory layout
17 #include <iw++/iw_core.hpp>
18 #else // Linux and Windows IPP v2021.10+ uses new directory layout
19 #include <ipp/iw++/iw_core.hpp>
20 #endif
21 
22 #include "open3d/core/Dtype.h"
23 #include "open3d/core/Tensor.h"
25 
26 namespace open3d {
27 namespace t {
28 namespace geometry {
29 namespace ipp {
30 
31 inline ::ipp::IppDataType ToIppDataType(core::Dtype dtype) {
32  if (dtype == core::UInt8 || dtype == core::Bool) {
33  return ipp8u;
34  } else if (dtype == core::UInt16) {
35  return ipp16u;
36  } else if (dtype == core::Int16) {
37  return ipp16s;
38  } else if (dtype == core::Int32) {
39  return ipp32s;
40  } else if (dtype == core::Int64) {
41  return ipp64s;
42  } else if (dtype == core::Float32) {
43  return ipp32f;
44  } else if (dtype == core::Float64) {
45  return ipp64f;
46  } else {
47  return ippUndef;
48  }
49 }
50 
51 void To(const core::Tensor &src_im,
52  core::Tensor &dst_im,
53  double scale,
54  double offset);
55 
56 void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im);
57 
58 void Dilate(const core::Tensor &srcim, core::Tensor &dstim, int kernel_size);
59 
60 void Resize(const core::Tensor &srcim,
61  core::Tensor &dstim,
62  t::geometry::Image::InterpType interp_type);
63 
64 void Filter(const core::Tensor &srcim,
65  core::Tensor &dstim,
66  const core::Tensor &kernel);
67 
68 void FilterBilateral(const core::Tensor &srcim,
69  core::Tensor &dstim,
70  int kernel_size,
71  float value_sigma,
72  float distance_sigma);
73 
74 void FilterGaussian(const core::Tensor &srcim,
75  core::Tensor &dstim,
76  int kernel_size,
77  float sigma);
78 
79 void FilterSobel(const core::Tensor &srcim,
80  core::Tensor &dstim_dx,
81  core::Tensor &dstim_dy,
82  int kernel_size);
83 
84 void Remap(const core::Tensor &src_im, /*{Ws, Hs, C}*/
85  const core::Tensor &dst2src_xmap, /*{Wd, Hd}, float*/
86  const core::Tensor &dst2src_ymap, /*{Wd, Hd, 2}, float*/
87  core::Tensor &dst_im, /*{Wd, Hd, 2}*/
88  Image::InterpType interp_type);
89 
90 } // namespace ipp
91 } // namespace geometry
92 } // namespace t
93 } // namespace open3d
94 
95 #else
96 #define IPP_CALL(ipp_function, ...) \
97  utility::LogError("Not built with IPP-IW, cannot call " #ipp_function);
98 #endif // WITH_IPP
double t
Definition: SurfaceReconstructionPoisson.cpp:172
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 core::Tensor &src_im, core::Tensor &dst_im, const core::Tensor &kernel)
Definition: IPPImage.cpp:169
void FilterBilateral(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float value_sigma, float distance_sigma)
Definition: IPPImage.cpp:201
void FilterSobel(const core::Tensor &src_im, core::Tensor &dst_im_dx, core::Tensor &dst_im_dy, int kernel_size)
Definition: IPPImage.cpp:260
void Resize(const core::Tensor &src_im, core::Tensor &dst_im, Image::InterpType interp_type)
Definition: IPPImage.cpp:93
void Dilate(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size)
Definition: IPPImage.cpp:132
void Remap(const core::Tensor &src_im, const core::Tensor &dst2src_xmap, const core::Tensor &dst2src_ymap, core::Tensor &dst_im, Image::InterpType interp_type)
Definition: IPPImage.cpp:310
void To(const core::Tensor &src_im, core::Tensor &dst_im, double scale, double offset)
Definition: IPPImage.cpp:41
void FilterGaussian(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float sigma)
Definition: IPPImage.cpp:232
void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im)
Definition: IPPImage.cpp:70
Definition: PinholeCameraIntrinsic.cpp:16