亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? convolve2.m

?? This is not my work but a function I use often. It is much faster than the conv2 function in matlab
?? M
字號:
function y = convolve2(x, m, shape, tol)%CONVOLVE2 Two dimensional convolution.%   Y = CONVOLVE2(X, M) performs the 2-D convolution of matrices X and%   M. If [mx,nx] = size(X) and [mm,nm] = size(M), then size(Y) =%   [mx+mm-1,nx+nm-1]. Values near the boundaries of the output array are%   calculated as if X was surrounded by a border of zero values.%%   Y = CONVOLVE2(X, M, SHAPE) where SHAPE is a string returns a%   subsection of the 2-D convolution with size specified by SHAPE:%%       'full'    - (default) returns the full 2-D convolution,%       'same'    - returns the central part of the convolution%                   that is the same size as A (using zero padding),%       'valid'   - returns only those parts of the convolution%                   that are computed without the zero-padded%                   edges, size(Y) = [mx-mm+1,nx-nm+1] when%                   size(X) > size(M),%       'wrap'    - as for 'same' except that instead of using%                   zero-padding the input A is taken to wrap round as%                   on a toroid.%       'reflect' - as for 'same' except that instead of using%                   zero-padding the input A is taken to be reflected%                   at its boundaries.%%   CONVOLVE2 is fastest when mx > mm and nx > nm - i.e. the first%   argument is the input and the second is the mask.%%   If the rank of the mask M is low, CONVOLVE2 will decompose it into a%   sum of outer product masks, each of which is applied efficiently as%   convolution with a row vector and a column vector, by calling CONV2.%   The function will often be faster than CONV2 or FILTER2 (in some%   cases much faster) and will produce the same results as CONV2 to%   within a small tolerance.%%   Y = CONVOLVE2(... , TOL) where TOL is a number in the range 0.0 to%   1.0 computes the convolution using a reduced-rank approximation to%   M, provided this will speed up the computation. TOL limits the%   relative sum-squared error in the effective mask; that is, if the%   effective mask is E, the error is controlled such that%%       sum(sum( (M-E) .* (M-E) ))%       --------------------------    <=  TOL%            sum(sum( M .* M ))%%   See also CONV2, FILTER2.% David Young, Department of Informatics, University of Sussex, February 2002,%   revised January 2005.% Deal with optional argumentserror(nargchk(2,4,nargin));if nargin < 3    shape = 'full';    % shape default as for CONV2    tol = 0;elseif nargin < 4    if isnumeric(shape)        tol = shape;        shape = 'full';    else        tol = 0;    endend;% Set up to do the wrap & reflect operations, not handled by conv2if strcmp(shape, 'wrap')    x = wraparound(x, m);    shape = 'valid';elseif strcmp(shape, 'reflect')    x = reflectborders(x, m);    shape = 'valid';end% do the convolution itselfy = doconv(x, m, shape, tol);%-----------------------------------------------------------------------function y = doconv(x, m, shape, tol);% Carry out convolution[mx, nx] = size(x);[mm, nm] = size(m);% If the mask is bigger than the input, or it is 1-D already,% just let CONV2 handle it.if mm > mx | nm > nx | mm == 1 | nm == 1    y = conv2(x, m, shape);else    % Get svd of mask    if mm < nm; m = m'; end        % svd(..,0) wants m > n    [u,s,v] = svd(m, 0);    s = diag(s);    rank = trank(m, s, tol);    if rank*(mm+nm) < mm*nm         % take advantage of low rank        if mm < nm;  t = u; u = v; v = t; end  % reverse earlier transpose        vp = v';        % For some reason, CONV2(H,C,X) is very slow, so use the normal call        y = conv2(conv2(x, u(:,1)*s(1), shape), vp(1,:), shape);        for r = 2:rank            y = y + conv2(conv2(x, u(:,r)*s(r), shape), vp(r,:), shape);        end    else        if mm < nm; m = m'; end     % reverse earlier transpose        y = conv2(x, m, shape);    endend%-----------------------------------------------------------------------function r = trank(m, s, tol)% Approximate rank function - returns rank of matrix that fits given% matrix to within given relative rms error. Expects original matrix% and vector of singular values.if tol < 0 | tol > 1    error('Tolerance must be in range 0 to 1');endif tol == 0             % return estimate of actual rank    tol = length(m) * max(s) * eps;    r = sum(s > tol);else    ss = s .* s;    t = (1 - tol) * sum(ss);    r = 0;    sm = 0;    while sm < t        r = r + 1;        sm = sm + ss(r);    endend%-----------------------------------------------------------------------function y = wraparound(x, m)% Extend x so as to wrap around on both axes, sufficient to allow a% "valid" convolution with m to return the cyclical convolution.% We assume mask origin near centre of mask for compatibility with% "same" option.[mx, nx] = size(x);[mm, nm] = size(m);if mm > mx | nm > nx    error('Mask does not fit inside array')endmo = floor((1+mm)/2); no = floor((1+nm)/2);  % reflected mask originml = mo-1;            nl = no-1;             % mask left/above originmr = mm-mo;           nr = nm-no;            % mask right/below originme = mx-ml+1;         ne = nx-nl+1;          % reflected margin in inputmt = mx+ml;           nt = nx+nl;            % top of image in outputmy = mx+mm-1;         ny = nx+nm-1;          % output sizey = zeros(my, ny);y(mo:mt, no:nt) = x;      % central regionif ml > 0    y(1:ml, no:nt) = x(me:mx, :);                   % top side    if nl > 0        y(1:ml, 1:nl) = x(me:mx, ne:nx);            % top left corner    end    if nr > 0        y(1:ml, nt+1:ny) = x(me:mx, 1:nr);          % top right corner    endendif mr > 0    y(mt+1:my, no:nt) = x(1:mr, :);                 % bottom side    if nl > 0        y(mt+1:my, 1:nl) = x(1:mr, ne:nx);          % bottom left corner    end    if nr > 0        y(mt+1:my, nt+1:ny) = x(1:mr, 1:nr);        % bottom right corner    endendif nl > 0    y(mo:mt, 1:nl) = x(:, ne:nx);                   % left sideendif nr > 0    y(mo:mt, nt+1:ny) = x(:, 1:nr);                 % right sideend%-----------------------------------------------------------------------function y = reflectborders(x, m)% Extend x so as to reflect at each boundary, sufficient to allow a% "valid" convolution with m to return a matrix the same size as% the orginal.% We assume mask origin near centre of mask for compatibility with% "same" option.[mx, nx] = size(x);[mm, nm] = size(m);if mm > mx | nm > nx    error('Mask does not fit inside array')endmo = floor((1+mm)/2); no = floor((1+nm)/2);  % reflected mask originml = mo-1;            nl = no-1;             % mask left/above originmr = mm-mo;           nr = nm-no;            % mask right/below originme = mx-mr+1;         ne = nx-nr+1;          % translated margin in inputmt = mx+ml;           nt = nx+nl;            % top/right of image in outputmy = mx+mm-1;         ny = nx+nm-1;          % output sizey = zeros(my, ny);y(mo:mt, no:nt) = x;      % central regionif ml > 0    y(1:ml, no:nt) = x(ml:-1:1, :);                   % top side    if nl > 0        y(1:ml, 1:nl) = x(ml:-1:1, nl:-1:1);          % top left corner    end    if nr > 0        y(1:ml, nt+1:ny) = x(ml:-1:1, nx:-1:ne);      % top right corner    endendif mr > 0    y(mt+1:my, no:nt) = x(mx:-1:me, :);               % bottom side    if nl > 0        y(mt+1:my, 1:nl) = x(mx:-1:me, nl:-1:1);      % bottom left corner    end    if nr > 0        y(mt+1:my, nt+1:ny) = x(mx:-1:me, nx:-1:ne);  % bottom right corner    endendif nl > 0    y(mo:mt, 1:nl) = x(:, nl:-1:1);                   % left sideendif nr > 0    y(mo:mt, nt+1:ny) = x(:, nx:-1:ne);               % right sideend

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级精品视频| 午夜亚洲福利老司机| 久久99国产精品久久99果冻传媒| 欧美精品免费视频| 日本sm残虐另类| 精品免费99久久| 成人性生交大合| 亚洲黄色免费网站| 欧美人与性动xxxx| 黑人巨大精品欧美一区| 国产精品乱子久久久久| 在线视频一区二区三| 日韩欧美综合在线| 精品不卡在线视频| 懂色中文一区二区在线播放| 国产精品人成在线观看免费| 91一区在线观看| 午夜精品成人在线| 26uuu精品一区二区| 波多野结衣在线aⅴ中文字幕不卡| 亚洲精选视频在线| 日韩一区和二区| 成人v精品蜜桃久久一区| 一区二区三区电影在线播| 日韩欧美一卡二卡| www.日本不卡| 免费黄网站欧美| 亚洲免费看黄网站| 日韩亚洲国产中文字幕欧美| 不卡av电影在线播放| 日本不卡一区二区三区高清视频| 久久伊99综合婷婷久久伊| 色婷婷精品大在线视频| 激情综合网av| 亚洲妇熟xx妇色黄| 欧美国产国产综合| 欧美一区二区在线播放| 99久久久国产精品免费蜜臀| 欧美aaa在线| 亚洲欧洲综合另类| 久久综合九色综合欧美亚洲| 国产喂奶挤奶一区二区三区| 国产精品99久久久久久似苏梦涵| 亚洲人成精品久久久久久| 精品国产一区久久| 欧美视频日韩视频在线观看| 欧美日韩免费电影| 国产盗摄精品一区二区三区在线| 亚洲成人先锋电影| 亚洲欧洲精品成人久久奇米网| 欧美一卡二卡三卡四卡| 日本高清视频一区二区| 国产在线视频一区二区| 日本大胆欧美人术艺术动态| 亚洲精品免费看| 国产精品丝袜久久久久久app| 日韩欧美中文字幕制服| 欧日韩精品视频| 91在线你懂得| 成人午夜在线播放| 国产精品一区2区| 经典三级在线一区| 麻豆国产欧美日韩综合精品二区| 亚洲小少妇裸体bbw| 亚洲欧美日韩国产手机在线 | 成人在线综合网| 久久不见久久见免费视频7| 午夜精品久久久久| 一区二区高清视频在线观看| 亚洲欧美日韩久久精品| 成人欧美一区二区三区黑人麻豆 | 日本视频在线一区| 午夜精品久久一牛影视| 亚洲香蕉伊在人在线观| 亚洲欧美日韩综合aⅴ视频| 国产精品久久一卡二卡| 国产精品天干天干在线综合| 欧美高清在线精品一区| 国产欧美精品一区aⅴ影院| 久久久久久久久久久久久久久99 | 欧美日韩中文国产| 欧美日韩中文字幕一区| 欧美高清激情brazzers| 欧美一区二区三区在| 欧美大片在线观看一区二区| 亚洲精品在线免费观看视频| ww亚洲ww在线观看国产| 国产日韩影视精品| 中文欧美字幕免费| 亚洲色图19p| 午夜视黄欧洲亚洲| 久久精品国产澳门| 国产精品白丝jk白祙喷水网站| 国产99一区视频免费| 99精品欧美一区| 在线观看日韩精品| 在线成人免费观看| 精品黑人一区二区三区久久| 国产欧美视频一区二区| 亚洲欧洲三级电影| 亚洲综合免费观看高清在线观看| 日韩综合在线视频| 国产一区二区视频在线| gogo大胆日本视频一区| 欧美在线高清视频| 精品国产百合女同互慰| 国产精品日产欧美久久久久| 亚洲综合精品自拍| 精品一区中文字幕| gogogo免费视频观看亚洲一| 欧美日韩免费视频| 久久久激情视频| 亚洲欧美日韩国产一区二区三区| 首页亚洲欧美制服丝腿| 国产精品伊人色| 欧美午夜精品久久久| 欧美成人精品3d动漫h| 1000部国产精品成人观看| 日韩av二区在线播放| 成人黄动漫网站免费app| 欧美精品在欧美一区二区少妇| 久久你懂得1024| 亚洲成a天堂v人片| 国产成人精品综合在线观看| 欧美熟乱第一页| 国产三级精品视频| 日本伊人午夜精品| 91免费观看国产| 精品成人一区二区三区| 亚洲美女区一区| 国产毛片精品视频| 精品婷婷伊人一区三区三| 日本一区二区免费在线| 蜜臀久久久99精品久久久久久| 99国产精品国产精品久久| 亚洲精品一区二区三区香蕉| 亚洲一级二级三级| 不卡高清视频专区| 久久久99久久精品欧美| 亚洲国产日韩综合久久精品| 国产成人精品免费在线| 日韩一级黄色片| 亚洲图片欧美色图| 99久精品国产| 国产日韩欧美麻豆| 老司机免费视频一区二区| 欧美系列一区二区| 日韩码欧中文字| 国产福利精品导航| 欧美成人女星排名| 日韩av一区二区在线影视| 欧美在线不卡一区| 亚洲欧美激情一区二区| 成人白浆超碰人人人人| 久久久不卡网国产精品二区| 久久精品二区亚洲w码| 欧美日韩亚州综合| 一区二区三区免费在线观看| 99精品视频一区| 国产精品久久久一区麻豆最新章节| proumb性欧美在线观看| 久久久久97国产精华液好用吗| 免费成人在线影院| 9191国产精品| 丝袜诱惑制服诱惑色一区在线观看| 日本高清免费不卡视频| 亚洲天堂精品在线观看| 91在线高清观看| 亚洲视频小说图片| 色一情一乱一乱一91av| 亚洲欧美激情视频在线观看一区二区三区| 国产成人免费在线视频| 国产精品午夜在线观看| 成人av在线播放网站| 中文字幕一区二区三区在线观看| 成人av网站在线观看免费| 综合久久久久久| 欧美午夜不卡在线观看免费| 亚洲成av人影院在线观看网| 欧美日韩国产一二三| 视频在线在亚洲| 欧美精品一区男女天堂| 国产成人精品免费在线| 中文字幕亚洲精品在线观看 | 欧美午夜理伦三级在线观看| 亚洲黄色在线视频| 欧美日本一区二区三区四区| 蜜臀精品久久久久久蜜臀| 久久久精品国产免大香伊| www.综合网.com| 亚洲一区国产视频| 日韩欧美一级在线播放| 国产乱妇无码大片在线观看| 中文字幕一区不卡| 欧美日韩高清影院| 国产在线精品一区二区| 亚洲视频你懂的| 欧美丰满高潮xxxx喷水动漫| 国产真实乱子伦精品视频| 国产精品理论片|