⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barrecog.h

📁 Visual C++数字图像识别技术典型案例 之 条形码技术 源码
💻 H
字号:
/******************************************************************************
 * 文件名:BarRecog.h
 * 功能:实现对条形码的识别
 * modified by PRTsinghua@hotmail.com
******************************************************************************/

#if !defined(AFX_BARRECOG_H)
#define AFX_BARRECOG_H

#include "Dib.h"

#if _MSC_VER > 1000
#pragma once
#endif

class CBarRecog  
{
public:
	int JudgNum(int w1, int w2, int w3, int w4, double mx);
	CString strCodeNumber;
	CString strCodeStyle;
	BOOL PreProcess(void);
	BOOL Recognize();
	//构造函数/析构函数
	CBarRecog();
	virtual ~CBarRecog();

	//成员变量
	BYTE** ImageArray;				//原始的图像数据数组-灰度
	RGBQUAD** m_tOriPixelArray;		//原始位图数据

	long ImageHeight;				//原图像的高度
	long ImageWidth;				//原图像的宽度

	int arPixelH[1000];				//为了水平方向直方图统计用
	int arPixelV[1000];				//为了垂直方向直方图统计用
	int arWidth[200];				//保存宽度序列:从最左边的黑条开始
	int arDifference[1000];			//差分
	bool arMark[1000];				//标记
	int ImageLeft;					//图像最左边的座标
	int ImageRight;					//图像最右边的座标
	int ImageTop;					//条形码顶部的座标
	int ImageBottom;				//条形码下部的座标

	CDib *m_dib;
	
	//操作
	void LoadImage(CString &FilePathName);
	void BinaryImage(BYTE threhold = 128);

protected:	
	int arDelta[1000];
	int arLeftEdge1[1000];
	int arLeftEdge2[1000];
	int arLeftEdge[1000];
};

#endif // !defined(AFX_BARRECOG_H)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -