本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}