Search code examples
math3dgeometryprojectionfisheye

How to move colored points from 2D image to 3D sphere


I have 2D color image. All colored points are located inside round area in center of this rectangle image, all points outside circle are black (I get these rectangle images from fisheye camera). I know the coordinates of center of this circle and its radius.

I need to move all colored points from circle area on 2D image to the surface of sphere. More precisely hemisphere, because my camera has 180 degrees FOV.

My question is. How to move these colored points correctly? Will it be correct to just assign Z coordinate to all points inside circle area in accordance with sphere equation?

To make my question more clear I attached 2D image from my fisheye camera and image with desirable result. enter image description here enter image description here


Solution

  • First, you need the lens calibration data of your camera. Ocam or opencv will do a great job for you.

    Second, as you mentioned that you already know your optical center, you can convert image coordinate into the sphere coordinate. So, now you have mapping function that maps image coordinate to sphere coordinate.

    Third, you need some sort of rendering tool to observe your image mapped sphere. The simplest way is to use OpenGL. Map your texture on a sphere and move the camera inside the sphere.