Learning OpenCV: cvSmooth processing
来源:互联网 发布:mac 进程管理器 编辑:程序博客网 时间:2024/05/22 07:53
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
#include "cv.h"
#include "highgui.h"
int g_slider_position = 0;
CvCapture * g_capture = NULL;
void onTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture,CV_CAP_PROP_POS_FRAMES,pos);
}
int main(void)
{
cvNamedWindow("video",CV_WINDOW_AUTOSIZE);
g_capture = cvCreateFileCapture("E:\\test\\fish1.avi");
int frames = (int)cvGetCaptureProperty(g_capture,CV_CAP_PROP_FRAME_COUNT);
if(frames != 0)
{
cvCreateTrackbar("position","video",&g_slider_position,frames,onTrackbarSlide);
}
IplImage * frame = NULL;
frame = cvQueryFrame(g_capture);
if(g_capture == NULL)
{
cout<<"read video file error!"<<endl;
}
IplImage * outFrame = NULL;
outFrame = cvCreateImage(cvGetSize(frame),IPL_DEPTH_8U,frame->nChannels);
cvNamedWindow("outvideo",CV_WINDOW_AUTOSIZE);
while(1)
{
frame = cvQueryFrame(g_capture);
if(frame == NULL)
{
break;
}
cvShowImage("video",frame);
cvSmooth(frame,outFrame,CV_GAUSSIAN,3);
cvShowImage("outvideo",outFrame);
char c = cvWaitKey(33);
if(c == 27)
{
break;
}
}
cvReleaseCapture(&g_capture);
g_capture = NULL;
cvDestroyWindow("video");
cvDestroyWindow("outvideo");
cvReleaseImage(&outFrame);
outFrame = NULL;
return 0;
}
#include <iostream>
#include <fstream>
using namespace std;
#include "cv.h"
#include "highgui.h"
int g_slider_position = 0;
CvCapture * g_capture = NULL;
void onTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture,CV_CAP_PROP_POS_FRAMES,pos);
}
int main(void)
{
cvNamedWindow("video",CV_WINDOW_AUTOSIZE);
g_capture = cvCreateFileCapture("E:\\test\\fish1.avi");
int frames = (int)cvGetCaptureProperty(g_capture,CV_CAP_PROP_FRAME_COUNT);
if(frames != 0)
{
cvCreateTrackbar("position","video",&g_slider_position,frames,onTrackbarSlide);
}
IplImage * frame = NULL;
frame = cvQueryFrame(g_capture);
if(g_capture == NULL)
{
cout<<"read video file error!"<<endl;
}
IplImage * outFrame = NULL;
outFrame = cvCreateImage(cvGetSize(frame),IPL_DEPTH_8U,frame->nChannels);
cvNamedWindow("outvideo",CV_WINDOW_AUTOSIZE);
while(1)
{
frame = cvQueryFrame(g_capture);
if(frame == NULL)
{
break;
}
cvShowImage("video",frame);
cvSmooth(frame,outFrame,CV_GAUSSIAN,3);
cvShowImage("outvideo",outFrame);
char c = cvWaitKey(33);
if(c == 27)
{
break;
}
}
cvReleaseCapture(&g_capture);
g_capture = NULL;
cvDestroyWindow("video");
cvDestroyWindow("outvideo");
cvReleaseImage(&outFrame);
outFrame = NULL;
return 0;
}
0 0
- Learning OpenCV: cvSmooth processing
- Learning OpenCV 2.4.9 图像平滑 cvSmooth
- openCV平滑函数----cvSmooth
- opencv---cvSmooth部分源码
- Opencv中cvSmooth函数
- OpenCV--cvSmooth函数
- OPENCV Cvsmooth 函数
- opencv中的cvSmooth函数学习
- opencv中cvSmooth的操作
- Opencv cvSmooth平滑滤波函数
- openCV学习笔记--cvSmooth函数
- cvSmooth()
- openCV学习笔记(4)--cvSmooth函数
- Opencv cvSmooth 双边滤波 参数设置未解决问题
- OpenCV之cvSmooth函数平滑滤波
- opencv简单平滑变换:cvSmooth (5)
- openCV之cvSmooth高斯滤波器
- OpenCV之cvSmooth函数平滑滤波
- 蔡勒公式的推导过程
- [CSAPP笔记][第十章 系统级I/O]
- mysql 之 ERROR 1364 (HY000): Field 'ssl_ciphe
- ftp server 可以实现你的电脑里的某个文件夹的共享
- [转]Leveldb 实现原理
- Learning OpenCV: cvSmooth processing
- ACO在无线传感网络部分应用
- UIApplication的详细介绍
- java中的泛型
- LightOj 1028
- linux基本命令(39)——grep命令
- python字符编码
- 排序算法之插入排序
- 98-Combination Sum II