資源簡介
一個彩色圖像的類,實現(xiàn)了常見的數(shù)字圖像處理接口,還包括:
1. 色彩空間RGB與YUV的互換;
2. 直方圖均衡;
3. 白平衡;
4. 規(guī)格化。
等接口。
代碼片段和文件信息
#include?“colorimage.h“
#ifdef?__CV
#include?
#include?
#endif?//?__CV
#define?ROUND(x)?(int)((x)?+?0.5?-?(double)((x)?0))
/**?@brief?GetBuf
??*
??*?@todo:?Reture?the?poiter?that?points?to?the?head?of?data?in?memory.
??*/
BYTE*?ColorImage::GetBuf()
{
????return?buf;
}
/**?@brief?AllocateAndBlank
??*
??*?@todo:?Allocate?memory?and?make?it?blank.
??*/
void?ColorImage::AllocateAndBlank()
{
????int?size?=?width?*?height?*?3;
????buf?=?new?BYTE[size?+?1];?/*?MakeBlank?*/
memset(buf?0?size?+?1);
assert(buf?!=?NULL);
}
/**?@brief?ClearMemory
??*
??*?@todo:?release?memory.
??*/
void?ColorImage::ClearMemory()
{
????if?(buf?==?NULL)?return;
delete[]?buf;
buf?=?NULL;
}
/**?@brief?CloneFrom
??*
??*?@todo:?Clone?an?image?from
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????23013??2009-02-19?09:11??colorimage.cpp
?????文件???????1936??2009-02-19?08:32??colorimage.h
-----------?---------??----------?-----??----
????????????????24949????????????????????2
評論
共有 條評論