CCTV viewing area and angles

escribblings

New member
Joined
Jan 25, 2015
Messages
8
Hi. First post so go gentle.


Just for background I got a Grade C GCSE in Statistics (and RSA Stage 1 (I think) at the same time) in 1994 and a Grade B GCSE in Mathematics in 1995. So I'm not a complete dunce, but I am very rusty.


What I am trying to work out here is not for any course work, it is for a personal project. Many people would probably have accepted a rough answer by now, but I like challenges - and now this one has bested me and I am desperately trying to figure it out.


So here it is.


I am trying to calculate the viewing angle required of a CCTV camera to view a set area at a set distance. More specifically, to be able to view said area in sufficient detail to make out personal features. In doing research, I have come across a statement that says the the minimum requirement for facial recognition is 40 pixels per foot. As such, a camera with a VGA resolution of 640p×480p would in theory be able to pick out a face over an area of 16'×12'.


If I were to mount the camera directly opposite and central to the area I wish to view, I would have no issues calculating the viewing angle of the camera.


e.g.


The camera is mounted 60' from the area to be viewed which is 16'×12'.


Now there is still one aspect I am unsure of, and that is how the cameras viewing angle is measured, but that is a minor detail and once I know the correct way I can factor that in accordingly. In the mean time I will solve the viewing angle for the above situation using both methods. In both methods we know that camera is perfectly central to the viewing area.


Method 1: Viewing angle based on the width of the area.


In this instance we are looking at a tetrahedron with a base of 16'×12' and a height of 60'. As those are the only measurements we currently have the easiest option is to split it down the centre and use Pythagoras on the remaining half.


Method 2: Viewing angle based on the diagonal of the area.


This is much the same as method 1, but this time we are looking at a cone with a base diameter of 20' (the diagonal of the area) and a height of 60' (but flattened into a triangle for this problem)


Method 1:


√((16÷2)²+60²) = 60.539'


Method 2: Is practically the same, but requires solving the hypotenuse of the viewing area.


√(16²+12²) = 20
√((20÷2)²+60²) = 60.828'


2 slightly different answers, but as I say I can factor in the correct one later.


The issue I have is that both of the above equations simply assume the top point of the cone or tetrahedron is perfectly central to the base.


However, the camera will be mounted 20' above ground level, and at least 10' to the side of the area to be viewed. And this is where I am falling down. Because i want to still be able to view the entire vertical area of 16'×12' at 40px/ft, even though the plane is not perpendicular to the point of origin, if that makes sense.


If this helps, here are the X,Y,Z co-ordinates of the 4 corners for the area to be viewed.


A - 0,0,0
B - 0,0,16
C - 0,12,0
D - 0,12,16


and the co-ordinates for the position of the camera


Starting position


E - 60,6,8


New position


F - 60,20,26


The plane of 16'×12' will somehow slice across the base of the tetrahedron or cone, which will rotate about point D until point E is in line with and extended to point F. And then the angle widened to make sure all other points are included.


Can anyone help?

[Edit]

It struck me overnight that I may not be successful in getting the entire area I want to view at the correct definition level.

In this case the top left corner (C 0,12,0) is more important than the bottom right (B 0,0,16).

But I would also be interested to know what the minimum resolution needed would be to get the 16'×12' area at that distance, height and offset.

P.s. I am quite happy to do the math, I'm am just not sure how to go about it.

[/edit]
 
