juan's aragon360grados tamas varga's panoramic photo books: china beijing tristan shu's vr innovations the eye of nagaur scott haefner's kite vr photography tabb firchau's aerialpans by rc helicopter a conversation with tito dupret about his world heritage tour an incredible xrez production an interview with carel struycken and the groninger museum exhibit kite panorama at sziget 2007 by aldo hoeben some images are more equal then others: sziget 2007 new dimension in aviation sports red bull air race abu dhabi 2007 alpine panoramas highlights of swiss photography panogames next gen screenshots 360 parks panoramas as a tool for education squaring the head of hermann redbull xfighters madrid 2006 place–hampi: stereographic panoramas of vijayanagara, india add some height to your panoramas how to make a quicktime vr in 10 minutes immervision's pure player pro for java shooting panos from a gondola in venice new pano2qtvr software for windows users a very, very large zoomify panorama – 2.5 gigapixels mirror image - reflections on single shot vr by pat st. clair bostjan burger - vr photographer at large an update on world heritage traveler and photographer tito dupret standard & poors awards goes virtual a walk around the moscow kremlin by alexey trusov imediatour jook leung talks panoramas on abc’s ‘ahead of the curve’ interview iqtvra summit in sedona update photokina: sep 28-oct 3 in cologne, germany catch the qtbug tour with dennis biela of lightspeed media smithsonian national air and space museum qtvr project new virtual reality site - fullscreenqtvr.com get inside the mercedes-benz slr mclaren! stitcher 4.0 release - an interview with realviz cto luc robert iqtvra washington dc summit vr news the taj mahal – world wonder on the web iqtvra & vrmag join forces in new alliance the quicktiming duo ideum, exploring new frontiers from escher to cubic vrs www.panoramas.hu wgbh interactive the riviera project the making of the zermatt vrscope one, two, 360
andrew magill's orientation aware camera allows to paint vr worldpanoramastock.com's innovative policy pangeavr for iphone by brian greenstone's pangeasoft multimedia postcard - a janus multimedia creation when design meets vr: panoramalampe panobrella when vr meets an umbrella krpano the multiresolution panorama flash player henning kramer of x60 about the mk panomachine kaidan's quick pan professional tutorial tools you can use - software autopano pro - just another stitcher ? hardly! using enfuse for night photography the flash panorama player revolution kolor autopano pro - an interview with alexandre jenny review of nodal ninja nn3 and preview of the new nn5 advanced panoramic stitching - a reasoned approach tools you can use: software hydra on location: georgia arounder shoot immervision releases the pure starter toolkit immervision - a company with vision spi-v 1.3 update, one year later tutorial - greenscreen object movie resizable cylindrical panorama flash viewer realviz® announces us digital panorama tour an interview with 360 precision founders: matthew rogers and stuart milne cgibackgrounds provides new venue for vr photographers brian greenstone releases pangeavr 1.0.1 vr based print ad campaign huge printed panorama of the duomo at b.i.t. in milan panoramic photography and image based modeling dvds by greg downing interactive panoramas book by corinna jacobs pleinpot - fullscreen panoramas to web pages made easy new karline rodeon pro vr head realviz releases stitcher express aldo hoeben’s spi-v engine panoscan announces new mk-3 panoramic camera system new kiwi tripod head from kaidan new panorama book featuring laurent thion and gilles vidal vrway partners with multimedia san paolo vrway partners with music label motette ursina for arounder milan case study: production of arounder milan peace river studio's pixorb surveyor catch the qtbug tour with dennis biela of lightspeed media production of the voice commentary for arounder milan the milan duomo cathedral choir and chapel master claudio riva karline rodeon vr head sound bytes - why sound? zoomifyer for flash – free software until end of march peace river studio's pixorb tripod head lens types supported by realviz stitcher using full-frame fisheye images with stitcher™ multinode qtvr tour with embedded flash navigation new software - convert cubic panoramas into video new autostitch panorama software getting viewers to pay for vr content - why not? paying for virtual tours – armchair travel’s experience with micropayments ambient sound for a specific vr ambient sound for city vr tours viewpoint, the new kodak professional pro 14n digital camera high dynamic range imaging, panoscan & spheron case study, tribunal plaza, nice photoshop 7 camera raw format/jpeg 2000 plug-in a new spin on flash object vr parma project: case study 2 parma baptistery and duomo shoot: case study vrscope the wide screen desktop movie
viewat dot org reaches 1500 vr's ! viewat dot org reaches 1500 vr's ! photokina 2008 cologne and ivrpa contests 2008 panotools meeting prague jeffrey martin's 360cities viewat org a 360 international project google sponsors the development of open source panorama making software jook leung's 360 degrees workshop in maine 2007 panotools meeting in lucerne switzerland 2007 ivrpa conference in berkeley vr community announcements get pumped for sziget 2006 world wide panorama event - gardens arounder launches a blog as it expands through europe 2006 vr summit in lisbon borders - the march 2006 world wide panorama event world wide panorama - the best of 2005 energy, a world wide panorama event 2005 summit in savannah pic du midi solar eclipse and digital imaging conference call for images for iapp international print exhibit overview of august 2005 panotools meeting in venice ivrpa summit in savannah september 26th - 30th panorama tools photography workshop, venice, august 4-7, 2005 the international association of panoramic photographers (iapp) spin control for novice qtvr users celebrate 2005 new year's events across the globe world wide panorama -sanctuary new world wide panorama event - sanctuary 360 days with mickael therer summit in sedona kicks off bridges - a world wide panorama panorama photography workshop, stuttgart, germany, july 9-11,2004 iqtvra summit in sedona, oct 25-29, 2004 new world wide panorama shoot - june 19-20-21, 2004 panorama seminar in venice, italy an interview with world wide panorama organizers mini virtual tour of boston world wide panorama - a day in the life of 180 photographers inside a wind tunnel: onera's s1ch march 2oth spring equinox , join the worldwide qtvr event an interview with peace river studios world heritage benrath castle in düsseldorf, underwater vr news special discounts on popular photography & stitching products holiday panoramas iqtvra washington dc summit
text
SEARCH
VR industry


