aacierto / structured-light

Automatically exported from code.google.com/p/structured-light
0 stars 0 forks source link

turning 3d scan pictures before loading seems to help just at the first sight when getting flat results #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i just got this working, but only with flat results. 
i tried to use "zskew" and "zscale". while this was just stretching the 
flatness and not producing a 
real 3d surface, rotating the scaned pictures 180° before loading them back 
into the program 
seemed to solve the problem at the first sight. 
but then using the solid triangle mesh view, now seems to light the object from 
the wrong side and 
i get either a dark (not really visible) positive or a good lighted negative 
after turning the 3d sketch.

my fault or a bug?
what's the best solution for this?
is this maybe also the reason for those big steps in the 3d model? 

i use "ThreePhaseScan_24_05".

Original issue reported on code.google.com by aquaindianer@gmail.com on 30 Jul 2009 at 10:30

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

I think you´ve simply to change the position of the cam towards the projector.
The soft expects the projector below the cam. Thjs way the projection of the 
fringes show a 2D picture where 
the points on the same plane (stripe) are lower in the 2D image the nearer they 
are.
Turning the images bottom to top solves this, but the order of the images is 
wrong now. It should give a right 
result if you name phase1 as phase3 and vice versa- but its simpler to change 
the positions...

The resolution of your result in 3D depends on the number of stripes in on 
projection. Means the more 
stripes you project, the more 3D points you can extract. But on the other hand, 
the more stripes you project, 
the more jumps between different stripes you´ll get in 3D if there are 
discontinueties in depth.
Try to get a number of stripes that fits to your projector´s res, your 
grabbing device and your object. And play 
with the camsettings to get a picture that still shows the fringes as sin waves 
(not an over contrasted  picture 
where the stripes are either white or black but grey between)

hope that helps
Gunter

Original comment by GWe...@googlemail.com on 30 Jul 2009 at 12:49

GoogleCodeExporter commented 8 years ago
Is it possible to SAVE to 3d points at this time? to mesh file or something? 
Also I
am having the same issue with flat scans - I made sure the camera was on top of 
the
projector but still had flat images - I have attached example images - rar file 
to
illustrate - maybe someone can tell me what I am doing wrong??? camera not high
enough - etc

thanks in advance nehock.

Original comment by neho...@gmail.com on 5 Aug 2009 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
GWebMA, I read above your comment about 'grey between' do you mean project is
slightly out of focus??  and from my images I tried my darndest to get the 
projector
focus to sharpest edge possible - should I have not sharped or focused it as 
well?

Original comment by neho...@gmail.com on 5 Aug 2009 at 4:44

GoogleCodeExporter commented 8 years ago
another set of my bust - from the side

Original comment by neho...@gmail.com on 5 Aug 2009 at 4:48

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

sorry, there seems to be something wired:

I rotated the images for I had my cam below of the projector (bottom to top).
With a cam over a projector  you don´t have to flip the images. If one sees a 
single stripe of the patterns, a 
valley is interpreted to be convex, a peak as being concave. So if you flip the 
images you´ll get a 3D negative.  
But with that flipping, I forgot one important thing: You´ve to change the 
order of the phases too... So 
instead of 1,2,3 you have to analyze in the order 3,2,1 The simplest way to 
correct that in already shot images 
is to rename phase1 as phase3 and phase3 as phase1.
To get it right in the code, you´ve simply to change the way the captured 
images are saved:

In XPatternGen:

if (counter == 9)
    {
     pp1.save(savePath (folderPath + "/phase3.png")); // instead of phase1
     pp2.save(savePath (folderPath + "/phase2.png")); 
     pp3.save(savePath (folderPath + "/phase1.png")); // instead of phase3
     pp4.save(savePath (folderPath + "/tex.png")); 
     mode = false;
     counter  = 0; 
     background (255); 
     println ("captured and saved images to " + folderPath);
     decodeData();   
     }

Now your setup should work.

to export to obj:

while you´re in solid (untextured)  viewmode hit the "q" key on your keboard. 
That should export an 
"output.obj" to your folder (may last a while).

Original comment by GWe...@googlemail.com on 5 Aug 2009 at 9:41

GoogleCodeExporter commented 8 years ago
Keep in mind that you can use negative zskew and zscale values, and this will be
based on the relative camera-projector orientation.

Original comment by kylecimc...@gmail.com on 22 Sep 2009 at 5:11