Friday 20 March 2009

Compression

Ok
I'm actually not only working on my bachelor project. I'm following another course and I'm working on my exam project for that course right now. The course is multimedia compression and I'm supposed to implement the compression steps of JPEG compression in Matlab. I'm not supposed to make JPEG files. I only have to make the transformations (DCT) forth and back and then save them as TIFFs. 
So as a real image processing guy I've used lenna or lena as my test image. I thought it might be fun to show how my lenna image looked like after compression and see how the image changes as I fixed some errors.

There are 3 sets of images showing the progress of my compression results where each set contains 2 images (except the final set). One compressed with quality 99 (the best quality) and one with quality 1 (give me a crappy picture quality). (Warning, I presume knwoledge of image compresssion in the following text, so if you don't understand a word just look at the pictures. It's not well written anyway. I'm pretty tired right now)

The original test image of lenna:

















First attempt at image compression of lenna (First image quality = 1 second quality = 99):

































Second attempt at compression. I've found out that the technique I had copied to change RGB to YCbCr was faulty so this was fixed for this attempt:

































The last and so far final attemp. I'm quite satisfied with the result. All the students were given a shell that we would have to fill out to make the compression. This shell called to functions. The first would convert the colours to YCbCr, subsample the chromonance channels, DCT and quantizise the images. The other would do the opposite. I had made a bunch of small functions to do all this work, so I only had to call the functions in the right order in the beforementioned two functions. 
Now I'm a programmer. That means I'm a bit lazy so after having written the first function I just copied it and pasted it into the second function and changed the function calls. Off course I would have to reorder it, so the inverse of the last step in the first function would be the first step in the second function. And I did that. Well at least I thought I did it. I realised that hadn't changed the order of dequantizising and inverse DCT, so I did IDCT before dequantizising my poictures. Doh.
Heres the final result (Q = 1, 20, 50 and 99):
      

First of all, boy is it annoying to add images to blogger :/ For some reason it insists to add the images at the top of my blog instead of were the cursor is.
Well anyway you can see quality 1 is horrible. But at quality = 20 you can the image is pretty good though you can see some block effects. I personally don't think theres to much difference between quality = 50 and 99 for this image.
In the end I'm quite pleased with results and now I only need to do some entropy coding so I can calculate my compression rate.

Until next time...

Monday 16 March 2009

CS Project - Surface computing

Oh, it's been a while...
More than a year has passed since my last post (not counting the post I made a couple of hours ago). I kind of always new that this would happen. It was bound to happen that I would loose interest im my blog. I wouldn't have any news to post and as time would pass by, I would just try to forget all about this miserable blog. That was exactly what happened. 
But things has changed. I have regained my interest in blogging and hopefully I'll have something interesting to blog about. The more observant readers has probably already guessed the subject I'll blog about, but for you who doesn't bother himself reading blog titles, I can tell you that I'll be blogging about my Computer Science Bachelor project which has something to do with surface computing.

How it all started
It was early February and I had just started on my Bachelor Project course. I was in the market for a study buddy to work on the project with. I happened to run into this dude (let's call him N) who also needed a buddy for a bachelor project. Luckily we both shared some of the same interests in CS so I had found a buddy for my project. Next mission: Find a project to work on.

Many CS students don't really know what to write about when they have to make a project so DIKU (CS department from Copenhagen University (founded by Peter Naur :-)) always has a list of possible projects suggested by the professors and associates at DIKU. Me and N had found this really interesting HCI (Human Computer Interaction) project about making an application for kids and teenagers to make small animations in. We mailed the man who had suggested the project and told him that we would like to hearm more about this project. However DIKU has just had to let some people go (sounds better than fire) and our contact was one of them :-/
Ok, minor drawback. What do you do? Well we just contacted another guy (let's call this guy K) who works with HCI at DIKU and asked if he wanted to be our guide during this project. Me and N told K about the suggested project and K's response sounded a bit like this: "Ahhh Tjaaahh Ehh". For those of you who are less experinced interpreting these phonetic noises follows a short translation/interpretation:

It's not because your project sounds boring but it is. Using kids as a user group is good but making a simple application on a computer for animation sounds a bit dull. Have you thought about Tangible User Interfaces (google it)?

We hadn't thought about using TUIs for a project but K showed me and N some videos of cool TUIs and we were convinced. One of the videos showed how another dude from DIKU (this dude is called E) had made a table which he used to mix music on. Me and N were (and still are) crazy about this table so we told K that we wanted to do something with it. So K mailed E asking if N and I could use E's table for N and I's bachelor project and E replied K yes who then replied N yes who then replied me yes. (confused?)

The result is that me and N has been allowed to borrow the table and tomorrow we'll be visiting an institution to talk with some kids and find out exactly what we'll be making. We're thinking board/card games, drawing/animation program and/or specialized computer games (perhaps air hockey). And the idea is ofcourse that I'll be blogging about our progress and hopefully also show yuo our results.

Well anyway, thanks if you made it this far and I hope ypu'll keep on reading this blog and perhaps post some ideas of you have any.

Here is a couple of videos showing the surface technology.

This is the ReacTable. It's a project from Spain and we'll be using some software made by this project.


Some videos of the table we'll actually be using can be seen at mixiTUI.com (Danish)

Back from the dead

Will soon start blogging again, but have to go now.