Showing posts with label mosaic project. Show all posts
Showing posts with label mosaic project. Show all posts

Saturday, March 17, 2007

4r3 u l337 enuf 2 r34d th15?

For those geeks and wanna-be-geeks in the croud, here is yet another "Geekness Test". This one is pretty long and intense. Personally, it says I am 22.5% geek. Prior to taking the test I would have guessed it was higher, but I guess the fact that I never crossed the D&D/Band/Renaissance Fair line and married a non geek means I get to be somewhat "normal" ;)

Not sure if this fact would have changed anything, but I spent the bulk of today reading about how to implement web services with J2EE technolgies and working on writing my own streaming PNG encoder in Java. Crazy that that is at only 22.5%!

----------------

On a good note, I finally got the PNG filtering working! On a bad note I found out the problem was an absent minded mistake of mine (NOTE TO SELF: subtracting the previous filtered value from the current one is NOT the same as previous input value). Its pretty amazing what filtering can do to improving the compression ratio of the DEFLATE algorithm. I will post some stats later when I have the rest of the filters finished and have written a driver for the encoder.

Tuesday, March 13, 2007

PNG Problems, Celebration Dinner, and an award!?

[start tech stuff]
To follow up from yesterday's venting post about Java, here is a bit more info for those of you who might be interested. I have been working on a PNG encoder in my recent spare time that allows for the creation of PNG images, written out to a specified file, in a streaming manor. i.e. you create the streaming encoder object, tell it about the image you want it to produce (height, width, encoding type, compression hints, etc) and then you call the encode method while passing it an inputstream. The encoder then reads data from this inputstream and builds your PNG for you, buffering out data to the file as it goes.

There are two reasons for me wanting this. A) I didn't want to overhead of having to build and encode very large images (6k x 6k pixels or more) in memory while storing the source image as well and B) its always fun to write code that has a direct and colorful result. :)

This past weekend I wrote the bulk of the encoder minus 1 important step in the PNG encoding process ... filtering. The whole time I ran into the issue that the default representation of data in Java (and most languages) is a primitive int object, which takes up 4 bytes and is a signed number. Well, when encoding PNG's and working with low level image data, few things use 4 bytes at a time. Sometimes things are encoded into 2 bytes. Sometimes less than 1, but almost always your working with single bytes at a time. This isn't that big of a problem on the surface .. just throw your data into byte objects and move on .... but there are two problems. 1) if a piece of data takes up more than one byte, you have to encode it in network form, which isn't always how it is stored internally and 2) java bytes are signed also even though the data I am representing isn't ... and the conversion of byte data, into byte objects, into ints for math operations, back into byte objects, and to a file as byte data ends screwing up the data from time to time.

I believe I have either fixed the problem in my code through some creative use of bit masking, etc and/or have narrowed down the problem area to a couple lines of code. Hopefully, this week I will be able to fix that and have filtering work properly. I have also run into the problem that the PNG spec isn't 100% on how the filters should be applied when reffering to previous bites, so I will have to still test that.

I am happy to report that the code currently CAN produce PNGs, just as it should, if you turn filtering off. They can be read in every image editor/loader I have tested them on, and that is a very uplifting note. The only problems is that without filtering, the compression algorithms is a fair bit less effective (a test image of all colors can be filtered and compressed as a PNG of around 50K .... my unfiltered and compressed image is about 400K+. Not perfect, but a good start).
[end tech stuff]

Last night, the two product consultants on our team at work were kind enough to take the whole team out to dinner at a local Indian restaurant in celebration of the work we got done in our last sprint and for how well the demo with the business owners went. It was really very kind of them. Despite a few reservations some of the team had for trying the new food, I think everyone enjoyed themselves and I had a great lamb dish with a mango lassi so I was all set :).

The only downside to this, and the numerous meetings I am getting invites for for the next few weeks from my new company ... is the time away from Emily. You wouldn't think that you could miss someone who you live with, but the days just aren't the same when you both are busy and you don't get to spend some real quality time with them. Hopefully, after Em comes back from STL next week (she is going back for a few days for work stuff and her dad's bday), and the meetings slow down after the two companies are integrated things will get back to normal.

-----------

When I got in today, there was a message waiting for me from a friend of mine who is a Sark consultant out at GE asking for me to give him a call. When I finally reached him a bit ago, he let me know that evidently I had been given an award. An award from back in November time frame. An award from a team at GE (my old client). An award for my contributions on a project that wasn't my primary project from people I am not 100% I ever met. Very strange and surprising to say the least. Evidently someone really like the limited work I did, so I have a plaque waiting for me. I will have to get some frames and hang it up along with my certification awards and my little SCJP and SCWCD pins at home ;)