Andrew Magill's Orientation Aware Camera allows to paint VR
Paint 360° with Andrew Magill's Orientation Aware Camera
by Andrew Magill





I started this project without really having any idea where it would end up. I started off by deciding it could be interesting to build a device that would sample a 3-axis magnetometer and a 3-axis accelerometer and send that data to my computer via USB. Devices very much like that are often sold as a 'tilt compensated compass', and go for $250-500. I made mine for about $150.

I happen to live in the same town as my new favorite hobby electronics site, SparkFun, so I ordered the accelerometer and magnetometer from them, and I was able to pick them up in person a couple days later. Next, I needed a way to get the data from the sensors to my computer. I wanted a USB connection, but I'd never done anything with USB before, and a little research into the controller chips told me that was a lot more trouble than I was willing to deal with. I also considered just having a microcontroller stand between the sensors and an off-the-shelf USB to serial adapter, but having the device appear as a COM port really didn't appeal to me. However, my research had also turned up another option; USBMicro's U421. The U421 is essentially just a breakout board with a microcontroller pre-programmed to relay data back and forth between its USB connection and its GPIO pins. It can speak SPI (same as my sensors), its USB interface just uses the HID drivers built into Windows, and it even came with a well-documented DLL that provided a nice simple interface for controlling it. It looked like it was just a matter of properly connecting it to the sensors, and then writing software to drive the whole thing.

