Vincent Cheung

Vincent Cheung's Blog


Home Older Posts »

Friday, February 27, 2009

Shape Collage 2.1

Shape Collage 2.1 has been released!

There are a couple new features, some performance tweaks, and some bug fixes. The coolest new feature is the ability to add photos from the web. Just give it *any* webpage that has pictures on it and Shape Collage will automagically download the pictures from that webpage for use in the collage! This does not however, work for sites that require you to login, like Facebook, but that's what FaceDown is for.

Other new features include the ability to adjust the rotations of the photos and the drop shadow. The program settings are now saved between sessions so if you like the settings a certain way, you don't have to set them every time.

I promise that this blog is not becoming an advertisement for Shape Collage and VincentCheung.ca. I will be blogging about my vacation (eventually) :p

Thursday, December 04, 2008

Shape Collage



Some collages of Tiki made using Shape Collage


Shape Collage is the latest side project that I've been working on. It is an automatic photo collage making program that can make collages in different shapes. Just look at the collages above and at the end of the post to see what it can do. There are a lot more examples on the Shape Collage web page.

It's really easy to make a collage. You can make one with just 2 mouse clicks and in as little as a couple seconds! It's quite customizable as well, as you can change the shape to really, anything you want. You can even draw your own shape! You can also customize the border, background, etc.

Arranging photos into a collage


The photos are automatically placed in the desired shape of the collage using a machine learning algorithm that I came up with that is simple, but fast and effective. Basically what it does is put the photos on a page and jiggle them around so they are arranged nicely. This is a much harder problem than you may think. My readers with some knowledge of computer science will be familiar with NP problems. My algorithm isn't perfect, but it does a pretty good job most of the time. If you're really anal about it, you can save the collage as a Photoshop PSD and edit the collage in Photoshop if you don't like the automatic placement of the photos.

I started working on this project b/c I read a paper that automatically created a photo collage and thought that it was really cool, especially since it took me so long to make my Californian photo collage. Since they didn't actually release a program or their source code, I decided to just implement their approach, but it was overly complicated and rather slow - it took several minutes to create a collage with just 30 photos. So, I tried something simpler that was much faster - my program can easily create a collage with thousands of photos. Then I realized that my algorithm didn't have to only create rectangular collages and could also create collages in different shapes, something that I had never seen before, and so Shape Collage was created!

Anyways, check it out and let me know what you think! It's available for Windows, Mac OS X, Linux, and anything that supports Java.

Snowboarding snowman collage


Volleyball collage

Thursday, September 11, 2008

GPS + Photos = Awesome

I got my GPS logger today and I took it out on the water with me when I went kayaking on Lake Ontario.

Basically the GPS logger is a small GPS device with no screen and you can connect it to your phone through bluetooth to figure out where you are. That's the basic "GPS" part. The "logger" part records where you've been and you can then download the tracks onto your computer later and do some cool stuff with it.

I got the QStarz BT-Q100Platinum. It works like a charm, is small, and the battery apparently lasts up to 32 hours. I'm not able to get a signal in my apartment, but once I got onto the street, it worked pretty well, although it made some errors with the tall buildings in the way, but out on the water, it was pretty accurate.

My attempt at hand modeling. If it looks bad, it's b/c the photo is not rotated correctly and I'm too lazy to fix this after having already uploaded the photo



Here's the path that I recorded (I rollerbladed to the place, kayaked to Centre Island and back, then rollerbladed home). The path isn't 100% accurate and some of the tracking is off. My rollerblading is not as erratic as the GPS device made it out to be (I was going straight on the road, but it thought that I had veered off the road a couple times and it also thought I was somewhere west of my apartment when I was in the elevator). It seems to be pretty accurate on the open water, but got confused in the city with the tall buildings blocking the satellites.


View Larger Map


That's pretty cool. It gets even cooler when you synchronize your photos to the path to get the exact longitude and latitude where you took each photo (since GPS inherently has timestamps for each data point). Click on the camera to see the photos that I took in that spot. This is all automatic!


View Larger Map


The long/lat info is stored right in the image file and when you upload to Picasa Web Albums, all the location information is automatically shown there as well (check out the map view on the right hand side).



I am definitely going to be doing this on my trips from now on!

Saturday, August 09, 2008

How to record the Olympic games from CBC

This tutorial will show you how to record the Olympic games from an internet streaming source using VLC. Since I am in Canada, I'm recording from CBC Olympics, which streams the videos in Windows Media format, but this procedure should work for other non-flash, non-silverlight, streaming videos as well (i.e. not YouTube or NBC Olympics).

1. Load the video that you want, eg. from CBC Olympics

2. Right-click the video

3. Select "Properties" from the right-click menu



4. Copy the URL of the streaming video



Edit (Aug. 14): The CBC is smarter than I give them credit. You can't just get the URL as described above. What you have to do is look at the URL of the page, something like:
http://www.cbc.ca/olympics/livevideo/#n=cbcsports_ca_4&p=athletics&e=mens_100m_round_1&dt=2008/08/14_08:49%20PM&s=http://authmfile.akamai.com.edgesuite.net/akamai.stream.auth/35018/wm/cbcwm.gen/v001/reflector:13377.js

