⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aux_resize_3d.m

📁 Standard model object recognition matlab code
💻 M
字号:
function y = aux_resize_3d (x, new_size)% FUNCTION y = aux_resize_3d (x, new_size)% % This funciton resizes a 3d matrix "x", into a "new_size".  It is% intended for the case when different scaled responses are to be% combined (mixing scales).  Here the resizing is done with% nearest-neighbor rule (ie. the values are replicated, not% interpolated, to the nearest neighbor values).  Note that, for% convenience, we assume the third dimension of x and y are to be% the same, and we just resize the first two dimensions% (corresponding to x and y in the image).  This should be used% only when the prod(new_size) is not too big (due to memory% shortage), and because of the for-loops this is to be used in the% later layers (when the receptive field sizes are big or the x-y% matrix sizes are small).old_size = size(x);y = zeros(new_size);sf = new_size(1:2)./old_size(1:2); % scale factor% For each index, find the range of new resized indices.  Then,% use repmat to copy the values over.  This is more or less like% imresize('nearest') function.for i = 1:old_size(1)  i_r = [round((i-1)*sf(1))+1:round(i*sf(1))];  for j = 1:old_size(2)    j_r = [round((j-1)*sf(2))+1:round(j*sf(2))];    y(i_r,j_r,:) = repmat(x(i,j,:), [length(i_r) length(j_r) 1]);  endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -