• (Excuse the bad pun in the caption, but i could not resist.)

    Last wednesday I went to buy a netbook. Initially I wanted to get the MSI Wind (the 6-cell version) but that was only available in white. So i got the EEE 1000H instead, which was a good alternative after all. It has a slightly bigger touchpad, a bigger HDD, the big battery, better testresults and was 50€ cheaper.

    At the moment I am waiting for a USB-CD-drive to arrive for installing XPprofessional. The HomeVersion is no good when it comes to networksettings. Fortuneately we get all Windows operatingsystems for free from the university.

    Until now I have only tested i few things, because I don’t want to install to many programs before the final OS is on. Browsing the internet works good, the screen is big enough to avoid too much scrolling. The webcam works nicely in contrast to the touchpad, which is a little unresponsive at times.

    The keyboard is only a little smaller than a normal one and with some time of adaption the typing works well.

    Today I copied UT99 from another PC to the EEE. The touchpad is not made for gaming, but with an external mouse its fine.

    When the external drive is there and all programs are installed, I will post some more experiences and some photos.

    Tags: , , , ,

  • When coding the gravitational simulation I found some old code from 2003 that was supposed to perform edge detection in images. Back then I did not have enough knowlegde in C++ to get it working right.
    Therefore I started with a completely new program.

    When a BMP-image is loaded, first its header is read into to structs, containing exactly the right set of variables, so that the information is easily readable.

    When needed, the pixel information is read into a dynamic twodimensional array of structs containing three unsigned 8bit integers. For this purpose I wrote a little template since C++ does not natively support dynamic memory allocation of multidimensional arrays.

    Then a number of algorithms can be performed on this array.
    Some of them are easy operations on single pixels, like inversion of colors, converting to greyscale or subtracting one picture from another.

    But the really interesting filters involve matrix convolutions. That means you take a sliding window the size of your matrix (preferrably of odd dimensions) and calculate the value for the central pixel by multiplying the surrounding pixels by the respective entries of the matrix.

    This way a lot of effects can be achieved.
    One of the more simple ones is blurring the picture. You just take the average of the pixels around the central pixel and put that value into the pixel. A better blurring can be done by weighting the entries with a gaussian function.

    The reverse effect is possible, too. A sharpening matrix subtracts the sourrounding pixels from the center.

    I implemented some matrices in the code but added a function that can dynamically read an arbitray matrix and perform a convolution on the image, so that new filters can be tested quickly.

    The program accepts as many arguments as you like and executes them in the order of entering.

    The main goal of the program is to detect edges in images.

    Gradient Estimation

    Gradient Estimation

    There are a lot of ways to filter out edges in images,  i.e. calculating the second derivative with a laplacian or estimating the gradients with gaussian and derivative-of-gaussian (DoG) convolutions.

    I am currently working on the non-maximum-suppression-algorithm which should preprocess the images for the edgedetector. The SUSAN-algorithm is already implemented and the Canny-Algorithm will follow shortly.

    The sourcecode can be found here (a compiled executable is included).

    Tags: , , , ,

  • Two years ago I started coding a small program in C++ to simulate gravitational forces between masspoints. After seeing a video of a simulation of matter clustering under gravitation in my astrophysics lecture I decided to continue and improve the code.

    I wanted the simulation to be easily extentable, so I made a class for the objects, which holds their parameters and some I/O-functions, and a class for the world, which contains all objects in a list and the functions to calculate their interactions.

    The algorithm is quite simple. For each calculation step the world goes through all objects and calculates the forces excerted on it by every other object. It then calculates the acceleration of the object and subsequently its new velocity and position.

    For visualisation of the results the coordinates of each object are written to a file after each step. (This part isn’t working correctly yet. There seems to be some problem with the fstream.)
    These coordinates are then read by a 3ds-max script to keyframe coordinates of spheres or alternatively to pointcoordinates of splines.

    I also wrote a similar algorithm in Delphi, which only computes the movement of two masspoints, but directly visualises the result by drawing to lines. The linewidth varies with the absolute value of the z-position and the hue represents the speed at this point.

    A more detailed description of the mathematical background can be found here.

    Download sourcecode

    Tags: , ,