Welcome! Log In Create A New Profile

Advanced

3d-scanner code

Posted by holgafreak 
3d-scanner code
September 09, 2013 06:24PM
hi all,
my first post, been thinking of getting a reprap

I've been thinking of what to do with my two different systems using laser line pointer. If there's interest, I'd try to comment the code, write docs.

The more sophisticated version is from a document I found, while scouring the net for info about 3d-scanners. I'm on my macbook, and don't have the paper now. But, it consists of four bars pointing upwards in the the corners of a square plate. The camera sees the laser in all four bars plus the object. Doing math the 3d-coords of the object can by found. The world coordinates of the bars are known by measuring them, so the object gets the real 3d-coords. And a big plus is, that knowing the world 3d-coords of the bars, system calibrates extrinsic parameters automatically. I've tried David and Parsley, but the calibration never works.

Another, much simpler is a version of the makescanner. Only a white board behind the object is needed, and the laser is turned connected to a pivot. I used stepper motor and ChipKit, but can be turned by hand also, webcam reads the line on the board and the object. Knowing the distance between laser and camera, 3d-coords can be found. But not true 3d world coords.

I have so much things to do, so I wont' begin to polish the code (build nice guis etc.), or maintaing it, so if there are any takers, I'd gladly give the code (GPL, opencv, works on any platform opencv does) and the instructions.

best

-matti

trying to struggle almost all art forms
Re: 3d-scanner code
September 09, 2013 09:27PM
holgafreak Wrote:
-------------------------------------------------------
> hi all,
> my first post, been thinking of getting a reprap
>
> I've been thinking of what to do with my two
> different systems using laser line pointer. If
> there's interest, I'd try to comment the code,
> write docs.

Yes there is interest!
Do not worry too much about the docs.
Start with some basic info so we can get going.

>
> The more sophisticated version is from a document
> I found, while scouring the net for info about
> 3d-scanners. I'm on my macbook, and don't have the
> paper now. But, it consists of four bars pointing
> upwards in the the corners of a square plate. The
> camera sees the laser in all four bars plus the
> object. Doing math the 3d-coords of the object can
> by found. The world coordinates of the bars are
> known by measuring them, so the object gets the
> real 3d-coords. And a big plus is, that knowing
> the world 3d-coords of the bars, system calibrates
> extrinsic parameters automatically. I've tried
> David and Parsley, but the calibration never
> works.

This is interesting, I have never seen this approach before.
I was looking for a way to do calibration of my scanner using
just a single bar placed in the middle of the turntable but using
4 bars sounds a lot more promissing!

>
> Another, much simpler is a version of the
> makescanner. Only a white board behind the object
> is needed, and the laser is turned connected to a
> pivot. I used stepper motor and ChipKit, but can
> be turned by hand also, webcam reads the line on
> the board and the object. Knowing the distance
> between laser and camera, 3d-coords can be found.
> But not true 3d world coords.

I have a scanner with black back screen but it should not be
a problem to put a white piece of paper on it.
Does it really have to be white?
HBBR Scanner page
I was also thinking of adding a movable laser so this would be a good excuse to actually do it.

>
> I have so much things to do, so I wont' begin to
> polish the code (build nice guis etc.), or
> maintaing it, so if there are any takers, I'd
> gladly give the code (GPL, opencv, works on any
> platform opencv does) and the instructions.
>

Publish it on github or some other website.

I have just published pythonic 3D Scanner GUI based on Kivy,
it would fantastic to somehow hookup your code.

HBBR Scanner Kivy based GUI

I have some spare cycles and I can help with any polishing :-)



> best
>
> -matti
>
> trying to struggle almost all art forms
Re: 3d-scanner code
September 10, 2013 08:22PM
hi,

