thomwolf / Magic-Sand

Magic-Sand is a software for operating an augmented reality sandbox
GNU General Public License v2.0
944 stars 138 forks source link

Reprojection Error too Big - Tried a few different things #55

Closed McBry closed 3 years ago

McBry commented 5 years ago

Hello,

Would appreciate any help to fix this. I am using a sandbox already set up for Oliver's Berkley program. I swapped computers and used one that I tested at home with Magic Sand. It worked at home but when I plug it into the Kinect and Projector setup at our museum, it gives me a reprojection error. I tried reducing the light spill and using a board that wasn't too reflective. I tried multiple times on the sand, with the board at a higher height, lower height etc... to no avail. I noticed that when I switch to the depth camera that I can't see anything until I raise my hand closer to the mounted Kinect. But this distance works fine for the other sandbox program. I'm not sure if this is an issue.

Here is a video of my calibration: https://youtu.be/eTN4UBVPtqw Here is a video of Berkley's Program working on it: https://youtu.be/6DqviANPyHE

It would be awesome if I could get any help to get this up and running and try some games with our visitors :)

Thank you much.

thomwolf commented 5 years ago

Hi McBry, I watched your video. The calibration seems to go ok and the 10 calibration points are acquired. The log on the video is quite blurry do you think you could extract a full log of the error in a txt format? You can dump more information in a debug file using the Dump Debug option in the Advanced panel. This will write the acquired and re-projected calibration points coordinates in a file.

At the end of the calibration step there is a self check step (where the error is raised in your case). In this self-check step, we compare the re-projection error of the calibration points with a constant value that I took equal to 50 millimeters. In you case it seems like the error is around 2000 millimeters which is a lot. This error is the average of all calibration points errors so it's hard to debug. Can you dump the calibration points coordinates in a file as I explained above so we can have a look at that?

McBry commented 5 years ago

Hi thomwolf,

Sorry about the delay. Had to wait until I could disconnect the other sandbox again. So, I tried it multiple times before and it didn't work. Now I tried it multiple times and it worked every time. I'm guessing the issue was when I put the "flat" board over the sandbox during calibration. I used a very thin (1/16") board that had a slight curve to it. This time I used a 5/8" sheet of plywood that was pretty well perfectly flat. Does it make sense that this may have been the issue?

Thank you for your time :D

danveloper commented 5 years ago

For anyone coming to this thread with the same problem: I faced the same issue and tried for hours to get the 2nd stage calibration to work. Using a flat blanket (red, not sure if that mattered) to cover the sandbox ended up working flawlessly for me. I had previously tried wood, cardboard, paper with no luck. Hope this helps.

RideLikeTheWind commented 5 years ago

Does that mean the maximum difference can be 50mm? I’ll see if I can use a flat surface like a blanket stretched over the sand. I’m also guessing the ‘flat’ sand has to be pretty much perfectly flat

McBry commented 5 years ago

I'm able to calibrate my sandbox and the difference between the first and second stage height is 6". I made a new one and I use two pieces of white foam board from the dollar store for the second stage calibration. The only reason I could conclude was that in the second stage my piece of wood was slightly warped and so no part of the surface was level to another.

jsiwek2 commented 5 years ago

I am having the same issue when it comes to completing the second stage. Could someone send a pic or video of how you completed the second stage? I'm trying to build this for an open house at my school.

jsiwek2 commented 5 years ago

I resolved this issue. The surface board for step 2 must be as flat as possible. It also cannot exceed 50mm above the flattened sand from step 1. I know others have been able to go further; however, in my case the board must be around 50mm. I simply bought some white foam board from the dollar store and put 45mm legs on the bottom of it. That way I can just lay the board over the sand and its always pretty much 50mm and even. Now, if the software would just load my calibration settings each time that would be fantastic.

dmargol1 commented 4 years ago

@thomwolf

Having this same issue myself. I've been able to get values ranging from 400-2000 depending on what i use to cover the second stage, but beyond that I am stuck.

What could be some potential issues that could cause this? Right now the top (second stage) is about 3 inches above the flat sand level, and the Kinect is about 21 inches above the top.

I'm not sure what the debug file could tell me, but I've included my latest one (had an error around 900).

CalibrationReprojectionErrors_12-11-2019-16-47-49.txt

McBry commented 4 years ago

I switched from a slightly warped piece of plywood (only slightly) to flat foam board, and it worked. I don't know that you are having the same issue, but try to make sure it is super flat and vary the reflectivity if possible.

dmargol1 commented 4 years ago

I switched from a slightly warped piece of plywood (only slightly) to flat foam board, and it worked. I don't know that you are having the same issue, but try to make sure it is super flat and vary the reflectivity if possible.

Based on this issue thread I already tried that. It definitely made a big improvement (error number dropped by over 1000), but still didn't fix things totally.

I was thinking about just modifying the source code to if (ReprojectionError > 500), but I figure that the number is high for a reason.

EDIT: Tried it, and while it ran it didn't really work (just a bunch of lines going through the center at different angles)

RasmusRPaulsen commented 4 years ago

It is not easy to say what causes these problems. Here are a few things you can try.

Best, Rasmus

dmargol1 commented 4 years ago

@RasmusRPaulsen Raising the Kinect up much higher did the trick.

sand1

jsiwek2 commented 4 years ago

I made a small video showing how to build, set-up, and calibrate the sandbox. Hopefully this might help someone.

https://www.youtube.com/watch?v=5AO8F4N1Wkw&t=411s

gekkie commented 2 years ago

OK... Old thread I know but after spending an entire day not being able to calibrate I thought I would post my solution to the world.

  1. Flatten the sand the best you can
  2. Start the calibration
  3. when it tells you to place a board ontop of the box, DON'T. Get a piece of Foam or something else that is between 4 cm and 5 cm thick and place that on the sand!
  4. Finish, get a beer, scream at yourself for not reading the comments.

So WHY on earth did I spend a day, well the first time I tested it, the calibration worked while there was around 14 cm between the sand and the top of the board. Got rid of the temp brace and then spent a day.

casshern6 commented 1 year ago

Hi! I'm having a bit of a problem with the Projector resolution parameter... I'm using Epson EB-L630U with 1920x1200 native res.

Program doesn't seem to register a proper resolution of projector, it is stuck at 1600x800. If i lower resolution to 1280x800 then the calibration doesn't seem to work and always gives me the same error "Reprojection Error too Big"

Question - how can i set higher resolution?

IMG_8802