Monday, March 12, 2007

Argh! Signed Bytes can kiss my butt!

I am not one for flaming about what programming language, IDE, etc is best or worst or whatever. I say, if build it, and it works to spec, then who cares.

That being said ... the fact that there isn't any easy way to work with unsigned byte data in Java (BC every fricken primitive type is signed) is really starting to piss me off!

Saturday, March 10, 2007

Small Update

  • new root beer - the other weekend I got a 6 pack of a new root beer: Henry Weinhard's Root Beer. Overall I have to say it was very good, but not as good as the last. This one had less of a bite and was a bit smoother. It also had a distinct vanilla flavor which was good (making it a kind of cross between cream soda and root beer). I have to thank Em's mom for suggesting it (she had had some back in Colorado?).
  • streaming png work (almost there) - I have the bulk of the work done on my streaming PNG encoder side project. Em babysat last night so I had some time to work on it. I have made some good progress and the parts I have left I think I already know how to do.
  • great weather - Friday it was almost 70 degrees here in Cinci!!!! Unfortunately I was in the office all day, but it still made the walk back to the car and the drive home very nice. Today Em and I spent some time at the park walking around which was great. I am SO READY for spring!
  • bean salad - my grandma makes a great bean salad and over the last couple weeks I have made it twice. A can of mixed beans plus just under a 1/4 cp. oil, vineger, a splash of apple cider vinegar, and a 2 or 3 table spoons sugar. Mix to coat and let sit for an hour or two. SO yummy!
  • corned beef and cabbage - tonight for dinner we(Em) made corned beef and cabage. Mmmm Mmmm Gooood. So simple, just time consuming. Em also made some Irish Soda bread which was the perfect complement.
  • broomball game - lost again, but no major aches or pains and we played well.
  • new pics - here are some new pics I have taken recently:


Wednesday, March 7, 2007

