Class SimulatePlanarWorld

java.lang.Object
boofcv.simulation.SimulatePlanarWorld

public class SimulatePlanarWorld extends Object
Simulates a scene composed of planar objects. The camera is distorted using the provided camera model.
  • Field Details

    • renderSampling

      public int renderSampling
      Increase this value to increase the simulator's accuracy. More points are sampled per pixel.
  • Constructor Details

    • SimulatePlanarWorld

      public SimulatePlanarWorld()
  • Method Details

    • enableHighAccuracy

      public void enableHighAccuracy()
      More accurate rendering but will run slower
    • setCamera

      public void setCamera(CameraUniversalOmni model)
    • setCamera

      public void setCamera(CameraPinhole model)
    • setCamera

      public void setCamera(CameraPinholeBrown model)
    • setCamera

      public void setCamera(LensDistortionNarrowFOV model, int width, int height)
    • setWorldToCamera

      public void setWorldToCamera(Se3_F64 worldToCamera)
    • addSurface

      public void addSurface(Se3_F64 rectToWorld, double widthWorld, GrayF32 texture)

      Adds a surface to the simulation. The center of the surface's coordinate system will be the image center. Width is the length along the image's width. the world length along the image height is width*texture.height/texture.width.

      NOTE: The image is flipped horizontally internally so that when it is rendered it appears the same way it is displayed on the screen as usual.

      Parameters:
      rectToWorld - Transform from surface to world coordinate systems
      widthWorld - Size of surface as measured along its width
      texture - Image describing the surface's appearance and shape.
    • resetScene

      public void resetScene()
    • render

      public GrayF32 render()
      Render the scene and returns the rendered image.
      Returns:
      rendered image
      See Also:
    • getImageRect

      public SimulatePlanarWorld.SurfaceRect getImageRect(int which)
    • setBackground

      public void setBackground(float background)
    • computePixel

      public void computePixel(int which, double x, double y, Point2D_F64 output)
      Project a point which lies on the 2D planar polygon's surface onto the rendered image The rectangle's coordinate system's origin will be at its center> +x right, +y up
    • getOutput

      public GrayF32 getOutput()