<br> ### Workpiece Scanning (Photogrammetry) [Joon's page](../joon/component/component.html) considers options for scanning a workpiece/stock in situ on a CNC bed (specifically Clank). Since photogrammetry seems to be taking off, it seemed like a worthwhile option to consider. The process is one where a camera module is mounted to the tool changer on the machine, which is commanded to move about the workspace and take photos from various poses. We consider two main approaches for handling the camera data: <b>Default approach:</b> Import photos to Meshroom, generate a 3D model, and then scale/localize it on the CNC bed with the help of aruco markers or other features. <b>"Smarter" approach:</b> Since we already have the camera pose, I assumed that there would be some way to plug that information into a photogrammetry pipeline as a way to cut down on the computational expense. The goal, of course, is to automate as much of this process as possible. Unfortunately, the most readily available options for photogrammetry (e.g., Meshroom) don't seem to expose this possibility. Alicevision's [photogrammetry pipeline](https://alicevision.org/#photogrammetry/natural_feature_extraction) consists of the following steps: * Feature Extraction * Image Matching * Feature Matching * Structure from Motion (this is where camera poses are estimated) * Depth Maps Estimation * Meshing * Texturing * Localization It's not clear that there's an easy way for users to supply camera pose information in this pipeline. ### Precedents [Automatic part localization in a CNC machine coordinate system by means of 3D scans](./localization.pdf) The scanning system employed is a NextEngine HD laser scanner. [3D Scanning System of Structured Light for Aiding Workpiece Position of CNC Machine Tool](https://ieeexplore.ieee.org/document/8614757) [On-machine 3D measurement of workpiece dimensions based on binocular vision](https://en.cnki.com.cn/Article_en/CJFDTotal-GXJM201304032.htm) [A helpful intro to the mathematics of photogrammetry](./math-of-photogrammetry.pdf)