28 #include <cuda_runtime.h>
44 unsigned int* uint_image_pixels,
float* float_image_pixels,
45 unsigned int width_images,
unsigned int height_images)
48 const unsigned int x_val = blockIdx.x * blockDim.x + threadIdx.x;
49 const unsigned int y_val = blockIdx.y * blockDim.y + threadIdx.y;
54 float_image_pixels[y_val*width_images + x_val] = (float)uint_image_pixels[y_val*width_images + x_val];;
61 template<BpImData_t T>
63 const T* image_to_filter,
float* filtered_image,
64 unsigned int width_images,
unsigned int height_images,
65 const float* image_filter,
unsigned int size_filter)
68 const unsigned int x_val = blockIdx.x * blockDim.x + threadIdx.x;
69 const unsigned int y_val = blockIdx.y * blockDim.y + threadIdx.y;
73 beliefprop::FilterImageAcrossProcessPixel<T>(x_val, y_val, image_to_filter, filtered_image,
74 width_images, height_images, image_filter, size_filter);
81 template<BpImData_t T>
83 const T* image_to_filter,
float* filtered_image,
84 unsigned int width_images,
unsigned int height_images,
85 const float* image_filter,
unsigned int size_filter)
88 const unsigned int x_val = blockIdx.x * blockDim.x + threadIdx.x;
89 const unsigned int y_val = blockIdx.y * blockDim.y + threadIdx.y;
93 beliefprop::FilterImageVerticalProcessPixel<T>(x_val, y_val, image_to_filter, filtered_image,
94 width_images, height_images, image_filter, size_filter);
Functions for smoothing input images that are used in both optimized CPU and CUDA implementations.
Contains namespace with utility functions for implementation.
Namespace to define global kernel functions for parallel belief propagation processing using CUDA.
__global__ void FilterImageAcross(const T *image_to_filter, float *filtered_image, unsigned int width_images, unsigned int height_images, const float *image_filter, unsigned int size_filter)
Kernel to apply a horizontal filter on each pixel of the image in parallel the input image is stored ...
__global__ void FilterImageVertical(const T *image_to_filter, float *filtered_image, unsigned int width_images, unsigned int height_images, const float *image_filter, unsigned int size_filter)
Kernel to apply a vertical filter on each pixel of the image in parallel the input image is stored as...
__global__ void convertUnsignedIntImageToFloat(unsigned int *uint_image_pixels, float *float_image_pixels, unsigned int width_images, unsigned int height_images)
ARCHITECTURE_ADDITION bool WithinImageBounds(unsigned int x_val, unsigned int y_val, unsigned int width, unsigned int height)
Checks if the current point is within the image bounds Assumed that input x/y vals are above zero sin...