Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
io
include
pcl
cuda
io
debayering.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2011, Willow Garage, Inc.
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions
9
* are met:
10
*
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* * Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following
15
* disclaimer in the documentation and/or other materials provided
16
* with the distribution.
17
* * Neither the name of Willow Garage, Inc. nor the names of its
18
* contributors may be used to endorse or promote products derived
19
* from this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*
34
* $Id$
35
*
36
*/
37
38
#pragma once
39
40
#include <pcl/cuda/point_cloud.h>
41
#include <pcl/io/openni_camera/openni_image.h>
42
43
namespace
pcl
44
{
45
namespace
cuda
46
{
47
48
struct
downsampleIndices
49
{
50
downsampleIndices
(
int
width
,
int
height
,
int
stride
)
51
:
width
(
width
),
height
(
height
),
stride
(
stride
)
52
{}
53
54
int
width
,
height
,
stride
;
55
56
__host__ __device__
57
bool
operator ()
(
int
i)
58
{
59
int
xIdx = i %
width
;
60
int
yIdx = i /
width
;
61
62
return
((xIdx %
stride
== 0) & (yIdx %
stride
== 0));
63
}
64
};
65
66
template
<
template
<
typename
>
class
Storage>
67
struct
DebayerBilinear
68
{
69
unsigned
width
;
70
unsigned
height
;
71
//static unsigned dataSize;
72
//static unsigned char* global_data; // has to be initialized only once!
73
//unsigned char* data;
74
unsigned
char
*
data
;
75
DebayerBilinear
(
unsigned
char
*bayer_image,
unsigned
width
,
unsigned
height
);
76
//DebayerBilinear (const openni_wrapper::Image::Ptr& bayer_image);
77
78
__inline__ __host__ __device__
OpenNIRGB
operator ()
(
int
index)
const
;
79
};
80
/*
81
struct DebayerEdgeAware
82
{
83
unsigned width;
84
unsigned height;
85
static unsigned dataSize;
86
static unsigned char* global_data; // has to be initialized only once!
87
unsigned char* data;
88
DebayerEdgeAware (const openni_wrapper::Image::Ptr& bayer_image);
89
~DebayerEdgeAware ();
90
91
__inline__ __host__ __device__ OpenNIRGB operator () (int index) const;
92
};
93
*/
94
template
<
template
<
typename
>
class
Storage>
95
class
DebayeringDownsampling
96
{
97
public
:
98
using
RGBImageType
=
typename
Storage<OpenNIRGB>::type;
99
void
100
compute
(
const
openni_wrapper::Image::Ptr
& bayer_image,
RGBImageType
& rgb_image)
const
;
101
};
102
103
template
<
template
<
typename
>
class
Storage>
104
struct
YUV2RGBKernel
105
{
106
unsigned
width
;
107
unsigned
height
;
108
unsigned
char
*
data
;
109
YUV2RGBKernel
(
unsigned
char
*yuv_image,
unsigned
width
,
unsigned
height
);
110
111
__inline__ __host__ __device__
OpenNIRGB
operator ()
(
int
index)
const
;
112
};
113
114
template
<
template
<
typename
>
class
Storage>
115
class
YUV2RGB
116
{
117
public
:
118
using
RGBImageType
=
typename
Storage<OpenNIRGB>::type;
119
void
120
compute
(
const
openni_wrapper::Image::Ptr
& yuv_image,
RGBImageType
& rgb_image)
const
;
121
};
122
123
template
<
template
<
typename
>
class
Storage>
124
class
Debayering
125
{
126
public
:
127
using
RGBImageType
=
typename
Storage<OpenNIRGB>::type;
128
void
129
computeBilinear
(
const
openni_wrapper::Image::Ptr
& bayer_image,
RGBImageType
& rgb_image)
const
;
130
131
//void
132
//computeEdgeAware (const openni_wrapper::Image::Ptr& bayer_image, thrust::host_vector<OpenNIRGB>& rgb_image) const;
133
134
//void
135
//computeEdgeAware (const openni_wrapper::Image::Ptr& bayer_image, thrust::device_vector<OpenNIRGB>& rgb_image) const;
136
};
137
138
}
// namespace
139
}
// namespace
openni_wrapper::Image::Ptr
pcl::shared_ptr< Image > Ptr
Definition
openni_image.h:61
pcl::cuda::DebayeringDownsampling
Definition
debayering.h:96
pcl::cuda::DebayeringDownsampling::compute
void compute(const openni_wrapper::Image::Ptr &bayer_image, RGBImageType &rgb_image) const
pcl::cuda::DebayeringDownsampling::RGBImageType
typename Storage< OpenNIRGB >::type RGBImageType
Definition
debayering.h:98
pcl::cuda::Debayering
Definition
debayering.h:125
pcl::cuda::Debayering::RGBImageType
typename Storage< OpenNIRGB >::type RGBImageType
Definition
debayering.h:127
pcl::cuda::Debayering::computeBilinear
void computeBilinear(const openni_wrapper::Image::Ptr &bayer_image, RGBImageType &rgb_image) const
pcl::cuda::YUV2RGB
Definition
debayering.h:116
pcl::cuda::YUV2RGB::RGBImageType
typename Storage< OpenNIRGB >::type RGBImageType
Definition
debayering.h:118
pcl::cuda::YUV2RGB::compute
void compute(const openni_wrapper::Image::Ptr &yuv_image, RGBImageType &rgb_image) const
pcl::cuda
Definition
eigen.h:100
pcl
Definition
convolution.h:46
pcl::cuda::DebayerBilinear::width
unsigned width
Definition
debayering.h:69
pcl::cuda::DebayerBilinear::DebayerBilinear
DebayerBilinear(unsigned char *bayer_image, unsigned width, unsigned height)
pcl::cuda::DebayerBilinear::data
unsigned char * data
Definition
debayering.h:74
pcl::cuda::DebayerBilinear::height
unsigned height
Definition
debayering.h:70
pcl::cuda::DebayerBilinear::operator()
__inline__ __host__ __device__ OpenNIRGB operator()(int index) const
pcl::cuda::OpenNIRGB
Simple structure holding RGB data.
Definition
point_cloud.h:56
pcl::cuda::YUV2RGBKernel::height
unsigned height
Definition
debayering.h:107
pcl::cuda::YUV2RGBKernel::data
unsigned char * data
Definition
debayering.h:108
pcl::cuda::YUV2RGBKernel::YUV2RGBKernel
YUV2RGBKernel(unsigned char *yuv_image, unsigned width, unsigned height)
pcl::cuda::YUV2RGBKernel::width
unsigned width
Definition
debayering.h:106
pcl::cuda::YUV2RGBKernel::operator()
__inline__ __host__ __device__ OpenNIRGB operator()(int index) const
pcl::cuda::downsampleIndices::operator()
__host__ __device__ bool operator()(int i)
Definition
debayering.h:57
pcl::cuda::downsampleIndices::height
int height
Definition
debayering.h:54
pcl::cuda::downsampleIndices::width
int width
Definition
debayering.h:54
pcl::cuda::downsampleIndices::downsampleIndices
downsampleIndices(int width, int height, int stride)
Definition
debayering.h:50
pcl::cuda::downsampleIndices::stride
int stride
Definition
debayering.h:54