Well, not quite. After I got the U421, I noticed that it does all its signaling at 5 volts, whereas the sensors require 3 volts. My roommate just happened to have a MAX3002 bi-directional level converter handy, which was just the right thing to fix the problem, except for its teeny little TSSOP (0.65mm pin pitch) chip package. So the whole project went on hold another week while I got a TSSOP/20 to DIP adapter from Logicalsys. I watched some tutorial videos on surface-mount soldering, bought myself some flux, and the soldering went remarkably easily.

With that problem solved, I worked out a layout to connect everything together on a bit of protoboard I bought, soldered everything together, wrote some code to have the U421 sample the sensors, and plugged it in to test.. and it worked! Here's what it looked like:


(If you're wondering, that box is a Hammond Manufacturing 1455 series enclosure. I got mine locally, but Digi-key has quite a few sizes in stock.)

However, I soon found it only worked for a few seconds at a time. For some reason, the accelerometer kept getting itself in a funny state and would just start returning garbage values until I power-cycled it. After much frustration, its datasheet finally revealed why; its chip select pin wasn't really a chip select pin.

The U421 only provides one SPI port, so I had both of the sensors bussed together on it, and used each sensor's chip select pin to let them know which one I was talking to. As it turned out, the chip select pin on the accelerometer doesn't really disable its SPI port when its not selected, it just switches it into I2C mode. So whenever I was trying to send a message to the magnetometer, the accelerometer would try to interpret it as an I2C message instead of ignoring it as it should have. The accelerometer provided no good way to have it ignore the bus completely. So, I ran out to the local electronic components shop and picked up a 74F32 OR-gate chip. Now instead of toggling the accelerometer's chip select pin, I just block its clock signal unless I really do want to talk to it. Problem solved.

Here's the finished layout. Sorry, no nice circuit diagrams or PCB layouts here. I drew these up just for my own benefit while I was planning out the layout. The color coding ought to be enough to see what's going on here, but if you want more detail, then refer to the datasheets for the U421, 74F32, MAX3002, accelerometer, and magnetometer.


In hindsight, I kind of regret going with the U421. Not that there's anything really wrong with it: it works as advertised and it got this project off the ground fairly fast. The problem is that every sensor sample requires a lot of communication round trips between my software and the U421. Each sample goes something like this:

Enable the magnetometer's chip select
FOR each axis (x, y, z)
Enable the magnetometer's reset pin
Disable the magnetometer's reset pin
Send command to measure axis by SPI
Wait until the magnetometer's data ready pin goes high
Read measurement result by SPI
END FOR
Disable the magnetometer's chip select
Enable the accelerometer's chip select
Send command to return status and acceleration registers by SPI
Read registers by SPI
Disable the accelerometer's chip select

That's at least 21 round-trips. I did a lot of experimentation to find ways to optimize this process, but the best I ever got was 5 samples per second, a fraction of sensors' maximum. What I should have done was just programmed a simple microcontroller to handle all the logic of sampling the sensors, and then given it a USB interface with one of FTDI's chips. I only found out about FTDI later, but they look like a great option to add USB to any device really easily.

At this point, I had a reliably working device that was more or less completely useless. I had a little console application I'd written printing out the data from the sensors, but it really cried out so what? Well, I've been getting into OpenGL development (and recently read the the Red Book cover to cover), so I started toying around with programs that would compute a transformation matrix from the sensor data and then rotate stuff on screen the same as the box. Still, so what? Next, on a whim, I dropped in some code I'd written for a previous project to connect to a webcam and get frames of video. Holding the box and webcam with one hand, I could rotate the camera, and the software rotated the video on screen in the same direction.. and the image seemed to stay perfectly level. That's when I started to think I had something interesting.

So I decided to add a camera to the box. The webcam I already had wouldn't quite fit even with its casing removed, so I went out and checked around a few stores until I found one that would, a Microsoft Lifecam VX-7000. Personally, I prefer Logitech, but none of theirs were quite the right shape. So, having been out of the box barely five minutes for a quick test, the Lifecam had most of its casing removed or trimmed back. Then I just drilled a big hole in the end of the box, put a rubber grommet in it to hide the nasty edge the drill left, and stuck the camera inside with a bit of really strong double-sided tape. To get everything to work over one USB cable, I just got the smallest USB hub I could find, removed its casing and all of its ports, mounted it inside, and soldered the USB cable, U421, and the webcam directly to it.

A couple weeks of tinkering with the software led to what you see in the video above. It's far from a finished product, but right now I'm pretty content with what it can do. Here's an equirectangular projection of the scene I captured in the video:

So, how does the software work? For the sake of brevity, I'll stick to how it accumulates the panorama the way it does. For everything else, you're welcome to read my source code.
So imagine you're in your favorite spot, and you just happen to have a camera that takes square pictures with a perfect 90-degree field of view. You take one picture to the north, one east, one south, one west, one straight up, and one straight down. Then you make twelve foot tall prints of all those pictures and attach them at the edges. The 'down' picture goes on the ground, the 'up' picture becomes a ceiling, and the other four are walls. Now, if you stand inside this big cube, with your head right at the center, you should be able to look around in any direction and it will be almost just like you're in the spot you took the pictures. In 3D computer graphics, this is called a skybox. This is how my program keeps track of and draws the surrounding view.


Now imagine, still standing inside this big cube, you get out that camera again. If you take a picture any one of the walls, it will exactly fill the camera's 90-degree field of view. So if you, say, hold your hand in front of the camera, take a picture of the north wall, and replace that wall with the picture you took, here's what you get:


The wall is the same as it was before, except your hand is on top of the old picture. You can do this again and again, adding something new every time, and all the parts that didn't get covered up stay the same.



This is where the analogy gets a little strained. Say you have, um, a television on a stick. Or a projector that.. oh, I give up. Watch the end of the video again. See how we take the image from the webcam and draw it in that little rectangle in 3D space? It's always facing the center, and it's always the same distance away from the center, but it rotates around the same as the box is being turned. (Now I'm talking about the real box, with the electronics in it.)
Now, with this video image floating around, if we start updating all six sides the way I described, then the frames video will get captured onto the sides. Now we can just turn the camera until it's covered every angle, and we're left with a panoramic image on the sides of the skybox. Those images can then be saved out and converted into other projections, like the equirectangular one above.

Here's the sides of the skybox from the capture I did in the video. This is a typical way of laying them out in one image, and the format preferred by HDRShop, the software I used to covert to the equirectangular image above.


Download C# source code (.zip, 555k)

Well, what are you waiting for? Now, it's your turn to go out and paint the world around you!

Links:
ominoushum.com



Subscribe Newsletter
Send to a friend
Do you have an interesting story
you want to share with our readers ?
Drop us a mail
VRMAG Homepage
Join:
VRMAG's Yahoo group

Check out:
VRMAG's Blog

VRMAG recommends:

Tripod heads:
360Precision
Nodal Ninja

Stitcher apps:
Autopano Pro
REALVIZ Stitcher
PTGui Pro

VR player:
Krpano
Flash panorama player
SPi-V
Pure player for Java

Community projects:
World Wide Panorama
ViewAt.org

Translations, voiceovers:
Networks

Print Magazine:
Monocle




The purpose of this banner is to raise funds for a new VR community project VRMag will launch in a few months.



 

Homepage
- - Credits - Links - Blog - VRMAG Yahoo Group - RSS Feed

Previous Issues: 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28

VRMAG archive: Feature Story - Hotlist - Column - Reviews - Day Trips

VArtist archive: Spotlight - Guest Artist - Gallery - Showcase - VR Industry - Community

The copyright of the images belong to the individual photographers. VRMAG is a publication of ©2008 VRWAY Int. All Rights Reserved.
Designated trademarks and brands are the property of their respective owners.

Other VRWAY publications: Arounder | Arounder Magazine | Panogames | Fullscreenqtvr | VPBrochure | VRBG