我尝试使用演示代码来检测和匹配David Lowe的SIFT功能(lowe@cs.ubc.ca)

在我的代码中。 所以我在Matlab中编译(.m)文件以生成DLL。 这是Matlab中的命令代码:

mcc -B csharedlib:SiftMatch match.m sift.m -v

但是,当我在C ++代码(在VS2010下)中使用DLL时,出现了一个问题:

SiftMatchInitialize();

This function returned false. I could not initialize the library.

并且调试显示:

bool MW_CALL_CONV SiftMatchInitializeWithHandlers(

mclOutputHandlerFcn error_handler,

mclOutputHandlerFcn print_handler)

{

int bResult = 0;

if (_mcr_inst != NULL)

return true;

if (!mclmcrInitialize())

return false;

if (!GetModuleFileName(GetModuleHandle("SiftMatch"), path_to_dll, _MAX_PATH))

return false;

{

mclCtfStream ctfStream =

mclGetEmbeddedCtfStream(path_to_dll);

if (ctfStream) {

bResult = mclInitializeComponentInstanceEmbedded( &_mcr_inst,

error_handler,

print_handler,

ctfStream);

mclDestroyStream(ctfStream);

} else {

bResult = 0;

}

}

if (!bResult)

return false;

return true;

}

在此函数中,ctfStream为NULL,bResult等于0。那么,什么问题呢?

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