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

📄 kmean.cpp

📁 K均值聚类算法 C++实现的K均值聚类算法。
💻 CPP
字号:
// KMEAN.cpp : implementation file
//

#include "stdafx.h"
#include "DERSImg.h"
#include "KMEAN.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKMEAN dialog


CKMEAN::CKMEAN(CWnd* pParent /*=NULL*/)
	: CDialog(CKMEAN::IDD, pParent)
{
	//{{AFX_DATA_INIT(CKMEAN)
	m_in = _T("");
	m_out = _T("");
	m_class = 1;
	//}}AFX_DATA_INIT
}


void CKMEAN::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CKMEAN)
	DDX_Text(pDX, IDC_IN, m_in);
	DDX_Text(pDX, IDC_OUT, m_out);
	DDX_Text(pDX, IDC_CLASS, m_class);
	DDV_MinMaxInt(pDX, m_class, 0, 10);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CKMEAN, CDialog)
	//{{AFX_MSG_MAP(CKMEAN)
	ON_BN_CLICKED(IDC_INPUT, OnInput)
	ON_BN_CLICKED(IDC_OUTPUT, OnOutput)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKMEAN message handlers

void CKMEAN::OnInput() 
{
	// TODO: Add your control notification handler code here
	CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
		            _T("影像文件(*.bmp)|*.bmp"),NULL);
    if(dlg.DoModal()==IDOK)
		m_in = dlg.GetPathName();
	
	UpdateData(FALSE);
}

void CKMEAN::OnOutput() 
{
	// TODO: Add your control notification handler code here
	CFileDialog dlg(FALSE,_T("bmp"),NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
					_T("影像文件(*.bmp)|*.bmp"),NULL);
    if(dlg.DoModal()==IDOK)
		m_out = dlg.GetPathName();
	
	UpdateData(FALSE);
}

⌨️ 快捷键说明

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