From 15f80db67c067e9f059e4345d3ffb22c32b9a879 Mon Sep 17 00:00:00 2001 From: Tianshu Cheng Date: Tue, 8 Sep 2015 16:28:01 -0500 Subject: [PATCH] add image_contour_detection.h --- stim/cuda/conv2.cuh | 10 +++++----- stim/image/image_contour_detection.h | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 stim/image/image_contour_detection.h diff --git a/stim/cuda/conv2.cuh b/stim/cuda/conv2.cuh index b1d154e..4e778e5 100644 --- a/stim/cuda/conv2.cuh +++ b/stim/cuda/conv2.cuh @@ -32,8 +32,8 @@ namespace stim{ if(i < w && j < h){ - copy[idx] = tex2D(texObj, i+100, j+100); - return; + //copy[idx] = tex2D(texObj, i, j); + //return; //tex2D(texObj, i, j); @@ -54,7 +54,7 @@ namespace stim{ //T temp = img[y * w + x] * mask[yy * M + xx]; //sum += img[y * w + x] * mask[yy * M + xx]; - sum += tex2D(texObj, x, y);// * mask[yy * M + xx]; + sum += tex2D(texObj, x-50, y+100) * mask[yy * M + xx]; } } copy[idx] = sum; @@ -89,8 +89,8 @@ namespace stim{ // Specify texture object parameters struct cudaTextureDesc texDesc; //create a texture descriptor memset(&texDesc, 0, sizeof(texDesc)); //set all values in the texture descriptor to zero - texDesc.addressMode[0] = cudaAddressModeWrap; //use wrapping (around the edges) - texDesc.addressMode[1] = cudaAddressModeWrap; + texDesc.addressMode[0] = cudaAddressModeMirror; //use wrapping (around the edges) + texDesc.addressMode[1] = cudaAddressModeMirror; texDesc.filterMode = cudaFilterModePoint; //use linear filtering texDesc.readMode = cudaReadModeElementType; //reads data based on the element type (32-bit floats) texDesc.normalizedCoords = 0; //not using normalized coordinates diff --git a/stim/image/image_contour_detection.h b/stim/image/image_contour_detection.h new file mode 100644 index 0000000..1f82efb --- /dev/null +++ b/stim/image/image_contour_detection.h @@ -0,0 +1,7 @@ +//#include +//#include +//#include + +stim::image gaussian_derivative_filter_odd(stim::image image, float sigma, unsigned int sigma_n, unsigned int winsize, float theta, unsigned int w, unsigned int h); +stim::image func_mPb_theta(stim::image lab, float theta, unsigned int w, unsigned int h); +stim::image func_mPb(stim::image lab, unsigned int theta_n, unsigned int w, unsigned int h); \ No newline at end of file -- libgit2 0.21.4