資源簡介
該函數可以實現將8位二值圖像(0,255),轉換為單色位圖二值圖像(0,1)
代碼片段和文件信息
#include?“stdafx.h“
#include??
#include?
#include?“cv.h“
#include?“highgui.h“
#include?“cvaux.h“
typedef??struct??tagBITMAPFILEHEADER
{?
unsigned?short?int??bfType;???????//位圖文件的類型,必須為BM?
unsigned?long???????bfSize;???????//文件大小,以字節為單位
unsigned?short?int??bfReserverd1;?//位圖文件保留字,必須為0?
unsigned?short?int??bfReserverd2;?//位圖文件保留字,必須為0?
unsigned?long???????bfbfOffBits;??//位圖文件頭到數據的偏移量,以字節為單位
}BITMAPFILEHEADER;?
typedef??struct??tagBITMAPINFOHEADER?
{?
long?biSize;????????????????????????//該結構大小,字節為單位
long??biWidth;?????????????????????//圖形寬度以象素為單位
long??biHeight;?????????????????????//圖形高度以象素為單位
short?int??biPlanes;???????????????//目標設備的級別,必須為1?
short?int??biBitcount;?????????????//顏色深度,每個象素所需要的位數
short?int??biCompression;????????//位圖的壓縮類型
long??biSizeImage;??????????????//位圖的大小,以字節為單位
long??biXPelsPermeter;???????//位圖水平分辨率,每米像素數
long??biYPelsPermeter;???????//位圖垂直分辨率,每米像素數
long??biClrUsed;????????????//位圖實際使用的顏色表中的顏色數
long??b
評論
共有 條評論