Then, load that in your web browser (Internet Explorer doesn't load this page for me, but Firefox does), and there is a single line, something like:
var streamPath = "http://authmfile.akamai.com.edgesuite.net/akamai.stream.auth/35018/wm/cbcwm.gen/token_MTIxODc2ODQwMw==_febc7bc84345875bacae79a34caf97c4//reflector:19191.asx";

The URL in between the quotation marks is the actual URL to the streaming video.


5. Open VLC and open a network stream



6. Select HTTP source

7. Paste in the URL

8. Select "Stream/Save" in the "Advanced Options"

9. Click "Settings..."



10. Select "Play locally" and "File"

11. Specify the save file, eg. "Women's Volleyball - USA vs Japan.wmv"

12. Select "ASF" under "Encapsulation Method" (because the video is in Windows Media format)



13. Click "OK" twice to close the windows for steps 6-9 and 10-12, then watch as it also records (you can also close the browser window from step 1)



14. When you want to stop recording, click stop or close VLC, then rename the save file to .wmv (VLC adds an extra '}' to the end of the filename by accident)



Saturday, January 26, 2008

"The trains are delayed"

There's a way to con the TTC somewhere to be found in the following story...

So, the other day, I found myself at Eaton Centre picking up some stuff. On the way home, I went to go take the subway. I figured it would be busy b/c it was rush hour (about 5:30). The platform was PACKED! It was probably 6 or 7 people deep, chest-to-chest, all along the entire length of the platform (the length of the subway train). I've never seen a subway that busy before. The TTC workers were saying that the trains were delayed and they didn't know when it was going to be fixed.

I wait maybe 2 or 3 min. I'm not sure how long these people have been waiting (insert joke involving memory-less exponentially distributed waiting times). People are leaving. Just as I decided that I was going to leave, a train comes. It's PACKED! Everyone inside is chest-to-chest as well. No one is able to get into the train b/c it's already so full. This is going North bound along Yonge at rush hour...

I know it's a lost cause at this point and decide to leave. I take a transfer, not bothering to ask for a refund. I figure that I'd try and take the streetcar. Usually you can't use a transfer at the same stop b/c then you could just take a transfer on your way out, run your errand, etc., and then go back into the subway or take the streetcar, or you could have 1 person go in and take a bunch of transfers from the automated machine and then go to the bus or streetcar stop and let others use these transfers and ride for free. But, the bus and streetcar drivers are pretty diligent at catching invalid transfers.

I wait for the streetcar and surprisingly, not many people are following my lead, probably b/c most are trying to head really far North. I go onto the streetcar and flash the transfer. I can see the driver looking at it and the thinking processes going on in her head and wondering how the hell my public transit path got me to the streetcar from the subway a couple feet away. I told her "the trains are delayed". She accepted this and let me on.

I had to then transfer to another streetcar at Spadina to head North and again the streetcar driver gave me a puzzled look while looking at my transfer. I again told the driver that "the trains are delayed" and I was let on.

There's little communication between the different transportation systems in the TTC, so I'm sure that this line can be used regardless of whether it's true or not.

So there you have it, a magical phrase that can be used to con the TTC.

Wednesday, December 05, 2007

Why I haven't been blogging

Hint: It starts with "L" and rhymes with "crazy"

I had a backlog of posts that I wanted to post and I didn't want to post new posts until I had posted these posts for fear that if I didn't post them, I'd never get around to posting them and they really needed to be posted, so due to my laziness and this posting mentality, all posting of posts was halted, and now to catch up, I'm posting a single post that summarizes all the posts that I wanted to post, and because of the diversity of topics in this post, I think there are more labels on this post than any other post that I've posted before. Post.

I have however, been keeping my delicious and picasaweb up to date, and those are always good if you want to check up on what I've been up to.

Here are the posts that you missed from the last 3 months or so:

iCat

  • iCat backwards is taci, but iKitty, or iKit, for short, backwards is Tiki!

  • I got her off of Craig's List and she's much cuter than your cat, dog, hamster, mouse, budgie, fish, snake, chinchilla, emu, baby, etc. :)






I've literally posted hundreds of photos of Tiki (737 as of this posting). I upload new pics as I download them from my camera (about weekly or bi-weekly).


Volleyball



Toronto Warriors 9-man Volleyball (San Francisco tournament pictures: here and here)


Coed Volleyball Intramurals


Men's Volleyball Intramurals


FaceDown


A program I made to download photos from facebook


Tribal Wars


I have a lot more free time since quitting this game


New TV show obsessions




(I didn't find this funny until I realized that Colbert was a fake character, at first, I just thought he was an idiot)




(I liked the video game)


Toilet Training.... my cat

Hint: it ends in a stand-off between a cat refusing to use the toilet and me fearing that she'll use my pillow as her new litter box




I've been tying garbage bags and shoelaces wrong this whole time

I recently discovered that knots are really cool (and useful!) I collected my findings on the most useful knots into a single illustrated document.


Real-life practical uses for the taut-line hitch, timber hitch, clove hitch, buntline hitch, sheet bend, and others


Happy 2nd (Real) Blogoversary!

I totally forgot about this (Oct. 14). Maybe I'll do a special post over the holidays about my blog, not that I've written too much here since the 3rd Blogoversary...
Home Older Posts »