charlescfenwick.com

April 19, 2008

Star Trek: Voyager Mosaics

Filed under: mosaic, python — Tags: , , , , , , , — chuck @ 5:55 am

Nothing new going algorithm wise here just used the closest color then segmented histograms and then the minimum distance methods to make these. They didn’t turn out as well as I hoped but I started with some crappy source images anyways I’m looking forward to trying more. But even more excited to get some Star Trek: The Next Generation mosaics going. You can never have enough Jean Luc Picard, the man with the most peculiar french accent in existence.


See them all in their Voyager goodness

April 6, 2008

LOST, the pictures.

Filed under: LOST, Programing, mosaic, python — chuck @ 6:40 pm

I gave it a shot and ended up with some ok results there is still a lot that can be done to improve things.

Using just the closest color ends up with ok results but when there are large areas of an almost solid color the results are less than desirable. These can be seen in the closestColor gallery.

To further extend things I created an algorithm that tries to insure that a given image doesn’t appear more than once in a given radius. This seems to work really except when two tile images are fairly close together. These can be seen in the Closest Color + Minimum Distance 16 gallery.

check them out in the links below

Jack Kate sayid
Jack Mosaics Kate Mosaics Sayid Mosaics

Back to making this thing better.

April 4, 2008

Making a Photo Mosaic: Finding the Right Tile, Closest Color

Filed under: Programing, mosaic, python — Tags: , , , , , — chuck @ 3:09 pm

How to find the right color

An RGB color can be thought of as a coordinate in a 3d Cartesian space. So to find the distance between two colors it is nothing more than find the distance between two coordinates in a 3d space.

(R1, G1, B1) and (r2, G2, B2)
SQRT((R1-R2)^2+(G1-G2)^2+(B1-B2)^2)
very easy now lets have MySQL do all the work and find the best match.
Imagine a table called images with columns r, g, and b where r, g, and b are the average colors of that particular image and below {R}, {G}, and {B} are the average RGB values of the source image rectangle we are comparing.

 
  SELECT SQRT((images.r-{R})*(images.r-{R})+(images.g-{G})*(images.g-{G})+(images.b-{B})*(images.b-{B})) as score, images.id as id, images.location as location FROM images ORDER BY score ASC LIMIT 150;

This will return a nice little list of the 150 closest matches by color. 150 were returned so at a later step in the mosaic creation process we can do a little more processing to the mosaic matching results.

March 31, 2008

Making a Photo Mosaic: Building the Image Library

Filed under: Programing, mosaic, python — Tags: , , , , , , — chuck @ 7:14 pm

Gratuitous amounts of Imagery

I need images and I mean lots of images. In my head I can only see having more images to make up the tiles the better. Of course every time I add an image it makes searching for the correct image a little slowewr, but ups the chance I may find a better match.
(more…)

March 27, 2008

Making a Photo Mosaic: Getting Started

Filed under: Programing, Uncategorized, mosaic, python — Tags: , , , , — chuck @ 9:12 pm

Why a Photo Mosaic?

Seems like there have been more and more photo mosaics popping up on digg lately. I figured I could make one, but one up the other people and actually write the program to make them instead of using some program I found online.
(more…)

March 26, 2008

Quick 404 page in cherrypy/turbogears

Filed under: cherrypy, python — Tags: , , , , , — chuck @ 3:37 pm

So you need to output quick 404 page for some reason? Well the worse thing you can do is make an error page then just send it out like normal because your server is still sending out status code of 200 which means everything was fine. Someone viewing the page would know it’s an error but another computer or bot would have no idea it encountered an error because it’s reading the status code. So simple solution send an status code 404 not found.

View CodePYTHON
 
 
  cherrypy.response.status="404"

that’s it then output as normal from there and you will have a nice little 404 page.

Powered by WordPress