Public Lab Research note

New beta capture interface for Spectral Workbench

by warren | December 12, 2013 16:07 12 Dec 16:07 | #9875 | #9875

I've been working in my spare time on a new interface for capturing spectra, pictured above, which is available at:

It uses the more flexible and robust Bootstrap interface widgets which I've been using on the rest of the site, and combines the mobile and desktop interfaces into a single flexible layout (which means that any feature we add to one will be available for both).


Some of this is really just reconstructing the features of the old interface in the new one, but one very nice addition is that you can now click to choose the "sampling row" in the mobile interface:


You can also do comparisons and run macros from the beta mobile interface. This is all a bit untidy at present, but now that it's implemented, refining it and adding new features should be much easier.


The still-untidy macros pane on the new beta capture interface.

Questions and next steps

We need to think a bit more about the macro interface and how new macros and additional tools are laid out in this new screen. There's more space than before, but the last interface got cluttered pretty fast, so I'd like to have some overarching layout strategy to avoid that. Also, I'd like to integrate some kind of premade online IDE component in the macros pane, so you can actually prototype in there, as well as search for and run macros.

Anyhow, feedback and bug reports are welcome; what do you think about making this the default interface? Is it ready? Is it at least better than the old one?


I tried using the beta capture interface in Chrome on my Galaxy S3. I ran into a couple issues that prevented me from taking a spectrum. The main issue is that it samples from the front facing camera and I can't figure out how to switch to the rear camera. This may be a WebRTC limitation in Android Chrome so I'm not sure if anything can be done about it. Also, it would be nice to be able to rotate the sampling row somehow on the initial screen. It's a really cool tool, and I'd really like to be able to use on my phone some day. It seems like building an Android app to do the video capture would solve a couple problems. It would avoid the WebRTC bugs, and it might give you some control over the camera's focus. I've found that when I use the camera app to photograph spectra I have to fight against autofocus or accidental re-focuses triggered by screen taps.

Reply to this comment...

Hi, Nathan - yes, Chrome doesn't have a camera selection interface yet, and I've filed a bug report with the Chromium team. Firefox for Android does, and works really well. I believe Opera does too.

We'd like to keep interface parity, so while we are working on native apps, we are hoping to keep the HTML interface, and basically just create JavaScript methods for more advanced camera access and manipulation.

Thanks for the feedback!!

Reply to this comment...

Thanks for the tip about Android Firefox, I just tried it out and was able to access my rear facing camera. I wasn't able to rotate the video feed. I tried pressing rotate button, but I'm not sure if it had any effect. The video feed kept repeating the same row of pixels after I pressed it (I'm not certain it was caused by it though). Also, the page would freeze after I pressed "begin capturing" sometimes (i.e. none of the buttons would work and the camera feed did not update).

W.r.t. native apps, have you looked into building a phonegap plugin? That could allow you to keep the HTML interface while using native code to control the camera feed.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

We had a Phonegap prototype going but they do not expose the raw video feed, but require the user to go through the camera widget, unfortunately. I'm hoping that when we make more progress on the iOS version we can backport some of that stuff to PhoneGap.

I'll spend some time on the rotation feature; I just fiddled with and improved the interface today, so there are a few more changes;

I also hope the freezing will be fixed by Firefox soon -- they just pushed some new WebRTC changes out in an update. I also need some more testing phones :-)

Reply to this comment...

Ok, I'm new to this group. I'm Biologist interested in capturing spectral data. I am often doing field work with no cell or wifi available and working with iOS devices. Is there a mobile version of the beta capture or other versions for iOS devices (iPhone), or will there be in the near future for the Spectral Workbench?

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Login to comment.