Everything Update For Josh

  • Parallels - I installed Parallels the other day on my iMac and I have to say, its a really impressive product. Very fast, clean interface, works great. I have XP running in it for Quicken and eventually .NET development, and its working great. The image files aren't too big either. My only complaint so far is that there isn't an easy way via the interface to create a snapshot of a virtual machine (ie a copy of its current state for backup purposes). I eventually made one by hand by copying the image files but a nice interface would have been nice. My only other glitch, and this is very minor, is that with dual monitors, the transition effects when switching between OSs blinks a bit and isn't smooth. All well ;). Oh, and once you install the Parallels tools in XP, you can move your mouse straight into it and out without clicking or anything and it will send the signals correctly. That plus clipboard integration is pretty nice.
  • Quicken - I installed this as I said above. Works well, I am still trying to get all my accounts setup correctly but I am happy. It did crash the first time I ran it (being the first program installed in XP, i had to laugh) but it has worked fine since.
  • SuperDuper - My final installation of the past weekend, this backup software is working out well. I broke down and paid for the "full" version since I really liked it and it unlocked the "smart updates" for your backup partition and in-app scheduling. Now I have it setup to make a smart backup once a week thats fully bootable. A nice bit of insurance.
  • Game Night - wed night was a Sark Game Night, we played Call of Duty at the Sark office. Fun times. I am pretty sure I was #1 (or 2) in every game so that was cool. With this, plus last week's Sark stuff and some large meetings this week I have gotten several lunches and dinners paid for recently. :-D
  • Moms weekend - this past weekend my mom and Em's mom made their way into town to visit. Other than some freak snow showers and a whirlwinds weekend, I think everyone had a great time. Some of the highlights were showing the moms JungleJims (they were both pretty much awe struck by the time they made it to the bakery, which is less than half the store), a good but not quite what we expected dinner at the Glendale Pub, some good relaxing and talking, and a great breakfast at the Original Pancake House. I had some GREAT sourdough pancakes BTW.
  • Em Test - Em took the Praxis this past weekend and thinks she did well. Not much left besides graduation!
  • Taxes - This weekend I gotta finish up our taxes. While I wouldn't suggest it just for the tax break, spending a ton of money on tuition results in a nice tax credit. Lots of debt, but a nice tax credit.
  • Broomball double header - Last two weeks we have had broomball double headers. First time we won both games, second time we lost both. 2/4 ain't too bad! :) Another game at 4 this week. Wish me luck.
  • work - work has been kinda crazy this week. Without going into too much detail, we ended our previous "Sprint" last week and had a large demo of our current progress on Monday that went very well. On Tuesday I had meetings pretty much all day to discuss the things that went well/wrong in the last sprint, figure out what we want to do this sprint and plan for those things. The rest of the week had me working to understand my new integration point (integrating the billing system with the system that stores policy information, which happened to be installed before I was born ;) ) and hashing out the basic design of my parts in conjunction with a coworker. This is looking to be a work filled sprint, but at the end we will have the majority of the system in place which is exciting. Also, we are working to get end-t0-end testing in place for our integration points which may mean I will be able to actually call up the a voice response system and test my code from last sprint which would be cool.
  • sark conf call - The Sark/Sogeti buyout officially happened on March 1st, so technically I now work for Sogeti US. I have been getting bits and pieces of information and details as they become available but still don't have a complete picture of what this will mean for the future. If I hear anything crazy I will post, don't worry :) We had a national conf. call on wed that was a lot of biz jargon and fluff, but at least gave us some names and the idea that things were moving forward. I should be getting benefit and policy info in the mail sometime this week....hopefully.
  • go carts, happy hour - last week we had our yearly Sark monthly meeting at the indoor competition racing place. 30+ MPH go-karts == fun even if my side hurt all the next two days from one bad turn into a wall. I did great, except for 4 penalties. But one wasn't my fault I swear! I though I had gotten one so I went into the pit area behind another guy, but when the guy saw me he just looked at me strange and told me to go ahead. Then on my next lap a diff official-guy gave me a penalty for going in the pit without a reason! You believe that crap!? ;)
  • seega - this project has stalled after its initial momentum, but I am hoping to work on it some this weekend. I have been just too buzy at work. plus...
  • photessera - I have been working some on this project. I came up with what I think is a more efficient design to keep the memory footprint down, but its hinges on my ability to find/make a PNG encoder that can create a file via streaming input (so that the entire original image need not be in memory). I have been reading the PNG spec and about the DEFLATE algorithm but fear that I will need 2 passes over the data to create the file. I MAY be able to get away with a single pass but I will have to do some creative sampling prior or concede that the compression won't be at its best. I am really considering throwing something together this weekend so that I can run some tests on the tradeoffs of time/memory footprint/number and amount of HD read & writes/complexity/resulting compression. Its actually a very interesting problem.
  • root beer - I got a new kind of root beer from JJs when we went last weekend. I will post a review whenever I get a chance to upload the pics
  • SCDJWS - my studying has been stalled with the above, but its moving along. Actually I have having to pick up a number of the secondary technologies in my current project which should be helpful.
  • Pics - I took some decent pics the other day, but haven't put them on the web yet. When I do there will be a post.
  • Noah's Arc in our backyard - the other morning I was getting ready and was looking out the window at our porch at the various birds which were enjoying the fresh birdseed I had put out. Your normal bunch of misc small birds flying around. Then I saw our resident squirrel come by, but with a friend, and got to watch him try his best to reach the location of our bird feeder (he eventually did get it, he is quite the acrobat). To go along with the pair of squirrels, we currently have a pair of Red Bellied Woodpeckers, Cardinals, and Blue Jays flying around. I actually got to see all 4 pairs in a half hour time span the other day. It was pretty cool.

Monday, February 19, 2007

Coding...

I finally pushed some initial code for Photessera up. Just some interfaces but at least its a start. I want to try a more TDD approach when writing it, so things may progress slowly. Also I am still trying to decide how much modularity I want to give it (e.g. I know I will want to test various decision and image building algorithms but I am not sure if they will just be during testing or if they will be options in the final app.) Hopefully I will decide on something soon.

...

I also pushed a rather large update (given the size of the project) today for Mag-Games. I had done a fair bit and had the latest code at work as of Friday but our network went flaky about quiting time, so evidently the commit didn't go through. But its there now. I had some trouble with deleting files and re-adding them (was using eclipse tool to generate file which was easier than modifying it by hand). I will chalk it up to inexperience with Subversion and/or Subclipse but I couldn't find a way to delete it, recreate it and have it keep the info. All well. Its still there now and didn't contain anything really worth while previously.

If I get a chance to write up the base/utility class unit tests ... I can move the project several point releases forward. Yeah its not TDD but at least I am trying.

...

