之前一直使用第3方控件来处理图像,所以很少去接触与分析图像数据,以前一直使用dib来做接口,也没有深入的去分析Dib.
个人觉得要分析图像数据,首先从DIB开始说起.
1.首先讲下Dib, 什么是Dib,window编程里面有章专门讲DIB的内容. DIB是设备无关的位图(DIB),适用于交换的图像文件格式(保存图像等).
首先包含一格位图头.
typedef struct tagBITMAPINFOHEADER // bmih
{
DWORD biSize ; // size of the structure = 40
LONG biWidth ; // width of the image in pixels
LONG biHeight ; // height of the image in pixels
WORD biPlanes ; // = 1
WORD biBitCount ; // bits per pixel (1, 4, 8, 16, 24, or 32)
DWORD biCompression ; // compression code
DWORD biSizeImage ; // number of bytes in image
LONG biXPelsPerMeter ; // horizontal resolution
LONG biYPelsPerMeter ; // vertical resolution