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

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

?? motionestntss.m

?? 運動估計(包含七種算法)
?? M
字號:
% Computes motion vectors using *NEW* Three Step Search method
%
% Based on the paper by R. Li, b. Zeng, and M. L. Liou
% IEEE Trans. on Circuits and Systems for Video Technology
% Volume 4, Number 4, August 1994 :  Pages 438:442
%
% Input
%   imgP : The image for which we want to find motion vectors
%   imgI : The reference image
%   mbSize : Size of the macroblock
%   p : Search parameter  (read literature to find what this means)
%
% Ouput
%   motionVect : the motion vectors for each integral macroblock in imgP
%   NTSScomputations: The average number of points searched for a macroblock
%
% Written by Aroh Barjatya


function [motionVect, NTSScomputations] = motionEstNTSS(imgP, imgI, mbSize, p)

[row col] = size(imgI);

vectors = zeros(2,row*col/mbSize^2);
costs = ones(3, 3) * 65537;


% we now take effectively log to the base 2 of p
% this will give us the number of steps required

L = floor(log10(p+1)/log10(2));   
stepMax = 2^(L-1);

computations = 0;

% we start off from the top left of the image
% we will walk in steps of mbSize
% for every marcoblock that we look at we will look for
% a close match p pixels on the left, right, top and bottom of it

mbCount = 1;
for i = 1 : mbSize : row-mbSize+1
    for j = 1 : mbSize : col-mbSize+1
        
        % the NEW three step search starts


        
        x = j;
        y = i;
        
        % In order to avoid calculating the center point of the search
        % again and again we always store the value for it from the
        % previous run. For the first iteration we store this value outside
        % the for loop, but for subsequent iterations we store the cost at
        % the point where we are going to shift our root.
        %
        % For the NTSS, we find the minimum first in the far away points
        % we then find the minimum for the close up points
        % we then compare the minimums and which ever is the lowest is where
        % we shift our root of search. If the minimum is the center of the
        % current window then we stop the search. If its one of the
        % immediate close to the center then we will do the second step
        % stop. And if its in the far away points, then we go doing about
        % the normal TSS approach
        % 
        % more details in the code below or read the paper/literature
        
        costs(2,2) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), ...
                                    imgI(i:i+mbSize-1,j:j+mbSize-1),mbSize);
        stepSize = stepMax; 
        computations = computations + 1;

        % This is the calculation of the outer 8 points
        % m is row(vertical) index
        % n is col(horizontal) index
        % this means we are scanning in raster order
        for m = -stepSize : stepSize : stepSize        
            for n = -stepSize : stepSize : stepSize
                refBlkVer = y + m;   % row/Vert co-ordinate for ref block
                refBlkHor = x + n;   % col/Horizontal co-ordinate
                if ( refBlkVer < 1 || refBlkVer+mbSize-1 > row ...
                     || refBlkHor < 1 || refBlkHor+mbSize-1 > col)
                     continue;
                end

                costRow = m/stepSize + 2;
                costCol = n/stepSize + 2;
                if (costRow == 2 && costCol == 2)
                    continue
                end
                costs(costRow, costCol ) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), ...
                    imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1), mbSize);
                computations = computations + 1;
            end
        end
        
        % Now we find the vector where the cost is minimum
        % and store it ... 
        
        [dx, dy, min1] = minCost(costs);      % finds which macroblock in imgI gave us min Cost
            
              
        % Find the exact co-ordinates of this point

        x1 = x + (dx-2)*stepSize;
        y1 = y + (dy-2)*stepSize;
            
        % Now find the costs at 8 points right next to the center point
        % (x,y) still points to the center
        
        stepSize = 1;
        for m = -stepSize : stepSize : stepSize        
            for n = -stepSize : stepSize : stepSize
                refBlkVer = y + m;   % row/Vert co-ordinate for ref block
                refBlkHor = x + n;   % col/Horizontal co-ordinate
                if ( refBlkVer < 1 || refBlkVer+mbSize-1 > row ...
                     || refBlkHor < 1 || refBlkHor+mbSize-1 > col)
                     continue;
                end

                costRow = m/stepSize + 2;
                costCol = n/stepSize + 2;
                if (costRow == 2 && costCol == 2)
                    continue
                end
                costs(costRow, costCol ) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), ...
                    imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1), mbSize);
                computations = computations + 1;
            end
        end
        
        % now find the minimum amongst this
        
        [dx, dy, min2] = minCost(costs);      % finds which macroblock in imgI gave us min Cost
            
              
        % Find the exact co-ordinates of this point

        x2 = x + (dx-2)*stepSize;
        y2 = y + (dy-2)*stepSize;
        
        % the only place x1 == x2 and y1 == y2 will take place will be the
        % center of the search region
        
        if (x1 == x2 && y1 == y2)
            % then x and y still remain pointing to j and i;
            NTSSFlag = -1; % this flag will take us out of any more computations 
        elseif (min2 <= min1)
            x = x2;
            y = y2;
            NTSSFlag = 1; % this flag signifies we are going to go into NTSS mode
        else
            x = x1;
            y = y1;
            NTSSFlag = 0; % This value of flag says, we go into normal TSS
        end
        
        
        if (NTSSFlag == 1)
            % Now in order to make sure that we dont calcylate the same
            % points again which were in the initial center window we take
            % care as follows
            
            costs = ones(3,3) * 65537;
            costs(2,2) = min2;
            stepSize = 1;
            for m = -stepSize : stepSize : stepSize        
                for n = -stepSize : stepSize : stepSize
                    refBlkVer = y + m;   % row/Vert co-ordinate for ref block
                    refBlkHor = x + n;   % col/Horizontal co-ordinate
                    if ( refBlkVer < 1 || refBlkVer+mbSize-1 > row ...
                           || refBlkHor < 1 || refBlkHor+mbSize-1 > col)
                        continue;
                    end
                    
                    if ( (refBlkVer >= i - 1  && refBlkVer <= i + 1) ...
                            && (refBlkHor >= j - 1  && refBlkHor <= j + 1) )
                        continue;
                    end
                    
                    costRow = m/stepSize + 2;
                    costCol = n/stepSize + 2;
                    if (costRow == 2 && costCol == 2)
                        continue
                    end
                    costs(costRow, costCol ) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), ...
                         imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1), mbSize);
                    computations = computations + 1;
                end
            end
                
            % now find the minimum amongst this
        
            [dx, dy, min2] = minCost(costs);      % finds which macroblock in imgI gave us min Cost
            
            % Find the exact co-ordinates of this point and stop

            x = x + (dx-2)*stepSize;
            y = y + (dy-2)*stepSize;            
            
        elseif (NTSSFlag == 0)
            % this is when we are going about doing normal TSS business
            costs = ones(3,3) * 65537;
            costs(2,2) = min1;
            stepSize = stepMax / 2;
            while(stepSize >= 1)  
                for m = -stepSize : stepSize : stepSize        
                    for n = -stepSize : stepSize : stepSize
                        refBlkVer = y + m;   % row/Vert co-ordinate for ref block
                        refBlkHor = x + n;   % col/Horizontal co-ordinate
                        if ( refBlkVer < 1 || refBlkVer+mbSize-1 > row ...
                            || refBlkHor < 1 || refBlkHor+mbSize-1 > col)
                            continue;
                        end

                        costRow = m/stepSize + 2;
                        costCol = n/stepSize + 2;
                        if (costRow == 2 && costCol == 2)
                            continue
                        end
                        costs(costRow, costCol ) = costFuncMAD(imgP(i:i+mbSize-1,j:j+mbSize-1), ...
                                imgI(refBlkVer:refBlkVer+mbSize-1, refBlkHor:refBlkHor+mbSize-1), mbSize);
                        computations = computations + 1;
                    
                    end
                end
        
                % Now we find the vector where the cost is minimum
                % and store it ... this is what will be passed back.
        
                [dx, dy, min] = minCost(costs);      % finds which macroblock in imgI gave us min Cost
            
            
                % shift the root for search window to new minima point

                x = x + (dx-2)*stepSize;
                y = y + (dy-2)*stepSize;
            
                stepSize = stepSize / 2;
                costs(2,2) = costs(dy,dx);
            
            end
        end

        vectors(1,mbCount) = y - i;    % row co-ordinate for the vector
        vectors(2,mbCount) = x - j;    % col co-ordinate for the vector            
        mbCount = mbCount + 1;
        costs = ones(3,3) * 65537;
    end
