资源简介
Opencv打开电脑自带USB摄像头,并调用模板匹配
代码片段和文件信息
//#include “StdAfx.h“
//#include “CvvImage.h“
//
//CvvImage::CvvImage(void)
//{
//}
//
//CvvImage::~CvvImage(void)
//{
//}
#include “stdafx.h“
#include “CvvImage.h“
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CV_INLINE RECT NormalizeRect( RECT r );
CV_INLINE RECT NormalizeRect( RECT r )
{
int t;
if( r.left > r.right )
{
t = r.left;
r.left = r.right;
r.right = t;
}
if( r.top > r.bottom )
{
t = r.top;
r.top = r.bottom;
r.bottom = t;
}
return r;
}
CV_INLINE CvRect RectToCvRect( RECT sr );
CV_INLINE CvRect RectToCvRect( RECT sr )
{
sr = NormalizeRect( sr );
return cvRect( sr.left sr.top sr.right - sr.left sr.bottom - sr.top );
}
CV_INLINE RECT CvRectToRect( CvRect sr );
CV_INLINE RECT CvRectToRect( CvRect sr )
{
RECT dr;
dr.left = sr.x;
dr.top = sr.y;
dr.right = sr.x + sr.width;
dr.bottom = sr.y + sr.height;
return dr;
}
CV_INLINE IplROI RectToROI( RECT r );
CV_INLINE IplROI RectToROI( RECT r )
{
IplROI roi;
r = NormalizeRect( r );
roi.xOffset = r.left;
roi.yOffset = r.top;
roi.width = r.right - r.left;
roi.height = r.bottom - r.top;
roi.coi = 0;
return roi;
}
void FillBitmapInfo( BITMAPINFO* bmi int width int height int bpp int origin )
{
assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32));
BITMAPINFOHEADER* bmih = &(bmi->bmiHeader);
memset( bmih 0 sizeof(*bmih));
bmih->biSize = sizeof(BITMAPINFOHEADER);
bmih->biWidth = width;
bmih->biHeight = origin ? abs(height) : -abs(height);
bmih->biPlanes = 1;
bmih->biBitCount = (unsigned short)bpp;
bmih->biCompression = BI_RGB;
if( bpp == 8 )
{
RGBQUAD* palette = bmi->bmiColors;
int i;
for( i = 0; i < 256; i++ )
{
palette[i].rgbBlue = palette[i].rgbGreen = palette[i].rgbRed = (BYTE)i;
palette[i].rgbReserved = 0;
}
}
}
CvvImage::CvvImage()
{
m_img = 0;
}
void CvvImage::Destroy()
{
cvReleaseImage( &m_img );
}
CvvImage::~CvvImage()
{
Destroy();
}
bool CvvImage::Create( int w int h int bpp int origin )
{
const unsigned max_img_size = 10000;
if( (bpp != 8 && bpp != 24 && bpp != 32) ||
(unsigned)w >= max_img_size || (unsigned)h >= max_img_size ||
(origin != IPL_ORIGIN_TL && origin != IPL_ORIGIN_BL))
{
assert(0); // most probably it is a programming error
return false;
}
if( !m_img || Bpp() != bpp || m_img->width != w || m_img->height != h )
{
if( m_img && m_img->nSize == sizeof(IplImage))
Destroy();
/* prepare IPL header */
m_img = cvCreateImage( cvSize( w h ) IPL_DEPTH_8U bpp/8 );
}
if( m_img )
m_img->origin = origin == 0 ? IPL_ORIGIN_TL : IPL_ORIGIN_BL;
return m_img != 0;
}
void CvvImage::CopyOf( CvvImage& image int desired_color )
{
IplImage* img = image.GetImage();
if( img )
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1598 2017-10-26 21:51 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\ClassDiagram1.cd
文件 6846 2011-12-13 19:52 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\CvvImage.cpp
文件 2350 2017-10-26 21:31 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\CvvImage.h
文件 107444 2017-10-28 21:52 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.aps
文件 2201 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.cpp
文件 538 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.h
文件 11384 2017-10-28 21:52 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.rc
文件 10448 2017-10-26 21:51 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.vcxproj
文件 2316 2017-10-26 21:51 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.vcxproj.filters
文件 222 2017-10-26 21:49 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImage.vcxproj.user
文件 19874 2017-10-28 21:57 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImageDlg.cpp
文件 1845 2017-10-28 21:45 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\OpenCV_OpenCameraImageDlg.h
文件 3298 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\ReadMe.txt
文件 67777 2009-08-31 02:31 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\res\OpenCV_OpenCameraImage.ico
文件 700 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\res\OpenCV_OpenCameraImage.rc2
文件 2406 2017-10-28 21:52 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\resource.h
文件 155 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\stdafx.cpp
文件 1632 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\stdafx.h
文件 234 2017-10-26 21:27 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\targetver.h
文件 3602 2017-10-28 21:58 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\x64\Debug\OpenCV_OpenCameraImage.Build.CppClean.log
文件 644 2017-10-28 21:58 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\x64\Debug\OpenCV_OpenCameraImage.log
文件 1287 2017-10-26 21:33 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage.sln
..A..H. 30208 2017-10-28 21:58 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage.suo
文件 53606 2017-10-26 16:11 OpenCV_OpenCameraImage_TemplateMatch\x64\Debug\mother.jpg
文件 49743 2017-10-27 11:07 OpenCV_OpenCameraImage_TemplateMatch\x64\Debug\mother2.jpg
文件 4475 2017-10-26 16:11 OpenCV_OpenCameraImage_TemplateMatch\x64\Debug\son.jpg
目录 0 2017-10-28 21:58 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\x64\Debug
目录 0 2017-10-28 21:58 OpenCV_OpenCameraImage_TemplateMatch\ipch\opencv_opencameraimage-24953b98
目录 0 2017-10-27 11:08 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\res
目录 0 2017-10-28 21:38 OpenCV_OpenCameraImage_TemplateMatch\OpenCV_OpenCameraImage\x64
............此处省略11个文件信息
相关资源
- opencv实现两幅图帧差
- opencv检查图片中是否有人
- OpenCV3编程入门及源码百度网盘链接
- 用opencv摄像头捕获识别颜色
- opencv_haartraining等可执行文件
- VS2013+OpenCV 2.4.9项目生成EXE文件如何在
- OPENCV条形码定位与识别
- opencv 三维建模点云详细
- 最全Opencv学习视频.txt
- opencv基础视频教程、实战项目视频.
- 贾志刚OpenCv视频教程
- TensorflowOpenCV.zip
- opencv410.zip
- nfc-emv (1)
- opencv4.0+相机标定+Qt5.9
- FreeType库
- 输送带在线故障识别方法与OpenCV实现
- 人脸识别正样本图片库
- OpenCv_人脸识别源代码
- opencv3.0 鱼眼镜头标定校正代码
- Linux下上QT实现人脸识别
- pb11.5+pbni+opencv249+zbar控制摄像头拍照
- Opencv Kmeans聚类进行图像颜色聚类分割
- 基于opencv的人体手臂识别
- opencv实现车辆速度检测.rar
- cmake-3.12.0
- OpenCV3.0实现SIFT特征提取+RANSAC剔除误匹
- Qt 5 and OpenCV 4 Computer Visi - Zhuo Qinglia
- xfeatures2d编译时提示缺的包
- opencv_contrib xfeatures2d vgg_generated
评论
共有 条评论