函数原型:
/** @brief Pencil-like non-photorealistic line drawing
@param src Input 8-bit 3-channel image.
@param dst1 Output 8-bit 1-channel image.
@param dst2 Output image with the same size and type as src.
@param sigma_s %Range between 0 to 200.
@param sigma_r %Range between 0 to 1.
@param shade_factor %Range between 0 to 0.1.
*/
void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2,
float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f);
参数说明:
src-原图
dst1-输出图像,单通道,灰度图像
dst2-输出图像,与src同样的大小和类型;
sigma_s:范围0-200;
sigma_r:范围0-1;
shade_fator:范围0-0.1
使用效果:
原图:
输出图1:
输出图2: