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

📄 meanshift.m

📁 Mean Shift 这个概念最早是由Fukunaga等人[1]于1975年在一篇关于概率密度梯度函数的估计中提出来的,其最初含义正如其名,就是偏移的均值向量,在这里Mean Shift是一个名词,它
💻 M
字号:
% Adam Kukucka% Zach Clay% Marcelo Molina    % CSE 486 Project 3function [ rowcenter colcenter M00 ] = meanshift(I, rmin, rmax, cmin,...    cmax, probmap)%inputs%   rmin, rmax, cmin, cmax are the coordiantes of the window%   I is the image%outputs%   colcenter rowcenter are the new center coordinates%   Moo is the zeroth mean% **********************************************************************% initialize% **********************************************************************M00 = 0; %zeroth meanM10 = 0; %first moment for xM01 = 0; %first moment for yhistdim = (0:1:255); % dimensions of histogram... 0 to 255, increment by 1[rows cols] = size(I);cols = cols/3; % **********************8% **********************************************************************% Main code% **********************************************************************% determine zeroth momentfor c = cmin:cmax    for r = rmin:rmax        M00 = M00 + probmap(r, c);    endend% determine first moment for x(col) and y(row)for c = cmin:cmax    for r = rmin:rmax        M10 = M10 + c*probmap(r,c);        M01 = M01 + r*probmap(r,c);    endend% determine new centroid% x is cols    colcenter = M10/M00;% y is rows    rowcenter = M01/M00;

⌨️ 快捷键说明

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