src/Pipeline.cpp
void Pipeline::blur(cv::Mat &input, BlurType &type, double doubleRadius, cv::Mat &output) {
		int radius = (int)(doubleRadius + 0.5);
		int kernelSize;
		switch(type) {
			case BOX:
				kernelSize = 2 * radius + 1;
				cv::blur(input,output,cv::Size(kernelSize, kernelSize));
				break;
			case GAUSSIAN:
				kernelSize = 6 * radius + 1;
				cv::GaussianBlur(input, output, cv::Size(kernelSize, kernelSize), radius);
				break;
			case MEDIAN:
				kernelSize = 2 * radius + 1;
				cv::medianBlur(input, output, kernelSize);
				break;
			case BILATERAL:
				cv::bilateralFilter(input, output, -1, radius, radius);
				break;
        }
	}
/**
	 * Softens an image using one of several filters.
	 *
	 * @param input The image on which to perform the blur.
	 * @param type The blurType to perform.
	 * @param doubleRadius The radius for the blur.
	 * @param output The image in which to store the output.
	 */
Softens an image using one of several filters.
@param input The image on which to perform the blur.
@param type The blurType to perform.
@param doubleRadius The radius for the blur.
@param output The image in which to store the output.
Softens an image using one of several filters . @param input The image on which to perform the blur . @param type The blurType to perform . @param doubleRadius The radius for the blur . @param output The image in which to store the output .
void Pipeline::blur(cv::Mat &input, BlurType &type, double doubleRadius, cv::Mat &output) {
		int radius = (int)(doubleRadius + 0.5);
		int kernelSize;
		switch(type) {
			case BOX:
				kernelSize = 2 * radius + 1;
				cv::blur(input,output,cv::Size(kernelSize, kernelSize));
				break;
			case GAUSSIAN:
				kernelSize = 6 * radius + 1;
				cv::GaussianBlur(input, output, cv::Size(kernelSize, kernelSize), radius);
				break;
			case MEDIAN:
				kernelSize = 2 * radius + 1;
				cv::medianBlur(input, output, kernelSize);
				break;
			case BILATERAL:
				cv::bilateralFilter(input, output, -1, radius, radius);
				break;
        }
	}
void Pipeline :: blur ( cv :: Mat & input , BlurType & type , double doubleRadius , cv :: Mat & output ) { int radius = ( int ) ( doubleRadius + 0.5 ) ; int kernelSize ; switch ( type ) { case BOX : kernelSize = 2 * radius + 1 ; cv :: blur ( input , output , cv :: Size ( kernelSize , kernelSize ) ) ; break ; case GAUSSIAN : kernelSize = 6 * radius + 1 ; cv :: GaussianBlur ( input , output , cv :: Size ( kernelSize , kernelSize ) , radius ) ; break ; case MEDIAN : kernelSize = 2 * radius + 1 ; cv :: medianBlur ( input , output , kernelSize ) ; break ; case BILATERAL : cv :: bilateralFilter ( input , output , -1 , radius , radius ) ; break ; } }
Softens an image using one of several filters.
Softens an image using one of several filters .