基于opencv的图像检索算法


基于opencv和vc++的图像检索,具有较好的检索效果和运行效率
资源截图
代码片段和文件信息
// DirDialog.cpp: implementation of the CDirDialog class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “DirDialog.h“

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


// Callback function called by SHBrowseForFolder‘s browse control
// after initialization and when selection changes
int __stdcall CDirDialog::BrowseCtrlCallback(HWND hwnd UINT uMsg LPARAM lParam LPARAM lpData)
{
    CDirDialog* pDirDialogObj = (CDirDialog*)lpData;
    if (uMsg == BFFM_INITIALIZED )
    {
        if( ! pDirDialogObj->m_strSelDir.IsEmpty() )
            ::SendMessage(hwnd BFFM_SETSELECTION TRUE (LPARAM)(LPCTSTR)(pDirDialogObj->m_strSelDir));
        if( ! pDirDialogObj->m_strWindowtitle.IsEmpty() )
            ::SetWindowText(hwnd (LPCTSTR) pDirDialogObj->m_strWindowtitle);
    }
    else if( uMsg == BFFM_SELCHANGED )
    {
        LPITEMIDLIST pidl = (LPITEMIDLIST) lParam;
        char selection[MAX_PATH];
        if( ! ::SHGetPathFromIDList(pidl selection) )
            selection[0] = ‘‘;

        CString csStatusText;
        BOOL bOk = pDirDialogObj->SelChanged(selection csStatusText);

        if( pDirDialogObj->m_bStatus )
            ::SendMessage(hwnd BFFM_SETSTATUSTEXT  0 (LPARAM)(LPCSTR)csStatusText);

        ::SendMessage(hwnd BFFM_ENABLEOK 0 bOk);
    }
  return 0;
}

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDirDialog::CDirDialog()
{
m_bStatus = FALSE;
}

CDirDialog::~CDirDialog()
{

}


BOOL CDirDialog::DoBrowse(CWnd *pwndParent)
{

    if( ! m_strSelDir.IsEmpty() )
    {
        m_strSelDir.TrimRight();
        if( m_strSelDir.Right(1) == “\“ || m_strSelDir.Right(1) == “//“ )
            m_strSelDir = m_strSelDir.Left(m_strSelDir.GetLength() - 1);
    }

    LPMALLOC pMalloc;
    if (SHGetMalloc (&pMalloc)!= NOERROR)
        return FALSE;

    BROWSEINFO bInfo;
    LPITEMIDLIST pidl;
    ZeroMemory ( (PVOID) &bInfosizeof (BROWSEINFO));

    if (!m_strInitDir.IsEmpty ())
    {
        OLECHAR       olePath[MAX_PATH];
        ULONG         chEaten;
        ULONG         dwAttributes;
        HRESULT       hr;
        LPSHELLFOLDER pDesktopFolder;
        //
        // Get a pointer to the Desktop‘s IShellFolder interface.
        //
        if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
        {
            //
            // IShellFolder::ParseDisplayName requires the file name be in Unicode.
            //
            MultiByteToWideChar(CP_ACP MB_PRECOMPOSED m_strInitDir.GetBuffer(MAX_PATH) -1
                                olePath MAX_PATH);

            m_strInitDir.ReleaseBuffer (-1);
            //
            // Convert the path to an ITEMIDLIST.
            //
            hr = pDesktop

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     219648  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3DebugRETRIEVAL_2_3.exe

     文件    1273640  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3DebugRETRIEVAL_2_3.ilk

     文件    4402176  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3DebugRETRIEVAL_2_3.pdb

     文件      16286  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugBuildLog.htm

     文件      22656  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugDirDialog.obj

     文件         65  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3Debugmt.dep

     文件        920  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.exe.embed.manifest

     文件        984  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.exe.embed.manifest.res

     文件        861  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.exe.intermediate.manifest

     文件      83944  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.obj

     文件   25296896  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.pch

     文件      24388  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3.res

     文件     734875  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DebugRETRIEVAL_2_3Dlg.obj

     文件     466875  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3Debugstdafx.obj

     文件    1223680  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3Debugvc90.idb

     文件    2469888  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3Debugvc90.pdb

     文件       4511  2010-02-05 14:58  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DirDialog.cpp

     文件        968  2010-02-05 02:12  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3DirDialog.h

     文件       4130  2010-02-03 13:11  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3ReadMe.txt

     文件      21630  2003-07-23 17:52  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3
esRETRIEVAL_2_3.ico

     文件        404  2010-02-03 13:11  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3
esRETRIEVAL_2_3.rc2

     文件       1099  2010-02-05 20:52  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3
esource.h

     文件      44692  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.APS

     文件       2175  2010-02-03 13:11  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.cpp

     文件        546  2010-02-03 13:11  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.h

     文件       6934  2010-02-05 20:52  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.rc

     文件       5760  2012-01-05 01:20  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.vcproj

     文件       1409  2010-02-22 14:30  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.vcproj.xpj-PC.xpj.user

     文件       1427  2012-01-06 20:43  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3.vcproj.ZGC-20110512JRG.Administrator.user

     文件       9145  2010-02-06 15:00  图像检索程序基于OpenCV2.0和VS2008RETRIEVAL_2_3RETRIEVAL_2_3RETRIEVAL_2_3Dlg.cpp

............此处省略671个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)