# # hide
# from boxsim.trajectory import *
# from nbdev.showdoc import show_doc

Boxfish Simulator

Example input image

main_img = np.asarray(PIL.Image.open("Yosemite_NP_M.jpg"))
show_img(main_img)
<matplotlib.axes._subplots.AxesSubplot at 0x7f13188c5828>

Show the trajectory of the random walk around the image

  • X,Y dimensions are in pixels and starts at pixel 0,0
traj= Trajectory(np.asarray(PIL.Image.open("Yosemite_NP_M.jpg")), 50)
plt.plot(traj.xyza[:,0], traj.xyza[:,1])
plt.legend(['Ground Truth XY trajectory'])
plt.title('2d XY')
plt.show()

Show result video

mvp.ipython_display('out.mp4', loop=True)