Also, for anyone who might read this and not MFC, I posted an open question here which I would love suggestions for.

Friday, February 16, 2007

Mag-Games ... Making Progress

This may come as a surprise to some of you, but I have been making steady progress on my Mag-Games project since announcing it to the world. If you check out the Google code page you can see that a few things have been added to the wiki (much more to come when I have time), I have been playing around with the issue tracking which isn't quite up to date anymore, and I have been writing a fair amount of code (you can check it out via a Subversion client or view it online).

Release 1.0 (Working game engine with a fully working Seega game w/ AI) should easily be made by the end of the month in keeping with my intended 1-a-month plan. So far I have been working mainly on the game engine and laying the framework for the future games. Yesterday and today I really started working on the Seega game rules and Alex has started working on the visual interface code. The main things left are the Seega interface, a small amount of game logic, and the game loader along with writing some better tests for each portion.

I am planning on uploading a cross-platform full download with instruction, basic help, and documentation when release 1.0 is ready. If you do try and checkout the code, know that its written in Java 1.5 with most of the files needed to slide it right into Eclipse (I recommend the Subclipse plug-in if your going that route). However, I am also trying to keep a complete Ant build file up to date for anyone not wanting to use Eclipse. All of the dependencies other than the JDK 1.5 libraries should be found in the repository. As of today, there isn't much you can run ... but you can get a feel for how its structured and try and find problems with my code ;)

All in all I am really happy with how it is going. Its nice to have one of my pet projects actually getting somewhere. I encourage any and all of you who are computer-inclined to check out what I have done so far and let me know what you think. If you find some crap code, bad design, great design, or have any suggestions or question please send them my way. I would love to discuss the app's design and implementation with you. Since the overall program is decently simple with a fair bit of abstraction built in, I hope to be able to easily add on and change out parts as I have time to refine them or give them new features.

On a similar note, I haven't had time to put up and re-organize the code for my Photo Mosaic (Photessera) software, but I swear I will soon.

Thursday, February 8, 2007

Update w/o Sark news

[I meant to post this yesterday before leaving work, but got tied up]
I was planning on having my next post be about the Sark/Sogeti news, but I haven't gotten much concrete information yet and there are a few other things I wanted to post ... so here they are:

Darts starts back up tonight with a match at 7:30. I am psyched b/c the matches are always a lot of fun and I will get a chance to see some Sark's I don't normally see. Plus with today's news, there will be plenty to talk about. Only downside is that Em has class tonight so she won't be getting back home until when I have to leave. Good thing she loves me :) [EDIT: we won!!! 11-4. Granted it took forever and was WAY WAY smoky, but we WON!]

This weekend is a Sark outing to go Tubing at PerfectNorth which should be a lot of fun .... and our second broomball game of the season. We "lost" our last game but only b/c of a sexist rule (girl goals count as 2 points). We scored and they scored once, so I say we tied. Goal for this week, is to score more points than the other team so there is no confusion.

Tuesday we got a "big" snow storm across the tri-state area. Pretty much shutdown things for the night. GAIC was kind enough to close their downtown businesses so that people could go home early (granted that just meant sitting in traffic earlier in the day, but it was a sound idea). So I got to leave around 2pm and got to sit in traffic for the next 1.5+ hours. All well, a few guys I work with had 2+ hour commutes home and lived much closer than me. It was the first time I had the "new" Sonata in the snow and it handled well. No sliding but it took it a second or 2 to catch when starting from a standstill. I can't complain. [Edit: I heard up-state NY got over 5' of snow over the past couple days ... makes our 6 inches seem pretty lame ;) ]

I have started two Google Code Projects, mag-games and photessera, to allow others to see my code and hopefully get some good input on the projects. I am currently in the process of putting up the code I have so far, organizing what I have, and getting some project info up in the wiki. If anyone has any suggestions, comments, ideas, or wants to help out ... please let me know. :) I will post small updates as I get things uploaded or I make some progress on the projects, but you can check their pages for more up-to-date info.

Wednesday, January 31, 2007

Updates-a-plenty

- Work -

Today we had our "Sprint" #3 kickoff meeting for most of the day. GAIC is using the Scrum as its agile project management methodology. Basically, in order to enable the project team to adapt to changing requirements the project is divided into many "sprints". Prior to each sprint set tasks are picked to be completed in that sprint, and their efforts estimated. During the sprint a "scrum" meeting is held each day where everyone gives a 2 minute description of what they did, what they are doing, and what impediments they have.

