亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产不卡高清在线观看视频| 欧美中文一区二区三区| 国产精品99久| 成人动漫在线一区| 欧美在线一区二区| 国产不卡视频在线观看| 91免费看`日韩一区二区| 欧美老女人第四色| 久久网站最新地址| 亚洲一区在线视频| 韩日精品视频一区| 色婷婷综合久久| 精品99一区二区三区| 粉嫩绯色av一区二区在线观看| 国模无码大尺度一区二区三区| 奇米四色…亚洲| 成人激情电影免费在线观看| 欧美性猛交xxxx乱大交退制版| www.欧美日韩| 91免费看片在线观看| 国产一区二区三区在线观看免费| 亚洲成人福利片| 一区二区三区在线观看网站| 午夜欧美大尺度福利影院在线看| 成人欧美一区二区三区在线播放| 欧美精品少妇一区二区三区 | 高清国产午夜精品久久久久久| 国内精品伊人久久久久av影院| 国内精品在线播放| 欧美视频在线不卡| 欧美国产日本视频| 蜜桃一区二区三区四区| 色就色 综合激情| 久久嫩草精品久久久精品一| 亚洲综合在线免费观看| 国产激情视频一区二区三区欧美| 成人一区在线看| 日韩三区在线观看| 久久综合久久综合久久综合| 国产视频不卡一区| 青青草国产成人av片免费| 老司机精品视频在线| 国产精品香蕉一区二区三区| 欧美久久久一区| 中文字幕一区视频| 午夜欧美一区二区三区在线播放| 美女mm1313爽爽久久久蜜臀| 一区免费观看视频| 亚洲国产成人91porn| 日本不卡不码高清免费观看| 91国产丝袜在线播放| 国产人成一区二区三区影院| 一本一本大道香蕉久在线精品| 欧洲亚洲精品在线| 国产精品灌醉下药二区| 国产中文字幕精品| 91视频精品在这里| 欧美国产日韩在线观看| 国产精品自在在线| 欧美精品一区在线观看| 久久se这里有精品| caoporn国产一区二区| 国产午夜精品久久久久久免费视| 一区二区三区不卡视频在线观看 | 狠狠色丁香九九婷婷综合五月| 成人一道本在线| 2020国产精品久久精品美国| 日本网站在线观看一区二区三区| 成人av资源下载| 国产亚洲精品超碰| 丝袜a∨在线一区二区三区不卡 | 久久综合色综合88| 激情五月婷婷综合网| 日韩一级黄色片| 蜜桃视频一区二区三区在线观看| 99久久99久久久精品齐齐| 777xxx欧美| 日日噜噜夜夜狠狠视频欧美人| 国产精品白丝jk白祙喷水网站| 欧美亚洲高清一区| 国产午夜精品福利| 日本网站在线观看一区二区三区| 91丨porny丨国产入口| 亚洲免费观看高清完整版在线观看熊| 久草这里只有精品视频| 精品国产一区二区国模嫣然| 久久9热精品视频| 久久先锋影音av| 日韩高清一级片| 日韩欧美中文字幕精品| 麻豆精品国产传媒mv男同 | 国产农村妇女精品| 日本成人在线看| 色婷婷精品大在线视频| 亚洲午夜一二三区视频| 这里只有精品电影| 国产在线视视频有精品| 国产视频不卡一区| 色94色欧美sute亚洲线路二 | 婷婷中文字幕一区三区| 欧美一级在线免费| 国产剧情av麻豆香蕉精品| 中文字幕亚洲精品在线观看 | 国产精品久久久久久久久久久免费看| 久久99精品视频| 欧美激情艳妇裸体舞| 在线免费av一区| 日韩av在线播放中文字幕| 欧美网站大全在线观看| 狂野欧美性猛交blacked| 国产欧美视频在线观看| 91国内精品野花午夜精品| 亚洲免费观看高清完整版在线观看熊 | 粉嫩蜜臀av国产精品网站| 久久久久久久久久美女| 色综合久久天天| 视频一区免费在线观看| 国产无人区一区二区三区| 在线观看日产精品| 激情小说欧美图片| 亚洲精品国产精品乱码不99 | 亚洲午夜一区二区| 精品国产91久久久久久久妲己| 免费美女久久99| 中文一区二区完整视频在线观看 | 欧美经典一区二区| 欧美日韩电影在线播放| 高清不卡在线观看| 亚洲成人在线免费| 欧美一区二区三区在线观看 | 91成人免费网站| 国内精品嫩模私拍在线| 亚洲一二三区视频在线观看| 久久久影视传媒| 欧美日韩中文字幕精品| 天天影视色香欲综合网老头| 91精品国产一区二区| 99re热这里只有精品视频| 免费观看在线色综合| 亚洲精品视频自拍| 欧美体内she精视频| 国产成人综合网| 美国毛片一区二区三区| 国产香蕉久久精品综合网| 欧美精品久久久久久久多人混战| 免费在线观看精品| 一区二区三区鲁丝不卡| 欧美日韩不卡一区二区| 97国产精品videossex| 国产乱人伦精品一区二区在线观看| 国产精品欧美一区二区三区| 日韩一区二区精品葵司在线| 91蜜桃婷婷狠狠久久综合9色| 亚洲主播在线观看| 亚洲欧美一区二区在线观看| 久久先锋影音av鲁色资源网| aaa欧美日韩| 韩国欧美国产1区| 国产精品国产三级国产普通话三级 | 国产福利精品一区| 美女网站一区二区| 午夜激情一区二区| 一区二区三区精品在线| 欧美一区二区视频在线观看2020| 国产麻豆视频一区二区| ㊣最新国产の精品bt伙计久久| 欧美色男人天堂| 91麻豆精品一区二区三区| 国产精选一区二区三区| 韩国女主播一区| 亚洲另类色综合网站| 国产精品看片你懂得| 久久综合色8888| 欧美无乱码久久久免费午夜一区| 国产真实乱对白精彩久久| 亚洲激情av在线| 国产精品二三区| 国产精品看片你懂得| 日韩一区二区不卡| 3d成人动漫网站| 99精品国产99久久久久久白柏| 日本亚洲最大的色成网站www| 中文字幕一区二区三区不卡在线| 日韩色视频在线观看| 日韩三级免费观看| 91久久精品国产91性色tv| 国内精品国产成人国产三级粉色| 一区二区三区 在线观看视频| 26uuu色噜噜精品一区二区| 日本道色综合久久| 日本大香伊一区二区三区| 欧美亚洲国产bt| 欧美精品乱码久久久久久按摩| 成人晚上爱看视频| 99综合影院在线| 精品一区二区在线观看| 国产在线精品国自产拍免费| 国产精品系列在线播放| 成人一级视频在线观看| 色悠悠久久综合|