Automated Planning and Optimization of Lumber Production Using Machine Vision and Computed Tomography