problem with distribute particles around the centroid + particle filter
1 view (last 30 days)
Show older comments
good morning every one
I have a problem with distribute particles around the centroid for multi moving objects
how can I do it ?
this is my code
clc;
close all;
clear all;
img = imread('frame1.jpg');
O =4; % number of object
d=3; %Dimanational array ( x, y , z)
N=50; % number of particle
S_X= 32; %sigma x
S_y=32; % sigma y
S_I=1; % sigma I
yq =[218; 179]; %centroid1
pos_index =[1,3];
ON = ones(1 ,N); % matrix all elaemnt is 1
SK= zeros (d,1);% initial matrix
SK(pos_index) =yq;% insert centroid values
SK(:,1,1)=[218, 177,170]; % object 1
SK(:,1,2)=[215,145,1]; % object 2
SK(:,1,3)=[177,254,1]; % object 3
SK(:,1,4)=[250,400,1];% object 4
R1= diag([S_X,S_y,S_I].^2);% diagnal matrix
RK = zeros(d,d); %create matrix to multiplcation of particle
RY=[1 0 0;0 1 0; 0 0 1];
RK(1:3,1:3)=RY; %
SK = SK( :,ON,:);
for i=1:O
SK(:,:,i)=SK(:,:,i)+ chol (R1)' * randn (d,N);
end
% image(img);
hold on;
plot (SK (pos_index(1), : ), SK (pos_index(2),:),'r+');
% plot (SK2 (pos_index(1), : ), SK2 (pos_index(2),:),'r+');
hold off;
4 Comments
John BG
on 8 Feb 2016
Nourah please supply frame1.jpg, hang it next to your question so we don't have to guess it, and can run your code, and help you find answers. If it's a huge file, since it's an image, just crop it and hand a portion of it.
Awaiting answer
Answers (0)
See Also
Categories
Find more on Feature Detection and Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!