-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6.1.cpp
More file actions
32 lines (22 loc) · 873 Bytes
/
6.1.cpp
File metadata and controls
32 lines (22 loc) · 873 Bytes
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
// Part6.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <vector>
#include <cxcore.h>
#include <cv.h>
#include <_highgui.h>
static CvMemStorage* storage = 0;
int main()
{
//##################################################################################
// упражнение 6.1
IplImage* src = cvLoadImage("../Part3/picture/88.png");
IplImage* dst = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 3);
float kernel[9] = { 0, 0, 1, 0, 1, 0, 1, 0, 0 };
CvMat kernel_matrix = cvMat(3, 3, CV_32FC1, kernel);
cvFilter2D(src, dst, &kernel_matrix);
cvNamedWindow("Square", CV_WINDOW_AUTOSIZE);
cvShowImage("Square", dst);
cvWaitKey(0);
cvDestroyWindow("Square");
}