mariuszhermansdorfer / SandWorm

Augmented Reality Sandbox for Grasshopper & Rhino
MIT License
20 stars 11 forks source link

Initial work on dynamic pixel sizing as part of #2 #22

Closed philipbelesky closed 4 years ago

philipbelesky commented 4 years ago

I had a Grasshopper definition floating around that had a calculation to determine pixel size given sensor height (I used to help figure out a table layout). I am Kinect-less at the moment so haven't tested this properly, but the getDepthPixelSpacing function provides the following values which seem sensible:

sensor height of 1060 = x 2.931725918576969
sensor height of 1060 = y 3.0296598284208076
sensor height of 500 = x 1.3828895842344193
sensor height of 500 = y 1.429084824726796
sensor height of 2000 = x 5.531558336937677
sensor height of 2000 = y 5.716339298907184

Note that this also adds back a sensorHeight parameter to the component, but that seemed unavoidable. Will test/update properly tomorrow to confirm it actually works when run as part of the plugin.

mariuszhermansdorfer commented 4 years ago

Great! I remember you sending this GH definition for a table setup and hoped you will be able to reuse the logic. Adding a sensorHeight parameter is fine for now but we should really look into creating an 'initial setup & calibration component' as mentioned in #1.

After the box is setup and mounted, one would hardly ever change this.

philipbelesky commented 4 years ago

Ok, have tested it 'live' and everything seems to work so it should be good to merge.

I need to run a proper calibration using one of the kinect calibrators for my setup at some point, as I'm seeing maybe a 10% difference between each model. Part of that might be unavoidable, but a future improved version of this function might also try and adjust the pixel spacing to account for lens distortion (or whatever the Kinect's IR equivalent is?).

mariuszhermansdorfer commented 4 years ago

Maybe worth considering for #1?