From the few meetings we have already had, it seems like a good plan in theory .... we will have to wait and see how well it works out, but I have heard good things. It is definitely a better plan than a monolithic waterfall model, but it really depends on the PM and how well the team can follow the guidelines. Only time will tell. ;)

This new sprint I have been tasked with writing up a new set of web services that will expose the billing system's account information and policy information to users who request it via the IVR system (Interactive Voice Response). I am psyched that I will be getting to do some real development and development with new things. I have no idea if my estimates for the work will be anywhere near correct, but we will see.

- Life -

The other night I made some really good risotto. I sauteed some chicken with peppers and then made up some risotto with various herbs, chicken broth, white wine, onions and garlic. At the end I added a stick of goat cheese, some parmesan, and the chicken and peppers. It was very yummy.

Not a whole lot has been going on other than work, working out (which I am glad to say I have been doing a decent amount of)
, sleeping, and trying to help Em study. Em found a flier at the rec. center saying they were going to have dodgeball leagues in April. I let our "activity committee" know and we may be doing that instead of indoor soccer for the spring. :-D

Yesterday I found this link (can't remember from where). Its from the Instructables.com website which I read every once in a while. It has some great tutorials on it for really out-there projects. I would love to make a set of invisible book shelves for our apt even if I have no idea where to put them. Maybe some day when we have our own house. Either way they are pretty cool.


- Tech -

Unfortunately I haven't had time or the chance to work on my mosaic project in the past few weeks. I spent some time this past weekend researching various methods of working with very large image files, but haven't gotten any more code hammered out really. This is also due to the fact that the latest code I wrote is sitting on the HD of a machine in Sark's office which I don't have daily access to. Hopefully I will be able to stop by on my way home tomorrow so I can start it back up. I want to rework some of the design and get the code into a new Subversion server on my new Mac so that I can track my changes and various attempts better. Also, if I can come across a free license for Jira I would really like to setup some project stuff and bug tracking for it so that I can keep track of what I am doing between coding sessions. If I can't get a copy of Jira, I may setup Trac or something like it (although I don't really want to have to setup new programming environments just to run the bug/project tracking software).

Last night I finally got around to using SuperDuper to backup my iMac to my external HD. So far I have to say I am fairly impressed. The interface is clean, simple, and straightforward. The initial backup (which is a full 1:1 backup took under 2 hours ... subsequent backups will be "smart" and just do the files and data that has changed). I am still on the fence if I will buy the "pro" version. It gives you some extra features, scheduling, etc. Things I want but I can probably do some other way.

On a somewhat interesting note, yesterday afternoon I was talking to a coworking about if there was a way to sync google calendar with iCal. From what I have found online it looks like you can only do read-only sync's each way assuming you publish your iCal to some WebDav server. However, yesterday we found a program some people are working on called SpanningSync. It allows you to sync both systems read/write and it will sync changes almost immediatly. Only problem was that it is currently in private beta .... well it was when we found it around 4pm. As of 6pm they opened it up for a public beta test ... and took it back down around 10 b/c their servers were maxed out. I didn't find out until this morning. I guess the early bird does catch the worm. After looking into it more and reading that it is probably either subscription based or a lifetime fee to use the end product ... and that it may use an intermediate server to sync the data ... I probably won't use it when its done. But the product is really cool none the less.

Wednesday, January 24, 2007

Virtual-Real-Reality?

I just a movie (via digg, so many of you may have already seen it or will) of some guys who setup a camera, and round mirror in a room and had a computer track their movement via their colored caps so that they could play real-life Bomberman the game. :-)

Now, if only we had thought of stuff like that in college.

I didn't have audio so I am not sure if there is commentary, but the video showed enough to make me jealous. Its kind of like the Wii, but on a larger scale. Its like the uber-Wii (insert appropriate jokes here). The video, and the text below it, says that they must have some sort of remotes for the dropping of bombs, but it is still quite cool. And I agree, it would be a great workout.

Along with my project ideas for making a program that could watch an NES emulators and learn to play the games, some ideas for projects involving steganography (which my HS nemesis is working on :) ), and my current photo mosaic project ... I have always thought it would be cool to develop algorithms for computer imaging and sight. I am sure there is tons of work already done in the area, but it always seemed interesting to me. I may do it yet, since it combines my hobbies of computers, algorithms and photography. Who knows.

