5
* Siddharth Kherada <siddharthkherada27[at]gmail[dot]com>
7
* This tutorial demonstrates how to use OpenCV Non-Photorealistic Rendering Module.
8
* 1) Edge Preserve Smoothing
9
* -> Using Normalized convolution Filter
10
* -> Using Recursive Filter
11
* 2) Detail Enhancement
12
* 3) Pencil sketch/Color Pencil Drawing
18
#include "opencv2/photo.hpp"
19
#include "opencv2/imgproc.hpp"
20
#include "opencv2/highgui.hpp"
21
#include "opencv2/core.hpp"
28
int main(int argc, char* argv[])
32
cout << "usage: " << argv[0] << " <Input image> " << endl;
38
Mat I = imread(argv[1]);
42
cout << "Image not found" << endl;
47
cout << " Edge Preserve Filter" << endl;
48
cout << "----------------------" << endl;
50
cout << "Options: " << endl;
53
cout << "1) Edge Preserve Smoothing" << endl;
54
cout << " -> Using Normalized convolution Filter" << endl;
55
cout << " -> Using Recursive Filter" << endl;
56
cout << "2) Detail Enhancement" << endl;
57
cout << "3) Pencil sketch/Color Pencil Drawing" << endl;
58
cout << "4) Stylization" << endl;
61
cout << "Press number 1-4 to choose from above techniques: ";
70
cout << "Press 1 for Normalized Convolution Filter and 2 for Recursive Filter: ";
74
edgePreservingFilter(I,img,type);
75
imshow("Edge Preserve Smoothing",img);
81
imshow("Detail Enhanced",img);
86
pencilSketch(I,img1, img, 10 , 0.1f, 0.03f);
87
imshow("Pencil Sketch",img1);
88
imshow("Color Pencil Sketch",img);
93
imshow("Stylization",img);