在对 Saliency Detection: A Boolean Map Approach(ICCV 2013) 这篇论文的代码进行编译运行时,需要OpenCV,修改compile.m中
opts.opencv_include_path = 'C:\opencv240\install\include'; % OpenCV include path
opts.opencv_lib_path = 'C:\opencv240\install\lib'; % OpenCV lib path
为
opts.opencv_include_path = 'C:\Dependences\OpenCV2.4.3\include'; % OpenCV include path
opts.opencv_lib_path = 'C:\Dependences\OpenCV2.4.3\lib'; % OpenCV lib path
此处是将原OpenCV路径配置为自己机器的路径。然后执行compile,成功编译出mexBMS.mexw64,返回主目录,运行demo时,会出现以下错误:
Invalid MEX-file 'E:\Matlab\Saliency detection-A boolean map approach\mex\mexBMS.mexw64': The specified
module could not be found.
Error in BMS (line 85)
mexBMS(input_dir,output_dir,sample_step_size,opening_width,dilation_width_1,...
Error in demo (line 24)
BMS('src/','output_efp/',false); % for eye fixation prediction
原因应该是缺少相应的DLL模块,运行Dependency Walker,选择mexBMS.mexw64,可以看出缺少以下三个DLL:
opencv_core243.dll
opencv_highgui243.dll
opencv_imgproc243.dll
将这三个DLL拷贝至mexBMS.mexw64同级目录下,再次运行demo,成功。