fixed big in gpu::HOGDescriptor, added property into CPU's HOGDescriptor

This commit is contained in:
Alexey Spizhevoy
2010-11-16 07:40:32 +00:00
parent e954577304
commit cc6a87fc9d
3 changed files with 11 additions and 9 deletions

View File

@@ -446,7 +446,7 @@ __global__ void compute_gradients_8UC4_kernel(int height, int width, const PtrEl
if (threadIdx.x == 0)
{
val = x > 0 ? row[x - 1] : row[x + 1];
val = x > 0 ? row[x - 1] : row[1];
sh_row[0] = val.x;
sh_row[(nthreads + 2)] = val.y;
sh_row[2 * (nthreads + 2)] = val.z;
@@ -454,7 +454,7 @@ __global__ void compute_gradients_8UC4_kernel(int height, int width, const PtrEl
if (threadIdx.x == blockDim.x - 1)
{
val = (x < width - 1) ? row[x + 1] : row[x - 1];
val = (x < width - 1) ? row[x + 1] : row[width - 2];
sh_row[blockDim.x + 1] = val.x;
sh_row[blockDim.x + 1 + (nthreads + 2)] = val.y;
sh_row[blockDim.x + 1 + 2 * (nthreads + 2)] = val.z;
@@ -553,10 +553,10 @@ __global__ void compute_gradients_8UC1_kernel(int height, int width, const PtrEl
sh_row[threadIdx.x + 1] = row[x - 2];
if (threadIdx.x == 0)
sh_row[0] = x > 0 ? row[x - 1] : row[x + 1];
sh_row[0] = x > 0 ? row[x - 1] : row[1];
if (threadIdx.x == blockDim.x - 1)
sh_row[blockDim.x + 1] = (x < width - 1) ? row[x + 1] : row[x - 1];
sh_row[blockDim.x + 1] = (x < width - 1) ? row[x + 1] : row[width - 2];
__syncthreads();
if (x < width)