当前位置:网站首页>[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code

[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code

2022-04-23 20:08:00 Matlab research studio

1 brief introduction

In order to solve the problem of target tracking loss caused by scale change in video frame target tracking , A processing method of adaptive tracking window is proposed , The difference between the estimated position of the next frame and the target position of the current frame is used as the detection amount , Adaptively adjust the tracking window , Achieve effective detection and tracking of targets . Experimental results show that : This method can effectively reduce the probability of target loss , Prevent false tracking of targets , Adapt to target scale changes .​

2 Part of the code

% extracts the center (cc,cr) and radius of the largest blobfunction [stats,N,flag,foremm]=extract(Imwork,Imback,index)%,fig1,fig2,fig3,fig15,index)    cc = 0;  cr = 0;  flag = 0;  [MR,MC,Dim] = size(Imback);  %Imwork(:,:,1),Imwork(:,:,2),Imwork(:,:,3), They are the images RGB value ,  % The purpose of the program is to extract two pictures R,G,B The difference between the three channels is greater than 10 Part of ( Two valued )  % subtract background & select pixels with a big difference   fore = zeros(MR,MC);            fore = imabsdiff(Imwork,Imback);  % To binarize , Remove image noise    Im2=im2bw(fore,80/255);  % Expand the image   foremm = bwmorph(Im2,'dilate',4); %2 time  % select largest object  labeled = bwlabel(foremm,4);              % Label the connected part of the binary image .  stats = regionprops(labeled,['basic']);   % obtain label Graphic properties of   % Use string 'basic', Property :'Area','Centroid' and 'BoundingBox' Will be calculated   [N,W] = size(stats);  if N < 1    return     end  % do bubble sort (large to small) on regions in case there are more than 1  id = zeros(N);            %   N Is the number of detected targets   for i = 1 : N    id(i) = i;  end  for i = 1 : N-1    for j = i+1 : N      if stats(i).Area < stats(j).Area        tmp = stats(i);        stats(i) = stats(j);        stats(j) = tmp;        tmp = id(i);        id(i) = id(j);        id(j) = tmp;      end    end  end  % make sure that there is at least 1 big region  if stats(1).Area < 100     return  end  %selected = (labeled==id(1));    flag = 1;  return

3 Simulation results

4 reference

[1] Li Yanyan , Tian Ruijuan , Zhang Xianxian . A combination method based on frame difference Kalman Filtering moving target tracking method [J]. Ordnance automation , 2019, 38(4):4.

About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .

Some theories cite network literature , If there is infringement, contact the blogger to delete .

版权声明
本文为[Matlab research studio]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232006078273.html