Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cv.h>
- #include "opencv2/highgui/highgui.hpp"
- #include <windows.h>
- int main(int argc, char *argv[])
- {
- __int64 Start;
- __int64 End;
- __int64 Freq;
- QueryPerformanceCounter((LARGE_INTEGER *)&Start);
- CvCapture* capture = cvCreateCameraCapture(0);
- if (!capture)
- {
- return 0;
- }
- QueryPerformanceCounter((LARGE_INTEGER *)&End);
- QueryPerformanceFrequency((LARGE_INTEGER *)& Freq);
- double time = (End Start) * 1000 / Freq;
- std::cout << "initialization time: " << time << " ms" << std::endl;
- int fps = 0;
- QueryPerformanceCounter((LARGE_INTEGER *)&Start);
- while (1)
- {
- ++fps;
- IplImage* frame = cvQueryFrame(capture);
- if (!frame)
- {
- break;
- }
- cvShowImage("images", frame);
- IplImage* image = cvCloneImage(frame);
- cvSmooth(frame, image, CV_BLUR, 5, 5);
- for (int y = 0; y<image>height; y++) // обнуление каналов данных
- {