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

📄 calibrtwocamadlg.h

📁 这是前段时间自己写的一个给两个摄像机定标的对话框程序
💻 H
字号:
// CalibrtwocamaDlg.h : header file
//

#if !defined(AFX_CALIBRTWOCAMADLG_H__F80D01A5_2770_4D33_AC11_6F5DE994B878__INCLUDED_)
#define AFX_CALIBRTWOCAMADLG_H__F80D01A5_2770_4D33_AC11_6F5DE994B878__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// eVision Include files

#include "cv.h"  // include core library interface
#include "highgui.h" // include GUI library interface

#include "KBasicStructures.h"
#include "KMathematica.h"


typedef KBasicStructures::FileProp FileProp;
/////////////////////////////////////////////////////////////////////////////
// CCalibrtwocamaDlg dialog
#include "multicam.h"
void WINAPI GlobalCallback (PMCSIGNALINFO SigInfo);
class CCalibrtwocamaDlg : public CDialog
{
// Construction
public:
	CString califlag;
	
	BOOL m_btnApplyOrder;
	BOOL m_bCompansateDistortion;
	int lfg,rfg;
	void DispCam2();
	void DispCam1();
	~CCalibrtwocamaDlg();
	//BOOL HasCheckMCUStatus;
	CCalibrtwocamaDlg(CWnd* pParent = NULL);	// standard constructor
    MCHANDLE m_Channel1,m_Channel2;//,m_Channel3;
    void Callback (PMCSIGNALINFO SigInfo);
    PVOID m_pCurrent1,m_pCurrent2;//m_pCurrent3;
//	int cx,cy;
    int m_SizeX;
    int m_SizeY;
    int m_BufferPitch;
	volatile BOOL m_bScreenRefreshCompleted1,m_bScreenRefreshCompleted2;//,m_bScreenRefreshCompleted3;
	BITMAPINFO * m_pBitmapInfo;

    CString m_strChannelStatus;
    int m_ChannelState;

	int m_nEffectiveImageNumber;
	
	CvVect64d m_distortion;
	CvMatr64d m_cameraMatrix;
	CvVect64d m_transVects;
	CvMatr64d m_rotMatrs;
	
	CvPoint2D64d* uveff;
	CvPoint3D64d* XYZeff;
	
	int m_nNumCorners;
	
	CvSize imgsize;
	
	IplImage** p2p_InputImages;
	
	FileProp m_ImageRoot;
		
// Dialog Data
	//{{AFX_DATA(CCalibrtwocamaDlg)
	enum { IDD = IDD_CALIBRTWOCAMA_DIALOG };
	int		m_nImageNumber;
	int		m_nXHeight;
	BOOL	m_bDisplayCorners;
	BOOL	m_bDisplayRT;
	int		m_nLeftCamNo;
	int		m_nRightCamNO;
	int		m_nXWidth;
	double	m_dGridHeight;
	double	m_dGridWidth;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCalibrtwocamaDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CCalibrtwocamaDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnStop();
	afx_msg void OnActive();
	afx_msg void OnLeftca();
	afx_msg void OnRightca();
	afx_msg void OnSave();
	afx_msg void OnLoadSelected();
	afx_msg void OnLoad();
	afx_msg void OnCalibrate();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void CalibrateCamera();
	void DisplayReport();
	void GenerateReport();
	void CalculateCalibrationErrors(bool print);
	CvPoint2D32f CalculateAngleRespectTo(CvPoint2D32f* arr, int n, CvPoint2D32f anchor, int thr1, int thr2=0, bool exact=true ,bool vert=false);
	void SortRespectTo(CvPoint2D32f *&arr, CvPoint2D32f anchor, int n);
	CvPoint3D32f FindRectangleCorner(CvPoint2D32f *points, int n );
	void SortPoints(CvPoint2D32f *&points, int n, CvPoint3D32f *init);
	CString* m_cstrImageNames;
	CvPoint2D64d m_dErrorPower;
	CvPoint2D64d m_dErrorMax;
	CvPoint2D64d m_dErrorMean;
	void FindCorners();
};

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

#endif // !defined(AFX_CALIBRTWOCAMADLG_H__F80D01A5_2770_4D33_AC11_6F5DE994B878__INCLUDED_)

⌨️ 快捷键说明

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