當前位置: 首頁>>代碼示例>>Java>>正文


Java Imgproc.bilateralFilter方法代碼示例

本文整理匯總了Java中org.opencv.imgproc.Imgproc.bilateralFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java Imgproc.bilateralFilter方法的具體用法?Java Imgproc.bilateralFilter怎麽用?Java Imgproc.bilateralFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.opencv.imgproc.Imgproc的用法示例。


在下文中一共展示了Imgproc.bilateralFilter方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: blur

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
/**
 * 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.
 */
private void blur(Mat input, BlurType type, double doubleRadius, Mat output) {
	int radius = (int) (doubleRadius + 0.5);
	int kernelSize;
	switch (type) {
	case BOX:
		kernelSize = 2 * radius + 1;
		Imgproc.blur(input, output, new Size(kernelSize, kernelSize));
		break;
	case GAUSSIAN:
		kernelSize = 6 * radius + 1;
		Imgproc.GaussianBlur(input, output, new Size(kernelSize, kernelSize), radius);
		break;
	case MEDIAN:
		kernelSize = 2 * radius + 1;
		Imgproc.medianBlur(input, output, kernelSize);
		break;
	case BILATERAL:
		Imgproc.bilateralFilter(input, output, -1, radius, radius);
		break;
	}
}
 
開發者ID:chopshop-166,項目名稱:frc-2017,代碼行數:34,代碼來源:Vision.java

示例2: blur

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
/**
 * 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.
 */
private void blur(Mat input, BlurType type, double doubleRadius,
	Mat output) {
	int radius = (int)(doubleRadius + 0.5);
	int kernelSize;
	switch(type){
		case BOX:
			kernelSize = 2 * radius + 1;
			Imgproc.blur(input, output, new Size(kernelSize, kernelSize));
			break;
		case GAUSSIAN:
			kernelSize = 6 * radius + 1;
			Imgproc.GaussianBlur(input,output, new Size(kernelSize, kernelSize), radius);
			break;
		case MEDIAN:
			kernelSize = 2 * radius + 1;
			Imgproc.medianBlur(input, output, kernelSize);
			break;
		case BILATERAL:
			Imgproc.bilateralFilter(input, output, -1, radius, radius);
			break;
	}
}
 
開發者ID:trc492,項目名稱:Ftc2018RelicRecovery,代碼行數:30,代碼來源:GripPipeline.java

示例3: blur

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
/**
 * 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.
 */
private void blur(Mat input, Blur.Type type, double doubleRadius,
	Mat output) {
	int radius = (int)(doubleRadius + 0.5);
	int kernelSize;
	switch(type){
		case BOX:
			kernelSize = 2 * radius + 1;
			Imgproc.blur(input, output, new Size(kernelSize, kernelSize));
			break;
		case GAUSSIAN:
			kernelSize = 6 * radius + 1;
			Imgproc.GaussianBlur(input,output, new Size(kernelSize, kernelSize), radius);
			break;
		case MEDIAN:
			kernelSize = 2 * radius + 1;
			Imgproc.medianBlur(input, output, kernelSize);
			break;
		case BILATERAL:
			Imgproc.bilateralFilter(input, output, -1, radius, radius);
			break;
	}
}
 
開發者ID:KHS-Robotics,項目名稱:DemonVision,代碼行數:30,代碼來源:DefaultPipeline.java

示例4: blur

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
/**
 * 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.
 */
private void blur(Mat input, BlurType type, double doubleRadius, Mat output) {
  int radius = (int) (doubleRadius + 0.5);
  int kernelSize;
  switch (type) {
    case BOX:
      kernelSize = 2 * radius + 1;
      Imgproc.blur(input, output, new Size(kernelSize, kernelSize));
      break;
    case GAUSSIAN:
      kernelSize = 6 * radius + 1;
      Imgproc.GaussianBlur(input, output, new Size(kernelSize, kernelSize), radius);
      break;
    case MEDIAN:
      kernelSize = 2 * radius + 1;
      Imgproc.medianBlur(input, output, kernelSize);
      break;
    case BILATERAL:
      Imgproc.bilateralFilter(input, output, -1, radius, radius);
      break;
  }
}
 
開發者ID:cyborgs3335,項目名稱:STEAMworks,代碼行數:34,代碼來源:GripPipelineWithBlur.java

示例5: apply_filters

import org.opencv.imgproc.Imgproc; //導入方法依賴的package包/類
public Mat apply_filters(Mat input_mat) {
    Mat blurred = new Mat();
    Mat edges = new Mat();
    Mat structure = new Mat();
    Imgproc.GaussianBlur(input_mat,blurred,new Size(3,3),1); //Jack-ify the image
    Imgproc.bilateralFilter(blurred,blurred,11,17,17);
    Imgproc.Canny(blurred,edges,20,50);
    structure = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,new Size(45,45));
    Imgproc.morphologyEx(edges,edges,Imgproc.MORPH_CLOSE,structure);
    return edges;
}
 
開發者ID:SCHS-Robotics,項目名稱:Team9261-2017-2018,代碼行數:12,代碼來源:GlyphDetector.java


注:本文中的org.opencv.imgproc.Imgproc.bilateralFilter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。