#include #include #include #include //#include #include #include #include typedef unsigned int uint; //typedef unsigned int uchar; std::vector< stim::vec > find_branch(GLint texbufferID, GLenum texType, unsigned int x, unsigned int y) { float sigma = 2.0; unsigned int conn = 7; float threshold = 40.0; float* cpuCenters = (float*) malloc(x*y*sizeof(float)); int sizek = 7; stringstream name; cpuCenters = stim::cuda::get_centers(texbufferID, texType, x, y, sizek, sigma, conn, threshold); cudaDeviceSynchronize(); std::vector > output; cudaDeviceSynchronize(); for(int i = 0; i < x; i++) { for(int j = 0; j < y; j++) { int idx = x*j+i; if(cpuCenters[idx] != 0) { float x_v = (float) i; float y_v = (float) j; output.push_back(stim::vec((x_v/(float)x*360.0), (y_v), y_v/8)); } } } free(cpuCenters); return output; }