LulzBot 3D Scanner

A forum dedicated to the development of the LulzBot 3D Scanner

Re: LulzBot 3D Scanner

Postby aeva » Thu Jan 30, 2014 7:55 pm

Here it is again, without changing any of the settings, from the upper camera:
scan.jpg
Noisey "scan" from the upper camera.

bg.jpg
Noisey "scan" from the lower camera.

mask.png
Resulting mask image.
mask.png (2.49 KiB) Viewed 1249 times


Also, the threshold and noise settings are hard coded - if the object being scanned doesn't effect this too much, we might be able to get away with just having these values hard coded for whatever makes sense for the scanner.


[edit]
Also, here is another version that doesn't use open_cv, is faster, and produces somewhat cleaner output:
Code: Select all
from glob import glob
from os.path import join
from tempfile import mkstemp
from PIL import Image, ImageOps, ImageChops, ImageFilter

THRESHOLD = 26


def threshold(img, t=127, invert=False):
    """
    Your standard threshold function.
    """
    def clamp (p):
        return 0 if p<t else 255

    def invert_clamp (p):
        return 0 if p>=t else 255

    gray = img.convert("L")
    clamp_func = clamp if not invert else invert_clamp
    return gray.point(clamp_func, 'L')


if __name__ == "__main__":
    # Load up images.
    search_dir = "fuzzy"
    scan_path = glob(join(search_dir, "scan.*???"))[0]
    bg_path = glob(join(search_dir, "bg.*???"))[0]
    scan, bg = map(Image.open, [scan_path, bg_path])

    # Create difference map
    diff = ImageChops.difference(bg, scan)
    diff.save("just_diff.png")

    # Create noisey image mask
    clamped = threshold(diff, THRESHOLD)
   
    # Blur and then clamp to eliminate noise
    smudge = clamped.filter(ImageFilter.GaussianBlur(5))
    smudge_mask = threshold(smudge, invert=True)

    # Use smudge mask to remove most noise but leave original clamp.
    result = clamped.convert("RGB")
    result.paste((0,0,0), None, mask=smudge_mask)
    result.save("mask.png")


And the resulting output:
mask.png
Clean mask from noisey source data without using opencv!
mask.png (3.91 KiB) Viewed 1247 times
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby aeva » Fri Jan 31, 2014 11:29 am

Out of curiosity this mornining, without tuning the settings, I ran photographic samples through the demo script instead of virtual scans to see what would happen:
scan.jpg
Scan sample via dslr.

bg.jpg
Background reference.

diff.png
The resulting difference map.

mask.png
Resulting mask image.
mask.png (8.49 KiB) Viewed 1239 times


Note that there is distortion below the object because the table's surface is kind of glossy. The scan interior would likely be either matte black or a (possibly retroreflective) surfacing of a very specific color (eg lime green or safety orange). Translucent objects most certainly will not work unless the background is textured (but that is problematic with using a turn table). Reflective objects might be scannable. It may also be the case that the scanner could have different settings for different types of objects, so that more things are scannable albiet with differening overall quality. Also worth noting that the scanner is planned to be enclosed, not open like most 3D scanners.

I will look to pick up some bright colored construction paper later and try this experiment again later on.
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby gannon » Fri Jan 31, 2014 11:43 am

I think that a washable opaque spray coating would be ideal for translucent/transparent objects. The less refraction/sub surface scattering the better for this form of 3D scanning :)
User avatar
gannon
 
Posts: 47
Joined: Wed Jul 10, 2013 11:42 am

Re: LulzBot 3D Scanner

Postby aeva » Fri Jan 31, 2014 12:12 pm

Well, reflective and translucent objcets are the bane of most 3D scanners as far as I'm aware. If you know of such a spray, do share :) that is like the holy grail.
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby nopick » Fri Jan 31, 2014 12:27 pm

I have used Prang tempura craft paint to coat parts that were subject to thermal testing with an infrared inspection system. In the testing case, we used black because it provided a uniform emissivity value across the part. That is necessary to obtain accurate temperature readings. In your case, any color should work. The paint provides a nice flat finish.

It sprays nicely out of a Preval (http://www.preval.com/what-is-preval) or similar sprayer when diluted properly and washes off with warm water. It will stain clothes.
nopick
 
Posts: 108
Joined: Mon Sep 09, 2013 11:14 am

Re: LulzBot 3D Scanner

Postby aeva » Fri Feb 07, 2014 1:11 pm

By the way, the code that I've been using for the demos above, as well as future demonstrations can now be found on our github repository: https://github.com/alephobjects/scanopticon-tools
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby aeva » Mon Feb 24, 2014 9:02 pm

Quick update: I've been building out some tools for working with voxel data, which will be used in the scanner software. You can find my code so far here: https://github.com/alephobjects/libvoxel. Nothing photogenic, however.

In a meeting today we discussed what would be needed to start building a prototype hardware, which will happen parallel to me building the software for it.
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby aeva » Fri Feb 28, 2014 12:45 pm

This picture shows one of many features that I've added to LibVoxel this week - volume casting!
cast_example_c.png

I've used Blender's bisect feature to show the difference between the two models. The model on the left is a hollow sphere, the model on the right is the cast version. They both have an identical outter topology, but the cast version lacks the internal topology.

This is an essential component for the scanner to be able to output manifold stl files instead of messy point clouds.
User avatar
aeva
 
Posts: 11
Joined: Wed Mar 27, 2013 11:30 am
Location: Chicago

Re: LulzBot 3D Scanner

Postby gannon » Fri Feb 28, 2014 1:40 pm

Nice news :)
Thinking of it, how will you be merging scan results? I would initially think a variant of ICP to work well.
User avatar
gannon
 
Posts: 47
Joined: Wed Jul 10, 2013 11:42 am

Re: LulzBot 3D Scanner

Postby geociencio » Fri Mar 07, 2014 6:04 pm

It sounds great, i am scanning with very basic hardware making SFM, and want to do a 3d laser scaner project, and waiting your results. THANKS A LOT FOR YOUR OPEN HARD/SOFT-WARE
geociencio
 
Posts: 1
Joined: Fri Mar 07, 2014 5:56 pm

PreviousNext

Return to 3D Scanner

Who is online

Users browsing this forum: No registered users and 1 guest