Questions tagged [opencv-solvepnp]

This tag is used in questions related to estimating the pose of an object. In other words, the relative orientation and position with respect to a camera

The 'PNP' in solvepnp means Perspective-n-Point.

For more details camera calibration and 3D reconstruction has a detailed explanation. And if that is not enough, Head pose estimation using OpenCV can help you further.

98 questions
1
vote
1 answer

opencv solvePnP, all axes look great except Y

I am running solvePnPRansac on an image dataset, with 2d feature points and triangulated 3d landmark points. It runs great, and the results in rotation, and in the forward and side axes, look great. The Y axis though, is completely wrong. I am…
anti
  • 3,011
  • 7
  • 36
  • 86
1
vote
1 answer

Camera Rotation SolvePnp

Could somebody help me with the math on calculating the Y rotation of my camera? I use SolvePnP to get a rvec. From this rvec I want to know how much my camera is rotated around its own Y axis. PointF[] ImagePointsCam =…
Lauran
  • 73
  • 1
  • 1
  • 9
1
vote
0 answers

Align camera to target

I'm working on a little project to align a camera to a fixed target (dimension in millimeter is known). The target have to be aligned horizontal and vertical centered in camera image, with no rotation. To achieve this the camera is mounted on a…
RobRobRob
  • 67
  • 2
  • 10
1
vote
1 answer

Comparing openCv PnP with openGv PnP

I am trying to build a test project to compare the openCv solvePnP implementation with the openGv one. the opencv is detailed here: https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#solvepnp and the openGv…
anti
  • 3,011
  • 7
  • 36
  • 86
1
vote
2 answers

opencv Vec3d to Eigen::Quaternion, euler flipping on results

I am using opencv::solvePnP to return a camera pose. I run PnP, and it returns the rvec and tvec values.(rotation vector and position). I then run this function to convert the values to the camera pose: void GetCameraPoseEigen(cv::Vec3d tvecV,…
anti
  • 3,011
  • 7
  • 36
  • 86
1
vote
1 answer

solvePnP/solvePnPRansac doesn't give good camera position estimation

I am trying to use this code to find camera position by locating flat image in the picture: https://docs.opencv.org/3.3.1/d1/de0/tutorial_py_feature_homography.html For this picture it works correctly: and finds the pattern. I use cv2.projectPoints…
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
1
vote
1 answer

Overhead camera's pose estimation with OpenCV SolvePnP results in a few centimeter off height

I'd like to get the pose (translation: x, y, z and rotation: Rx, Ry, Rz in World coordinate system) of the overhead camera. I got many object points and image points by moving the ChArUco calibration board with a robotic arm (like this…
1
vote
0 answers

How to handle camera calibration for opencv at scale

I'm using openCV solvePNP algorithm to detect and measure a device's pose from an AR Marker using openCV. My end goal is to get very precise real-world measurements. My app is likely to run on a wide range of iOS and Android devices. I understand…
nwales
  • 3,521
  • 2
  • 25
  • 47
1
vote
0 answers

Feature detection and tracking on 2D images for displaying AR contents

I am developing an Android app in which I want to track a 2D image/a piece of paper, analyze what the user write/draw on it, and correctly display different 3D contents on it. I am working on the tracking and displaying simple 3D contents part,…
1
vote
0 answers

OpenCV solvePnPRansac always returns 0

I have been using ORB feature to do matching of two video frames which suppose to have some common features in advance. Later a transformation is estimated by solvePnPRansac which works relatively well before some modifications were given today. I…
user18441
  • 203
  • 2
  • 11
1
vote
1 answer

solvePNP for planar triangle

I have a quite simple task: get Euler angles of a planar triangle. Pattern looks like this So, the algorithm: 1) get image from webcam -- done 2) convert to gryascale, filter, etc. -- done 3) get mass centers of all connected components, and filter…
vmkan
  • 43
  • 6
0
votes
0 answers

Transformation of extrinsic camera parameters from solvePnP

I have a camera that has known intrinsic parameters but unknown extrinsic parameters. I am attempting to get an extrinsic calibration and to do that, I positioned a chessboard pattern with known world coordinates in the frame of the camera. To get…
vatbub
  • 2,713
  • 18
  • 41
0
votes
0 answers

2D Coordinate to 3D world coordinate(solvepnp)

Converting 2D Pixels to World Coordinates I want to convert some 2d pixels in the picture captured by the camera to the world coordinates on the ground. We have a target tracking project, and I need to turn the 2d pixel track of the target tracking…
0
votes
0 answers

How do I convert to camera pose in world from rvec and tvec of cv2.SolvePnP

I'm trying to get quaternions and translations out of rvec and tvec with code like this: import cv2 import numpy as np from scipy.spatial.transform import Rotation # 2d image_points_2D = [[1331.284,610],[1473.253,468.6115],…
0
votes
1 answer

In inverse Image Projection, do I need to add or subtract t vector to my camera coordinates after multiplying with R inverse?

I am currently working on the transformation between object, camera and world coordinates in an inverse image projection task. I have the following information available: image coordinates of an object in the form of (u,v,1) Euler angles converted…