大概是用opencv 的 gaussion blue
Ref : https://cg2010studio.com/2012/05/24/opencv-%E5%BD%B1%E5%83%8F%E6%A8%A1%E7%B3%8A%E5%8C%96-image-smoothing/
for
(
int
i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 )
{ bilateralFilter ( src, dst, i, i*2, i/2 );
if
(i==THRESHOLD)
imwrite(
"girl_Bilateral.jpg"
, dst );
if
( display_dst( DELAY_BLUR ) != 0 ) {
return
0; } }
原圖:
經過
BILATERAL BLUR
java 的版本
Ref : http://stackoverflow.com/questions/20753130/opencvandroid-imgproc-gaussianblur-application-stopped
Mat mat = inputFrame.gray();
org.opencv.core.Size s = new Size(3,3);
Imgproc.GaussianBlur(mat, mat, s, 2);
return mat;
public GaussianBlur Test{ | |
public static void main(String[] args){ | |
System.loadLibrary(Core.NATIVE_LIBRARY_NAME); | |
Mat im = Imgcodecs.imread("test.jpg"); // 入力画像の取得 | |
Mat dst = new Mat(); | |
Imgproc.GaussianBlur(im, dst, new Size(5, 5) ,1 ,1); | |
Imgcodecs.imwrite("test2.jpg", dst); // 出力画像の保存 | |
} | |
} |
沒有留言:
張貼留言