1. 程式人生 > >KInect AR沙盒制作的一點小經驗

KInect AR沙盒制作的一點小經驗

osi graphics lose inux round tro linux m tuning ply

最近在微博上看到這樣一條 微博 >點這看<

技術分享圖片

看起來非常有意思,就去Google了一下如何制作。

沒想到這是一個開源項目,而且還告訴你如何安裝

OK,接下來就說說我的制作過程。

首先,先放出這個開源項目所有教程、資源的網站

https://arsandbox.ucdavis.edu/instructions/

上面說了各種要求,大家可以自己去看,我這截個圖吧

技術分享圖片

都是英文,我開著翻譯一點點看,但是在校準那,都是英文而且沒有字幕,所以看著頭疼。

前期軟件非常簡單,只需要復制粘貼就可以了,難就難在校準,還有Kinect跟投影儀的架子不好做

Hardware Requirements

An AR Sandbox requires the following hardware components:

  • A computer with a high-end graphics card (see the “Computer” section below for more specific hardware recommendations), running any version of Linux. The AR Sandbox software, in principle, also runs on Mac OS X, but we advise against it.
  • A Microsoft Kinect 3D camera
    . The AR Sandbox software, or rather the underlying Kinect 3D Video Package as of version 3.3, supports Kinect-for-Xbox 1414 and 1473, Kinect for Windows, and Kinect for Xbox One. The first three are functionally identical, so get the cheapest model you can find. Note: The second-generation Kinect for Windows v2 is not yet
    supported by the AR Sandbox software.
  • A digital video projector with a digital video interface, such as HDMI, DVI, or DisplayPort.
  • A sandbox with a way to mount the Kinect camera and the projector above the sandbox.
  • Sand.

這是人家的要求

其實也沒多高配置,我GT840M都可以跑,英偉達的Linux顯卡驅動你要到官網去下。

你還需要一個Kinect v1,我之前做項目時在淘寶上買了個v1,才400塊左右。

最重要的還有個投影儀,我去找陳院長借了一個。

然後你得裝個Linux系統,我裝了個Ubuntu(雙系統),用著挺好的

其他的像沙盤啊,沙啥的都可以後面調好了咱再弄。我們先看怎麽把這個軟件跑了

第一開發階段就是 先把整個功能跑一下,管他對的準不準。

為了方便,我這樣做的:

技術分享圖片

技術分享圖片

實際上應該是這樣的,為了不費那麽大功夫搭這個架子,我就豎著放了

技術分享圖片

好,給大家看看要怎麽做

https://arsandbox.ucdavis.edu/forums/topic/complete-installation-instructions/

跟著這個教程走

實在看不懂就翻譯,還不行就全部一步步復制粘貼。

(我就是這樣的,也沒報啥錯)

Note: Please don’t comment on this thread; it’s gotten unwieldy. If you have any questions, concerns, or problems, please start a new thread.

Due to the currently surging interest in AR Sandbox installations, I am posting complete installation instructions, starting from a blank desktop PC with an Nvidia GeForce graphics card. Due to increasing weirdness in recent versions of Mac OS X (starting with 10.7), I can no longer recommend Mac computers and Mac OS X to drive AR Sandbox installations.

