Hi Jairo, Peter, sorry for the slow reply. My hard drive actually failed just after these posts and I haven't done any scanning. Actually, if I hadn't uploaded the example data, it would have been lost, so that was a good thing!
@Jairo, I''m glad I can supply something helpful to your project. I have also experienced the warping you are talking about with Autostitch and other programs which assume a stationary but rotating camera. It is still kind of odd to me that there are limited tools to do mosaic stitching with a regular ordered grid, since the problem is much simpler than when trying to make true panoramas. Even stitching blind without blending would be welcome if it was programmatic, especially if it was combined with some easy way to calibrate the size of the image/pixel/displacement. You should know though that while the warping is caused by the software making assumptions about camera angle, it is also highly dependent on how flat/warped the individual component images are. The images I gave you were taken with a high end dinolite edge camera, as opposed to a cheap generic one, and there is a marked difference in warping no matter which software you use. For all of them though I think it should be possible to make improvements by calibrating your source images first.
@peter, I also appreciate any attempt at the depth from focus problem with BoofCV. Apart from being a bit of a project, do you think my imagined pipeline of depth from focus using one focal length/magnification, which provides the scan locations for a higher magnification scan, is at least theoretically feasible/robust? I still haven't made a serious attempt at it in either Boof or OpenCV, but it would be nice to get an idea of whether it's an idea worth pursuing over some other option I haven't thought of yet. I did found a
depth map to gcode converter for CNC milling which feels like a bit part of the problem.
Thanks, And best regards,
Ahron