{"id":103,"date":"2016-04-19T15:40:35","date_gmt":"2016-04-19T15:40:35","guid":{"rendered":"http:\/\/siddharthv.com\/?p=103"},"modified":"2024-08-22T18:35:03","modified_gmt":"2024-08-22T18:35:03","slug":"rasp3dscanner","status":"publish","type":"post","link":"https:\/\/siddharthv.com\/?p=103","title":{"rendered":"3D Scanning with Raspberry Pi and MATLAB"},"content":{"rendered":"<p>Raspberry Pi opens a lot of possibilities for do-it-yourself projects. It\u2019s affordable and full of potential for implementing challenging projects. After having spent several years tinkering around my 3D printer, wanting to build my own 3D scanner to complete the 3D workflow was an exciting idea. Using MATLAB and the Raspberry Pi hardware support package for development made the experiment quick and easy, at least from the software perspective.<\/p>\n<p>In this project, I decided to use one of the most basic scanning techniques &#8211; focusing more on getting the entire mechanism to work with off-the-shelf components rather than get the best possible results. Raspberry Pi serves as the main controller board for the setup, capturing the images using the Pi Camera, controlling the Line LASER diode and providing control signals to the EasyDriver (Stepper Motor Driver). I have used MATLAB and the Raspberry Pi Hardware support package to implement the algorithm and deploy it to the Raspberry Pi. This step helped me reduce the time required to setup the controller board, and allowed me to focus on getting the mathematics behind the scanning algorithm correct.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-184 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper_pointcloud.png?resize=660%2C667&#038;ssl=1\" alt=\"stormtrooper_pointcloud\" width=\"660\" height=\"667\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper_pointcloud.png?w=742&amp;ssl=1 742w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper_pointcloud.png?resize=297%2C300&amp;ssl=1 297w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 1: 3D Point Cloud generated using the scanner<\/em><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-185 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper.png?resize=660%2C656&#038;ssl=1\" alt=\"stormtrooper\" width=\"660\" height=\"656\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper.png?w=827&amp;ssl=1 827w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper.png?resize=300%2C298&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper.png?resize=768%2C763&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 2: 3D Point Cloud converted into a mesh object using MeshLab and NetFabb Basic<\/em><\/p>\n<hr \/>\n<h2>Basic Theory<\/h2>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-186 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure3.png?resize=660%2C377&#038;ssl=1\" alt=\"figure3\" width=\"660\" height=\"377\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure3.png?w=693&amp;ssl=1 693w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure3.png?resize=300%2C171&amp;ssl=1 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 2: Image of a 3D object<\/em><\/p>\n<p>An image of a 3D object provides the projection of the object onto a two dimensional plane. It is trivial to extract the X and Y coordinates of any point on the object since they lie within the image plane. However, the information related to the depth of the point with respect to the center of the object is lost due to the projection. In order to retrieve this information, we need some special help. Thankfully, this is not as difficult as it sounds.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-187 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure4.png?resize=660%2C284&#038;ssl=1\" alt=\"figure4\" width=\"660\" height=\"284\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure4.png?w=1095&amp;ssl=1 1095w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure4.png?resize=300%2C129&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure4.png?resize=1024%2C441&amp;ssl=1 1024w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/figure4.png?resize=768%2C331&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 4: A simple triangulation setup consisting of a Line LASER diode projecting a line on the 3D object<\/em><\/p>\n<p>The image above shows a very simple triangulation setup using a camera and a line LASER. The LASER diode is positioned such that it creates a triangle with the view direction of the camera. As you can see from the image, the LASER line projects on the object and intersects the view direction of the camera exactly at the axis of rotation of the object. The angle at the intersection of the LASER line and the view direction (we will call it THETA) provides us with the first tool for extracting depth related information from the image captured by the camera.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-188 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig5.png?resize=660%2C323&#038;ssl=1\" alt=\"fig5\" width=\"660\" height=\"323\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig5.png?w=1039&amp;ssl=1 1039w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig5.png?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig5.png?resize=1024%2C502&amp;ssl=1 1024w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig5.png?resize=768%2C376&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 5: Z-coordinate can be determined by simple trigonometric calculations<\/em><\/p>\n<p>Let us assume that the Y coordinate corresponds to each line of pixels in the image and maps to the actual Y coordinate through some scaling factor. At each Y coordinate, the point on the surface of the object where the LASER line projects itself, the intersection of the LASER line with the view direction of the camera (if there was no object to block its path) and the perpendicular dropped from the point on the surface to the view direction form a right-angled triangle. The length of the perpendicular dropped on the view direction gives us the distance of the surface point from the view direction and can be considered as our X coordinate with some scaling factor. The other smaller side of the triangle gives us the depth of the surface point with respect to the axis of rotation, again with a scaling factor. As you can see, the calculations are basic trigonometrical operations.<\/p>\n<p>Now, let use this information to build our basic scanning algorithm. In order to extract 3D information of each point lying on the surface of the object, we need to first determine the points at which we can extract this information. This can be achieved very easily by capturing two images \u2013 once without the LASER on and once with the LASER on. Since everything else in the view of the camera remains the same, difference of the two images should give us all the points that lie on the LASER line projected on the object. By converting the difference image into a binary image, we can remove most of the extraneous information in the difference image and mark all points lying on the LASER line in white and the remaining pixels of the image as black. We can further narrow down our region of interest by making assumptions about the rectangular area that covers the entire object in the image.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-189 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig6.png?resize=660%2C318&#038;ssl=1\" alt=\"fig6\" width=\"660\" height=\"318\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig6.png?w=1001&amp;ssl=1 1001w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig6.png?resize=300%2C145&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig6.png?resize=768%2C371&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 6: Taking difference of two images of the object \u2013 one with the LASER line projected and one without, helps us extract the points that are projected onto the object.<\/em><\/p>\n<p>Now we have all the necessary components available for extracting the 3D coordinates of every point lying on the surface of the object. There is still one part that still needs to be taken care of. The points extracted from the images lie on the same image plane and are not oriented correctly in the 3D space. For this, we need to rotated each extracted 3D point by some amount about the axis of rotation. By carefully keeping track of the rotation of the object, we can easily determine the angle by which the points need to be rotated after each rotation step. The final algorithm looks something as shown in the image below.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-192 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig7.png?resize=660%2C409&#038;ssl=1\" alt=\"fig7\" width=\"660\" height=\"409\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig7.png?w=885&amp;ssl=1 885w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig7.png?resize=300%2C186&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig7.png?resize=768%2C476&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p style=\"text-align: center;\"><em>Figure 7: Complete flowchart for steps required to scan a complete 3D object<\/em><\/p>\n<h2>Prerequisites<\/h2>\n<p>For this project, you will need the following hardware and software tools:<\/p>\n<ol>\n<li>Software:\n<ol>\n<li>MATLAB 2015b+ and Hardware Support package for Raspberry Pi<\/li>\n<li>Image Processing Toolbox<\/li>\n<li>Camera Calibration Toolbox<\/li>\n<li>Point Cloud Toolbox<\/li>\n<li>MeshLab (tool for generating meshes from point clouds)<\/li>\n<\/ol>\n<\/li>\n<li>Hardware:\n<ol>\n<li>Raspberry Pi<\/li>\n<li>Pi Camera<\/li>\n<li>Line LASER diode<\/li>\n<li>EasyDriver Stepper Motor driver module<\/li>\n<li>Stepper Motor<\/li>\n<li>Optional\n<ol>\n<li>Raspberry Pi prototyping plate<\/li>\n<\/ol>\n<\/li>\n<li>3D Printed parts for the turn-table<\/li>\n<li>MakerBeam kit for the chassis<\/li>\n<li>Soldering Iron<\/li>\n<li>Ethernet Cable for connecting the Raspberry Pi to the laptop<\/li>\n<li>Power Supply \u2013 5v 4A at least<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2>Downloadable Code and Models<\/h2>\n<p>You can download the code from:<\/p>\n<p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/56861-raspberrypi-+-matlab-based-3d-scanner\">http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/56861-raspberrypi-+-matlab-based-3d-scanner<\/a><\/p>\n<p>You can download the printable parts from:<\/p>\n<p><a href=\"http:\/\/www.thingiverse.com\/thing:1622779\">http:\/\/www.thingiverse.com\/thing:1622779<\/a><\/p>\n<h2>Tasks<\/h2>\n<h3>Task 1: Preparing the Chassis<\/h3>\n<p>I have used the MakerBeam starter kit to build my chassis for the project. It is easy to use and provides a sturdy base for the camera, LASER diode and the turntable.<\/p>\n<p>You will need the following in order to complete the chassis:<\/p>\n<ol>\n<li>Two 300mm beams<\/li>\n<li>Two 200mm beams<\/li>\n<li>Three 100mm beams<\/li>\n<li>Two 60mm beams<\/li>\n<li>90-degree brackets<\/li>\n<li>60-degree bracket for the LASER diode<\/li>\n<\/ol>\n<p>Use the 60-degree bracket to angle the LASER diode towards the center of the stepper motor placed between the 300mm beams at the other end. Once you connect the camera, you will have to ensure that the center of the stepper motor exactly coincides with the center of the image captured by the camera. With this, the triangulation setup will be complete.<\/p>\n<p>The turn-table can be printed using the models linked in the download section. The base can be fitted directly on top of the stepper motor. The bearing slides into the base and the turntable plate should fall into place on top of the bearing and connecting the shaft coupling connected to the stepper motor shaft.<\/p>\n<p>The complete setup should look like this:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-190 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig9.jpg?resize=480%2C640&#038;ssl=1\" alt=\"fig9\" width=\"480\" height=\"640\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig9.jpg?w=480&amp;ssl=1 480w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/fig9.jpg?resize=225%2C300&amp;ssl=1 225w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<h3>Task 2: Preparing the hardware circuits<\/h3>\n<p>I have used the Raspberry Pi Rev B board for this project. I am also assuming that the Pi Camera is connected to the camera port on the board. The circuit diagram assumes the pin layouts match this board.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-191 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/scircuit.png?resize=660%2C415&#038;ssl=1\" alt=\"scircuit\" width=\"660\" height=\"415\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/scircuit.png?w=1034&amp;ssl=1 1034w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/scircuit.png?resize=300%2C189&amp;ssl=1 300w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/scircuit.png?resize=1024%2C644&amp;ssl=1 1024w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/scircuit.png?resize=768%2C483&amp;ssl=1 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p>There are two main parts to the hardware setup:<\/p>\n<ol>\n<li>Stepper motor control<\/li>\n<li>LASER switch control<\/li>\n<\/ol>\n<h4><strong>Stepper Motor Control<\/strong><\/h4>\n<p>For the Stepper motor control circuit, we are using the EasyDriver board (<a href=\"http:\/\/www.schmalzhaus.com\/EasyDriver\/\">link<\/a>). This board takes away all the pains of having to build a voltage-regulated power supply that can deliver consistent and enough current to run a stepper motor, along with the PWM control signals required to run them. With this board, all we need to do is connect a dc power supply with a high-enough current rating (4 Amps is sufficient), connect the control lines to IO pins on the Raspberry Pi, connect the stepper motor to the motor output, and you are ready to go! It really is that simple. Thanks Brian!!!<\/p>\n<p>And Did I mention that EasyDriver also provides a regulated 5v output that can drive other circuits? Well, yes it does! So we will be powering up the Raspberry Pi and the LASER diode with this regulated supply! Double Thanks Brian!!!<\/p>\n<p>The EasyDriver requires the following inputs:<\/p>\n<ol>\n<li><strong>ENABLE<\/strong>&#8211; When this control signal is low (0v), the motor output is enabled and what signals are applied to the other control signals, get propagated to the stepper motor. We connect this pin to one of the IO pins on the Raspberry Pi (<strong>Pin 24<\/strong>). We have to remember to set this pin to logical 0 whenever we want to enable the stepper motor and to logical 1 whenever we want to disable it.<\/li>\n<li><strong>MS1<\/strong>and\u00a0<strong>MS2<\/strong>\u00a0&#8211; These two control signals control the micro-stepping mode of the stepper motor. The stepper motor usually takes about 200 steps to complete one full rotation &#8211; with a step-size of 1.8 degrees. Micro-stepping allows you to break this into smaller steps &#8211; 1\/2, 1\/4, or 1\/8. Essentially this means that it allows you to reduce the step-size to 0.9, 0.45 or 0.225 degrees respectively, allowing finer control on the rotation. We connect\u00a0<strong>MS1<\/strong>\u00a0to\u00a0<strong>Pin 25<\/strong>\u00a0and\u00a0<strong>MS2<\/strong>\u00a0to\u00a0<strong>Pin 23<\/strong>\u00a0on the Pi. Setting the pins to (0,0) tells the driver to run the motor without any micro-stepping. Setting the pins to (1,1) tells the driver to run the motor with the smallest step-size &#8211; 1\/8th. The values in between are left to you to decipher.<\/li>\n<li><strong>STEP<\/strong>&#8211; this control line drives the stepper motor. When we apply a pulse to this line (000011110000), the driver moves the stepper motor by one step when the line transitions from 1 to 0 (also called the falling edge of the pulse). We connect this line to\u00a0<strong>Pin 18<\/strong>\u00a0of the Pi. We will write a small MATLAB function to send a pulse on this IO pin. More about that in the software setup.<\/li>\n<li><strong>DIR<\/strong>&#8211; this control line decides whether the stepper motor will rotate in the clockwise or counter-clockwise direction. We will connect this line to\u00a0<strong>Pin 17<\/strong>\u00a0of the Pi. Setting this line to logical 0 makes the stepper rotate in clockwise direction and logical 1 makes it rotate in the counter-clockwise direction.<\/li>\n<\/ol>\n<h4><strong>LASER Switch Control<\/strong><\/h4>\n<p>For the scanning setup, we need a mechanism to switch the LASER diode on and off when required. We accomplish this using a very simple transistor switch circuit. We use a NPN transistor (TIP31) in the common-emitter configuration and a voltage-divider bias (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Bipolar_transistor_biasing#Voltage_divider_biasing\">Wikipedia<\/a>). In our circuit,\u00a0<strong>R1<\/strong>\u00a0is the 120-ohm resistance and\u00a0<strong>R2<\/strong>\u00a0is the 10 KOhm resistance.\u00a0<strong>Pin 22<\/strong>\u00a0of the Pi is connected to the outer lead of\u00a0<strong>R1<\/strong>. When we set this pin to logical 1, it is equivalent of tying\u00a0<strong>R1<\/strong>\u00a0to\u00a0<strong>Vcc<\/strong>. By ensuring that voltage across the base and emitter is higher than the forward bias, we allow the current to flow through the collector and thereby activating the LASER diode. When we set this pin to logical 0, it is equivalent of typing\u00a0<strong>R1<\/strong>\u00a0to ground, pulling the voltage across the base and emitter to zero, switching off the current through the collector and deactivating the LASER diode.<\/p>\n<p>The LASER diode has two leads &#8211; power and ground. The power lead is connected to the +5v supply coming from the EasyDriver and the ground lead is connected to the collector of the NPN transistor.<\/p>\n<p><strong><em>Note:<\/em><\/strong><strong><em>\u00a0<\/em><\/strong><em>It is important to tie the ground of the +5v supply from the EasyDriver and the ground of the Raspberry Pi together to ensure the control signals coming from the Pi have a common ground.<\/em><\/p>\n<p><em>I would recommend that you test the entire circuit on a breadboard before assembling it on top of the prototyping shield so that there is no need for any costly reworks!<\/em><\/p>\n<h3><\/h3>\n<h3>Task 3: Getting the Software together<\/h3>\n<p>For the software, we need to do two things:<\/p>\n<ol>\n<li>Prepare the Raspberry Pi to communicate with MATLAB using the hardware support package. You can get the details about that here:<br \/>\n<a href=\"http:\/\/www.mathworks.com\/help\/supportpkg\/raspberrypiio\/functionlist.html\">http:\/\/www.mathworks.com\/help\/supportpkg\/raspberrypiio\/functionlist.html<\/a><\/li>\n<li>Once you have setup the SDC and plugged it into the Raspberry Pi, you need to open the Rasp3DScanner project in the MATLAB guide interface. This is a simple GUI interface for the scanner. Make sure that you have changed the current directory to point to the folder containing the scanner code you downloaded from MATLAB File Exchange.<\/li>\n<\/ol>\n<h4>Code Walkthrough<\/h4>\n<p>You should see the following files in the Rasp3DScanner archive:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-193 size-full\" src=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/files.png?resize=483%2C396&#038;ssl=1\" alt=\"files\" width=\"483\" height=\"396\" srcset=\"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/files.png?w=483&amp;ssl=1 483w, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/files.png?resize=300%2C246&amp;ssl=1 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<p>Rasp3DScanner.fig is the main GUI file and can be launched from MATLAB console by typing \u201cguide\u201d and selecting the Rasp3DScanner project from the browse field. Rasp3DScanner.m contains all the code for the application and implements the scanning algorithm. There basic utility functions that are self-explanatory in the sense that they control the functioning of the LASER, the Stepper motor and camera.<\/p>\n<p>The cameraParams.mat file contains calibration data from my setup. You should regenerate the cameraParams.mat file for your setup by following the steps here:<\/p>\n<p><a href=\"http:\/\/www.mathworks.com\/help\/vision\/ug\/single-camera-calibrator-app.html\">http:\/\/www.mathworks.com\/help\/vision\/ug\/single-camera-calibrator-app.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi opens a lot of possibilities for do-it-yourself projects. It\u2019s affordable and full of potential for implementing challenging projects. After having spent several years tinkering around my 3D printer, wanting to build my own 3D scanner to complete the 3D workflow was an exciting idea. Using MATLAB and the Raspberry Pi hardware support package [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false},"categories":[6,8,9,10],"tags":[13,16,20,25,26],"class_list":["post-103","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matlab","category-programming","category-raspberry-pi","category-tinkering","tag-3dscanning","tag-easydriver","tag-laser","tag-programming","tag-raspberrypi"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/06\/stormtrooper_pointcloud.png?fit=742%2C750&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pfZkYk-1F","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":78,"url":"https:\/\/siddharthv.com\/?p=78","url_meta":{"origin":103,"position":0},"title":"Nerfors are online!!!","author":"siddharth.vaghela","date":"June 6, 2015","format":false,"excerpt":"Recently, I got my hands on four pieces of dirt-cheap radio modules - the nrf24L01s or the Nerfors as I like to call them. After watching them rot on my table for a while (they unfortunately don't rot away like the fruits), I finally decided to do something about them.\u2026","rel":"","context":"In &quot;Tinkering&quot;","block_context":{"text":"Tinkering","link":"https:\/\/siddharthv.com\/?cat=10"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/06\/img_0175.jpg?fit=1200%2C900&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/06\/img_0175.jpg?fit=1200%2C900&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/06\/img_0175.jpg?fit=1200%2C900&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/06\/img_0175.jpg?fit=1200%2C900&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/06\/img_0175.jpg?fit=1200%2C900&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":195,"url":"https:\/\/siddharthv.com\/?p=195","url_meta":{"origin":103,"position":1},"title":"Math Art!","author":"siddharth.vaghela","date":"September 9, 2016","format":"image","excerpt":"(Image Credit: http:\/\/blogs.mathworks.com\/community\/2013\/06\/20\/paul-prints-the-l-shaped-membrane\/)","rel":"","context":"In &quot;3D Modeling&quot;","block_context":{"text":"3D Modeling","link":"https:\/\/siddharthv.com\/?cat=2"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/09\/stacks2.png?fit=563%2C538&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/09\/stacks2.png?fit=563%2C538&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/09\/stacks2.png?fit=563%2C538&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":360,"url":"https:\/\/siddharthv.com\/?p=360","url_meta":{"origin":103,"position":2},"title":"Modeling an Omni-Directional Robot in Simscape: Part 2","author":"siddharth.vaghela","date":"September 6, 2024","format":false,"excerpt":"The post details the process of creating a virtual model of an omni-directional robot wheel using Simscape's Multibody modeling tools. It outlines steps such as breaking down the assembly hierarchy, creating components like passive wheels and wheel hubs, and connecting them with joints to enable motion. The final model serves\u2026","rel":"","context":"In &quot;Modeling&quot;","block_context":{"text":"Modeling","link":"https:\/\/siddharthv.com\/?cat=41"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/09\/image-22.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/09\/image-22.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/09\/image-22.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/09\/image-22.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":100,"url":"https:\/\/siddharthv.com\/?p=100","url_meta":{"origin":103,"position":3},"title":"Studio Ghibli&#8230; a love affair","author":"siddharth.vaghela","date":"August 13, 2015","format":false,"excerpt":"I don't quite remember what made me watch the first film made by Studio Ghibli. But, I do know for certain that it started a love affair with Hayao Miyazaki's work that will last a lifetime and hopefully will be passed down to my children as well! So, rather than\u2026","rel":"","context":"In &quot;3D Modeling&quot;","block_context":{"text":"3D Modeling","link":"https:\/\/siddharthv.com\/?cat=2"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/08\/jiji_painted.png?fit=639%2C639&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/08\/jiji_painted.png?fit=639%2C639&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2015\/08\/jiji_painted.png?fit=639%2C639&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":215,"url":"https:\/\/siddharthv.com\/?p=215","url_meta":{"origin":103,"position":4},"title":"Light Sensor with Attiny85 and a photo-resistor","author":"siddharth.vaghela","date":"October 12, 2016","format":false,"excerpt":"As part of a larger project, I need a light sensor that can provide a digital pulse whenever the photo-resistor output drops (which means that something obstructed the light source it is exposed to). A very basic circuit for that is shown below: \u00a0 Here a photo-resistor is connected to\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/siddharthv.com\/?cat=4"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/10\/circuit_with_oscilloscope1.png?fit=1200%2C634&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/10\/circuit_with_oscilloscope1.png?fit=1200%2C634&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/10\/circuit_with_oscilloscope1.png?fit=1200%2C634&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/10\/circuit_with_oscilloscope1.png?fit=1200%2C634&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2016\/10\/circuit_with_oscilloscope1.png?fit=1200%2C634&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":331,"url":"https:\/\/siddharthv.com\/?p=331","url_meta":{"origin":103,"position":5},"title":"Modeling an Omni-Directional Robot in Simscape: Part 1","author":"siddharth.vaghela","date":"April 15, 2024","format":false,"excerpt":"Introduction Every robot navigates with different levels of control and agility. If a mobile robot\u2019s level of control matches its total possible degrees of freedom, its movement is described as holonomic[1]. When the level of control is less than its available degrees of freedom, its movement is described as non-holonomic.\u2026","rel":"","context":"In &quot;Modeling&quot;","block_context":{"text":"Modeling","link":"https:\/\/siddharthv.com\/?cat=41"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/04\/car_degrees-1024x1024.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/04\/car_degrees-1024x1024.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/04\/car_degrees-1024x1024.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/siddharthv.com\/wp-content\/uploads\/2024\/04\/car_degrees-1024x1024.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/siddharthv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":3,"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":369,"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/siddharthv.com\/index.php?rest_route=\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/siddharthv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/siddharthv.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/siddharthv.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}