In my prior post (http://www.ipcamtalk.com/showthread.php?2697-Hik-bullet-Install-with-custom-mounting-plates), I pondered the published angle of view of the cameras and questioned if they were horizontal or diagonal angles provided.
Turns out, the internet if full of wrong information. So with a bunch of math, pretty pictures, I present my case as to how and why what I tell you here is TRUTH.
First I started with my DS-2CD2332-I camera and this spec from HIK: http://www.hikvision.com/UploadFile/image/2014032411393544577.pdf
Well, all the angles for the different focal lengths are provided at 2 different aspect ratios, this should be a quick study and I can get back to my cold IPAs.
To calculate a horizontal FOV, all you need is the focal length and the width of the sensor. The width of the sensor might be different for the 2 aspect ratios, especially if they are giving diagonal angles, not horizontal.
My excel formula for sensor width =2*B4*TAN(RADIANS(C4)/2) – where B is focal length and C is angle of view.
Looking at the numbers, you see the sensor width changes with different lenses. So Hikvision is feeding us a load of crap and my work here is not done. The camera sensor cannot change size.
So with the Hikvision LIES, I went to the internet in search of some TRUTH. Google helped me with identifying a possible sensor, the Aptina AR0330. https://www.aptina.com/products/image_sensors/ar0330/
I moved forward with the possibility that this sensor is correct. What I care about is the sensor size, which is purported to be 5.07mm (H) x 3.38mm (V). It also has a resolution of 2304(H) x 1536(V) and a pixel size/pitch of 2.2µm.
I calculated the angles and compared them to the published angles, still not making any sense.
This calculation assumes one thing; the sensor has 2304 horizontal pixels and the output is 2048. The vertical pixels match, so I assume they are cropping 256 pixels from the sensor on the 3MP output and the effective sensor width is 4.51mm, not 5.07.
So putting the IPA back in the refrigerator, I needed to take some measurements from the camera. The old ruler trick is OK, but not very accurate. To do it properly, you need to know the principal point of the lens. http://www.cam-it.org/index.php?topic=5424.0 Here MaxIcon is assuming that the principal point is at the sensor plane. Well, that’s a bad assumption. The principal point is not a physical point, it’s an optical one (or virtual point) that could be anywhere behind the front of the lens and possibly way behind the sensor itself. Without getting too deep into it, it’s the point in the lens in which all incoming rays intersect. Like the tip of a pyramid. But, due to lightbending in the lenses, it’s not where you think it is.
And your triangle calculation, with one leg as the ruler and the other leg as this critical distance, can be wrong if your leg is wrong.
So, with the free tools online that use OpenCV to calculate intrinsic values, I was able to take some images and do all the math without rulers.
The hard GIVENs in these calculations are as follows
- Pixel size (assumed to be 2.2µm from Aptina)
- Chessboard/Checkerboard with known # of squares, known size of squares and mounted on a very flat plane.
With just this, I can calculate the ACTUAL focal length. I also get lens distortion data as well as lens principal point and lens center. Not needed for this endeavor.
So I printed a checkerboard, mounted it flat to a sheet of rigid carbon fiber and measured the actual size of the squares.
Then I setup the camera (v5.2.0 fw) to 3MP and took a series of stills and fed them to the camera calibration program.
It spits out the focal length is fx=fy=1827 pixels, so 1827 x 2.2µm= 4.02mm. Finally!, I can almost taste that hoppy beverage. The lens is 4mm, the calibration confirms it. The sensor is with great certainty the Aptina.
So you can take my FOV/Angle of View numbers above as TRUTH.
But, I couldn’t stop there. I had a 2.8mm DS-2CD2532F-IWS sitting nearby. One more data point, nothing like a double-check.
The 2.8mm camera calibration yielded a 3.25mm focal length. Ugh, uncertainty creeping back in. Grabbed the DS-2CD3332-I 2.8mm and took yet another series of photos, another calibration. Focal length = 3.20mm.
So at this point, I’m out of 2.8mm samples, BUT it appears that Hikvision is stuffing the 2.8mm cameras with 3.2mm lenses and lying to everyone. Or at least my batch.
Next I’ll tackle the 3MP vs 1080 FOV difference.
Turns out, the internet if full of wrong information. So with a bunch of math, pretty pictures, I present my case as to how and why what I tell you here is TRUTH.
First I started with my DS-2CD2332-I camera and this spec from HIK: http://www.hikvision.com/UploadFile/image/2014032411393544577.pdf
Well, all the angles for the different focal lengths are provided at 2 different aspect ratios, this should be a quick study and I can get back to my cold IPAs.
To calculate a horizontal FOV, all you need is the focal length and the width of the sensor. The width of the sensor might be different for the 2 aspect ratios, especially if they are giving diagonal angles, not horizontal.
My excel formula for sensor width =2*B4*TAN(RADIANS(C4)/2) – where B is focal length and C is angle of view.
Looking at the numbers, you see the sensor width changes with different lenses. So Hikvision is feeding us a load of crap and my work here is not done. The camera sensor cannot change size.
So with the Hikvision LIES, I went to the internet in search of some TRUTH. Google helped me with identifying a possible sensor, the Aptina AR0330. https://www.aptina.com/products/image_sensors/ar0330/
I moved forward with the possibility that this sensor is correct. What I care about is the sensor size, which is purported to be 5.07mm (H) x 3.38mm (V). It also has a resolution of 2304(H) x 1536(V) and a pixel size/pitch of 2.2µm.
I calculated the angles and compared them to the published angles, still not making any sense.
This calculation assumes one thing; the sensor has 2304 horizontal pixels and the output is 2048. The vertical pixels match, so I assume they are cropping 256 pixels from the sensor on the 3MP output and the effective sensor width is 4.51mm, not 5.07.
So putting the IPA back in the refrigerator, I needed to take some measurements from the camera. The old ruler trick is OK, but not very accurate. To do it properly, you need to know the principal point of the lens. http://www.cam-it.org/index.php?topic=5424.0 Here MaxIcon is assuming that the principal point is at the sensor plane. Well, that’s a bad assumption. The principal point is not a physical point, it’s an optical one (or virtual point) that could be anywhere behind the front of the lens and possibly way behind the sensor itself. Without getting too deep into it, it’s the point in the lens in which all incoming rays intersect. Like the tip of a pyramid. But, due to lightbending in the lenses, it’s not where you think it is.
And your triangle calculation, with one leg as the ruler and the other leg as this critical distance, can be wrong if your leg is wrong.
So, with the free tools online that use OpenCV to calculate intrinsic values, I was able to take some images and do all the math without rulers.
The hard GIVENs in these calculations are as follows
- Pixel size (assumed to be 2.2µm from Aptina)
- Chessboard/Checkerboard with known # of squares, known size of squares and mounted on a very flat plane.
With just this, I can calculate the ACTUAL focal length. I also get lens distortion data as well as lens principal point and lens center. Not needed for this endeavor.
So I printed a checkerboard, mounted it flat to a sheet of rigid carbon fiber and measured the actual size of the squares.
Then I setup the camera (v5.2.0 fw) to 3MP and took a series of stills and fed them to the camera calibration program.
It spits out the focal length is fx=fy=1827 pixels, so 1827 x 2.2µm= 4.02mm. Finally!, I can almost taste that hoppy beverage. The lens is 4mm, the calibration confirms it. The sensor is with great certainty the Aptina.
So you can take my FOV/Angle of View numbers above as TRUTH.
But, I couldn’t stop there. I had a 2.8mm DS-2CD2532F-IWS sitting nearby. One more data point, nothing like a double-check.
The 2.8mm camera calibration yielded a 3.25mm focal length. Ugh, uncertainty creeping back in. Grabbed the DS-2CD3332-I 2.8mm and took yet another series of photos, another calibration. Focal length = 3.20mm.
So at this point, I’m out of 2.8mm samples, BUT it appears that Hikvision is stuffing the 2.8mm cameras with 3.2mm lenses and lying to everyone. Or at least my batch.
Next I’ll tackle the 3MP vs 1080 FOV difference.
Attachments
Last edited by a moderator: