double d = 0.65;
m_List.InsertColumn(0, _T("原影像檔案名"), LVCFMT_CENTER, rect.Width() / 2, 0);
m_List.InsertColumn(1, _T("d的值"), LVCFMT_CENTER, rect.Width() / 2, 1);
CFileFind finder;
CStringList filelist;//檔案串列
BOOL bResult = finder.FindFile(strPathNametwo);
int i = 0;
while (bResult)
{
bResult = finder.FindNextFile();
//判斷是否是目錄或者是隱藏檔案,又或者是".."和".",如果是,進入下一輪回圈
if (finder.IsDirectory() || finder.IsDots() || finder.IsHidden())
continue;
else//如果是檔案
{
CString str;
//得到檔案名
str = finder.GetFileName();
//得到檔案后綴名
int nLen = str.GetLength() - finder.GetFileTitle().GetLength();
str = str.Right(nLen);
//判斷檔案格式,如果是影像檔案,將其完整的路徑保存在串列中
if (str == ".jpg" || str == ".png" || str == ".bmp" || str == ".gif" || str == ".tif") {
filelist.AddTail(finder.GetFilePath());
CString filePath = finder.GetFilePath();
Mat imageInput = imread(filePath.GetBuffer(0));
m_List.InsertItem(index, finder.GetFileName()); // 檔案名
//m_List.SetItemText(index, 1, "0"); // 相似度 // 更新
m_List.SetItemText(index, 1, (LPCTSTR)(&d));
index++;
i++;
//waitKey(500);//暫停0.5S
}
}
}
double d 的值其實是我用一個演算法得到的值,這里我用具體的資料來表示,在SetItemText()函式中無法顯示 d 的值,求大佬指點!!!
uj5u.com熱心網友回復:
BOOL SetItemText( int nItem, int nSubItem, LPTSTR lpszText );要求 text 不是 d的值 (轉換為 字串)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/284687.html
標籤:圖形處理/算法