If nothing else, I have been curious about trying to find some interesting mirrors, lenses that I could mount my camera to and take pictures through that aren't your normal lenses (I have seen projects for connecting peep-whole door lenses to camera which produced some cool fish eye pictures). I may need to make a trip to the hardware store some time soon and see what a couple bucks could get me.

Thursday, January 11, 2007

More Mosaic Comparisons

<~~ The original













<~~ Mosaic created by the simple algorithm

(This one's choice of dark colors seems much better and has more "detail" which comes across
looking like noise)









<~~ Mosaic created with 3x3 partitions


(This one chose some strange tiles for the darker stuff ... a tile that was mostly black with a yellowish dot in the middle ... but has better color smoothing .. the feathers are a ton cleaner)

Shipped! Kinda ...

I found two shipment notices waiting for me in my inbox this morning from Apple :)
Unfortunately, they were for my printer and my mini-dvi-to-dvi connector :(

But at least its a start.

No updates really ... beyond the fact that I am waiting for the Mac to arrive, and still working on the Mosaic program (Jeff, I will send you the source or find a way to post it soon .... I need to work out a few bugs and clean it up a bit. You can't hold it against me if the code isn't up to Google's standards ;) ... however, I can happily say I coded all of it short of the image read/write APIs. Those are from standard Java api's.)

One interesting thing to note, I worked out a more advanced matchEngine which parses each tile into an set number of "sectors" which it compares individual to the seed tile (instead of comparing the whole tile's avg color, this checks multiple regions of the tiles). I thought this would give me very similar results, but could aid in color boundries being more "correct". An example of the problem I was hoping to avoid would be two library images, one red on the top half, and blue on the bottom ... and the other with the colors reversed. Both would have the same overall avg color (some purple) but if the tile we were matching had more red on top ... one would make a much better choice. My "simple" match engine couldn't distinguish the two. My second one can .... but as it turns out, that obvious case doesn't come up that often unless you have a huge library to pick from. In reality, the mosaics it is producing seem to have a little better color consistency, but it really depends on the image and the library. Most are actually ending up worse in various ways. So, its back to the drawing board on that one.







<~~~ Original


Simple Match ~~>










<~~ 2x2 Partitioned


4x4 Partitioned ~~>










In this case the simple match looks the best in my opinion. With the 4x4 we end up getting some color detail that was lacking in the previous ones, but we lose a ton of clearity. I still haven't fully figured out what is going on.

Tuesday, January 9, 2007

Mosaic Project Progress

Between last friday and today I have made a fair amount of progress on my mosaic project. The basic modules are all implemented and I have done a fair bit of refinment already. As I suspected, efficiency (in calculations and in the program's memory foot print) is the big determining factor in how good of a mosaic it can produce.

Original "seed" image of a car ~~~>

If you check out my web photo album, I have added a new public folder with some mosaics I have made after a fair bit of tweaking and modifications. The album contains scaled down versions of the original images (the seed images), scaled down versions of the mosaics the program produced, and some zoomed in cropped images so that the individual tiles can be seen.

<~~ Mosaic of the above image, click to see larger version

Currently, the program has a library of aprox 250 images of varying color, size, and origin (some are mine, some are stolen from stock photo sites on the internet. larger librarys help a ton!). The mosaics you can see in the album have a set number of tiles in the direction of the seed image's longer side (125 currently) and a proportional number in the other direction to keep the photo's original aspect ratio. Each tile produced in the end image is 50x50 pixels which means the final mosaics are 6250x___ pixels large. Yeah thats pretty big. The app currently saves the images into PNG format which has decent compression but I haven't tweaked the default settings, so currently some of the mosaic files are quite large (ranging from 4MB - 30MB). PNG format was chosen b/c its a loss-less compression and I didn't want to lose any information b/c of JPEG compression (such as can been seen in the ones I uploaded. Along with losing resolution in the resize, since Picasa requires JPEGs, they also lost some clarity there). Suprisingly, each mosaic is produced in under a minute depending on the number of unique library images used and the final size.

^^ Sample zoomed in image of tiles (taken from Mona-Lisa mosaic, pixels 1000,1000 - 1300,1300) ^^

C along with 2 main objects: an urrently, I have 4 modules: library, planBuilder, matchEngine, and mosaicBuilderImage, and a Plan. The current modules were all designed to be as simple as possible and yet functional. The matchEngine and mosaicBuilder modules have had some tweeking so that I could use 125x__ tiles without crashing the Java jeap ;). The matchEngine is currently just finding the avg color of the entire image and then doing a simple diff. against the tile its checking to see which library image is the "best". While this is working OK, I have several ideas for better matchers which could be a bit more efficient and take into account better algorithms for matching edges and colored regions. Trying to implement those algorithms is next on my list along with rewriting the mosaicBuilder to better use the file buffers and JAI tiles. If I can get those to work the work should be much faster, produce better matches, and be able to build the resulting mosaic without requiring the whole thing to be in memory at once (the big Java heap problem ... an uncompressed 6000x6000 pixel image is fairly large in memory as a BufferedImage :) ).

Thats it for now. I will post another update and some more photos when I have implemented some of those algorithms, or rewritten the mosaicBuilder. If I could at least reduce the memory footprint, I could increase the tile resolution which would help the mosaics, but not as much as better library choices. (Although all of this should run great even if inefficient on the new Mac ;) )

