在运行SUN论文源代码saliencyimage_convolution.m的时候,由于对代码运行速率与机器性能的充分结合利用,我修改了代码为多核并行运行的代码,里面含有parfor…end的循环体,但出现了如下的问题,发下是Matlab中并行运算之前load的数据不能顺利加载入并行运算池中,鉴于网上的资料太少,我加以个人的理解和解决方案在此,以供大家加以借鉴。
Preface
本博客提供了.mat文件在并行运算中的load方案
源代码分析
function smap=saliencyimage_convolution(img,scale)
% function smap=saliencyimage(img,scale)
% Calculate saliency map for color image, at certain scale
% each filter is zero summed
% load ICA basis functions
load stats;
d=size(B1,1); % number of filters
D=size(B1,2); % color filter streched length
fsize=D/3; % length of filter at each channel
psize=sqrt(fsize); % square filter
% preprocess image
% if scale~=1
% img = imresize(img,scale);
% end
img=double(img);
img=img/std(img(:));
[height, width , ~] = size(img);
% pr