Open3D (C++ API)  0.16.1
IPPImage.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// - Open3D: www.open3d.org -
3// ----------------------------------------------------------------------------
4// The MIT License (MIT)
5//
6// Copyright (c) 2018-2021 www.open3d.org
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24// IN THE SOFTWARE.
25// ----------------------------------------------------------------------------
26#pragma once
27
28#ifdef WITH_IPPICV
29#define IPP_CALL(ipp_function, ...) ipp_function(__VA_ARGS__);
30
31// Required by IPPICV headers, defined here to keep other compile commands clean
32#define ICV_BASE
33#define IW_BUILD
34#include <iw++/iw_core.hpp>
35
36#include "open3d/core/Dtype.h"
37#include "open3d/core/Tensor.h"
39
40namespace open3d {
41namespace t {
42namespace geometry {
43namespace ipp {
44
45inline ::ipp::IppDataType ToIppDataType(core::Dtype dtype) {
46 if (dtype == core::UInt8 || dtype == core::Bool) {
47 return ipp8u;
48 } else if (dtype == core::UInt16) {
49 return ipp16u;
50 } else if (dtype == core::Int16) {
51 return ipp16s;
52 } else if (dtype == core::Int32) {
53 return ipp32s;
54 } else if (dtype == core::Int64) {
55 return ipp64s;
56 } else if (dtype == core::Float32) {
57 return ipp32f;
58 } else if (dtype == core::Float64) {
59 return ipp64f;
60 } else {
61 return ippUndef;
62 }
63}
64
65void To(const core::Tensor &src_im,
66 core::Tensor &dst_im,
67 double scale,
68 double offset);
69
70void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im);
71
72void Dilate(const open3d::core::Tensor &srcim,
74 int kernel_size);
75
76void Resize(const open3d::core::Tensor &srcim,
79
80void Filter(const open3d::core::Tensor &srcim,
82 const open3d::core::Tensor &kernel);
83
86 int kernel_size,
87 float value_sigma,
88 float distance_sigma);
89
90void FilterGaussian(const open3d::core::Tensor &srcim,
92 int kernel_size,
93 float sigma);
94
95void FilterSobel(const open3d::core::Tensor &srcim,
96 open3d::core::Tensor &dstim_dx,
97 open3d::core::Tensor &dstim_dy,
98 int kernel_size);
99} // namespace ipp
100} // namespace geometry
101} // namespace t
102} // namespace open3d
103
104#else
105#define IPP_CALL(ipp_function, ...) \
106 utility::LogError("Not built with IPP-IW, cannot call " #ipp_function);
107#endif // WITH_IPPICV
Definition: Tensor.h:51
InterpType
Image interpolation algorithms.
Definition: Image.h:191
int offset
Definition: FilePCD.cpp:64
const Dtype Int64
Definition: Dtype.cpp:66
const Dtype UInt16
Definition: Dtype.cpp:68
const Dtype Bool
Definition: Dtype.cpp:71
const Dtype Int32
Definition: Dtype.cpp:65
const Dtype Int16
Definition: Dtype.cpp:64
const Dtype UInt8
Definition: Dtype.cpp:67
const Dtype Float64
Definition: Dtype.cpp:62
const Dtype Float32
Definition: Dtype.cpp:61
void Filter(const open3d::core::Tensor &src_im, open3d::core::Tensor &dst_im, const open3d::core::Tensor &kernel)
Definition: IPPImage.cpp:174
void FilterBilateral(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float value_sigma, float distance_sigma)
Definition: IPPImage.cpp:206
void FilterSobel(const core::Tensor &src_im, core::Tensor &dst_im_dx, core::Tensor &dst_im_dy, int kernel_size)
Definition: IPPImage.cpp:265
void Resize(const open3d::core::Tensor &src_im, open3d::core::Tensor &dst_im, t::geometry::Image::InterpType interp_type)
Definition: IPPImage.cpp:98
void Dilate(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size)
Definition: IPPImage.cpp:137
void To(const core::Tensor &src_im, core::Tensor &dst_im, double scale, double offset)
Definition: IPPImage.cpp:46
void FilterGaussian(const core::Tensor &src_im, core::Tensor &dst_im, int kernel_size, float sigma)
Definition: IPPImage.cpp:237
void RGBToGray(const core::Tensor &src_im, core::Tensor &dst_im)
Definition: IPPImage.cpp:75
Definition: PinholeCameraIntrinsic.cpp:35