Compared to Windows, Linux support is second-grade or non-existent for most medical imaging and position tracking hardware, but with some extra effort you should be able to implement most systems on Linux, too. Webcams should work, probably best via OpenCV imaging device.
2D barcode tracking using single camera based tracking is very inaccurate: in-plane translation/rotation error is less than a millimeter/few degrees but error in distance from camera can be 10% and out of plane rotation error can be 5-15 degrees. Therefore it can only be used for demos or low-accuracy applications.
For proper tracking (with submillimeter/subdegree error, resulting total system accuracy of up to a few millimeters), you can use an inexpensive stereo tracker, such as the Optitrack Duo (costs $2300).