did a quick cleanup and wrote a pdf of what I remeber. The 7z-file (45Mcool smiley is here [www.mattikoskinenphoto.com]
The code-page isn't rewritten yet, so there's no link to this file. Just this.

There are three different 3d-scanners, the frame one, the white background one and the threePhase projector-camera one. Also the calib-program to find the intrinsics of the camera.

If you can make something out of these to make them more user friendly, good.

best

-m
Re: 3d-scanner code
September 11, 2013 01:02PM
Hi,

I just got your file and I am reading the code and pdf's first.
There is a ton of goodies in your code! There is also a bunch of
test data in various formats, what is the origin of these pics and
videos?

> If you put these e.g on Github, I can try to comment the code (if I remember,
> what's it all about.

I think this is the best way to proceed, I will put code on Github in a day or two.

"A paint-brush laser range scanner" - excellent paper I did not know about.

elektrknight
Re: 3d-scanner code
September 11, 2013 01:47PM
Hi,

Code is on Github.
I have made no changes to it except for skipping all the binaries and media files.

3d-code on Gtihub
Re: 3d-scanner code
September 11, 2013 03:30PM
thanks,
have something new to learn except git pull ...

-m
Re: 3d-scanner code
September 12, 2013 11:14AM
Пожалуйста, переведено Google

I studied a bit of Russian working at Telenokia in the 80's, Still know the characters, but that's all.

-m
Anonymous User
Re: 3d-scanner code
September 12, 2013 11:41AM
Since this an English forum and the person you responded to is no longer a member, no worries! grinning smiley
Re: 3d-scanner code
September 14, 2013 04:37AM
Hi,
I am going through the code and have couple of questions.

calib - this is based on code from OpenCV, what is different?

scanPic - findLaserCenterByRow()
Could you explain a bit the algorithm behind it?

cfs - LEDs

You have this description:

I made one frame using leds as markers, and the code automatically found the
points. Bad thing was, that the leds I bought (3mm) were so tiny, and the bar
too thick, so the camera didn't see all the leds properly.

I can not make LED positions in the video.
Where are the they placed? Corners of the frame?
Re: 3d-scanner code
September 21, 2013 12:01PM
hi,

sorry for the delay, I got no mail indications. In the video, there are no LEDs, the black points are in the place, where a LED should be. So, you have to do the manual calibration by clicking the cursor in the place of the dot. When you have LEDs, the program finds them automatically, so no need to click the spot. Although, if the program can't find them, it's easier to see the spot to click. These dots or LEDs mark the place, where the world coords are measured, so finding them accurately is needed for accurate operation.

calib is basically the same, I think I added only possibility to use the 720p HD-mode, instead of 640x480.

The scanPic - findLaserCenterByRow()

this is something I found on the Net. Apparently, it's some kind of subpixel maximum type algorithm. The rest are really many tries, coded from various sources, but this seemed to work most robust. (I have a new, more powerful laser-line pointer though, when making scanPic, never tried with cfs.)


best

-m
Re: 3d-scanner code
September 22, 2013 05:20PM
holgafreak Wrote:
-------------------------------------------------------
>... In the video, there are no LEDs, the black points are
> in the place, where a LED should be. So, you have
> to do the manual calibration by clicking the
> cursor in the place of the dot. When you have
> LEDs, the program finds them automatically, so no
> need to click the spot. Although, if the program
> can't find them, it's easier to see the spot to
> click. These dots or LEDs mark the place, where
> the world coords are measured, so finding them
> accurately is needed for accurate operation.

OK that explains what I was seeing in the video.
I will be looking at this code for calibration ideas for my dual laser scanner.
The simplest mod to my scanner would be to install 4 LEDs on the back
screen but that is just 1 frame and I need a second frame somewhere.
Any idea what is the ideal distance separating 2 frames?


> calib is basically the same, I think I added only
> possibility to use the 720p HD-mode, instead of
> 640x480.

OK - sounds useful as I am also using 720p camera :-)

>
> The scanPic - findLaserCenterByRow()
>
> this is something I found on the Net. Apparently,
> it's some kind of subpixel maximum type algorithm.
> The rest are really many tries, coded from various
> sources, but this seemed to work most robust. (I
> have a new, more powerful laser-line pointer
> though, when making scanPic, never tried with
> cfs.)
>

Any pointers to the Net source of this algorithm?
Re: 3d-scanner code
September 23, 2013 01:40AM
hi,

the only thing I remember for being source of the algorithm is rp-3d-scanner(?) github-code, or some Chinese page translated with google.

I think the distance should be such, that the camera can see and separate the frames sufficiently. Best thing is to try different variations :-)

hope this helps a bit

-m
Sorry, only registered users may post in this forum.

Click here to login