Camera covered L-shape area
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Good evening\morning
I work on a project that finds the optimum location of cameras with minimizing the number of cameras.
I already wrote a code that works for square or rectangle shape.
my code -find the matrix that represent the covered area by one camera. -put the matrices of all cameras in a way that is suitable to use the bintprog function.
function C=OneCamera(u,v)
clc
LCamera = 5;
WCamera = 6;
LArea = 5;
WArea = 6;
A = [];
radios = 16;
NumOfConstrants =30;
for u=1:LCamera
for v=1:WCamera
for i=1:LArea
for j=1:WArea
d=(i-u)^2+(j-v)^2;
if d<radios
C(i,j)=1;
else C(i,j)=0;
end;
end;
end
u
v
C
J= reshape (C',30,1)
A(:,end+1) = -J
end
end
b = - ones(NumOfConstrants,1);
f = ones(30,1);
x = bintprog(f,A,b)
Num_of_camera_and_cam_location=reshape(x',6,5)
end
NOW, i tried to write a code for different layouts such as L-shape and U-shape I have some difficulties,,if I assume that i have L-shape I divide the area to two areas and find the matrices. BUT how will bintprog will work with that.
0 comentarios
Respuestas (1)
Image Analyst
el 3 de Dic. de 2011
Just have two cameras, one at each endpoint of the L looking toward the corner. That should cover the entire field of view, depending on your lens. Why does your code assume each camera's field of view is a circle? Most cameras have rectangular fields of view.
2 comentarios
Image Analyst
el 5 de Dic. de 2011
Because I saw the Pythagorean formula
d=(i-u)^2+(j-v)^2;
if d<radios
and a comparison of that distance with radios, which I took to mean a misspelling of radius rather than radios since you were talking about distances from cameras not from radios. Correct me if I'm wrong. I don't know what you mean by corner camera or dome cameras - can you provide examples? Are your cameras high up looking down at some rectangular are on the floor? If so do you want or need some kind of correction for the perspective change over the field of view?
Ver también
Categorías
Más información sobre Camera Views en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!