Last edited:
OK, so no replies :(.

Well I have persevered with this and now have some more figures to work with.

So here is what I have done - can you help me with anything I have done wrong and help me to solve the remaining portions.

cctv_iso_zpsd887d590.jpg

So I created the above image to help illustrate the problem and my workings.

The rectangle, A̅B̅C̅D̅, represents the area to be viewed 16'×12'. Point E is the location of the camera, 60' to the right, 10' back and 8' above the area in question.

A̅C̅ & B̅D̅ = 16'
A̅B̅, C̅D̅ & f̅h̅ = 12'
C̅f̅ & D̅h̅ = 10' making A̅f̅ & B̅h̅ = 26'
h̅j̅ & i̅E̅ = 8' making f̅j̅ & g̅E̅ = 20'
f̅g̅, h̅i̅ & j̅E̅ = 60


To work out the distance from the camera to the edge points of the area I created extra points to make some right angled triangles to get the extra measurements required.

A̅g̅ = √(A̅f̅²+f̅g̅²) = 65.391 130 9'
B̅i̅ = √(B̅h̅²+h̅i̅²) = 65.391 130 9'
C̅g̅ = √(C̅f̅²+f̅g̅²) = 60.827 625 3'
D̅i̅ = √(D̅h̅²+h̅i̅²) = 60.827 625 3'


This now allows me to work the distance to the edge points.

E̅A̅ = √(A̅g̅²+E̅g̅²) = 68.381 283 99'
E̅B̅ = √(B̅i̅²+E̅i̅²) = 65.878 676 37'
E̅C̅ = √(C̅g̅²+E̅g̅²) = 64.031 242 37'
E̅D̅ = √(D̅i̅²+E̅i̅²) = 61.351 446 6'


With the lengths now in place, I can work out the angles at E.

∠AEB = Cos⁻¹((E̅A̅²+E̅B̅²-A̅B̅²)÷(2×E̅A̅×E̅B̅)) = 10.031 402 26°
∠AEC = Cos⁻¹((E̅A̅²+E̅C̅²-A̅C̅²)÷(2×E̅A̅×E̅C̅)) = 13.362 495 48°
∠AED = Cos⁻¹((E̅A̅²+E̅D̅²-A̅D̅²)÷(2×E̅A̅×E̅D̅)) = 16.621 105 88°
∠BEC = Cos⁻¹((E̅B̅²+E̅C̅²-B̅C̅²)÷(2×E̅B̅×E̅C̅)) = 17.637 604 37°
∠BED = Cos⁻¹((E̅B̅²+E̅D̅²-B̅D̅²)÷(2×E̅B̅×E̅D̅)) = 13.864 275 68°
∠CED = Cos⁻¹((E̅C̅²+E̅D̅²-C̅D̅²)÷(2×E̅C̅×E̅D̅)) = 10.708 268 24°


Extending E̅B̅, E̅C̅ & E̅D̅ to match E̅A̅,through points B, C & D respectively, gives 4 isosceles triangles with sides E̅A̅, E̅k̅, E̅l̅ & E̅m̅.

E̅k̅, E̅l̅ & E̅m̅ = E̅A̅

B̅k̅ = E̅A̅-E̅B̅ = 2.502 607 62'
C̅l̅ = E̅A̅-E̅C̅ = 4.350 041 62'
D̅m̅ = E̅A̅-E̅D̅ = 7.029 837 39'


The bases of each triangle are as follows

A̅k̅ = √(E̅A̅²+E̅k̅²-2×E̅A̅×E̅k̅×Cos(∠AEk​)) = 11.956 978 05'
A̅l̅ = √(E̅A̅²+E̅l̅²-2×E̅A̅×E̅l̅×Cos(∠AEl​)) = 15.911 733 61'
A̅m̅ = √(E̅A̅²+E̅m̅²-2×E̅A̅×E̅m̅×Cos(∠AEm​)) = 19.767 449 99'
k̅l̅ = √(E̅k̅²+E̅l̅²-2×E̅k̅×E̅l̅×Cos(∠kEl​)) = 20.967 086 41'
k̅m̅ = √(E̅k̅²+E̅m̅²-2×E̅k̅×E̅m̅×Cos(∠kEm​)) = 16.506 376 05'
l̅m̅ = √(E̅l̅²+E̅m̅²-2×E̅l̅×E̅m̅×Cos(∠lEm​)) = 12.761 496 47'


Which makes an irregular quadrilateral with the following angles

∠Akl = Cos⁻¹((A̅k̅²+k̅l̅²-A̅l̅²)÷(2×A̅k̅×k̅l̅)) = 48.931 398 9°
∠Alk = Cos⁻¹((A̅l̅²+k̅l̅²-A̅k̅²)÷(2×A̅l̅×k̅l̅)) = 30.509 359 31°
∠kAm = Cos⁻¹((A̅k̅²+A̅m̅²-k̅m̅²)÷(2×A̅k̅×A̅m̅)) = 56.449 048 33°
∠kmA = Cos⁻¹((A̅m̅²+k̅m̅²=A̅k̅²)÷(2×A̅m̅×k̅m̅)) = 37.135 276 72°
∠mkl = Cos⁻¹((k̅l̅²+k̅m̅²-l̅m̅²)÷(2×k̅l̅×k̅m̅)) = 37.489 245 23°
∠mlk = Cos⁻¹((k̅l̅²+l̅m̅²-k̅m̅²)÷(2×k̅l̅×l̅m̅)) = 51.925 607 92°
∠lAm = Cos⁻¹((A̅l̅²+A̅m̅²-l̅m̅²)÷(2×A̅l̅×A̅m̅)) = 40.115 358 31°
∠lmA = Cos⁻¹((A̅m̅²+l̅m̅²-A̅l̅²)÷(2×A̅m̅×l̅m̅)) = 53.454 504 41°

∠Akm = Cos⁻¹((A̅k̅²+k̅m̅²-A̅m̅²)÷(2×A̅k̅×k̅m̅)) = 86.415 675 05°
∠kml = Cos⁻¹((k̅m̅²+l̅m̅²-k̅l̅²)÷(2×k̅m̅×l̅m̅)) = 90.585 146 62°
∠mlA = Cos⁻¹((A̅l̅²+l̅m̅²-A̅m̅²)÷(2×A̅l̅×l̅m̅)) = 86.430 137 28°
∠lAk = Cos⁻¹((A̅k̅²+A̅l̅²-k̅l̅²)÷(2×A̅k̅×A̅l̅)) = 96.559 241 79°


The only issues I have now is that

∠Akl+∠Alk+∠kAm+∠kmA+∠mkl+∠mlk+∠lAm+∠lmA = 356.009 799 13°

and

∠Akm+∠kml+∠mlA+∠lAk = 359.990 200 74°

do not have the same result, and also do not add up to 360°

I can only assume this is due to compounding rounding errors. At least the second answer is less than 0.01° out.

With these measurements, is it possible (without drawing to scale or using trial and error) to work out the smallest rectangle that this irregular quadrilateral will fit inside??
 
Top