Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera is the same), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center ![Camera view] (http://wstaw.org/m/2017/06/07/point_x_center.jpg "Camera view") ![Top view] (http://wstaw.org/m/2017/06/07/point_x_center_top_1.jpg "Top view")

2) Ball X coordinate high (near right side of image) ![Camera view] (http://wstaw.org/m/2017/06/07/point_x_side.jpg "Camera view") ![Top view] (http://wstaw.org/m/2017/06/07/point_x_side_top_1.jpg "Top view")

On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera is the same), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center ![Camera view] (http://wstaw.org/m/2017/06/07/point_x_center.jpg "Camera view") ![Top view] (http://wstaw.org/m/2017/06/07/point_x_center_top_1.jpg "Top view")

2) Ball X coordinate high (near right side of image) ![Camera view] (http://wstaw.org/m/2017/06/07/point_x_side.jpg "Camera view") ![Top view] (http://wstaw.org/m/2017/06/07/point_x_side_top_1.jpg "Top view")

On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera is the same), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center center



2) Ball X coordinate high (near right side of image) image)



On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera is the same), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center



2) Ball X coordinate high (near right side of image)



On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera is the same), are the same as previous), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center


2) Ball X coordinate high (near right side of image)


On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. View is compensated by undistort(). I try to calculate X and Y position of the ball ralative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX/dY dX,dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fx fy from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera are the same as previous), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center


2) Ball X coordinate high (near right side of image)


On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?

Estimation of ball position (3d reconstruction)

I have a white small ball in camera view. The ball is in front of camera but higher than camera (Yball > Ycam). View is compensated by undistort(). I try to calculate X and Y position of the ball ralative relative to camera position. What I know:
- know exact distance from the optical center of the camera to the ball,
- know shift dX,dY of my ball in pixels from center of cam view,
- know focal length in pixels (fx and fy from camera matrix determined by camera calibration).

I try calculate physical X and Y position relative to camera using dx,dy,fx,fy,distance. If the position of the ball is near the center of the screen then I can accurately calculate the position using fx and fy. But I noticed, that if the ball is on the side, near the edge of the view (but physicial Y position and distance from camera are the same as previous), then the ball in image is higher. Here's an example:

1) Ball X coordinate is in center


2) Ball X coordinate high (near right side of image)


On the second example, 'top' coordinate changed from 433px to 396px, but ball is on the same physical Y as in previous example and at the same distance from the optical center. So if I use 'fy' (focal length y) to calculate Y position, my estimated position will be different.
Could You please help me, what am I doing wrong? How to calculate the position of the ball, what parameter did not take into account?