资源简介
该程序实现打开工业相机采集的12位raw格式的图像,基于opencv编写的,注意配置opencv设置,在release文件夹里放了所需的opencv数据库!
代码片段和文件信息
#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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6402048 2012-12-31 09:54 ReadRaw\Debug\ReadRaw.exe
文件 15284324 2012-12-31 09:54 ReadRaw\Debug\ReadRaw.ilk
文件 27233280 2012-12-31 09:54 ReadRaw\Debug\ReadRaw.pdb
文件 674484 2012-03-20 17:36 ReadRaw\ReadRaw\0度偏振图像.tiff
文件 2895360 2012-10-31 17:38 ReadRaw\ReadRaw\Clear.raw
文件 7330 2011-03-12 20:37 ReadRaw\ReadRaw\cvvImage.cpp
文件 2057 2011-01-21 20:45 ReadRaw\ReadRaw\cvvImage.h
文件 8078 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\cl.command.1.tlog
文件 305842 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\CL.read.1.tlog
文件 4100 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\CL.write.1.tlog
文件 129881 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\cvvImage.obj
文件 2 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\li
文件 2 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\li
文件 5078 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\li
文件 15702 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\li
文件 2738 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\li
文件 2072 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\mt.command.1.tlog
文件 1976 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\mt.read.1.tlog
文件 426 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\mt.write.1.tlog
文件 2912 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\rc.command.1.tlog
文件 17504 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\rc.read.1.tlog
文件 1190 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\rc.write.1.tlog
文件 915 2012-11-08 20:12 ReadRaw\ReadRaw\Debug\ReadRaw.exe.em
文件 980 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.exe.em
文件 640 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.exe.intermediate.manifest
文件 49 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.lastbuildstate
文件 2641 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.log
文件 129627 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.obj
文件 33292288 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.pch
文件 79952 2012-12-31 09:54 ReadRaw\ReadRaw\Debug\ReadRaw.res
............此处省略89个文件信息
相关资源
- opencv3.1.0+opencv_contrib利用vs2013编译完成
- draw.io-12.4.2绘图最新
- goturn.caffemodel & goturn.prototxt
- ubuntu下安装opencv3.4.7+opencv_contrib3.4.7所
- VScode+opencv3.4+mingw5.3+cmake-3.9.0.rar
- Delphi-OpenCV-master delphi2010-XE8可用的O
- OpenCV 3.2.0 官方文档 高清.pdf版
- 随意VS版本+opencv3.4.1+opencv_contrib3.4.1
- opencv420_cuda_dnn编译_install文件.zip
- facerecognize.zip
- 性别年龄模块包.zip
- opencv_contrib-master
- DrawPanel_mainfile.zip
- 基于机器视觉的交通标志识别系统
- opencv-2.4.9.zip
- OpenCV3编程入门(完整版).pdf+配套源
- OpenCV3编程入门电子书PDF
- opencv3.2.0在VS2015下的编译库(包含32位
- 利用opencv进行双目图像采集,并进行
- Fashion-MNIST.zip包括raw和processed文件夹
- OpenCV-2.4.3
- 学习OpenCV中文版(高清扫描版)()
- opencv 2.4.10
- opencv 3.1.0.rar
- opencv-3.1.0-windows版本
- OpenCV图像拼接原理解析和分模块实现
- 基于OpenCV的视频车速监测
- opencv-4.1.0-vc14_vc15.rar
- opencv-2.4.13.6-vc14.exe
- Opencv3.4.3+opencv_contrib
评论
共有 条评论