hairu / freelss

FreeLSS is a laser scanning program for the Raspberry Pi. It allows a Raspberry Pi to function as the core to a complete turn table laser scanning system.
GNU General Public License v3.0
279 stars 133 forks source link

about LocationMapper::calculateCameraRay #15

Closed staraimm closed 9 years ago

staraimm commented 9 years ago

I think the z should be "mCameraZ + m_focalLength".

166 x = (x * m_sensorWidth) - (m_sensorWidth * 0.5) + m_cameraX; 167 y = (y * m_sensorHeight) - (m_sensorHeight * 0.5) + m_cameraY; 168 real z = m_cameraZ - m_focalLength;

Can anybody explain that?

hairu commented 9 years ago

Take a look at the description of the coordinate system at the top of Main.h. The camera sits in positive Z and is looking down the -Z direction. The sensor plane is "focal length" closer to the origin than the focal point of the camera.