** one other thing I need to do is get some prints made to determine how small an image can be printed (and in what resolution/dpi/ppi) so that it can be recognized as being a photo, but as small as possible so as to fit in the mosaic better. Maybe this week I will throw together some sample images and have them printed out at Kroger. 30 cents isn't bad for a print test. :)


These two images (different sizes, and which look pretty crappy scaled down) demonstrate how photos with distinct colors and clear areas are much easier to reproduce and still have the image come across. But, all things said, I think Mona looks pretty good so far ;)

Friday, January 5, 2007

Pre-weekend update

I don't have any big plans for this weekend other than working on my computer, working out, and relaxing ... :-D ... just how I wanted it. Tonight is a Steak-n-shake night, yay coupons in the mail, and maybe watching IceAge which I got from my parents for Christmas.

So far, this week on the "beach" has been pretty uneventful. Most of my time has been spent surfing the internet, wishing people would update their blogs more often ;) and researching/working on my Mosaic project. Actually, I have put together almost an entire simplified version of what it will be and things are looking up. I have one more class to write (arguably the hardest for this version 0.1) but then I will be finished with a "working" skeleton which I am proud of. I implemented very "simple" versions of each of my components (tile-match-er, plan-builder, library, and mosaic-builder) which implement all of my desired functions but in very basic ways (the tile-match-er always chooses the first image from the library to match your tile to ... hey it works, quit laughing :) ). Next up will be advancing each module to be better and closer to the final product.

I have found several areas where I think performance will be an issue and I haven't yet come up with any good solutions. The project is definitely duable, I just need to figure out how long each of these operations will take and what clever ways I can balance runtime size and execution speed to have it do what I want it to do. Should be interesting. I will probably post again when I come to each one and talk about the problem and my ideas for solutions. Hopefully I can get some good comments.

Other than that, not a whole lot is going on. Just trying to stay busy waiting for the 15th so that I can start out at GreatAmerican and waiting for the Jan. 9th for MacWorld and ordering my new computer. I have been trying very hard not to post about it until I at least have it ordered, but I may break down before then. The fact that Josh got his new MBP last night isn't helping any at all either ;).

I got a cool photo of some new candles Em got for Chistmas last night and will probably post one of them for today's photo after I get home. Maybe I will walk around the apt. complext when I get home and see if I can get any interesting ones before Emily gets home from work. Best part of being on the beach? Getting to leave around 2 on Fridays :).

Thursday, January 4, 2007

IrfanView and EyeBatch

Between trying to find a good way to backup the photos on my computer, editing/croping them to be displayed on the web, and researching my Mosaic project ... I have found a huge need for batch photo editing software. It is invaluable when trying to rename, resize, and backup a few thousands photos to my external hard drive.

My current favorite has got to be EyeBatch. Only problem ... its not free, and the $40 price tag seems a bit high for utility software that I don't "need". But, they do have a 30 day trial which I believe is fully functional, and after that there are other options ;) [caugh] astalavista [caugh]. It is a pretty nice little utility.

The first screen you are presented with allows you to navigate your hard drive and add photos to its working list (individually, by folder, or by folders with sub folders). Once you have the list of file you want to work with, the second screen allows you to screate a script of actions you want to take on each of the files. EyeBatch has a ton of different actions that can be done ranging from the obvious (save file as, resize, crop, etc) to some pretty interesting ones (add masks, change colors, add semi-transparent watermarks, crop borders automatically, etc). Each options usually allows for a fair amount of customization (you can rename files, select where they will be saved to, add pre/suffixes, number, modify formats, etc) which allows you to do pretty much anything.

