Photogrammetry is awesome, and there’s a whole bunch of papers and software out there that mean you can do it for free. But taking 100’s of photos can be a pain. I’ve been eyeing up ways of automating this for a while now, and finally carved out a few hours to research and build an automated system that will turn a turntable and take photos automatically.
I used my Dremel 3D20 to print out the parts. One major problem is that the build volume of the 3D20 isn’t big enough to print the larger parts. I considered scaling them, but the issues with the gears would have made that process more difficult than I was willing to commit to.
Instead, I opened each file in Autodesk MeshMixer (free), and simply cut each piece in half, then printed the halves separately:
Everything just fits together without any glue. I may want to make things a bit more solid in future, but for now it’s fine just resting together.
I’d previously purchase an Arduino starter kit to play around with (dreams of robot feet), but hadn’t done much with it beyond the tutorials.
To make this work, you’ll also need some stepper motors such as these. The link I’ve given you there is for a pack of 5 that also contains female-male wires. I was missing these, and for the mean time (until a pack arrives) I’ve improvised:
It was fairly straight forward to wire up – ports 2,3,4,5 on the arduino, to the 4 pins (IN1-IN4) on the stepper motor driver board. 5v (yellow in the above) and ground to the relevant pins.
Then upload the .ino file from thingverse to the Arduino.
Next step is more difficult – get QPython for your android phone (no idea what the process is for iPhone, sorry), and put python on a computer you’re going to hook up to the Arduino. I’m using my trusty little Surface Go.
Copy Server.py to your phone, and client.py to somewhere useful on your computer. Both phone and computer will need to be on the same wifi network.
[Note that I’ve forked the original python code on github to make some minor quality of life changes: https://github.com/pfalkingham/AA-Scan – possibly more to come in the future.]
Launch QPython, click editor, and then open the server.py script.
You now need to put in the IP address of your phone where it says “ServerAddress=”, e.g. “serverAddress=192.168.8.100”.
At this point you can also change where the photos will be stored.
Then run the script (small ‘play’ button at the bottom of the screen). You should see a terminal that looks like this:
If it doesn’t, then something’s not right, and I can’t help I’m afraid.
In your Arduino IDE, just check which COM port the arduino is on. for me it was COM3, so in client.py I added my phone’s address to serverAdressList, and I replaced ‘dev/ttyACM0’ with ‘COM3’.
Then you just run the script with “python Client.py”.
If everything worked, you should see some movement, and your phone will start taking photos:
I used a rabbit vertebra, found in the garden to test this set-up. The vert is less than 2 cm in length. I ran it on the turntable in 4 poses (balanced on dorsal, ventral, cranial, and caudal sides), collecting a total of 720 photos, then threw all the photos in AliceVision Meshroom and processed as one lot. The result is, frankly, stunning:
This is going to be very, very useful for small objects in the future. And the best part is, it’s entirely portable.