当前位置: 首页>>代码示例>>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;未经允许,请勿转载。