Forum Replies Created

Viewing 15 posts - 1 through 15 (of 459 total)
  • Author
    Posts
  • in reply to: Theoretical background for Calibration method #118416

    Oliver Kreylos
    Keymaster

    Base plane equation:

    1. Collect a bunch of 3D points d_i in depth image space from the camera’s depth image.

    2. Convert depth image-space points to metric camera space using camera’s intrinsic depth un-projection matrix (read from camera firmware): c_i = DP * d_i.

    3. Find the plane equation (nx, ny, nz) * c_i = o that best fits all points c_i using a standard least-squares linear system solver A^T * A * x = A^T * b.

    Projector calibration matrix:

    1. Collect a set of tie points that associate a 2D point p_i in projector image space with a 3D point c_i in metric camera space.

    2. Create an over-determined linear system for (p_ix * w_i, p_iy * w_i) = H_2 * c_i where H = (h0, …, h3, h4, …, h7, h8, …, h11) is an unknown 3×4 matrix, H_2 is the 2×4 matrix consisting of the upper two rows of H, and w_i = h8*c_ix + h9*c_iy + h10*c_iz + h11 is the homogeneous weight of H * (c_ix, c_iy, c_iz, 1).

    3. Solve the system A^T * A * x = 0 by finding the eigenvector of A^T * A that has the smallest eigenvalue.

    4. Extend the resulting matrix H to an OpenGL projection matrix by inserting a third row (0, 0, 0, -1) and pre-multiplying it with the inverse of a viewport matrix that maps the projector’s screen rectangle to [-1, 1] in both x and y, and the camera-space tie points’ z range, after multiplication with the extended H, to [-0.5, 0.5] in z. Z maps to [-0.5, 0.5] instead of [-1, 1] to avoid clipping away geometry that is lower or higher than the lowest or highest tie point, respectively.

    in reply to: Hot key in Projector/Camera Calibration? How move picture? #118415

    Oliver Kreylos
    Keymaster

    You cannot move the picture in the CalibrateProjector calibration utility, by design. If you are referring to the calibration steps that are involving the RawKinectViewer utility (base plane equation and 3D box corners), then see step 3 of the detailed software installation guide.

    in reply to: Can I use Kinect 1520? #118414

    Oliver Kreylos
    Keymaster

    Kinect model 1520 (“Kinect-for-Xbox-One”) is supported, but it is not ideal for the AR Sandbox, and there are some issues that need to be addressed during calibration (see the detailed software installation guide).

    in reply to: Toggle Contour Lines via Control Pipe? #118392

    Oliver Kreylos
    Keymaster

    Nice job!

    Minor source code critique:

    contourLineSpacing and useCountourLine should not be elements of class Sandbox; they should be local variables of their respective code branches inside the control pipe handling code inside the frame() method. There’s no need to modify Sandbox.h.

    In the contourLineSpacing block: Read from the second token into a local variable of type GLfloat, then there’s no need to cast to GLfloat later. You don’t need to check if contour lines are enabled before setting their distance; if they’re disabled, the surfaceRenderer will ignore the distance setting. This will come in handy later when you globally enable contour lines on renderers that might have had them disabled before. You don’t necessarily have to set the contour line distance in the RenderSettings structure itself; those values are only used to store command line options before the surfaceRenderer is created. No need to wrap the code into a try/catch block; none of the methods called in the block can throw exceptions.

    In the useContourLines block: similar basic comments to above. In addition, I advise against using integers to encode boolean values at textual interfaces. Instead of parsing the second token into an int and comparing that int to 0 or 1, directly compare the second token to “on” and “off” using, e.g., isToken(tokens[1],”on”) and act accordingly. That way the command pipe syntax is in line with other boolean-value commands such as “dippingBed off.”

    I.e., I would do

    else if(isToken(tokens[0],"useContourLines"))
      {
      if(tokens.size()==2)
        {
        /* Parse the command parameter: */
        bool useContourLines=isToken(tokens[1],"on");
        if(useContourLines||isToken(tokens[1],"off"))
          {
          /* Enable or disable contour lines on all surface renderers: */
          for(std::vector<RenderSettings>::iterator rsIt=renderSettings.begin();rsIt!=renderSettings.end();++rsIt)
            rsIt->surfaceRenderer->setDrawContourLines(useContourLines);
          }
        else
          std::cerr<<"Invalid parameter "<<tokens[1]<<" for useContourLines control pipe command"<<std::endl;
        }
      else
        std::cerr<<"Wrong number of arguments for useContourLines control pipe command"<<std::endl;
      }
    else if(isToken(tokens[0],"contourLineSpacing"))
      {
      if(tokens.size()==2)
        {
        /* Parse the contour line distance: */
        GLfloat contourLineSpacing=GLfloat(atof(tokens[1].c_str()));
        
        /* Check if the requested spacing is valid: */
        if(contourLineSpacing>0.0f)
          {
          /* Override the contour line spacing of all surface renderers: */
          for(std::vector<RenderSettings>::iterator rsIt=renderSettings.begin();rsIt!=renderSettings.end();++rsIt)
            rsIt->surfaceRenderer->setContourLineDistance(contourLineSpacing);
          }
        else
          std::cerr<<"Invalid parameter "<<contourLineSpacing<<" for contourLineSpacing control pipe command"<<std::endl;
        }
      else
        std::cerr<<"Wrong number of arguments for contourLineSpacing control pipe command"<<std::endl;
      }
    • This reply was modified 1 week, 6 days ago by  Oliver Kreylos. Reason: Improved parsing of useContourLines command
    • This reply was modified 1 week, 6 days ago by  Oliver Kreylos. Reason: Typo!
    in reply to: What recommended configuration PC? #118372

    Oliver Kreylos
    Keymaster

    Right now the most cost-effective GPU for an AR Sandbox is probably a GeForce 1060. There is also a Turing-generation GeForce 2060, but it appears to still be a lot more expensive.

    in reply to: Can I use Distance info from Kinect in OpenCv? #118371

    Oliver Kreylos
    Keymaster

    The SARndbox application talks to the Kinect camera at the USB device level, and only one application can open a USB device at a time.

    If you want to feed a depth map into another application, you will have to modify the SARndbox application’s source code to intercept depth maps either directly where it receives them from the Kinect driver or after depth filtering, and send them to another library in-process, or to another application via IPC.

    in reply to: Toggle Contour Lines via Control Pipe? #118332

    Oliver Kreylos
    Keymaster

    There is currently no command for contour line control on the control pipe. All the commands it does understand are listed in the Sandbox class’s frame() method, in Sandbox.cpp around line 1178.

    in reply to: USB Button Solution #118277

    Oliver Kreylos
    Keymaster

    What do you mean by “screenshot feature?”

    in reply to: MAC 0s Vrui-4.6-005 error 71 #118276

    Oliver Kreylos
    Keymaster

    It looks like OS X has a new C++ compiler. The first is just an FYI from the USB library; ignore that. The second is something I’m going to look into. The third is a problem. “Placement new” appears to be missing, and that’s an issue with no easy work-around. I will need to check if that is a change to the C++ standard, or an OS X quirk.

    In general, you won’t have a good time trying to run the AR Sandbox on OS X, anyway, due to problems like these.

    in reply to: Kinect FOV too small in calibration #118268

    Oliver Kreylos
    Keymaster

    Ignore it. Go through the calibration, and it will all be fine.

    That said. your projector image doesn’t fill the entire box. I would zoom in a bit.

    in reply to: Help!!! Image 90 out #118235

    Oliver Kreylos
    Keymaster

    It looks like you forgot to add -fpv (“fixed projector view”) to SARndbox’s command line.

    in reply to: GL error! #117951

    Oliver Kreylos
    Keymaster

    In that case, you didn’t install the Nvidia driver, or something went wrong during its installation. Without the driver, the grapbics card won’t be used.

    in reply to: USB Button Solution #117950

    Oliver Kreylos
    Keymaster

    Vrui-4.5-004 already includes ScriptExecutorTool. No need to download it again and re-build.

    in reply to: how to hide contour lines in window2 #117925

    Oliver Kreylos
    Keymaster

    After the -wi 1 command line argument that switches to the second window’s parameter set, you can add -ncl to disable contour lines for that window.

    in reply to: Glitch / freeze on Startup #117913

    Oliver Kreylos
    Keymaster

    One thing that might work is to run KinectUtil reset all immediately after boot. If booting leaves your Kinect in a bad state, resetting it should clear it up.

Viewing 15 posts - 1 through 15 (of 459 total)