You can also watch a full walk-through video of steps 1-5.

  

  1. Install the current version of 64-bit Linux Mint with MATE desktop on a blank desktop computer. This needs to be a real computer; the AR Sandbox does not work from inside a virtual machine.
  2. Install vendor-supplied drivers for the Nvidia graphics card. Open the Control Center, select “Driver Manager,” wait for the panel to show up and the list of available drivers to be populated, and then select the recommended Nvidia binary driver and press “Apply Changes.” Then wait until the change is complete (might take a while), and reboot your computer.
  3. Open a terminal window and enter precisely the following commands (if in doubt, cut & paste directly from this web page, one line at a time). ~ is shorthand for the user’s home directory:
    cd ~
    wget http://idav.ucdavis.edu/~okreylos/ResDev/Vrui/Build-Ubuntu.sh
    bash Build-Ubuntu.sh

    The script run in the last command will ask you for your user’s password to install prerequisite libraries, and then build the Vrui VR toolkit. That will take a little while and produce lots of output, and at the end you’ll be greeted by a spinning globe in a window. Close that window and go back to the same terminal as before.

  4. To install the Kinect 3D video package, run in the same terminal:
    cd ~/src
    wget http://idav.ucdavis.edu/~okreylos/ResDev/Kinect/Kinect-3.2.tar.gz
    tar xfz Kinect-3.2.tar.gz
    cd Kinect-3.2
    make
    sudo make install
    sudo make installudevrules
    ls /usr/local/bin

    Check that the list of names printed by the last command contains KinectUtil and RawKinectViewer.

  5. To install the AR Sandbox software itself, run in the same terminal:
    cd ~/src
    wget http://idav.ucdavis.edu/~okreylos/ResDev/SARndbox/SARndbox-2.3.tar.gz
    tar xfz SARndbox-2.3.tar.gz
    cd SARndbox-2.3
    make
    ls ./bin

    Check that the list of names printed by the last command contains CalibrateProjector and SARndbox. The AR Sandbox calibration utility and main application are now in ~/src/SARndbox-2.3/bin.

  6. Plug in your first-generation Kinect device and download intrinsic calibration parameters directly from its firmware. In a terminal window, run:
    sudo /usr/local/bin/KinectUtil getCalib 0

    This might ask you for your password again; if so, enter it to continue.

  7. Align your camera so that its field of view covers the interior of your sandbox. Use RawKinectViewer to guide you during alignment. To start it, run in a terminal window:
    cd ~/src/SARndbox-2.3
    RawKinectViewer -compress 0
  8. Calculate your sandbox’s base plane, by following the instructions in the AR Sandbox Calibration – Step 4 video, or this new video that shows all required calibration steps in one. You can use the already-running instance of RawKinectViewer.
    You need to enter the base plane equation (and the 3D sand surface extents in the next step) into the BoxLayout.txt file in etc/SARndbox-<version> inside the SARndbox source directory. Under Linux Mint, the default text editor is called “pluma.” So to edit the file, run in a terminal window:

    cd ~/src/SARndbox-2.3
    pluma etc/SARndbox-2.3/BoxLayout.txt &

    The ampersand at the end of the second command will keep the terminal window usable while the text editor is running. Now enter the base plane equation as described in the video. To copy text from a terminal window, highlight the desired text with the mouse, and then either right-click into the terminal window and select “Copy” from the pop-up menu that appears, or press Shift-Ctrl-c. To paste into the text editor, use the “Edit” menu, or press Ctrl-v.

    Pro tip: The quickest way to copy&paste text from any window into any other window is: 1: Highlight text in source window with the mouse. 2: Move mouse to destination window and to the location where you want to paste the text, and click the middle mouse button.

  9. Measure the 3D extents of the sand surface. In the newly-released Kinect-3.2 package, this can be done inside RawKinectViewer as well by following the instructions in this video, starting at 4:10. Make sure to measure the box corners in the order lower-left, lower-right, upper-left, upper-right. After you have copied the box corner positions into the text editor as described in the video, save the file (via the “File” menu or by pressing Ctrl-s), and quit from the text editor (via the “File” menu or by pressing Ctrl-q).
  10. Align your projector such that its image fills the interior of your sandbox. You can use the calibration grid drawn by Vrui’s XBackground utility as a guide. In a terminal, run:
    XBackground

    After the window showing the calibration grid appears, press the “f” key to toggle it into full-screen mode. Ensure that the window really covers the entire screen, i.e., that there are no title bar, desktop panel, or other decorations left.

    Press Esc to close XBackground’s window when you’re done.

  11. Calibrate the Kinect camera and the projector with respect to each other by running the CalibrateProjector utility:
    cd ~/src/SARndbox-2.3
    ./bin/CalibrateProjector -s <width> <height>

    where <width> <height> are the width and height of your projector’s image in pixels. For example, for an XGA projector like the recommended BenQ, the command would be:

    ./bin/CalibrateProjector -s 1024 768

    Very important: switch CalibrateProjector’s window to full-screen mode by pressing F11 before proceeding. Then follow the instructions in this video, starting at 10:10.

  12. Finally, run the main AR Sandbox application:
    cd ~/src/SARndbox-2.3
    ./bin/SARndbox -uhm -fpv

    Switch SARndbox’s window to full-screen mode by pressing F11, or the calibration created in the previous step will not line up.

  13. Read the “AR Sandbox post-installation setup” post for some additional automation and fine-tuning suggestions.

好,最後一步就是最難的校準了,先給大家看看,我到這一步的效果,是個視頻

https://1drv.ms/v/s!AhyyHJSYB2g7itEyj8Rjlu3GoNXgmg

校準就得你們自己去弄了,我做到這裏就收拾東西了,因為實在沒錢做架子,校準也看不太懂,只知道要記錄幾個點的位置。還要用圓盤定位

KInect AR沙盒制作的一點小經驗