OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Mon, 11 Nov 2019 03:32:02 -0600Perspective transformation - Deriving formula for single Camerahttp://answers.opencv.org/question/221482/perspective-transformation-deriving-formula-for-single-camera/I would like to solve an equation and of that formulate a formula that takes two inputs and gives one output:
**Input:**
- (u,v) - Pixel coordinates
- (t) - Translation of the camera with respect to the plane, in one dimension (z)
**Output**
- (x,y) - World coordinate
And for the rotation of the camera, this is set to static. So the only part that can alternate is the height of the camera with respect to the plane.
I've successfully solved an equation system, but for when the camera has fixed rotation and fixed height as described here: https://dsp.stackexchange.com/a/46591/46122
But now I want to express a formula but that takes one additional parameter (height in [mm]).
However, I'm not sure how this equation system would look like described here, https://dsp.stackexchange.com/a/46591/46122
to reflect my additional parameter.
My goal is to have a camera mounted on a linear rail (that moves in the z-direction and is vertical to the plane) that can detect objects on the plane. To my help, I have a laser sensor that constantly measures the height from the plane to the camera, which can be given as an input to the transform.
Any help is appreciated!r.anderssonMon, 11 Nov 2019 03:32:02 -0600http://answers.opencv.org/question/221482/perspective transformation with given camera posehttp://answers.opencv.org/question/72020/perspective-transformation-with-given-camera-pose/Hi everyone!
I'm trying to create a program, that I will use to perform some tests.
In this program an 2D image is being displayed in 3D space in the cv:viz window, so user can change camera (viewer) position and orientation.
![image description](/upfiles/1443709792833003.jpg)
After that, program stores camera pose and takes the snaphot of the current view (without coordinates axes):
![image description](/upfiles/14437098062513117.jpg)
An here is the goal:
I have the **snaphot** (perspective view of undetermined plane or part of the plane), **camera pose** (especially its orientation) and **camera parameters**. Using these given values I would like to **perform perspective transformation to compute an ortographic view of this given image** (or its visible part).
I can get the camera object and compute its projection matrix:
camera.computeProjectionMatrix(projectionMatrix);
and then decompose projection matrix:
decomposeProjectionMatrix(subProjMatrix,cameraMatrix, rotMatrix, transVect, rotMatX, rotMatY, rotMatZ);
And what should I do next?
Notice, that I can't use chessboard cornersbecause the image is undetermined (it may be any image) and I can't use the corner points of the image, because user can zoom and translate the camera, so there is posibility, that no image corner point will be visible...
Thanks for any help in advance!pawsThu, 01 Oct 2015 09:41:43 -0500http://answers.opencv.org/question/72020/