Clear Filters
Clear Filters

Camera covered L-shape area

1 view (last 30 days)
Ayda
Ayda on 3 Dec 2011
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.

Answers (1)

Image Analyst
Image Analyst on 3 Dec 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 Comments
Ayda
Ayda on 4 Dec 2011
We had assume the covered area is rectangle.
from where you get that we assume it circle?
we do not work on corner cameras, our camera is Dome Camera.
Image Analyst
Image Analyst on 5 Dec 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?

Sign in to comment.

Categories

Find more on MATLAB Support Package for IP Cameras 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!