SIV – a stereoscopic jps viewer for Linux

As promised in JPS-viewer for linux, here comes the very first release of  SIV, the first available  Stereoscopic  Image Viewer for Linux supporting quad buffered stereo. Well this is not 100% correct, since it is build upon OpenSceneGraph it is somewhat platform independant and schould compile well on windows, mac and unix platforms. However, I only tried with linux since there are enough alternatives available for most other platforms.

SIV is  capable of displaying jps stereo images in different stereo modes. I tried it in fullscreen/windowed mode with anaglyphic and quad buffered stereo mode. Different output devices I tested were my Vuzix VR920 and relevator shutter glasses  on Nvidia Quadro FX 350M and FX 3400. It still lacks some convenience functions like a diashow mode.

Screenshot of the viewer as window in anaglyphic mode:

jpsviewer-anaglyph

A note about the name SIV, SIV stands for Stereoscopic  Image Viewer, but as I found out Siv is also the name of the wife of the god Thor in the norse mythology. See: Wikipedia: Sif and Behindthename: Siv. Sif and Siv are the same name, both writings are possible. Once I found out this, I thought that’s a cool name for this piece of work.

Usage:

./siv [options] jpsfile(s)
Options:
–CullDrawThreadPerContext                 Select CullDrawThreadPerContext
threading model for viewer.
–CullThreadPerCameraDrawThreadPerContext  Select
CullThreadPerCameraDrawThreadPerCo-
ntext threading model for viewer.
–DrawThreadPerContext                     Select DrawThreadPerContext
threading model for viewer.
–SingleThreaded                           Select SingleThreaded threading
model for viewer.
–accum-rgb                                Request a rgb accumulator buffer
visual
–accum-rgba                               Request a rgb accumulator buffer
visual
–cc                                       Request use of compile contexts and
threads
–clear-color <color>                      Set the background color of the
viewer in the form “r,g,b[,a]”.
–display <type>                           MONITOR | POWERWALL |
REALITY_CENTER |
HEAD_MOUNTED_DISPLAY
–rgba                                     Request a RGBA color buffer visual
–samples <num>                            Request a multisample visual
–screen <num>                             Set the screen to use when multiple
screens are present.
–serialize-draw <mode>                    OFF | ON – set the serialization of
draw dispatch
–stencil                                  Request a stencil buffer visual
–stereo                                   Use default stereo mode which is
ANAGLYPHIC if not overriden by
environmental variable
–stereo <mode>                            ANAGLYPHIC | QUAD_BUFFER |
HORIZONTAL_SPLIT | VERTICAL_SPLIT |
LEFT_EYE | RIGHT_EYE |
HORIZONTAL_INTERLACE |
VERTICAL_INTERLACE | CHECKERBOARD |
ON | OFF
–window <x y w h>                         Set the position (x,y) and size
(w,h) of the viewer window.
-O <option_string>                         Provide an option string to
reader/writers used to load
databases
-e <extension>                             Load the plugin associated with
handling files with specified
extension
-h or –help                               Display this information
-l <library>                               Load the plugin

You may notice that most of the options come from osgViewer, which is the base class for the viewer. This gives the advantage, that one can use the “normal” osgViewer controls such as flying around the scene. Try holding the right mouse button and moving the mouse up or down for zooming out or in. Or press F for toggling fullscreen mode or press S for toggling the stats (fps, etc.) display.

You may supply multiple .jps files at the command line.  I.e. ./siv *.jps will display all jps files in the current folder 😉

Once the first image of the list is being displayed you may use CURSOR_UP/DOWN or the mouse wheel to select a different image for being displayed. In future versions I may implement a diashow function…

When displaying an image the filename of the image is displayed in the lower left corner.

You can find some jps images for trying out the viewer on:  Stereo Images From Juneau.

Possible Problems:

As default SIF starts in fullscreen quad buffered stereo mode. Thus if your graphics hardware does not support this mode, the viewer will exit with the following error:

Error: Not able to create requested visual.
GraphicsWindow has not been created successfully.
Viewer::realize() – failed to set up any windows

In this case try anaglyphic mode or the apropiate 3D mode for your hardware (see the –stereo option).

You may experience the application segfaulting. Most possibly the reason is that your OpenSceneGraph lacks the library  osgdb_jp2.so in the lib/osgPlugins folder. If you strace the application and the last thing it tries before segfaulting is to access osgdb_jp2.so, this is the reason. The Problem will be corrected in the next version of SIV. For now install Jasper and rebuild OpenSceneGraph.

Download:      

Do not download these files anymore unless you explicitely want this version. New version is available at: SIV-1.0 released

I decided to publish the viewer under the creative common noncommercial license. Make sure you have the OpenScenegraph library installed before trying to compile or run the viewer. You may download the full source (Eclipse Project) from here: [download#5] or an x86_64 binary from here: [download#6]. More binary formats may be available in the future. Fore the x86_64 binary you’ll need OpenSceneGraph-2.8.

Binaries for most linux distributions can be downloaded from www.openscenegraph.org.  Instructions on how to build OpenSceneGraph on gentoo can be found on PlopByte.

Building from source:

For building from source unpack the zip and cd to siv/Release and run make.

Future plans:

For the future I’d like to implement a diashow function and to integrate the VR920 headtracking into the viewer. It would be really cool to view a sea panorama image in 3D by turning the head :) This is the reason why the image is not being displayed plain, but on a cylinder segment. For the tracking I’ll have to write a driver for the VR920 headtracking  first, to get the camera viewmatrix for the viewer. Since in Vuzix Forums I found a non working driver,  from which I was able to learn how to read the sensor data, I only have to implement the neccesary calculations and calibration methods.

