<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problems with stereo vision using two M5Stack Timer cameras (Fisheye lens)]]></title><description><![CDATA[<p dir="auto">Hi community,</p>
<p dir="auto">I am trying to work out the stereo vision principle with two timer cameras type fisheye lens. My problem is that I can't find the focal length of the lens in the specs. I tried to calculate the focal length with the Diagonal Field Of View(DFOV), but I don't know if it's correct. Because I didn't got a distance near the correct value in combination with the depthmap and disparity.</p>
<p dir="auto">My calculation for the focal length is based on the following formula from <a href="http://www.bobatkins.com/photography/technical/field_of_view.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.bobatkins.com/photography/technical/field_of_view.html</a></p>
<p dir="auto">FOV (equisolid fisheye) = 4 * arcsin (frame size/(focal length * 4))</p>
<p dir="auto">For the frame size I calculated the diagonal frame size, because I only know the DFOV. I get the sizes of the image area from this specsheet:<br />
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/OV3660_CSP3_DS_1.3_sida.pdf" target="_blank" rel="noopener noreferrer nofollow ugc">https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/unit/OV3660_CSP3_DS_1.3_sida.pdf</a></p>
<p dir="auto">With Pythagoras and the image area sizes I have found a value of 3.6299 mm for the diagonal frame size. By rewriting the formula I have gotten the following result. DFOV = 120 degrees.</p>
<p dir="auto">focal length = (diagonal frame size/(sin(DFOV/4)))/4<br />
focal length = (3.6299/(sin(120/4)))/4 = 1.815 mm</p>
<p dir="auto">Is this the correct way to calculate the value or do you know the right value?</p>
<p dir="auto">For the stereo vision part I have worked with the stereocalibrate() and stereorectify() functions from OpenCV in Python. This to get a correct disparity map. Maybe there is something wrong in that code, but I think that the focal length is wrong at the moment. So please help me out and thanks in advance.</p>
<p dir="auto">Michael</p>
<p dir="auto">PS:<br />
I have the python code with the depth calculation shown in the following image. The distance need to be around the 1.2 meters for the specific pixel. Calculations are at the moment in mm.</p>
<p dir="auto"><img src="/assets/uploads/files/1647875556930-stereovision-m5stack-timercam-fisheye-resized.png" alt="0_1647875513394_stereovision M5Stack TimerCAM fisheye.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.m5stack.com/topic/4137/problems-with-stereo-vision-using-two-m5stack-timer-cameras-fisheye-lens</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 11:18:03 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4137.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Mar 2022 15:13:29 GMT</pubDate><ttl>60</ttl></channel></rss>