25 roi.height = image.
rows();
26 roi.width = image.
cols();
29 status = nppiCopy_8u_C1R(
31 blob->
count(2) *
static_cast<int>(
sizeof(uint8_t)), roi);
33 status = nppiCopy_8u_C3R(
35 blob->
count(2) *
static_cast<int>(
sizeof(uint8_t)), roi);
37 if (status != NPP_SUCCESS) {
44 const int src_width,
const int src_height,
45 const float coeffs[3]) {
48 roi.height = src_height;
49 roi.width = src_width;
50 status = nppiColorToGray_8u_C3C1R(src->gpu_data(), src->width_step(),
51 dst->mutable_gpu_data(), dst->width_step(),
53 if (status != NPP_SUCCESS) {
61 const int src_width,
const int src_height,
65 roi.height = src_height;
66 roi.width = src_width;
67 status = nppiSwapChannels_8u_C3R(src->gpu_data(), src->width_step(),
68 dst->mutable_gpu_data(), dst->width_step(),
70 if (status != NPP_SUCCESS) {
78 const int src_width,
const int src_height) {
81 roi.height = src_height;
82 roi.width = src_width;
83 status = nppiDup_8u_C1C3R(src->gpu_data(), src->width_step(),
84 dst->mutable_gpu_data(), dst->width_step(), roi);
85 if (status != NPP_SUCCESS) {
92 const int src_width,
const int src_height,
95 NppiInterpolationMode remap_mode = NPPI_INTER_LINEAR;
97 image_size.width = src_width;
98 image_size.height = src_height;
99 NppiRect remap_roi = {0, 0, src_width, src_height};
100 NppStatus status = NPP_SUCCESS;
101 int d_map_step =
static_cast<int>(map_x.
shape(1) *
sizeof(float));
104 status = nppiRemap_8u_C1R(src_img.
gpu_data(), image_size,
108 dst_img->
width_step(), image_size, remap_mode);
111 status = nppiRemap_8u_C3R(src_img.
gpu_data(), image_size,
115 dst_img->
width_step(), image_size, remap_mode);
121 if (status != NPP_SUCCESS) {
122 AERROR <<
"NPP_CHECK_NPP - status = " << status;
A wrapper around SyncedMemory holders serving as the basic computational unit for images,...
const Dtype * gpu_data() const
const std::vector< int > & shape() const
Dtype * mutable_gpu_data()
void Reshape(const int num, const int channels, const int height, const int width)
Deprecated; use Reshape(const std::vector<int>& shape).
A wrapper around Blob holders serving as the basic computational unit for images.
uint8_t * mutable_gpu_data()
const uint8_t * gpu_data() const
std::shared_ptr< Image8U > Image8UPtr
bool nppImageToGray(const base::Image8UPtr &src, const base::Image8UPtr &dst, const int src_width, const int src_height, const float coeffs[3])
bool nppDupImageChannels(const base::Image8UPtr &src, const base::Image8UPtr &dst, const int src_width, const int src_height)
bool nppImageRemap(const base::Image8U &src_img, base::Image8U *dst_img, const int src_width, const int src_height, const base::Blob< float > &map_x, const base::Blob< float > &map_y)
bool nppSwapImageChannels(const base::Image8UPtr &src, const base::Image8UPtr &dst, const int src_width, const int src_height, const int order[3])
bool nppImageToBlob(const base::Image8U &image, base::Blob< uint8_t > *blob)