why a 3d coin scanner?
i’ve always been fascinated with coins. the images on coins are often very intricate and the metallic shine makes especially unused coins very beautiful. coin faces are sort of 3d objects compressed into an almost 2d representation with little loss of perceived depth (the coin design process might actually most of the time be the other way around, i.e. from 2d to 3d).
this fascination for coins left me with a desire to create 3d models of coins. modeling copies of actual coins on a computer requires a lot of artistry and time. i’m lacking both unfortunately 😉
the most obvious solution to me was to scan the coin faces. but this poses another problem, high resolution 3d scanners are not cheap. a while back i solved this problem with a low cost touch probe 3d scanner. but this device is painstakingly slow since every point has to be visited with a rather slow mechanical system in order to scan the entire surface of a coin.
a far better solution is a system with just one mechanical axis (x) along which the coin is translated while the other axes (y and z) are captured by the camera. there are still faster and better methods but this is fairly easy to implement as a homemade project.
objective
my first 3d coin scanner required an arduino with an external power source, a usb camera and a computer to scan coin faces. all these components made the scanner cumbersome to use. it also caused various problems because the components did not get recognized reliably for example. it therefore became quickly clear that a system with closer integration of the components would be better.
when the raspberry pi hq camera was released in early 2020 i ordered one with the intent to use it as a webcam with a decent quality lens. after a trial i dumped the idea since the camera became larger than intended. while testing two different cctv lenses i found that one had decent macro capabilities making the camera and my raspberry pi 3b+ the perfect combination for a simple 3d coin scanner. in addition to better reliability i wanted the scanner to be much closer to a commercial product in terms of usability.
scanning principle
the scanning principle is the same as for my first 3d coin scanner, i.e. it is based on the light section principle using white light that is partially blocked such that a shadow is cast onto the surface of the object.
design
the following rendering shows the final design of the scanner.
the prototype is mostly 3d printed.
the upper knob is used to adjust the position/angle of the light. a large incidence angle (the angle between the surface normal of the object and the light rays) offers a high vertical resolution. too large an incidence angle leads to areas that are not illuminated and therefore not scanned. a good compromise is required in order to capture a maximum of the surface in one pass. the other knob is to manually move the carriage on which the object is positioned.
the covers on the sides can be removed to manually adjust the focus of the lens. the lid on the left covers the opening where the coin is placed onto the carriage. the lid as well as the covers are used to block most of the light coming from the outside.
a section view of the scanner is shown below.
components used
the scanner utilizes the following off-the-shelf components:
- raspberry pi 3b+
- raspberry pi hq camera
- stepper motor driver (ULN2003)
- geared stepper motor (28YBJ-48)
- leds (just some bright led with a wide viewing angle)
- linear rails and bearings
the total cost of the components including the raspberry pi, the camera and the lens is a little over $100.
scanning workflow
the 3d coin scanner does not create the 3d model from the images directly. the device takes images in sequential order with the help of a python script. the images are then processed into a point cloud using another python program. finally the point cloud is meshed with meshlab or cloudcompare and further processed in blender.
the models would be a great starting point for reverse engineering the coins into actual cad models (nurbs surfaces). that unfortunately requires relatively expensive software such as geomagic. so for now i keep on working with meshed models.
results
3d scans of various swiss coins:
some 3d scanned us coins:
3d scanned euro coins:
conclusions
the use of a raspberry pi and a raspberry hq camera for a 3d coin scanner is great. the systems works very reliably and produces great results. but there are situations when the system has problems capturing the shape of the surface. this is especially true if the relief is too shallow or too deep. color variations are another problem that can introduce image noise that ultimately leads to rough surfaces.
got a coin to scan? if it’s an interesting one i’d gladly scan it. just drop me a line!