资源简介
该程序已经在VS2010上跑通,具有一定的参考价值,希望能够帮助到有需要的朋友!!另:如果程序由于上传或者其他原因出现了不能使用的问题,请联系我,如果在使用中遇到了什么问题,也请联系我,由衷的希望可以和各位朋友们一起讨论,共同进步!!
代码片段和文件信息
#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(
相关资源
- OpenCV_world330.lib
- win32平台的opencv3.4.2
- 基于Openmesh的孔洞修补算法
- OpenCV2.1安装包
- 深入理解OpenCV:实用计算机视觉项目
- 学习OpenCV(中文版)pdf文档+源码
- 学习opencv 中文版及源码
- opencv-3.3.1 for vs2013
- OpenCV3.2编译文件
- QtOpencvImageGUI
- OpenCV实现多目三维重建
- opencv2.4.13lib_x86_x64_vs2013
- 形状匹配find_scaled_shape_model
- OpenCV 3.3_x86_minGW_world
- Opencv-stitcher基本原理参考文献
- opencv调用海康威视摄像头源代码内大
- 配合单文档调用opencv的代码
- 基于机器学习的车牌识别研究
- opencv SVM图分类训练图片和测试图片
- QT+opencv的图像处理
- HOG+Adaboost级联分类器训练代码
- VS+QT+Opencv可视化编程
- VS2010自带的图片库,包含许多按钮的
- 最全的OpenCV源代码
- 基于Opencv的红外运动目标识别与跟踪
- mingw编译的opencv库
- 基于颜色车牌识别
- 基于ORB算法的特征提取和匹配(VS20
- 基于SIFT算法的特征提取(VS2015+OpenC
- 超像素分割SLIC(简单线性迭代聚类)
评论
共有 条评论