Changes

Jump to: navigation, search

BarraCUDA Boiz

385 bytes removed, 00:27, 12 April 2017
Analysis
The kernels:
setSamples - goes through the entire image and collects samples from the image (the current pixel and the next x number of pixels).
__global__ void setSamples(cv::cuda::PtrStepSz<float> samples, cv::cuda::PtrStepSz<uchar> img, int dimC) {
int i = blockIdx.y*blockDim.y + threadIdx.y;
}
}
 
calculateDistance - goes through the image and computes the difference between the samples and the centers from the input image.
__global__ void calculateDistance(cv::cuda::PtrStepSz<float> centers, cv::cuda::PtrStepSz<float> samples, int k, int N, int dim, double* minval, float* D) {
}
__global__ void sampleClassification(cv::cuda::PtrStepSz<int> indices, cv::cuda::PtrStepSz<int> count, cv::cuda::PtrStepSz<float> centers, cv::cuda::PtrStepSz<float> samples, int N, int ncluster, int dim) { // Sample classification int col = blockIdx.x * blockDim.x + threadIdx.x; int row = blockIdx.y * blockDim.y + threadIdx.y; int i = col + row * N; if (i >= N) return; double minidx = 0; double minval = 1000000000; for generateImage - takes the modified image and then writes it to the file using the function "out(int k = 0; k<ncluster; k++) { double dist = 0".0; for (int d = 0; d<dim; d++) { float diff = centers(k, d) - samples(i, d); dist += diff * diff; } if (minval > dist) { minval = dist; minidx = k; } } indices(i, 0) = (int)minidx; count((int)minidx, 0) += 1; }
__global__ void generateImage(cv::cuda::PtrStepSz<uchar> out, cv::cuda::PtrStepSz<int> indices, cv::cuda::PtrStepSz<float> centers, int dim) {
36
edits

Navigation menu