Archive for category News

Reinforcement-learned bike pumper

You don’t know me, but lately I’ve been getting super interested in learning to jump on a dirt jump bike. Like doing an ollie on a skateboard, there is lots of technique that experienced people have that makes them effective, confident, and able to jump high. I suspect that the details around this are not something that are easily communicated, and lots of it is becomes second nature (and is likely done by muscle-memory / feel).

I’ve been trying to see what gets you to go higher (e.g., https://youtu.be/wR2SI9WnNrw?t=17), but haven’t fully unlocked it yet.

Given that I’ve been playing around with reinforcement learning lately, I was curious if I could setup a simple environment and get an RL agent to learn how to pump in order to get maximum efficiency. I ended up not focusing on height, but rather pump-ability.  I setup a small simulation to see if this was possible. I’m bad at physics, so one of the most challenging parts was to work some model of the “pump” into the physics model that was controllable by the agent…kind of like how we use our arms and legs to pump. I ended up with hacking a simple mass / spring which has no connection to a physical model. It kind of worked, and the agent was able to learn to pump at the correct times.

More details, along with the source code here: https://github.com/nbirkbeck/rl-bike-pumper

Check out the example video:

 

 

No Comments

NES Audio Synthesizer — and making my first ROM

Ever since undergraduate days, I’ve always been interested in the NES platform. I’d somehow built a mostly functional emulator (which is somewhat surprising in hindsight), and have had some toy projects around this in the past (like trying to automatically turn the renderings into 3D, https://github.com/nbirkbeck/ennes)

But, I’d never actually built a ROM or built anything that used the platform. I was looking into hobby things to do over this last Christmas break, and thought about building up a game. I know that there are good tools (like NESMaker) for building up a game, but I mostly tinker around with NES because I like the low-level stuff — so using an engine-like tool didn’t seem like something I wanted to take up right now. Also didn’t have any cool ideas of what to build.

Another project that I’ve thought about in the past, was whether I could get the NES to synthesize some audio from an actual song. Again, I’m sure there are tools to do this, but I was just interested in seeing what I could build on a one or two day deadline.

NES audio is composed of 4 signal components: 2 square waves, 1 triangle wave, and a noise channel. I remember when writing a NES emulator (back in University) that I was surprised at how the Super Mario Brothers song had used the noise channel as percussion.

So, given an input, we can do some Fourier analysis on the input (in block sizes of 1024, 2048, 4096 samples), and try to decompose the input audio signal into the best parameters from the NES signal components. Basically, I did this greedily, finding the best matching parameters (which are frequency, duty-cycle type, and volume) for each of the 4 waveforms. I guess harmonics should probably be handled better–and transients (like percussion) should likely be handled more effectively. Anway, it was fun to play around with this, and for the most part if you know how the audio is parameterized, you can easily simulate how things would sound.

But it is much more fulfilling to actually build a ROM. I noticed that there was a c-compiler (cc65) that already had support for NES, and that there was a runtime library with some crude drawing abilities. So the octave code, spits out a super inefficient c-code representation of the commands to drive the audio on the NES, and there is a small driver program to visualize some of the parameters of the audio channels.

It was fun debugging some issues in my emulator to get it to work with the ROM. Turns out the runtime library for cc65 was doing some self-modification of the code (for some tables or something) and my memory mappers weren’t handling that correctly (and ended up segfaulting). Anyway, the resulting interface looks like (the overlays are from my emulator):

The analysis code is here: https://github.com/nbirkbeck/nes-freq-audio

And there are some video examples, where hopefully you can make out the source song:

There are some cracks and pops, since the analysis code doesn’t try to maintain consistency of the waveform when switching parameters. I also tried to decompose the sound so that multiple NES machines could compose and make a more realistic rendering, but ultimately (I think due to synchronization) the result wasn’t worth posting.

 

No Comments

Shape stylized images

Its been a very long time…

I realize that there are a bunch of side projects that are worth a short blog post. About 1.5 years ago, I was working on some coding tutorials to help a friend learn to program. One of starter projects we worked on was to generate a stylized image by populating an image with a bunch of dots (or other shapes). This is inspired by colorblindness test patterns, as I really wanted to generate a bunch of test patterns for testing video color characteristics that would easily allow you to determine if color metadata (e.g., primaries, matrix coefficients, transfer functions) were being interpreted correctly by a video processing system or display.

Well, I never did actually generate the actual test patterns with this code. But we did generate a couple of interesting images. Below are example Andre the Giant

And here is another one that is a portrait of me:

Source code and sample input images on the github project: https://github.com/nbirkbeck/oneonetute

And a video:
 

 

No Comments

JavaScript depth mesh renderer

Was playing around with some old code for generating depth maps and decided to create a demo that renders the depth maps in WebGL. The color video is stacked vertically on the depth texture so that the two will always be in sync. Looked into packing the depth into the 24-bit RGB channels, but as the video codec is using YUV there was significant loss and the depth looked horrible. A better approach would be to pack the data into the YUV channels, but I didn’t try. For this example, the depth is only 8-bit.

You can see the one video here:
http://js-depthmesh.appspot.com/

Stacked color and dpeth

Stacked color and depth

js-depthmesh

, , ,

4 Comments

Javascript & WebGL Image-based rendering demo

Back when I first started doing grad studies at the U of A, I worked with some others on image-based modeling and rendering (http://webdocs.cs.ualberta.ca/~vis/ibmr/rweb.php?target=main).  Back then we had very specific renderers for the latest and greatest hardware (Keith Y. was the author of these), and I had worked a bit on a wxWidgets cross platform version of the renderer and the capture system.

The file format was a binary IFF-type format that could be used to stream partial models.  Internally, look-up tables and texture basis images were represented either raw or in Jpeg.  I originally just wanted to use emscripten to port that version to javascript, but kind of got discouraged after seeing some of the work that would have had to been done to the no-longer maintained renderer source, which had inline assembly and used ancient GL extensions, and I wasn’t sure what was required to interface with dependent libraries (like libz).  Turns out you can natively do all of the necessary binary file unpacking (and jpeg/raw image decompression) to get things loaded into WebGL textures.  Admittedly, some of these things are not as direct as they would be if you were calling say libjpeg to decompress, but interesting nonetheless.  So here is a WebGL version of the renderer:

http://js-ibmr-renderer.appspot.com

that has almost all the same functionality as the desktop app (doesn’t do the 2D or cube-map look-up tables, and doesn’t support some of the older file formats).  Should work with anything that has a decent graphics card and a browser that supports WebGL.

Source code: https://github.com/nbirkbeck/js-ibmr-renderer

screenshot

 

 

No Comments

Updated source files for the random shape generator

Updated some source files for the random shape generator:
http://www.neilbirkbeck.com/source/meldshape-0.1.zip
http://www.neilbirkbeck.com/source/tiling-0.1.zip
http://www.neilbirkbeck.com/source/rshape-0.2.zip

,

No Comments

Updates, resume, cs-site, etc.

I guess this site will be undergoing an overhaul in the next little bit.  Also, fixed up some issues with my CS pages (http://www.cs.ualberta.ca/~birkbeck)

I’m trying to get better at updating my resume (and the associated page on this site).  In this regard, I’m grateful to my committee and graduate supervisors for my latest award (I’m just really slow posting this):

https://www.cs.ualberta.ca/research/awards-accolades/graduate

I’m honored to share this title with Amir-Massoud Farahmand.

, , , ,

2 Comments

Off-line, reading, dreading the coming spring.

Haven’t got much done lately. Was working on revising an old paper for resubmission, which required rereading all the literature. It is mostly on interactive segmentation, so I got a chance to read some other image segmentation papers that I haven’t read before (e.g., the math behind intelligent scissors or livewire). Some cool methods based on shortest paths, dynamic programming, random walkers, weighted distances, and level sets. And of course the graph-cut techniques. I particularly like the methods that do region clustering on the image data (e.g., Live Surface or Lazy snapping), which then allows for either a faster (possibly hierarchical) segmentation. Such clustering seems to be appearing other areas of vision, such as stereo and flow computations (there is a new cvpr09 paper for flow). I am holding myself back from implementing one of these because I don’t need it for anything.

There are lots of nice details for automatic matting (e.g., Bayesian matting and the extensions in GrabCut). The matting tries to determine the foreground and background colors as well as the compositing factor, typically given a trimap (bg/fg labels and the portion in between where the matting happens). In the past I have just used a trilateral filter (using color, distance, and alpha) to get a better border, but these methods would work far better.

Aside from reading, I have also been trying to clean up my multicapture dc1394 code. It is by no means clean yet, but it is better than it was. More details to come in the project page: http://www.neilbirkbeck.com/?p=1359

The cleaning up involved learning more of the boost library, which I am ashamed that I haven’t exploited earlier.  On the other hand, most of what I was changing was to remove dependencies on Qt for lower parts in the architecture.  I still prefer Qt’s QFile, QFileInfo, QDir to boost::filesystem, but boost::filesystem is pretty handy.  Same goes for boost::format and boost:regex.

No Comments

New site transferred

Well, after debating the directory structure for far too long, I decided to finally transfer the main site over.

You can still access the old site here, at least for a while.

I still have a bunch of things to finish up.

  • The publications are still in the old database (although, they don’t change all that much and probably could be a static page).
  • The latest movies and random movies in the sidebar widget are little plugins that I created (they need to be cleaned up;  there probably are similar plugins to these)
  • The media page just spits out all the media (should be paged and cleaner)
  • The projects page somewhat resembles the old page, but I would like it to be more grid-based and less blog like
  • Videos have always probably been somewhat incompatible (I always use ffmpeg, mencoder, or gstreamer) with standard OS installations.  Need to automatically create derivatives of these.  Youtube video’s need to properly reference thumbnails.
  • Local meta-mirror needs to be modified, reorganized to reflect merges.
  • Short tags or some other way to show/add thumbnails for my videos.  Currently my videos use the old system for accessing thumbnails (subdirectory thumbs).  Should be made to be more wordpress-like with postsmeta.

It’s a pretty long list, and I’m sure it will take me a while to get to it, but at least most of the things are up now.

No Comments

Content Layout

I can’t seem to find a good solution to keep all of the old links (directory
structure) while maintaining full featured attachments in wordpress.

WordPress attachments seem to like to be in a subdirectory of the wordpress
root. Unfortunately, it would be nice to have the root in a subdirectory
of the web root (for clealiness), so I don’t want the two roots to coincide
(would end up more cluttered than it already is, with a bunch of wp files).
What would be ideal is the ability to put just the uploads in the root
directory and have wp somewhere else (but again, this wasn’t working entirely,
after several attempts).

I thought that the attachments would work fine if they were using absolute
paths, but this only partially worked. Some of the url grabbing for the
attachments was not using the GUID (which may be a deprecated feature), and
were instead just replacing the upload directory from the file uri to
get the web url. This obviously wasn’t working properly. The solution is
to then instead copy over most of the content to wordpress’s content directory.

This allows me to have some control over the directory structure (with
the add_from_server plugin, which allows adding media files from the
web serverr, which again only really worked with content nested in the uploads
directory). To maintain a fully workable previous version of the site, without
having two full copies of the content, I decided to keep as much old content
in the web root and move over everything from the old site into wordpresses
content directory. The old-site will then be fully operational from the WP
content directory (without rewriting any links). If it is ever desired to move
the old php stuff into a subdir, links will have to be reprocessed.

Stuff in the main directory that is probably going to stay:

  • iphoneads
  • yum

Stuff that should be mirrored (maybe, at least until the few people that have bookmarks have updated them):

  • jshape (with warnings in root).
  • images
  • movies
  • source
  • glacier

Everything will be moved/deleted. There shouldn’t be many dead links, but there may be a couple.

No Comments

Color Tracker

This last friday: I was reading a paper that integrated time of flight sensors with stereo cameras for real-time human tracking and I came across some old papers for color skin tracking. I couldn’t help myself from trying out an implementation of the tracker: color_tracker and color_tracker2

It is really simple, but works pretty good for fast motions.

Another reference was on boosting for detection of faces in images. I was tempted to try and implement a version. It’s a good thing it was closer to the end of a Friday, so I didn’t start…which is probably a good thing as I have little use for such a beast.

Vids will probably only play if you have VLC or Divx installed (encoded with ffmpeg and the usual incompatibility problems)

,

No Comments

Prelim version

Oh yeah, the test version of the new site is currently here

No Comments

Swiss ranger videos

Added some videos to the swiss ranger that use texture from image sequences. I had been working with calibrating the cameras relative to the scanner and felt I needed to show something about it.

Also trying to transfer this site over to a wordpress. Most of the scripts are ready to pull stuff out of my DB. Already spent far too long working on it, but it may not be done for a few days yet.

No Comments

Glaicer flow and more wigglers

Test of optic flow on glaciers

More wigglers (they aren’t the greatest):
jay ollie,
jay kickflip,
adam noseslide,

No Comments

Some blender models

I found some old models of humans computed from shape-from-silhouette that might be useful to someone. I put them up here for the time being “ models , but I will probably add them to the database as assets.

No Comments

Wiggles

The wiggler. And others A Sunday morning well spent. Inspiration: Mr. Unibrows.

No Comments

Segmentation tool

This is a project that I have been working on for quite some time now. Not too long ago I tried out an idea with a shape prior. I had wanted to post the details for some time, but finally there is at least something up. See the project page.

No Comments

Recent upgrade

I recently upgraded to a Phenom II X4. Didn’t want to upgrade OS (FC9), but as the new HW didn’t work directly with my previous installation, I really had no choice.

Upgrade was rather painless. Some problems with some of my packages due to upgrades to sip (e.g., __setitem__ no longer takes multiple arguments).

Only other problems were the typical Flash installation pain, sound not working out of the box (M4A78 Pro Mobo), and temperature sensors not working. The first two are solved (alsa-drivers package solved sound), but I still don’t have a solution for the sensors. I did, however, try out FC11 beta earlier, and the sensors seemed to work then. Tried recent version of lm_sensors with no luck either. Guess I’ll have to wait.

Most of the settings are complete, so I can, hopefully, resume to normal work.

No Comments

Passive walker

Added some details about what I played around with for half of this week (an implementation of a passive walker). There is a lot more to be said about it, but you will have to read Brubaker’s paper (or his thesis) to get the details.

I also added some animations that will be useful for the wxshow.

No Comments

wxshow

The last weekend I worked on a cross-platform utility for viewing the models of my research. Not quite done yet, but updates will appear on the new project page.

No Comments

Vids.

A new video
for you to enjoy.

No Comments

Gtk Swiss Ranger

I spent some time during the last week working (and playing) around with our new time of flight scanner. Posted some code and thoughts here .

No Comments

Sorry about that…

It appears that my site had been hacked somehow. Sorry if it installed some stupid malware on your computer. Maybe I’ll write a script to check and see if the problem happens again.

No Comments

Shape

Added a stroke mode to the shape generator.

See the project page.

No Comments

Sliles and bGlass

Our first iPhone app, Sliles, was accepted a while back and finally came online this week (seriously). The entire review process took longer than we expected. The first app, bGlass, was actually rejected (see the project). Yay! I almost like rejection better.

No Comments