【Matlab Debugging】使用 addAttachedFiles(pool, files) 指定要附加的必要文件。

在运行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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值