Instructables


The Milkscanner is a tool that allows the scanning of objects and creates a Displacement map for use with Moviesandbox or any other 3D App that would allow for displacement mapping.

Ingredients:
1 Webcam
1 Tupperware Bowl
3 cups of Milk
1 custom LEGO rig

You can download the Milkscanner PC-Application and SourceCode (creates the displacement map automatically from a webcam image) from the Milkscanner webpage:

http://milkscanner.moviesandbox.net

If you have questions, please feel free to leave a comment on the Moviesandbox forums at:
http://forums.moviesandbox.net

UPDATE:::UPDATE:::UPDATE:::UPDATE:::UPDATE

Check out a life-size version of the milkscanner using Ink on vimeo!

Thanks for your interest!
 
Remove these adsRemove these ads by Signing Up

Step 1: Scanning...

Picture of Scanning...
Maschinenkrieger.jpg
You fix the webcam above the bowl (you don't necessarily have to use LEGO, but it is a fast way to build and adjust...) and put the object to be scanned in it. Note that the Scanner can only scan half an object at a time.You then cover it half in milk. The milk basically "slices" through the object.

You can subtract the white part form the picture the webcam takes and the rest serves as your "slice". You then add some more milk and make another picture. That way you slice through the whole object, three spoons of milk at a time.

Step 2: Use your Displacement Map

Picture of use your Displacement Map
MaschinenKriegerHeight.jpg
MaschinenKriegerColor.jpg
After creating a Displacement-map from your scanning, you can use it with the Trace-Tool and bring it into Moviesandbox, as shown in the youtube-video.

You can also import it as a displacement Map in Blender or Maya or any other Application that uses Displacement Maps. But remember - the displacement map only covers half the object!

Enjoy!
1-40 of 118Next »
haqbany11 months ago
you are genius
nice one
dgn37 years ago
i think a good solution would be to have the camera attached to the same screw drive that lowers the object into the milk, like sort of have the whole assembly lowering into the milk (without having the camera ever reach the milk of course ;)
drcrash dgn37 years ago
Another enhancement, which would make it not a "milk scanner" anymore, would be to replace the milk with a horizontally scanning laser. You can get one for $10, regularly on sale at www.harborfreight.com. It's a laser level that paints a line. To paint the object all the way around, you could position the laser level so that part of its scan hits the object from the front, and part of it bounces off a mirror and hits it from the back. (Or better, do it from three angles 120 degrees apart, with the middle of the laser stripe hitting the object directly, and each end of the stripe reflected off a mirror behind the object and to one side and the other.)
Picking out such a laser line against dispersed light coming in from the surroundings can be tricky, especially since you are looking at a reflection of the light at non-tasty angles. You'd then best use a darkroom box to take the pictures in. And even if you do that, there are parts (most notably car tires and other black rubber parts) that don't reflect much light, and won't be picked up at all. An added problem can be angular distorsion (perspective), if you can't make it so the laser and webcam's axes of orientation are virtually identical. You'll still have a mapping, but it'll be skewed. We once built a 3D scanner that scanned moving parts on a conveyor belt. Fun times. In short: Milk (or any opaque liquid) is probably easier. Except for parts of the same color, of course...
fiezi (author)  drcrash7 years ago
The problem with lasers is that it would narrow down the types of objects you could scan. For example, you couldn't scan a ring anymore, or anything that has holes in it. A fluid can do that because you can pour it in. Also, one other thing to remember when going for precision is that the milk level rises depending on the size of the object in the pool (unless you use the infinity pool idea) when you lower the object.
moopet fiezi7 years ago
You can't scan a lot of objects with this setup anyway - for instance, how would you scan something like a yo-yo where the camera cannot see the milk because at whatever angle, some part which is narrower is obscured by some part which is wider.
dbell moopet7 years ago
Still won't work for *all* shapes, but for a yo-yo, rotate it 90 degrees around an axis other than the axle. In other words, put the slot in the vertical plane. And for a symmetrical object like the yo-yo, you only need half the scan (one hemisphere.)
mappum moopet7 years ago
This is a great idea, and probably needed a good imagination to think up! For problems of not being able to see everything, can't you just use more than one camera? They could be at angles, although, the may totally screw up the thing from the perspective.
fiezi (author)  moopet7 years ago
I know it's limited in that way. But usually you can get around the problem if you can disassemble the object and scan in multiple passes. But of course, you're right!
Have you tried it for metallic objects?
I think it would be a better idea not to rise the object being scanned, but push another object (a cube or cylinder) in the milk. 1, This would reduce the speed of milk level to half. 2, The rising speed of milk level would change less.
drcrash dgn37 years ago
I don't see the advantage of having the camera move. Having the camera and the milk level fixed seems ideal. Any distortion will be simple fisheye distortion in a plane, and constant. (So it'd be easy to correct for.) Unless you correct for fisheye, it'd be better to have a long lens (or a zoom zoomed in) and put the camera as far away as practicable. With a decent-res still camera with time lapse, you could get some pretty precise images.
drcrash7 years ago
Nice. If you're raising the level by hand anyway, it might be preferable to use a screw drive, and turn the screw by hand, to lower the object into the milk. (Easier to turn a screw 1 revolution or 1/2 a revolution or whatever than to dole out 3 uniform teaspoons of milk.) An advantage of the screw drive is that it would work with different-sized containers, and it would raise the level by a constant distance per turn rather than a constant volume. (If your object is reasonably large relative to the size of your container, how much liquid you need to raise the level a given amount depends on the fraction of the surface that is occupied by the object---for places with large cross-sections, you need to add less liquid because the object itself is occupying more volume at that level.)
n0ukf drcrash7 years ago
Even if you use a screw mechanism to lower the object into the milk, the object will displace some milk and raise the level as well, changing the uniform increments of screw distance to a less uniform step. Though the smaller the object displacement is relative to the area of the milk surface, the smaller this effect will be.
drcrash n0ukf7 years ago
Good point. I suppose that if you raise/lower the object, you could set up a couple of tubes to maintai the milk at the right level. One would be almost flush with the surface, but a little below it, coming down from a milk reservoir. (Like a water cooler or one of those dog bowls with the jug that refills the bowl). The other would also be flush with the surface, but a little above it, coming up from a milk drain. If the level in the scanner container dropped below the first one, it would dispense more milk. If it went above the second one, it would drain excess milk. That should keep the milk level within about a millimeter of what it's supposed to be, with no intervention.
drcrash drcrash7 years ago
Wait a second... if you're just lowering the object into the milk, you only need the overflow tube, not the dispenser tube. As long as you never raise the object during a scan, you shouldn't have to add more milk to restore the level. Doh. Cool. Doh.
stib drcrash7 years ago
nonononono! Raising and lowering the object would distort the map, because as you raise or lower it it's going to get bigger as it approaches the camera and vice versa. Why not, raise the level of the milk using a pump (you can get small submersible pumps for fishponds fountains ).
highjacked stib4 years ago
You could hook up the camera to the screw drive as well, which would lower the camera as it lowers the object.
drcrash stib7 years ago
My understanding is that the scan is only looking at the perimeter of the object, where it meets the milk. If you hold the milk level constant, and lower the object into the milk, that plane stays the same distance from the camera. It is not distorted except by the fisheye effect of a relatively short-focal-length lens. I'd think that fixed "distortion" would be easier to compensate for correctly if you use a fixed camera-to-scan-plane distance than if you used a rising one. (Fisheye effect gets worse for objects that extend toward the camera.)
stib drcrash7 years ago
dang, you're right. Raising the level of the milk is actually going to give you perspective distortion, so you do need to have some sort of mechanism for raising or lowering the object, without changing the level of the milk.
Raising the level of milk only brings the "clip" closer to the camera. The actual object doesn't change, only its outline. A automatic spoon would be the way I would go for this. Just make it so the spoon dips in some milk and dumps in in the trough three times. Its lego, It would be a piece of cake!
The object doesn't change, but it's already somewhat fisheye distorted by the short focal length lens. (With near parts looking a bit too big and far parts looking a bit too small.) The successive scans with the rising milk will capture that distortion, which is in each image. A screw thread to lower the object and an overflow for the milk seems much better. One way to do that would be with a geared-down synchronous motor, like a rotisserie motor, to turn the screw slowly and steadily. That wouldn't cost much. Given automatic, very steady downward motion like that, you could just shoot a video and sample the video for about the right number of frames, and get precisely spaced slices. The screw can just be a long enough piece of all-thread rod, for a very few bucks at the hardware store. The lowering platform can be attached to it with a couple of nuts around it, glued to a strut at a wide enough spacing that it holds very good alignment. Add a couple of guides rails to keep the platform from moving laterally (rotating around the threaded rod), and you'd be done.
magents drcrash6 years ago
Why not place a ruler in the milk tub, with the bottom of the ruler at the bottom right hand corner of the tub and the top of the ruler at the top of the upper right corner. Then as the milk is added you and/or the software can see the depth of each slice. MAybe not use a ruler, but a graduation of colors or black and red bars. the pump is controlled by the webcam, it looks for red and stops when it can't see it, then it looks for black and stops when it can't see it.
That's perfect, and you only need a black bar. Each frame will show the exact length of the bar that is still above the milk. From that, basic trig will tell you precisely how deep the milk is in that frame, which gives you your 'Z' offset. It doesn't matter how much the relative volume changes between frames, as each one will give the absolute offset.
keastes magents6 years ago
1. you run into the control problem again, when you stop pumping there will still be some in the piping between the pump and the container, this will drain into your container ( afterthought:unless the inlet is near the bottom we/ a one way valve 2.if you know the pumps flow rate you can have it run for so long dispensing a certain amount of milk I might have missed something there if i did feel free to let me know I'm not afraid of being proven wrong (it's just another way not to do it)
I work at an envelope plant, and we maintain constant levels of liquids in different vats wtih nipple bottles. You get a bottle with a long neck. Fill it with your liquid, and invert it over the vat. The liquid will auto dispense to the lip of the bottle. Now if you want to raise the level of the vat. You just raise the bottle that much.
Wouldn't you get the best result by keeping a constant milk level while submerging (or emerging) the object and keeping the camera at a constant distance from it? I say, have your object lay on a moving platform that slowly travels down into the milk tank. Have the cam also connected to a platform that slowly lowers it towards the milk at the same rate as the object.
your mechanism would change the volume of the milk also changing the level.
ahuezo keastes5 years ago
Use a recipient with a constant flow of milk. The recipient needs to have a hole on it at one side. This hole will maintain the milk level while a pump restores the milk back. Then use a mechanism to lower the object. When the objects ups or downs, the volume of milk will vary, but the excess of milk or the lack of it will be drained or filled by the system. The camera does not need to move. My English is not good, I hope you did understand me. Saludos desde México.
drcrash stib7 years ago
A submersible pump doesn't solve the problem. Pumping is easy, but controlling it precisely is hard. I think it's easier to precisely control the level of the object with a screw thread than to precisely control a rising level of milk. (Except perhaps by putting the container on a screw thread and raising it, but why bother?)
But what about a simple, homemade pump. The oldest mechanical solution to this problem I can think of, the screw of Archimedes. That can be (assuming a good seal) very precisely adjusted. This can then be used manually, and at a future point, hooked up to a little stepper and then you have a fully automated scanner. Other precise pumping options could involve little chemistry styrettes (sp?) but that seems like it could get complicated, and would be harder to scale.
We know how much liquid is added with the spoon approach. Three spoon fulls every frame. This is a set volume every captured layer. Any +/-displacement from the object should be handled by the program. In other words the size of layer (circumference of the image caputerd) is proportional to the height of the layer (distance from previous layer). Hopefully I am correct that the program would compensate for knowing that X amount of liquid has been added from one frame to the next. The "resolution" of the output should not be affected if this compensation is handled.Can you clarify that for us Mr. Fiezi? With that said, onto precision for automating the introduction of the liquid. I agree that a screw thread would be a precise way to introduce the milk into the tub. And the comment below about the syringe fits perfectly for precise measurements of liquids. Use a large CC syringe and anchor the plunger to a nut. Attach a threaded axel to a fixed speed motor. thread the nut ont the axel and secure bot the syring and motor to a common mount. See the horrible little mock up I put here:
C:\Users\\Pictures\For DIY\horriblePic.jpg
ummm....doesn't adding more milk raise the level as well.........
Joell drcrash4 years ago
hang on, I think you've failed to account for how using a screw drive (moving an object by a fixed distance rather than fixed volume) would essentially negate the whole point of this exercise because your screw drive would lower differing volumes of the object per revolution if the object is irregular. The final effect after taking all the pictures and scanning them would be distorted because of this difference. And because of the differing volume per revolution the liquid displaced wouldn't be constant and the whole thing would get messed up...
or you could use your small amount of common sense, put on your thinking cap, take a nappy to let your tummy settle, wake up, and discover that adding milk (fine, for you, danimals) makes this so much easier i hope i came across "constructive"
Lance Mt.4 years ago
 Wait.. cant you just flip the object? Some careful alligning otta do it?  

PS i'm doing it now ^.^
joeld424 years ago
brilliant! couldn't you just start with the object submerged, and have a pinhole drain for the milk, and take pictures at a fixed interval as it drains? then you wouldn't need any mechanical parts at all. i think i have to try this...
Nice idea! This is truly awesome.
FreakCitySF7 years ago
So you got a scaned 3-d image can you print it out on a 3d printer now?
1-40 of 118Next »