Brad's Blog

web dev, django, running, food, or whatever

Published: 2008-05-02

A Go at California Rolls

Food Fun

Well, I've tried to make some California rolls. I think they turned out OK. Not the prettiest rolls, but they tasted good... maybe I shouldn't have eaten them all, though!These were made with the following ingredients: 1 cup of rice. (most recipes call for short grain rice, but I used long grain rice)1Tbsp of Rice vinegardash of saltNoriCarrotsCucumberImitation crab meat (or real crab meat if you have it)1 AvacadoBoil 1 and 3/4 cups of ...


Published: 2008-04-13

Review: Beginning Game Development with Python and Pygame

It's been out for a while now, and I'd always meant to write a review for this book... I pre-ordered it, and I've had it for awhile, but I haven't worked through the whole thing (though I've hit most of the latter chapters). Actually, this is not really a review, per se... just my succinct list of pros and cons.So, without further ado:Pros:Very easy to read.Great examples that actually workChapters 1 ...


Published: 2008-03-04

Google blocking automated searches?

This morning I was writing a little python, and I used Firefox's Google toolbar to search for isalnum. The strange thing about this, though, is that Google didn't do the search! Instead they gave me a message saying:We're sorry...but your query looks similar to automated requests from a computer virus or spyware application. To protect our users, we can't process your request right now.Luckily I could type in a captcha and continue the ...


Published: 2008-02-15

Shrinking Images with Python

Python

My wife had a very large image, and she needed some smaller versions of it. Well, I thought I'd just fire up The GIMP and create a few shrunken versions, but by the time The GIMP loaded on my G4 Mac mini, I'd almost finished writing the python coded needed to do the task for me!Writing code is good!import Imagefrom sys import argvdef shrink(filename): im = Image.open(filename) w,h = im.size # Create images that ...


Published: 2008-01-24

Tracking a Laser pointer with Python and OpenCV

opencv python

A recent thread on the OpenCV mailing list (entitled: "Tracking laser dots") discussed techniques that could be used to track the dot from a laser pointer. This sounded like something fun, so I finally got around to trying it out. Essentially this could be done acheived by the following algorithm: Grab the video frame. Convert the video frame to the HSV color space. Split the frame into individual components (separate images for H, S, and V). Apply a threshold to ...


Published: 2008-01-14

Super Spicy Creamy Veggie Chili

Food Fun

I like food. I like to eat it... I like to make it. A few days ago I got a craving for some chili, and I almost had all of the ingredients that I needed. What I didn't have, was meat. So, I decided to improvise, and what resulted was the recipe below. It's sure to give all the gastric goodness of any other spicy bowl of chili!Ingredients:1 can black beans.1 can dark red kidney ...


Published: 2007-12-05

Computing Correlation Coefficients in Python

Image Python numpy pil

A useful technique for matching objects in images is to compute the images' Correlation Coefficients. Essentially, you take any image and compute the correlation between it and another, smaller image containing ONLY the object that you want to identify. The resulting correlation image should contain bright spots where there is a high correlation (or match) between the two images. Here's a simple python script to compute the correlation between two images: https://github.com/bradmontgomery/correlation It requires PIL ...


Published: 2007-10-31

Announcing pgSlideShow

Apps Python pygame

I've just released a simple little application called pgSlideShow. It's a free image slideshow application written in Python using pygame. It recursively searches a given directory for image files, and then displays them on a computer screen in Fullscreen mode. You can get it here: http://bradmontgomery.net/pgSlideShow/https://github.com/bradmontgomery/pgSlideShow


Published: 2007-10-16

On the Move...

Well, I've just created my account here at blogger.com, and I'll have to try it out for a while before I decide whether or not I'm happy. I've been using my own system for a while, and normally, I'm happy with a simple, stream-lined app, but I've begun wanting new features that I just don't have time to build for myself...So, I'm here. We'll see how it works.


Published: 2007-10-16

PyOpenGL on OS X

OS OpenGL Python X

Update: July 7, 2010: For the past year or so I've been using virtualenv, virtualenvwrapper, and pip to manage and install python packages, and I highly encourage everyone to use these tools! It may take a bit to learn how to use these tools, but once you do, the rewards are great! (especially when using 3rd party python libraries on Mac OS X).To install PyOpenGL using the aforementioned tools, you'd simply do the following.Create a virtual ...