//========================================================
// 函数名:HoughDIB
// 功能:对图像进行Hough变换,找到图像的倾斜角
// 参数:
// int tAngle;图像的倾斜角
// int step; 角度步长,目的是减少Hough变换的计算量
// LPSTR lpDIBBits;要变换的图像指针
// LONG lWidth;图像的宽度
// LONG lHeight;图像的高度
// 返回值:图像的倾斜角
//=========================================================
int CxxxView::HoughDIB(int fAngle,int tAngle, int step, LPSTR lpDIBBits, LONG lWidth, LONG lHeight)
{
LPSTR lpSrc; // 指向源图像的指针
LPSTR lpDst; // 指向缓存图像的指针
LPSTR lpTrans; // 指向变换域的指针
LONG lLineBytes; // 图像每行的字节数
LPSTR lpNewDIBBits; // 指向缓存DIB图像的指针
HLOCAL hNewDIBBits;
LPSTR lpTransArea; // 指向变换域的指针
HLOCAL hTransArea;
int iMaxDist; // 变换域的尺寸
int iMaxAngleNumber;
int iDist; // 变换域的坐标
int iAngleNumber;
long i,j; // 循环变量
unsigned char pixel; // 像素值
MaxValue MaxValue1; // 存储变换域中的两个最大值