Opencv non-realistic rendering picture special effects processing

Non-Photorealistic Rendering (Non-Photorealistic Rendering), also known as artistic rendering, common effects include lead sketch, watercolor painting, etc.

  1. Edge smoothing
Mat src = imread( "apple.jpg", IMREAD_COLOR);
imshow("src",src);

// 边缘保持平滑,type 1、使用标准化卷积滤波器,2、使用递归过滤器
int type = 1;
edgePreservingFilter(src,img,type);
imshow("Edge Preserve Smoothing",img);

  1. Detail enhancement processing
// 细节增强,使图像更清晰
detailEnhance(src,img);
imshow("Detail Enhanced",img);

Insert picture description here

  1. Pencil, watercolor
Mat img1;
        
// 铅笔素描/彩色铅笔画
pencilSketch(src,img1, img, 20 , 0.3f, 0.03f);
imshow("Pencil Sketch",img1);
imshow("Color Pencil Sketch",img);

Insert picture description here

  1. Stylization
// 风格化滤波器产生的输出图像看起来像使用水彩绘制的图像
stylization(src,img);
imshow("Stylization",img);

Insert picture description here


Guess you like

Origin blog.csdn.net/pyt1234567890/article/details/109719527
Recommended