Use optic_flow_dots to generate optic flow video files that simulate arbitrary translational and rotational motions of a camera through a cube-shaped environment of dots, similar to the famous starfield screensaver of yore. The sides of the environment cube have arbitrary length 2. Only the dots within a sphere centered on the camera are visible. The purpose of this sphere is to keep the dot density constant in any direction. The diameter of the sphere is also 2. As the camera moves, dots that cross a side of the cube are wrapped. To prevent cyclical looping of the same dots, the wrapped dots are given fresh random coordinates for the dimensions that did not cross the side. For example, when a dot drops out of the backside of the environment (that is, Z<-1), Z is incremented by 2 and X and Y are set to random values between -1 and 1.
The translation and rotation parameters can be constant throughout the video, or dynamically change from frame to frame. See the descriptions of the 'trans_xyz', 'rot_xyz', and 'rot_dpf' parameters in the function's help section for more information on this.
Other features include setting the background color; shape, size, and color of the dots; limited dot lifetime; toggle erasing between frames on and off; and setting the limits of the dot environment to create, for example, groundplanes or fronto-parallel planes of dots.
All settings are controlled using comma-separated name-value pair arguments. See the function's help section for details.
Duijnhouwer (2021). optic_flow_dots (https://github.com/duijnhouwer/optic_flow_dots), GitHub. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!