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

📄 dlgpatternrecog.h

📁 模式识别的作业代码
💻 H
字号:
#if !defined(AFX_DLGPATTERNRECOG_H__A52A58FE_BA67_4A3C_AB02_77D6EE8B6F70__INCLUDED_)
#define AFX_DLGPATTERNRECOG_H__A52A58FE_BA67_4A3C_AB02_77D6EE8B6F70__INCLUDED_

#include "MYLIB\PatternRecog.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgPatternRecog.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDlgPatternRecog dialog

class CDlgPatternRecog : public CDialog
{
// Construction
public:
	CDlgPatternRecog(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CDlgPatternRecog)
	enum { IDD = IDD_DIALOG_PATTERNRECOG };
	CTabCtrl	m_tabctlPRCoordinate;
//	BYTE	m_lColorValR;
//	BYTE	m_lColorValG;
//	BYTE	m_lColorValB;
	int		m_nWhichColorNoUse;
	BYTE	m_btObjectColR;
	BYTE	m_btObjectColG;
	BYTE	m_btObjectColB;
	BYTE	m_btBackroundColR;
	BYTE	m_btBackroundColG;
	BYTE	m_btBackroundColB;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDlgPatternRecog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDlgPatternRecog)
	afx_msg void OnPaint();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	virtual BOOL OnInitDialog();
	afx_msg void OnRadioNoUseR();
	afx_msg void OnRadioNoUseG();
	afx_msg void OnRadioNoUseB();
	afx_msg void OnSelchangeTabPR(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnButtonPrUpdate();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMenuPr2Manu();
	afx_msg void OnMenuPr2Auto();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMenuPatternSampleObjManu();
	afx_msg void OnMenuPatternSampleBakManu();
	afx_msg void OnMenuPatternAutoSampleAddObj();
	afx_msg void OnMenuPatternAutoSampleAddBak();
	afx_msg void OnMenuPatternAutoSampleDelBak();
	afx_msg void OnMenuPatternAutoSampleDelObj();
	afx_msg void OnMenuPattern0AutoSampleEnd();
	afx_msg void OnButtonPrExit();
	afx_msg void OnButtonPrRecognize();
	afx_msg void OnMenuPr2Restore();
	afx_msg void OnButtonPrRestore();
	afx_msg void OnMenuPatternEnableReal();
	afx_msg void OnMenuPatternDisenableReal();
	afx_msg void OnMenuPatternMultiModeAddthird();
	afx_msg void OnMenuPr23ClassLinear();
	afx_msg void OnMenuPr2Unenable3ClassLinear();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	void DrawCurSamplePoint(tagRGBVal rgb);
	void MultiModeClassifyTransWhenAutoRecog(tagStatics Obj,tagStatics Bak,tagStatics Third);
	void GetMutilModeStaticsInfo(tagStatics* Obj,tagStatics* Bak,tagStatics* Third);
	void GetTwoPointOfOptiLineWithAxisArea(CPoint* lpP1,CPoint* lpP2);
	void GetTabXYFromLogicXY(int LogicX,int LogicY, long* TabX,long* TabY);
	void DrawOptimizationClassifyLine(BYTE XMeanVal, BYTE YMeanVal);
	void TwoModeClassifyTransWhenAutoRecog(float m_fA,float m_fB,BYTE XMean,BYTE YMean);
	void GetOptimizationClassifyLine(BYTE* pXMeanVal,BYTE* pYMeanVal);
	void DrawRecognizedImage();
	void TwoModeClassifyTrans(float fA,float fB);
	void DrawSamplePoint(BYTE btXColVal,BYTE btYColVal);
	void Draw3DimetionAxis(CDC* pDC,LPSTR lpBitsData);
	void GetFigureLogicXY(CPoint point0,CPoint* lpoint1 );
	void Draw2DimetionAxis(CDC* pDC,LPSTR lpBitsData,int  nWhichNoUse);
	

public:

	LineArray m_arr3ClassLineArray;      //3类识别的直线数组
	int  m_nCountNumOfLines;             //当前绘制的直线条数,最大值是MAXIMIZE_LINES

	BOOL m_lMultiModeEnabled;
	BOOL m_bIsEnabledRealTimeProcess;    //是否进行实时判别(2模式)
	BOOL m_bIsParallelWithXYAxis;

	RGBValArray m_arrAutoSampleObjData;  //用于保存自动采样的目标数据点列
	RGBValArray m_arrAutoSampleBakData;  //用于保存自动采样的背景数据点列
	RGBValArray m_arrAutoSampleThirdData;//用于保存自动采样的第三模式数据点列

	LONG m_lAuotSampleMode;      //标志自动采样的模式
	CPoint m_ptCurRButtonDown;
	LONG m_lRButtonDown;         //
	BOOL m_b3ClassRecogEnabled;  //3类线性识别开关
	BOOL m_blIsUpdated;
	CPoint m_ptFigureXY0;
	float m_fB;
	float m_fA;
	int m_nTabPosY;
	int m_nTabPosX;
	int m_nDIBHeight;
	int m_nDIBWidth;
	long m_lCoordinateDim;       //用于标志坐标的维数

	//用于保存自动采样的数据点
	//typedef CArray<CTaskDeviceStateInfoMsg,CTaskDeviceStateInfoMsg&>	 CTaskDeviceStateInfoArray;
	CRect m_TabRect;
	CRect m_rectImage;
	CDC* m_lpTabDC;

	// 标识是否已经绘制橡皮筋线
	BOOL	m_bDrawed;
	
	// 保存鼠标左键单击时的位置
	CPoint	m_p1;
	
	// 保存鼠标拖动时的位置
	CPoint	m_p2;
	
	// 当前鼠标拖动状态,TRUE表示正在拖动。
	BOOL	m_bIsDraging;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLGPATTERNRECOG_H__A52A58FE_BA67_4A3C_AB02_77D6EE8B6F70__INCLUDED_)

⌨️ 快捷键说明

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