 // each input image.
 // For each channel in each image, the mean and stddev has
 // already been calculated
-// For each pixel, subtract the mean and divide by the stddev
+// For each channel in each pixel, subtract the mean and divide by the stddev
 __global__ void global_contrast_normalization_kernel(const cv::gpu::PtrStepSz<float> *input,
 									const float *mean,
 									const float *stddev,

	const int zIndex = blockIdx.z * blockDim.z + threadIdx.z;

	//Only valid threads perform memory I/O
	if((xIndex<cols) && (yIndex<rows))
	{
		// yIndex * cols = number of floats per complete
		// filled row

	// Each image it its own zIndex
	const int zIndex = blockIdx.z * blockDim.z + threadIdx.z;

	// Insure only valid threads perform memory I/O
	// If the x/y index for this thread is beyond the
	// number of cols/rows, do nothing
	if((xIndex < input[zIndex].cols) && (yIndex < input[zIndex].rows))
	{
		// xIndex * 3 since col has a blue green and red component
		float blue	= input[zIndex](yIndex, 3 * xIndex);
