资源简介
开发环境为VS2010+opencv2.4.9,图像伪彩色增强,包括强度分层法、灰度级-彩色变换法、频域变换法。

代码片段和文件信息
#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 )
{
CopyOf( img desired_color );
}
}
#define HG_IS_IMAGE(img) \
((img) != 0 && ((const IplImage*)(img))->nSize ==
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 29696 2018-03-20 21:56 Gray2RGB\.vs\Gray2RGB\v14\.suo
文件 6651 2014-12-20 13:57 Gray2RGB\Gray2RGB\CvvImage.cpp
文件 1931 2013-08-27 21:06 Gray2RGB\Gray2RGB\CvvImage.h
文件 17752 2014-12-20 14:02 Gray2RGB\Gray2RGB\CV_picture.cpp
文件 5738 2014-12-20 15:14 Gray2RGB\Gray2RGB\CV_picture.h
文件 157894 2017-10-24 21:45 Gray2RGB\Gray2RGB\gray.bmp
文件 106212 2017-10-23 20:35 Gray2RGB\Gray2RGB\Gray2RGB.aps
文件 2019 2017-09-28 10:22 Gray2RGB\Gray2RGB\Gray2RGB.cpp
文件 454 2017-09-28 10:22 Gray2RGB\Gray2RGB\Gray2RGB.h
文件 11536 2017-10-23 20:35 Gray2RGB\Gray2RGB\Gray2RGB.rc
文件 7174 2018-03-20 21:55 Gray2RGB\Gray2RGB\Gray2RGB.vcxproj
文件 2363 2017-09-28 10:35 Gray2RGB\Gray2RGB\Gray2RGB.vcxproj.filters
文件 143 2017-09-28 10:22 Gray2RGB\Gray2RGB\Gray2RGB.vcxproj.user
文件 10971 2017-10-25 17:19 Gray2RGB\Gray2RGB\Gray2RGBDlg.cpp
文件 1547 2017-10-25 15:56 Gray2RGB\Gray2RGB\Gray2RGBDlg.h
文件 3032 2017-09-28 10:22 Gray2RGB\Gray2RGB\ReadMe.txt
文件 67777 2009-08-31 02:31 Gray2RGB\Gray2RGB\res\Gray2RGB.ico
文件 672 2017-09-28 10:22 Gray2RGB\Gray2RGB\res\Gray2RGB.rc2
文件 2006 2017-10-23 20:34 Gray2RGB\Gray2RGB\resource.h
文件 141 2017-09-28 10:22 Gray2RGB\Gray2RGB\stdafx.cpp
文件 1632 2017-09-28 10:22 Gray2RGB\Gray2RGB\stdafx.h
文件 234 2017-09-28 10:22 Gray2RGB\Gray2RGB\targetver.h
..A..H. 52 2017-10-25 17:10 Gray2RGB\Gray2RGB.opensdf
文件 891 2017-09-28 10:22 Gray2RGB\Gray2RGB.sln
..A..H. 15872 2017-10-25 17:16 Gray2RGB\Gray2RGB.suo
文件 28 2017-10-25 16:38 Gray2RGB\Readme.txt
文件 108544 2017-09-28 11:18 Gray2RGB\Release\Gray2RGB.exe
文件 5319680 2017-09-28 11:18 Gray2RGB\Release\Gray2RGB.pdb
目录 0 2018-05-25 14:11 Gray2RGB\.vs\Gray2RGB\v14
目录 0 2018-05-25 14:11 Gray2RGB\.vs\Gray2RGB
............此处省略13个文件信息
- 上一篇:MINGHUE-CSDN留言源码.rar
- 下一篇:模拟电子电路王远答案
相关资源
- 基于STM32平台配置OV7620摄像头,并采集
- 图像标准测试灰度图片
- 最简单的基于FFmpeg的libswscale的教程
- jpeglib读取jpeg,转为bmp图,24真彩和灰
- OpenCV中对图片进行灰度处理
- 互联网灰度部署系统解决方案
- opencv彩色视频以灰度格式和极坐标格
- 国际标准测试图像
- 图像镶嵌代码
- 基于FPGA图像处理灰度图像变换
- RGB与IHS间转换及灰度化
- 灰度共生矩阵下的遥感图像分类处理
- 对灰度图像做差
- 灰度图像的中值滤波算法verilog实现
- lenaboatbabooncamerahouse标准灰度图像库
- 从摄像头提取视频文件
- 基于FPGA的灰度图中值滤波
- 基于FPGA的彩色图片转灰度实现
- 数字图像处理经典图像灰度、彩色
- FPGA的RGB转灰度
- 图像处理标准图像库灰度、彩色、纹
- 灰度直方图寻找波峰
- lena等37张经典灰度图
- 图像的点运算(包括图像反色,灰度
- 基于Tsallis熵的图像分割方法
- 笔记本OpenCV调用摄像头进行人脸捕捉
- 数字图像处理数据集一-BSD68
- 成都市dem灰度图
- 灰度图像基本处理,包括二值化和求
- KITTI数据集介绍
评论
共有 条评论