CvImage类参考手册
Wikipedia,自由的百科全书
CvImage使用前需要包含 cv.h 头文件
#include <cv.h>
[编辑]
CvImage::CvImage
bool CvImage::CvImage(); bool CvImage::CvImage(CvSize size, int depth, int channels); bool CvImage::CvImage(IplImage* pIplImg); bool CvImage::CvImage(const CvImage& cvImg); bool CvImage::CvImage(const char* filename, const char* imgname=0, int color=-1); bool CvImage::CvImage(CvFileStorage* fs, const char* mapname, const char* imgname); bool CvImage::CvImage(CvFileStorage* fs, const char* seqname, int idx);
默认构造函数,创建一个图像。影象对应的数据在析构的时候自动被释放。
- size
- 图像大小
- depth
- 像素深度
- channels
- 通道数
- pIplImg
- IplImage结构影象
- cvImg
- CvImage对象的引用
- filename
- 文件名字
- imgname
- 图片的别名
- color
- 暂无
- fs
- 暂无
- mapname
- 暂无
- seqname
- 存储队列的名字
- idx
- 数据存储中的索引
[编辑]
CvImage::~CvImage
CvImage::~CvImage();
析构函数。
[编辑]
CvImage::clone
CvImage CvImage::clone();
生成当前影象的一个copy。
[编辑]
CvImage::create
void CvImage::create(CvSize size, int depth, int channels);
创建一个影象。
- size
- 图像大小
- depth
- 像素深度
- channels
- 通道数
[编辑]
CvImage::release
void CvImage::release();
释放一个打开的影象。
[编辑]
CvImage::clear
void CvImage::clear();
释放一个打开的影象。和release功能相同。
[编辑]
CvImage::attach
void CvImage::attach(IplImage* img, bool use_refcount=true);
将一个影象和当前对象绑定。如果使用引用计数,则引用计数增加1。 当引用计数减少到0的时候释放img对应的内存。
- img
- 图像数据
- use_refcount
- 是否使用引用计数
[编辑]
CvImage::detach
void CvImage::detach();
取消当前对象绑定的数据。如果使用引用计数,则引用计数减少1。 当引用计数减少到0的时候释放img对应的内存。
[编辑]
CvImage::load
bool CvImage::load(const char* filename, const char* imgname=0, int color=-1);
暂无。
[编辑]
CvImage::read
bool CvImage::read(CvFileStorage* fs, const char* mapname, const char* imgname ); bool CvImage::read(CvFileStorage* fs, const char* seqname, int idx);
暂无。
[编辑]
CvImage::save
void CvImage::save(const char* filename, const char* imgname);
暂无。
[编辑]
CvImage::write
void CvImage::write(CvFileStorage* fs, const char* imgname);
暂无。
[编辑]
CvImage::show
void CvImage::show(const char* window_name);
在指定窗口中显示图像。
- window_name
- 窗口的名字。
[编辑]
CvImage::is_valid
bool CvImage::is_valid();
当前对象是否已经帮定了有效的影象。是返回true,否返回false。
[编辑]
CvImage::width
int CvImage::width()const;
返回影象的宽度。没有影象的话返回0。
[编辑]
CvImage::height
int CvImage::height()const;
返回影象的高度。没有影象的话返回0。
[编辑]
CvImage::size
CvSize CvImage::size()const;
返回影象的尺寸。没有影象的话返回cvSize(0,0)。
[编辑]
CvImage::roi_size
CvSize CvImage::roi_size()const;
返回影象的ROI区域大小。没有影象的话返回cvSize(0,0)。
[编辑]
CvImage::roi
CvRect CvImage::roi()const;
返回影象的ROI区域。没有影象的话返回cvRect(0,0,0,0)。
[编辑]
CvImage::coi
int CvImage::coi()const;
返回影象的COI。没有影象的话返回0。
[编辑]
CvImage::set_roi
void CvImage::set_roi(CvRect roi);
设置影象的ROI。
- roi
- ROI区域。
[编辑]
CvImage::reset_roi
void CvImage::reset_roi();
重置影象的ROI。
[编辑]
CvImage::set_coi
void CvImage::set_coi();
返回影象的COI。
[编辑]
CvImage::depth
int CvImage::depth();
返回像素的深度。没有影象的话返回0。
[编辑]
CvImage::channels
int CvImage::channels();
返回影象通道数。没有影象的话返回0。
[编辑]
CvImage::pix_size
int CvImage::pix_size();
返回影象像素的大小。值等于像素深度乘以通道数。
[编辑]
CvImage::data
uchar* CvImage::data(); const uchar* CvImage::data()const;
获取对应对应的影象数据地址。没有影象的话返回NULL。
[编辑]
CvImage::step
int CvImage::step()const;
返回IplImage::widthStep,没有影象的话返回0。
[编辑]
CvImage::origin
int CvImage::origin()const;
返回影象结构。0-顶—左结构,1-底—左结构 (Windows bitmaps 风格)。
[编辑]
CvImage::roi_row
uchar* CvImage::roi_row(int y); const uchar* CvImage::roi_row(int y)const;
返回第y行数据。没有影象的话返回NULL。
- y
- 影象行数。
[编辑]
运算符重载
operator const IplImage* (); operator IplImage* (); CvImage& operator=(const CvImage& img);
暂无。
[编辑]