Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 1
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 2
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 3
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 4
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 5
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 6
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 7
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 8
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 9
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Image 10
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 1
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 2
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 3
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 4
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 5
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 6
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 7
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 8
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 9
Raspberry Pi 4B / Oak-D Lite Portable 3D Camera 3D Printer File Thumbnail 10

Raspberry Pi 4B / Oak-D Lite Portable 3D Camera

slimpickens avatarslimpickens

May 6, 2022

printables-icon

Description

A 3D scanning camera using a portable Raspberry Pi 4B running OpenCV attached to a Luxonis Oak-D Lite Spacial AI USB camera.  The output of OpenCV in this implementation are still image RGBD PNG files.  RGBD refers to a dual image file with the color 1080p format still image on the left, and an equally sized black and white depth image on the right.  The depth image is a greyscale “heat map” image, where objects closer to the camera are brighter.

The Oak-D Lite has an onboard processor which when combined with OpenCV running on the pi with a python script can generate these RGBD images when the “S” key is pressed on the pi.

Each snapshot taken with this portable camera can be imported into the Looking Glass Portrait 3D display using HoloPlay Studio software running on a Windows or Mac PC.

This setup give a very quick and easy way to create 3D content for the Looking Glass Portrait.

The 3D Openscad, 3mf, and STL files in this model are for making a mounting plate to attach the Oak-D Lite to the pi along with a power supply, Li ion battery, 4 inch touchscreen display, USB-C cables and mounting hardware to construct a portable 3D camera.

Below is a build of materials for making the camera:

Bill of Materials:

Hardware:

1. Oak-D Lite (Fixed Focus) $149 plus shipping (Approx. $29 to US)

https://shop.luxonis.com/collections/usb/products/oak-d-lite-1?variant=42583102488799

2. Raspberry pi 4 Model B (2GB or greater) $45 and up, hard to get right now

https://www.raspberrypi.com/products/raspberry-pi-4-model-b/

3. Touchscreen/ Case Combo $39

Smraza Raspberry Pi 4 Touchscreen with Case, Cooling Fan, 4 inch Touch Screen IPS LCD Display 800x480 HDMI Monitor for RPI 4B

https://www.amazon.com/gp/product/B07XBWYD9P/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1

4. Power Supply/ 4000mAh Battery Card with Standoffs for Raspberry Pi $25.59

Model # Maker Focus RPI UPS pack Standard V3P

https://www.amazon.com/dp/B01LAEX7J0/ref=cm_sw_em_r_mt_dp_ZKCMPZTS4MVBT1K4KVFM?_encoding=UTF8&psc=1

5. 2X Right Angle USB C to USB A 20mm cables $7.99 each, $15.98 Total

https://www.amazon.com/dp/B075QZ8M2Y/ref=cm_sw_em_r_mt_dp_VCWQBPQB7J1WFRV3KNY4?_encoding=UTF8&psc=1

6. 32GB micro SD card for the Raspberry Pi image.  Approx. $8

7. 4X 2.5mm Thread, 20mm Length Hex Head Mounting Screws, Double Sided Foam Tape, small zip ties (2.5mm Width)

8. 3D printed Oak-D Lite Raspberry Pi Mount Bracket, files in Model Files below

Total Build cost as shown above: $312

 

Additionally, you will need the Looking Glass Portrait with its HoloPlay Studio software running on a Windows PC or Mac to convert the RGBD images to Holograms for 3D viewing.

https://lookingglassfactory.com/product/portrait

It is $399 plus shipping.

 

Assembly Instructions:  

1: Enclosure:

Assemble the Acrylic enclosure which comes with the Touch Screen Display, Add the short standoffs for the power supply, double tape the Li-ion battery pack to the underside of the power supply and place over the standoffs with the battery sandwiched between the acrylic and the power board.  Route the Li-ion battery lead through the cutout in the power board and plug into the power board.  Make sure the small power switch is in the OFF position on the board.

2. Oak-D Lite:

Print the Mount Plate and either thread the side stud with a ¼-20 die, or shave the stud until it fits snugly into the ¼-20 mount socket on the Oak-D Lite.  If you thread the stud, screw the Oak-D on until it lines up with the edge of the mount plate.  Insert a right angle USB-C cable into the Oak-D and affix the cable and Oak-D to the mount plate with three small zip ties.  Trim the ends.  Next, use the 2.5mm X 20mm hex screws to attach the mount/Oak-D Lite through the holes on the corners of the power board into the standoffs on the enclosure.  Attach the USB-A end of the Oak-D cable to one of the USB ports on the end of the raspberry pi.  Attach the other USB-C cable to the power input on the Pi, and the USB-A end into one of the USB-A ports on the power supply board.

Software Installation:

1.  Download the premade Luxonis Raspberry Pi 4 OpenCV image from their Google Drive link:

https://drive.google.com/drive/folders/1O50jPpGj_82jkAokdrsG--k9OBQfMXK5

The version you want is:

KS_Rpi_OS_Full_V2 as of this writing on 050522

You may also build OpenCV by installing yourself on Raspberry Pi.  There are Youtube videos which show how to do this.

2. Use Balena Etcher or equivalent to create the Raspberry Pi Boot SD card.

3. Charge the Li-ion battery board using a 3A USB-C charger plugged into the power supply board.

4. Boot the Raspberry Pi, its easiest to SSH into the board to install the Touchscreen software. Instructions for this come with the touchscreen.

5. Make sure the Raspbian OS is updated (sudo apt-get update, sudo apt-get upgrade)

6. Open Terminal, enter: LSUSB and make sure that the OS sees an entry for Intel Movidius MiriadX, which is the Oak-D Lite camera.

7. In terminal cd to /depthai-experiments/gen2-mega-depth

8. Run the Python Script: python3 main.py

This should start the OpenCV camera, and by clicking the top bar tab labeled “Detections” you should see the 2D image and the 3D Heat Map image side by side.  I use the Onboard on screen keyboard to hit the “S” (shutter) key to snap an image.  The image will be in the /depthai-experiments/gen2-mega-depth/rgb_depth directory as RGBD1.PNG files.

Congratulations! Its taking RGBD images!  If you have a Looking Glass Portrait, you can network these files to the computer running HoloPlay Studio and convert them into 3D holograms.  An example is shown in the photos.

Here is a link to a video of the Looking Glass Portrait showing the image:

https://youtube.com/shorts/SubuTbNEjWg?feature=share

Next step is to put desktop links on the Pi to your Onboard Keyboard, the Python Script, and the files locations.  Further work includes customizing the Python script to make it work for your particular project.  I modified the main.py script to name images with the date and time in the file name so that it won't overwrite images.  If anyone gets this far, leave a comment and I'll provide the modified python script.