You have to adjust your focus from back to front or vice versa. You can buy a rail system that slides the camera back and forth. You have to go slow and maybe use manual focus. Then after taking 10, or so, shots, you stack them.

We implemented method B which works better in many cases. But not in all cases and not that different to delete the older and faster method A. Method A is a simple weighted average. Method B searches for the best plane, creates a pseudo 3D map of the object, smoothes it and then creates the resulti...