OpenCV之滤镜&人脸美化(二) 边缘保留滤波

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huanghuangjin/article/details/81667712
EPF(边缘保留算法)
    高斯双边滤波
    均值迁移
    导向滤波(拓展库中)
    局部均方差(后面自己实现)

代码

#include "../common/common.hpp"

void main(int argc, char ** argv)
{
    // 做人脸美化算法都会拿这张图做测试,就看美化后,脸上水滴还在不在,图上的字还在不在等
    Mat src = imread(getCVImagesPath("/images/example.png"));
    imshow("src9-4", src);

    long st = getTickCount();
    Mat dst;
    bilateralFilter(src, dst, 0, 100, 15); // 双边滤波效果一般,而且耗时还很多,无法实时
    imshow("result", dst);
    long tt = getTickCount() - st;
    float time = (tt / getTickFrequency()) * 1000;
    printf("execution time(ms) : %.2f\n", time); // execution time(ms) : 11353.93   太耗时了

    waitKey(0);
}

效果图

这里写图片描述

猜你喜欢

转载自blog.csdn.net/huanghuangjin/article/details/81667712