end

motionVect = vectors;
NTSScomputations = computations/(mbCount - 1);
                    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产性色一区二区| www.在线欧美| 亚洲成人动漫在线观看| 中文字幕亚洲欧美在线不卡| 国产欧美日韩亚州综合| 久久精品亚洲一区二区三区浴池| 欧美大尺度电影在线| 91精品国产综合久久久蜜臀图片 | 日韩一区二区精品在线观看| 欧美日本精品一区二区三区| 欧美精品在线视频| 欧美日韩国产精品成人| 91精品国产综合久久蜜臀| 欧美一级片免费看| 26uuu亚洲| 国产精品蜜臀在线观看| 国产精品久久久久精k8| 五月天欧美精品| 蜜桃av噜噜一区二区三区小说| 蜜桃视频在线一区| 国产一区二区精品久久91| 国产成人精品一区二区三区四区 | 免费高清不卡av| 久久丁香综合五月国产三级网站| 国产一区二区女| av在线一区二区| 欧美卡1卡2卡| 精品成人一区二区三区四区| 中文字幕中文乱码欧美一区二区| 亚洲精品乱码久久久久久| 亚洲bdsm女犯bdsm网站| 国内精品久久久久影院色| 成人av手机在线观看| 欧美性猛片xxxx免费看久爱| 亚洲精品一区二区三区福利| 日韩毛片视频在线看| 天天综合色天天综合色h| 激情综合一区二区三区| 色八戒一区二区三区| 日韩视频免费观看高清在线视频| 国产精品久久久久影院色老大| 亚洲一二三四在线| 韩国成人在线视频| 欧美在线观看视频一区二区 | 精品一区二区三区不卡 | 91久久精品一区二区| 日韩视频一区二区在线观看| 亚洲欧美日韩在线不卡| 狂野欧美性猛交blacked| 色中色一区二区| 国产欧美va欧美不卡在线| 亚洲午夜国产一区99re久久| 成熟亚洲日本毛茸茸凸凹| 欧美精品在线一区二区三区| 亚洲精品成人悠悠色影视| 国产一区美女在线| 91.麻豆视频| 亚洲一区av在线| 色综合色综合色综合色综合色综合 | 精品亚洲porn| 欧美美女喷水视频| 亚洲国产精品成人久久综合一区 | 亚洲精品在线免费播放| 天堂在线一区二区| 在线观看91视频| 亚洲免费在线播放| av不卡在线播放| 亚洲成人资源在线| 久久99精品国产麻豆不卡| 91精品1区2区| 亚洲人123区| 不卡影院免费观看| 国产精品少妇自拍| 粉嫩高潮美女一区二区三区 | 午夜激情久久久| 欧美色图在线观看| 一区二区三区美女视频| 色综合久久久久综合体| 亚洲精品少妇30p| 日本黄色一区二区| 日韩一区在线播放| 91亚洲精华国产精华精华液| 亚洲色图.com| 欧美午夜片在线看| 一区二区三区在线观看视频| 欧美亚洲综合另类| 婷婷开心激情综合| 欧美www视频| 国产成人精品网址| 欧美激情一区二区三区蜜桃视频| 成人免费毛片app| 亚洲精品国产第一综合99久久| 欧美午夜在线观看| 强制捆绑调教一区二区| 欧美精品一区二区三区四区| 国产成人免费在线| 亚洲精品写真福利| 欧美精品1区2区3区| 国产一区二区主播在线| 亚洲少妇30p| 91麻豆精品国产91| 国产精品亚洲一区二区三区在线| 国产精品久久久久久福利一牛影视 | 久久久亚洲高清| 97久久精品人人澡人人爽| 亚洲国产精品久久人人爱蜜臀| 日韩一区二区电影| 成人免费视频视频| 亚洲综合清纯丝袜自拍| 日韩无一区二区| av在线不卡观看免费观看| 亚洲五月六月丁香激情| xnxx国产精品| 在线观看av一区二区| 美女一区二区三区| 亚洲天堂a在线| 精品日韩99亚洲| 在线免费亚洲电影| 韩国精品久久久| 亚洲成人资源网| 中文字幕一区在线观看| 91精品中文字幕一区二区三区| 国产福利不卡视频| 亚洲国产一区二区三区青草影视 | 亚洲精品成人天堂一二三| 欧美一卡2卡3卡4卡| 99国内精品久久| 精品一区二区在线视频| 日韩理论片在线| 国产三级精品在线| 欧美一区二区三区播放老司机| 欧美精品久久天天躁| 成人午夜视频福利| 精品一区二区免费视频| 精品99久久久久久| 9色porny自拍视频一区二区| 成人国产免费视频| 中文字幕久久午夜不卡| 精品国产一区二区在线观看| 欧美日韩亚洲综合一区| 91丨九色丨尤物| 国产精品性做久久久久久| 日本一不卡视频| 午夜精品久久久久影视| 1区2区3区欧美| 欧美国产日韩亚洲一区| 欧美成人r级一区二区三区| 欧美精品第1页| 欧美美女视频在线观看| 欧美日韩美少妇| 欧美三级电影网| 欧美美女黄视频| 91精品久久久久久久99蜜桃| 欧美人妇做爰xxxⅹ性高电影| 欧美日韩中字一区| 欧美日韩一区在线| 欧美日本视频在线| 欧美一区二区三区免费| 日韩欧美在线网站| 欧美变态口味重另类| 日韩精品中文字幕一区| 精品99久久久久久| 国产欧美精品国产国产专区| 国产精品视频观看| 亚洲男女一区二区三区| 国产在线不卡一卡二卡三卡四卡| 日本亚洲天堂网| 久久99精品久久只有精品| 九一九一国产精品| 国产福利视频一区二区三区| 9i在线看片成人免费| 色综合视频在线观看| 欧美美女黄视频| 国产午夜精品久久久久久久| 国产精品久久99| 天天色 色综合| 国产一区不卡视频| av网站一区二区三区| 欧美性猛交xxxxxx富婆| 日韩一区二区精品在线观看| 欧美经典一区二区| 亚洲综合在线五月| 美日韩一区二区| 成人免费电影视频| 欧美视频在线播放| 日韩欧美123| 亚洲免费看黄网站| 美女视频黄频大全不卡视频在线播放| 国产专区欧美精品| 色天天综合色天天久久| 日韩一级高清毛片| 日韩毛片在线免费观看| 久久99精品国产麻豆不卡| 成人激情综合网站| 91精品国产综合久久蜜臀| 国产精品视频yy9299一区| 日韩福利电影在线观看| 99久久国产综合精品女不卡| 亚洲综合一区在线| 美女免费视频一区|