필터 지우기
필터 지우기

Camera covered L-shape area

조회 수: 1 (최근 30일)
Ayda
Ayda 2011년 12월 3일
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.

답변 (1개)

Image Analyst
Image Analyst 2011년 12월 3일
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
Ayda
Ayda 2011년 12월 4일
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 2011년 12월 5일
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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for IP Cameras에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by