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.

Saturday 13 October 2007

Zzzzzzzzzzzzzzzzzzzzzzzzzzzzz

OK - I'vee failed to update this blog. Those few people who actually read this blog must for sure have forgotten all about it. Anyway here'sa small update.
University started again :(
My two classes were Linear Algebra and Network. The Exams for those two classes are in about two weeks, so right now I should be studying in stead if writing. ;)
I haven't programmed that much because of Uni, so not much to say about that.
Btw. It was my birthday in thursday (11th Oct.) I've recieved a Detroit Red Wings Jersey and a Henrik Zetterberg Figure :D
And the latest news is that I've preordered the new GP2X F200. It's an handheld console, but unlike PSP and NDS (Which I both own a copy off) it's opensource and runs a version of Linux. This means that everbody can make their own games and software for it legally. Well it's a new exciting toy for me ;)
You can read more about it here.

Until next time - Peter

Thursday 2 August 2007

Vacation Update

It's been a while since I last worked on my game. I don't really know why besides the fact that I've been busy watching sport. Beside the last week of the tour, I've watched all the sport I wanted to watch. I must admit, that I'm disappointed with Cycling right now and I've completely dropped the sport for a long time. It's sad but it's reality.
On the positive side the Danish SAS-liga has started again and my team, Randers, is number one after a fantastic 5-0 win over Aab.
Back to programming. Thoug I haven't worked much on my game I still have been active on the programming side. I've been busy reading up on some Java and PHP since I'm gonna make some kind of a survey for a forum I'm a member of (www.iqon.dk - Danish)
However the really interesting thing is that I've actually read up on my 3D skills. I feel a lot more confident on my 3D programming and have started writing a small library to put my knowledge into use. It's not gonna be any fancy, but it will allow me to load and display static and animated 3D models. I'm also working on a simple particle system, so I may be able to make some 3D game in the following 12 months.

I suppose that's all for now, so happy coding or whatever you're spending your time doing.

Tuesday 26 June 2007

Vacation

Just a small update.

I finished my last exam yesterday and you know what that means: Summer Vacation.
Vacation = Time,
Time = Chance to work on computer = Me making games :D
I'm planning on making a remake of an old game (already started) and I hope to finish this game during my vacation. Besides that, I also hope to get a chance to do a bit of reading about OpenGL so that I can improve my almost nonexisting 3D skills.

Ofcourse I'm not gonna sit in front of the comp all day. Summer also equals lot of sports (le tour, wimbeldon) so when I'm not working on my game I'm most likely watching sport.

Monday 11 June 2007

I'm Alive

Well I haven't been active for like a month or two and I have no excuse besides me being lazy ;(
The PGD compo is over and it didn't go well. Real Life killed my game. :(
The scores hasn't been published yet, but I'll be surprised if I don't end last or at least in way down in the bottom of the list. My game isn't playable. You can hardly call it a game at all, but it doesn't matter anymore. I'm going to start on a new game much more exciting. It's a remake of an old classic, but I'm not gonna tell which one at this time.
It may take af couple of weeks before I get started. I'll have to finish my exams in the next few weeks, but the I have a complete summer vacation to program in :)

It seems I don't have anymore to say. I just had to write something in this blog since I was beginning to feel guilty. ;)