The interface is decently intuitive for such a utility (add actions from action list to script list, double click on each to set parameters) and when you are satisfied you just hit [process] and away it goes. The program can slow a lesser machine down a bit when its chugging along through a large list of decently sized files, but thats to be expected (and process priority can be changed). Overall I have been extremely happy with it. A couple nice features were its ability to preserve EXIF data and intelligently copy JPEGs so that they wouldn't be re-encoded resulting in loss of data and/or artifacts.


Just today I stumbled across IrfanView again and am currently playing around with it. It is primarially a image/audio/movie viewer and player. It has a thumbnail view and can quickly bop around through your media. It has what looks to be a decent amount of batch edit functionality but I haven't ran it against a large image list to compare efficiency yet. The interface isn't as intuitive as EyeBatch, it appears to have been designed by the programmer, not a "designer", but is fully functional. On the plus side, IrfanView is free to begin with, supports the viewing(and for most writing) of a huge number of formates, and has some ability to design add-on plugins?


They both share one problem, however. They are only written for windows. So when I get the Mac I will need to find a substitute. Right now I am thinking about the Mosaic project and trying to figure out how much a decent sized poster print will cost to have printed, what kind of aspect rations we are talking about, and what kind of resolution I will need to A) have the print come out clean and crisp and B) how big and at what resolution can I print the "photo-pixels" so that they are small enough to have the overall image be recognizable, but still recognizable themselves. I think I am going to have print off some samples to try and get a feel for how big an image can be and still be recognizable and at what PPI I can get them to print it and have it matter. According to one site's table and my own rough calculations the end photograph may need to be a 20+ megapixel image to print as big as I want it with decent PPI.

hrmmm. thats pretty big ;)

Wednesday, January 3, 2007

Photo Mosaic Project

As of today, I am starting a new project that I have been thinking about for some time. Given my "free time" while on the beach, I am hoping to get a fair bit of the research done and beyond the "I wish I had time to do ___" phase.

Project Idea: Photo Mosaic Software
Project Background/Reason: I have taken thousands of photos of the past year+ and would love to find a way to incorporate them all into a some type of summarized fashion. I have seen numerous posters, images, collections of photo mosaics over the past few years and have always thought it might be interesting trying to develop software that could produce reasonable facsimiles from a group of stock photos.
Project Goals: Develop a fully contained piece of software that given a seed picture, a collection of stock photos and some other information (algorithm to use, sizing, etc), will produce a composite mosaic of the seed picture with a given size and resolution. My main goal in the end is to be able to use the software to produce a poster size print of another photo I have taken of probably Emily and myself (or something else from the past year) made up of all of the the rest of my 2006 photos and hang it on our wall.
Probable Project Phases:

  1. Get a better feeling of the image types are being used (mainly jpeg), image processing API's available, etc.
  2. Figure out a very basic initial algorithm for deciding how much a stock photo resembles the portion of the seed image in question.
  3. Write up a framework for the image manipulation, editing, creation, storing of image meta-data, and analysis.
  4. Write up a basic shell of the software that allows for the main inputs/outputs/previews to be seen and edited.
  5. Refine algorithms, framework for performance and correctness.
So, as of right now I am on step zero. i.e. writing a post about the project. I think this could be a pretty cool one. Image analysis has always been something I have had an interest in, but have never really pursued. The project gives me an excuse for having all of the photos I have taken over the past year or so, and should give me a creative outlet when trying to come up with fast and effective algorithms for deciding which picture is best. Also, I am hoping that when it comes time to figure out the better algorithms, I may be able to get some outside help. As long as we can talk about it in an implementation agnostic way, I bet Kevin/Josh/my dad, etc could combine for some pretty interesting algorithms.

Thanks to my mom for reminding me about this project. Every time Em and I went home I would remember it but through the hussle and bussle of the holidays would forget to write down any of my thoughts. She sent me a link to two very interesting photo blogs (they have been added to my del.icio.us page) one of which contained the image to the left. Pretty neat if you ask me.

Also, in my quick searching on wikipedia for related topics, I found a link to: MacOSaiX. A small software utility which is basically exactly what I want to develop, for Mac OS X. Which only reaffirms my ambition to write this code. It looks like it has some interesting features. I will probably use it as a baseline once I get my new computer. [Although the sample images created are pretty low resolution, hopefully I can do better, but I feel clarity will be limited by processing time and stock photo collection size. Hopefully I can tackle both of those problems] One really cool feature of his product is that you can give the software a set of google image searches and it will use those for its stock photo collection. Neat idea.