qertcalgary.blogg.se

Arduino camera 3d images
Arduino camera 3d images













arduino camera 3d images
  1. #ARDUINO CAMERA 3D IMAGES SERIAL#
  2. #ARDUINO CAMERA 3D IMAGES CODE#
  3. #ARDUINO CAMERA 3D IMAGES DOWNLOAD#

Make photo => find brightest pixel in every row => save picture of representation brightest pixels => find distance between middle of picture and brightest pixel in every row => convert gathered polar coordinates to kartesian XYZ => save ASC file with point cloud.Įxplanation can be found in comments in code.įirst thing must be done preety soon is setting where Z-value is equal 0. So basically program sequence looks something like that, but it is divided into 2 loops (make photos and the rest):

#ARDUINO CAMERA 3D IMAGES DOWNLOAD#

Download and installation instructions are there: Libraries are well documented also.įirst thing to do in processing is installation of GSVideo library.

#ARDUINO CAMERA 3D IMAGES CODE#

That means the probability of mistake during code writing decrease. Why Processing? Because it is easy to use, with big reference and tutorial base. if it's an L (ASCII 76) turn off the LED:

arduino camera 3d images

if it's a capital H (ASCII 72), turn on the LED:

#ARDUINO CAMERA 3D IMAGES SERIAL#

read the oldest byte in the serial buffer: Int incomingByte // a variable to read incoming serial data into Stepper oki(48,8,9) //see stepper tutorial in for info about thatĬonst int ledPin = 13 // the pin that the LED is attached to It is using arduino's standard stepper library. Less steps causes mistakes because of elasticity of rubber band. I chose 4 steps per phase, which means i got 120 photos and 120 profiles around object, every 12 degree. It has simple code, which causes rotate stepper when got command from Procesing. I owe Arduino Leonardo only, so it was only choice i've got. Using potentiometer, i can set voltage to needed level (3,7V in my case). Power supply for stepper is super-simple LM317 application. Part Value Package Library Position (mil) Orientation Ready to termotransfer boards and schematics are attached below. More info can be found in Arduino reference and on Tom's Igoe page: For reducing output pins to 2, You can use small, additional board.

arduino camera 3d images

In simplest variant, h-bridge uses 4 digital output pins from Arduino, +5V and GND. Because of low power consumption of stepper, L293D is more than enough. Z value is the same value as Z in Cartesian system.Ĭonversion from polar to Cartesian is very simple: x = ro * cosinus( fi )īipolar stepper is driven by h-bridge. So after first move, fi = 3, after second fi = 6, after third fi = 9 etc. for 120 profiles around object, platform moves about 360deg / 120 = 3 deg. This constant amount in equal 360 degree / number of operation It grows an constant amount, every time platform rotate. Ro is our distance, measured in previous operation. In polar system, every point look something like that: P = (distance from Z axis, angle between point and X axis, Z) which is P = (ro, fi, z). Previous operations gave us coordinates in polar coordinates system.

arduino camera 3d images

Then rotating platforms move by some angle and whole operation repeats. This operation repeats every layer, in my case it is 480times. Using simple trigonometry, we can calculate "ro": sinus(alpha) = b / ro, which means that ro = b / sinus(alpha) Angle between laser and camera axle is constant and equals "alpha". When we get that information, we have to convert it into millimeter (how many pixels are in one millimeter). On picture, this distance is marked as "b". To found this, we have to measure how many pixels are between optical axle of camera and laser-marked point. We have to found Cartesian coordinates (in some space) of points which belongs to scanned object.īasically, we are looking for distance, between rotation axle and a point marked red by laser ("ro" on the picture).















Arduino camera 3d images