3D milk scanner

Discussion about everything. New games, 3d math, development tips...
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

3D milk scanner

Post by bitplane »

Inspired by the original milkscanner, I built my own out of bits of junk-

Image
Instead of taking pictures all the time, I'm using a video and extracting the frames in virtualdub, I got some encouraging results for a first test-
Image

However... I've got some problems.

Firstly, milk is prone to bubbles and has too much surface tension, so the resolution isn't as good as it should be. If you try to break the surface down with a detergent then you get more bubbles, which is no good. I'm looking for an opaque liquid with a really thin surface that's not very viscous and won't strip the paint off or stain my mum's tacky ornaments.
Secondly, my algorithm for reconstruction sucks. The video compression artefacts ruin the nice flat surfaces and the auto-balance changes the colours between frames. I guess I need some kind of blur / flood-fill / average difference thing but I haven't decided what yet..
Thirdly, a constant flow of liquid doesn't mean constant depth, I need some kind of constant calibration object in the scan, like a 45 degree slope or something. Area of cross sections won't cut it because part of the object will be occluded... there's also the problem of perspective correction
Finally, how do you go about merging multiple heightmaps from different directions into a solid mesh? Sounds like a hard (yet fun) problem.

Any ideas?
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

Being a chemical engineering major I may be of some help for your liquid problem. The best bet, if you are willing to find it may be a Aqueous Copper (II) Nitrate solution. Copper Nitrate is a blue salt that dissolves in water making a nice thick blue cloudy solution. Orange juice may be less bubbly than milk but it stills bubbles. If you want zero bubbles get some kind of salt that has color (salts dissolve in water 100% disassociation). They dont stain but they react with Aryl compounds such as benzene but im sure you shouldnt have a problem with that.
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

i think using still pictures instead of video will eliminate a lot of the bubbling... but the result will be of lower resolution, obviously
if you're looking for me, start looking on irc, i'm probably there.
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

Armen138 wrote:i think using still pictures instead of video will eliminate a lot of the bubbling... but the result will be of lower resolution, obviously
Which is exactly why he is not using the original milkscanner program and is making his own :)

Alpha Omega, correct me if I am wrong, but doesn't a Copper Sulfate and Water mixture produce a translucent, and not opaque, liquid? Once it starts to be come cloudy instead of translucent, isn't that the point where the water is no longer dissolving any copper sulfate because the mixture is saturated?

@bitplane: If you do use the copper sulfate (because I could be wrong about the opacity deal) I'd watch out for putting anything with iron in there, like if any of those ornaments have metal pieces or hooks at all. If I remember correctly, the mixture of Copper Sulfate and Water produces SulfurDioxide, which oxidizes iron very quickly.

One thing you could try (Although it's messy) is food coloring. You should be able to get that at close to if not completely opaque, and it shouldn't bubble or have any more surface tension than does water.
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

DeM0nFiRe wrote:
Alpha Omega, correct me if I am wrong, but doesn't a Copper Sulfate and Water mixture produce a translucent, and not opaque, liquid? Once it starts to be come cloudy instead of translucent, isn't that the point where the water is no longer dissolving any copper sulfate because the mixture is saturated?
Image copper sulfate solution
Image copper nitrate solution
I refered to Copper Nitrate although they are very similar compounds.
You are correct but as you can see putting enough Copper Sulfate or Nitrate in a solution makes a nice opaque blue color. I have used it in lab and it is very blue even if not saturated. Also a alternative I just thought of is using a mixture of Calcium (II) Hydroxide. It will make a white solution that looks just like milk, it is also safer and doesnt stain your hands if you get it on you.

Nitrates in total are alot more soluble in water than sulfates thus it is hard to get an oversaturated mixture of Copper Nitrate.
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

Heheh, whoops, you did say Copper Nitrate :D I guess you can disregard what I said then ^^
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Cool, thanks for the suggestions :)

Armen, I don't want to use photos because I don't have camera control software or one of those putton pusher rod things and a tiny bit of camera shake from me pressing the button would mess the whole thing up. Besides, video is just easier - I can get all 255 levels of depth for the heightmap, possibly even more.

I'll try to souce some copper nitrate
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
wITTus
Posts: 167
Joined: Tue Jun 24, 2008 7:41 pm
Location: Germany

Post by wITTus »

For what do you use the Bacardi actually?
Generated Documentation for BlindSide's irrNetLite.
"When I heard birds chirping, I knew I didn't have much time left before my mind would go." - clinko
hayate
Posts: 43
Joined: Mon Feb 16, 2009 9:38 pm
Location: Brescia, Italy

Post by hayate »

I think I understood how to solve your problem just by taking a quick look at you first picture :lol: : the bubbles are probably made by the flow of the milk from the tin can into your container. In the original milkscanner milk is added between the photos, so, during the photo, the milk doesn't have any bubble.
Sorry for my awful english ^_^'
Image
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

Yeah, we all know that that is the problem. Bitplane, however, is not doing individual photo by individual photo, as has been stated. He is doing it with a live video feed.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

hayate wrote:I think I understood how to solve your problem just by taking a quick look at you first picture :lol: : the bubbles are probably made by the flow of the milk from the tin can into your container. In the original milkscanner milk is added between the photos, so, during the photo, the milk doesn't have any bubble.
The bubbles are just part of the surface tension problem, the main problem here is that there's a skin on the surface of milk which means that the milk bulges up before settling over the surface, which reduces the available resolution.
The background noise isn't caused by bubbles in the picture, they're compression artefacts caused by the video (bubbles are not square). I could fix this by taking pictures, but I want an automated solution.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

wITTus wrote:For what do you use the Bacardi actually?
I don't touch the stuff, it's my friend's girlfriend's. If you could pan to the right a little more you'd see four more bottles of more manly spirits, which are mine :D
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hayate
Posts: 43
Joined: Mon Feb 16, 2009 9:38 pm
Location: Brescia, Italy

Post by hayate »

bitplane wrote: Thirdly, a constant flow of liquid doesn't mean constant depth, I need some kind of constant calibration object in the scan, like a 45 degree slope or something. Area of cross sections won't cut it because part of the object will be occluded... there's also the problem of perspective correction.
bitplane wrote: I could fix this by taking pictures, but I want an automated solution.
You can use an electric valve to control the flow of the milk controlling it with a small application: add some colored lines on the side of the container, when the milk cover one of the lines close the valve, wait a bit for the surface to became quiet, then reopen the valve (or a small electric pump instead of the valve) .
I think that if you use something less viscous than milk you surface will be filled with waves insted of bubbles (maybe I'm wrong)
bitplane wrote: (bubbles are not square).
yeah, and next time you'll say that Santa Claus isn't real shattering all my dreams... :lol:
Sorry for my awful english ^_^'
Image
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Well, I could get my PIC Micro programmer out and make a proper solution, capturing video frames by webcam or TWAIN source but that kinda defeats the whole purpose of a milk scanner being accessible to everyone (everyone who has access to a kitchen and a camera capable of doing video)
A laser scanner with turntable would be a better choice if I was going hi-tech, which I probably will one day but that's not exactly a Sunday afternoon project.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

Is there a reason why you can't extend your hose so that it is in the bottom of the container? That way it doesn't splash into the container.That should cause less problems with surface tensions and ripples and all of that junk.
Post Reply