Package boofcv.simulation
Class SimulatePlanarWorld
java.lang.Object
boofcv.simulation.SimulatePlanarWorld
Simulates a scene composed of planar objects. The camera is distorted using the provided camera model.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionint
Increase this value to increase the simulator's accuracy. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSurface
(Se3_F64 rectToWorld, double widthWorld, GrayF32 texture) Adds a surface to the simulation.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 upvoid
More accurate rendering but will run slowergetImageRect
(int which) render()
Render the scene and returns the rendered image.void
void
setBackground
(float background) void
setCamera
(LensDistortionNarrowFOV model, int width, int height) void
setCamera
(CameraPinhole model) void
setCamera
(CameraPinholeBrown model) void
setCamera
(CameraUniversalOmni model) void
setWorldToCamera
(Se3_F64 worldToCamera)
-
Field Details
-
renderSampling
public int renderSamplingIncrease 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
-
setCamera
-
setCamera
-
setCamera
-
setWorldToCamera
-
addSurface
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 systemswidthWorld
- Size of surface as measured along its widthtexture
- Image describing the surface's appearance and shape.
-
resetScene
public void resetScene() -
render
Render the scene and returns the rendered image.- Returns:
- rendered image
- See Also:
-
getImageRect
-
setBackground
public void setBackground(float background) -
computePixel
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
-