2

Note: I am not asking for projecting a 3D object onto a 2D camera-view image (for which many answers exist).

It's even simpler than that: I have a 3D model of, say, a street. I want to turn that into a street map. So it's a straightforward top-down / bird's eye view, with no camera view. I'm using OpenCV for image processing.

I realize it's straightforward to program this from scratch, but I would like to know if some routine already exists for doing this in OpenCV.

Anton
  • 1,458
  • 1
  • 14
  • 28
  • 2
    opencv is for computer vision, not for computer graphics. But afaik there are some functions to project 3D points to camera in openCV. You'll have to compute texturing yourself. Or you just use openGL instead :) – Micka Sep 06 '17 at 15:46
  • @Micka thank you: if you write this as an answer in the negative I will accept it! – Anton Sep 06 '17 at 15:58
  • You can do it also directly in C++ see [OpenCV Birdseye view without loss of data](https://stackoverflow.com/a/39316776/2521214) – Spektre Sep 07 '17 at 05:48

2 Answers2

3

OpenCV has projectPoints function, but you would have to compute the texturing yourself.

http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#void projectPoints(InputArray objectPoints, InputArray rvec, InputArray tvec, InputArray cameraMatrix, InputArray distCoeffs, OutputArray imagePoints, OutputArray jacobian, double aspectRatio)

Using a computer graphics library like openGL might be better.

Micka
  • 19,585
  • 4
  • 56
  • 74
1

I mean transform your "up vector" to match the cartesian z axis and then just run an x y grid sampling taking highest z value per voxel or average

Sneaky Polar Bear
  • 1,611
  • 2
  • 17
  • 29