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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionintIncrease this value to increase the simulator's accuracy. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSurface(Se3_F64 rectToWorld, double widthWorld, GrayF32 texture) Adds a surface to the simulation.voidcomputePixel(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 upvoidMore accurate rendering but will run slowergetImageRect(int which) render()Render the scene and returns the rendered image.voidvoidsetBackground(float background) voidsetCamera(LensDistortionNarrowFOV model, int width, int height) voidsetCamera(CameraPinhole model) voidsetCamera(CameraPinholeBrown model) voidsetCamera(CameraUniversalOmni model) voidsetWorldToCamera(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
-