Well, I hope you enjoy the 3rd dimension. If you like the viewer feel free to link to MyGNU.de.

Stay tuned for updates

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

JPS-viewer for linux

As I stated before in Vuzix VR920 with Linux and active 3D stereo, I planned to write the first stereo enabled jps viewer for linux. At least I was not able to find a viewer for jps stereoimages that is capable of displaying in active pageflipped stereo.

I made some progress in writing the viewer. The viewer itself depends on OpenScenegraph. It is now capable of displaying jps stereo images in different stereo modes. I tested it in fullscreen/windowed mode with anaglyphic and quad buffered stereo mode. Different output devices I tried were relevator shutter glasses and my Vuzix VR920 on Nvidia Quadro FX 350M and FX 3400. Here comes the first screenshot of the viewer in windowed mode:

jpsviewer-anaglyph

Of course the screenshot is of the viewer in anaglyphic only, since I can’t include anything else in the blog 😉

I still have to do some code cleanup. But expect the viewer to be published soon.

Stay tuned for updates

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

stereoscopic mplayer

Experimenting with my VR920 3D stereo glasses I found a patch to enable stereoscopic support in mplayer (thanks to Stuart Levy). With this patch I can now watch 3D movies on my eyewear under linux. Let me tell you, it’s a really cool experience.

The patch should work at least with nvidia quadro boards, probably with some others. It can also be used with CRT and generic shutter glasses. You can download the patch from here:

mplayer-stereoscopic.patch

Some stereoscopic sample movies for trying it out can be found on www.3d.wep.dk.

For Gentoo users I modified the mplayer ebuild to include the patch. Download from here:

[download#2]

To use it just copy the mplayer subtree from the portage tree to /usr/local/portage/media-video/mplayer and remove the ebuilds. Copy the new ebuild to that directory and the patch to the “files” directory. Then run

ebuild /usr/local/portage/media-video/mplayer/mplayer-1.0_rc2_p28058-r1.ebuild digest

Be sure to include the following line in your /etc/make.conf.

PORTDIR_OVERLAY="/usr/local/portage"

Then just re-emerge mplayer.

Now start mplayer with -vo gl2:stereo and enjoy a new experience in the 3rd dimension.

Addon: Updated modified ebuild for the new version in portage tree:

[download#4]

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Vuzix VR920 with Linux and active 3D stereo

I recently received my VR920 3D stereo glasses from USA. A detailed review of the device can be found here : Introducing the Vuzix iWear VR920. A photo of the VR920 can be seen below:

VR920 HMD

The device of course works flawlessly using Windows. The situation under Linux is a bit different, due to missing driver support from the manufacturer, as usual.

Stereo vision works at least with nvidia quadro boards, probably also with others. I.e. Ati FireGL should work, but I never tried this. Setting this up was easy. I only had to start a second XServer and add the line

Option “Stereo” “1″

into the screen section of its xorg.conf. With this setting you get a different image for both eyes and thus real stereo vision if your application supports quad-bufferred stereo. It is important that the screen resolution is between 640×480 and 1024×768 and the refresh rate is 60 Hz. The xorg.conf you are using for this must not use the composite extension. For disabling the Composite extension append the following to the xorg.conf:

Section “Extensions”
Option         “Composite” “Disable”
EndSection

Sadly this also prevents the use of compiz, hopefully Nvidia fixes the incompatibility between stereo and the composite extension some day.

For starting the xserver i use the following little script, which opens 2 xterms and starts the program (given as parameter with arguments) in one of them.

#!/bin/bash

/usr/X11R6/bin/X :1 -dpi 96 -xf86config ./xorg.conf.3d -auth /var/gdm/:1.Xauth vt8 &
DISPLAY=:1.0
export DISPLAY
sleep 5
icewm&
hotkeys&
xterm -fn 9×15&
xterm -fn 9×15 -e $@&

The headphone gets detected as alsa device:

usb 2-2: new full speed USB device using uhci_hcd and address 8
usb 2-2: configuration #1 chosen from 1 choice
generic-usb 0003:1BAE:0002.0002: hiddev0,hidraw1: USB HID v1.00 Device [Icuiti Corp. VR920 Video Eyewear] on usb-0000:00:1d.1-2/input3
usb 2-2: New USB device found, idVendor=1bae, idProduct=0002
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-2: Product: VR920 Video Eyewear
usb 2-2: Manufacturer: Icuiti Corp.
usbcore: registered new interface driver snd-usb-audio

cat /proc/asound/cards:

1 [ Eyewear ]: USB-Audio – VR920 Video Eyewear
Icuiti Corp. VR920 Video Eyewear at usb-0000:00:1d.1-2, full speed

I was able to get mplayer to play on the device by setting the output device to hw=1,0 .

Sadly the mixer does not seem to work. At least the mixer levels are not controllable. Perhaps any alsa developer has an idea for this? It is even more important since the mixer control wheel at the device freezes after three steps when using linux.

More important than having controllable sound is to get the integrated headtracking to work. There is a non-working driver at vuzix forums. At least it can read the sensor data from the device but does not seem to handle the data correctly. I will look into this soon.

Update: My VR920 headtracking driver is now available here: VR920 headtracking driver for Linux

Playing with the device I had to find out that there is no jps stereoimage viewer for linux. The only programm I found, which is able to read jps-images, is gqview (GQView3D). Sadly gqview is not able to display theese images using active quad-buffered stereo. Thus I decided to write my own jps viewer. It will be based upon OpenSceneGraph (OpenSceneGraph) since I have some experience in OpenSceneGraph development. Perhaps I can integrate headtracking into it. Would be really cool to view a sea panorama image in 3D by turning the head :)

Stay tuned for updates.

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

siteinfo

Translator