-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path26_Sharpen_Filter.cpp
37 lines (27 loc) · 946 Bytes
/
26_Sharpen_Filter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<iostream>
using namespace std;
using namespace cv;
// Trackbar kullanarak Sharpen uygulayalim ;
// ilk olarak GaussianBlur filtresi ile duzlestirme yaparak resimdeki gurultulerden kurtulucaz,
// sonrasinda ise duzlestirilmis resimde addWeighted ile keskinlestirme yapicaz.
Mat orgimg, dst;
int trackValue = 1;
void track(int, void* )
{
addWeighted(orgimg, trackValue / 7.0, dst, -0.5, 0, dst); // Sharpen
imshow("addWighted", dst);
}
int main()
{
orgimg = imread("image.jpg");
resize(orgimg, orgimg, Size(400, 600)); // hiz kazanmak icin yeniden boyutlandiralim
GaussianBlur(orgimg, dst, Size(3, 3), 10); // Gaussian Filter
namedWindow("Trackbar", WINDOW_AUTOSIZE);
createTrackbar("Sharpen", "Trackbar", &trackValue, 100, track); // trackbar
imshow("original image", orgimg);
waitKey(0);
return 0;
}