opencv基本图像操作
来源:互联网 发布:网络预约出租车运输证 编辑:程序博客网 时间:2024/04/26 10:43
// Basic_OpenCV_2.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include "cv.h"#include "highgui.h"using namespace std;void SmoothImage(IplImage* image)//平滑函数{cvNamedWindow("Smooth_in");cvNamedWindow("Smooth_out");cvShowImage("Smooth_in",image);IplImage* out = cvCreateImage(cvGetSize(image),IPL_DEPTH_8U,3);cvSmooth(image,out,CV_BLUR,32,32);//平滑函数,后面两个参数是窗口大小cvShowImage("Smooth_out",out);cvReleaseImage(&out);cvWaitKey(0);cvDestroyAllWindows();}void doPyrDown(IplImage* in, int filter = IPL_GAUSSIAN_5x5)//图像缩小为一半{//Best to make sure input image is divisible by two.assert(in->width%2 == 0 && in->height%2 == 0);IplImage* out = cvCreateImage(cvSize(in->width/2 , in->height/2) , in->depth , in->nChannels);cvPyrDown(in , out);cvNamedWindow("PyrDown_out");cvShowImage("PyrDown_out",out);cvReleaseImage(&out);cvWaitKey(0);cvDestroyAllWindows();//return out;}void doCanny(IplImage* in , double lowThresh , double highThresh , double aperture){IplImage* out = cvCreateImage(cvSize(in->width,in->height) , IPL_DEPTH_8U , 1);if(in->nChannels != 1){//cout<<"error! unsupported format or combination of formats() in unknown function"<<endl;//return;//canny only handles gray scale image//若不是灰度图,直接转化成灰度图IplImage* gray = cvCreateImage(cvGetSize(in), IPL_DEPTH_8U, 1); cvCvtColor(in, gray, CV_BGR2GRAY);out = gray;}cvCanny(in , out , lowThresh , highThresh , aperture );cvNamedWindow("Canny_out");cvShowImage("Canny_out",out);cvReleaseImage(&out);cvWaitKey(0);cvDestroyAllWindows();}int _tmain(int argc, _TCHAR* argv[]){IplImage* image = cvLoadImage("lena.jpg");//SmoothImage(image);//doPyrDown(image);doCanny(image ,10 , 100 , 3 );system("pause");return 0;}
- opencv基本图像操作
- opencv图像基本操作
- opencv-图像基本操作
- OpenCV-图像基本操作
- opencv图像处理基本操作
- OpenCV之图像基本操作
- OPencv图像处理基本操作
- opencv图像基本操作算法
- OpenCV-图像的基本操作
- opencv图像处理基本操作
- opencv(9)---图像基本操作
- opencv(c++)-图像基本操作
- opencv-图像处理1 图像基本操作
- OpenCV随笔002-图像的基本操作
- OpenCV(四)图像的基本操作
- python+opencv实操-图像基本操作
- 图像处理matlab+OpenCV基本操作
- opencv基本操作 图像的卷积
- ffmpeg source code analyse - macro - MATCH_PER_TYPE_OPT
- Session和Cookie小结以及PHP单点登陆的实现
- log4j未写日志排错
- 转载:RAID相关内容
- 《黑马程序员》java IO流基本操作(3)
- opencv基本图像操作
- 每天一个linux命令(6):rmdir 命令
- Annotation
- Matlab代码的分析、优化和加速
- [Java] final 关键字
- 修改linux的默认运行级别
- 每天一个linux命令(7):mv命令
- TI CC2540/2541 Bluetooth Low Energy Software Developer's Guide第二章
- cygwin 重装的 download incomplete try again解决方案