Search This Blog

TopMeny

Thursday, December 13, 2007

Level Set Framework

A study of .NET as a platform for computational intensive applications.
levelseteditorGUI.jpg
Level Set Editor GUI - Built on top of the level set framework (C#, .NET, DirectX).

Keywords: level sets, framework, .NET, C#, marching cubes, visualization, 3D, computer graphics

Authors: Anders Bursjöö and Hannes Larsson
Supervisor: Ken Museth, Professor Linköpings Universitet
Download report: LevelSetFramework_Thesis_Report_v2.0.pdf

Level set is a mathematical technique for tracking surfaces. It is used in 3D-computer graphics for organic simulations such as water and smoke. It is pretty hard to understand so we wanted to create a framework that a user could use in level set operations. The framework should apply to a novice user as well as a professional user that want to extend the framework.

The framework is written in .NET 2.0 and contains two different data structures from level sets and some basic operations for scalar field manipulations and advection. The framework is built with interfaces to be extendible.

LS_GUI.png

A GUI has been created on top of the framework (see the image above). The program uses marching cubes to generate the mesh and is rendered in DirectX. The marching cubes algorithm is general and could be plugged into OpenGL or some other graphics library.

The colors indicate the normal direction. Several layers (levels) have been rendered to display the structure of level sets. Each level represents a constant value.
utha_1.jpg
Utah teapot level set,
full volume.
utha_2.jpg
Utah teapot level set,
cross section.
utha_4.jpg
Utah teapot level set,
cross section.

bunny_erosion.jpg
Eroded bunny
bunny_erosion.jpg
Original bunny
bunny_erosion.jpg
Dilated bunny

View demo movies:
levelseterosion.jpg
Dilation

levelsetmean.jpg
Mean curvature flow

levelsetmorph.jpg
Morph

DirectX as UserControl in a Windows Form

How to insert a DirectX render-window into a Windows Form application using the DirectX sample framework.
Keywords: DirectX, sample framework, windows form, UserControl.
Download source code and executable
directxasusercontrol.jpg
I found it very hard to find a good example of how to have a DirectX window inside a Windows Form application and still have standard Windows Form controls without making DirectX lock the GUI. I also wanted to use a sample framework application from the DirectX samples.
There is a very good example (CML viewer) of using a DirectX sample framework in a WinForm and I have looked at it a lot when creating this example. Anyway, I wanted to do it my way so I did my own version of it. I also wanted the rendering-loop to be optimal and it actually is in the later versions of the sample framework. It is using the ApplicationIdle-event to render, read more about optimal rendering-loops at Tom Millers blog.
Note that the sample framework is not created to be used like this so you may want to consider creating the DirectX-stuff yourself without the sample framework.
Sometimes the applications has problems at start up, maybe because of the LoaderLock turned off, does anyone have a solution? For LoaderLock problems, see this thread.
I have not put much effort in documentation and super pretty code (all my time goes to my master thesis projekt) but it is an implementation that work and I don´t think it is that hard to understand.

Level set viewer and cloth simulation

Level set viewer, cloth simulation with collision detection against a level set model and a ply-model viewer.

levelseteditor.jpg
This was a project and lab exercises in a course held by Professor Ken Museth. The result of my and my partners work is a Ply-model/Level set/Cloth simulation viewer. In other words, you can open and view ply-models and also save level sets to a ply format. The level set part also gives opportunity to modify the model a little bit (basic boolean operations) as well as viewing different levels, view different resolutions of the model and more. The cloth simulation is a piece of fabric that is created by a transmission line matrix with spring connected to the nodes in different ways. The project is written in C#, .NET 2.0 and DirectX. Please take some time to view the demo videos or download and run the executable.
Note: You must have .NET 2.0 and DirectX 9.0c installed to run the demo executable.

Download demo executable (56 MB)
Download demo video 1 - Ply model (30 MB)
Download demo video 2 - Level set (67 MB)
Download demo video 3 - Cloth simulation on level set model (34 MB)

Unstructured Light Fields

3D representation of real objects using pictures and unstructured Light Fields.

lightfields.jpg
This project is a result from a course at school. Our first goal was to create an unstructured Light Field system where you could take some pictures of an object (using markers for tracking) and then create novel views of the object from a small set of images. By doing this you do not need to create a whole 3D environment and 3D models. You can "simulate" 3D by interpolating between a set of images. The result of the project is a Light Field program that can create these novel views; we did however use images from a 3D program since we did not get the tracking to work 100%. Please view the demo movie, read the report or download the executable.
Note: You need .NET 2.0 to run the exe-file.
Download demo video (6 MB)
Download executable (0.5 MB)
Download report (4 MB)

Data Exploration

Data exploration of house prize data in the Boston region.

infoviz.jpg
This project is created using C#, DirectX and OpenViz. The program shows an information visualization tool that can help the user to explore large amount of data. Normally it can be very hard to understand and find relations in a large data set. By using an information visualization tool the user can confirm relation between variables and also discover new ones. This program uses a scatter chart in a linked combination with a parallel chart and also a 3D parallel chart to view one to one relations between the data set variables. Please view the demo movie or download the project report.
Download demo movie (160 MB)
Download project report (1.5 MB)

Web File/Directory Browser using AJAX

A very simple web based file browser using AJAX and PHP.

filebrowser.jpg
This is a project that has been created to demonstrate the power of AJAX and XML. I did this project with a friend, Mattias Arrelid. We were tired of the standard web file browsers that just took too long time. We wanted to try and use AJAX to speed up the process. By using AJAX just a part of the data needed to be requested instead of the whole page beeing sent back and forth. We also wanted to be able to view the content of several directories at the same time. Please download the demo project or report.
Note: You need to put the files on a server that handles PHP and the browser only works with Firefox (css-problems with Internet Explorer).
Download source code (28 KB)
Download project report (140 KB)

Medical visualization

Visualization of medical data.

sciviz.jpg
Scientific visualization is a process where scientific information is presented in images in some way. The information has a connection to the real physical data in abstract to information visualization where the data does not need to have a real world relation. This project demonstrates visualization of medical data retrieved from an x-ray scanner. The input data is combined into a 3D model. This project is written in C++ using VTK.
Download demo movie (20 MB)

Movie restoration

A tool for restoration of old movies.
sequence.jpg
The task was to stabilize an old movie so that the frames did not move around and also to correct or normalize the gray scale of the image. We solved this using Matlab and explained in a simple way: looking at a characteristic part of the image and then compare that part to the next frame we were able to stabilize the movie clip. By looking at the histogram of the images we also could correct the gray scale. This program was created in a general way to work on any source.

Red eye removal

A simple red eye removal tool using Matlab.

redeye.jpg
It seems like a simple task, but red eye removal is quite complicated. It includes locating the eye and removing the redness and make the eye look natural with a believable color and specular shine. This was a task that was given to us in the Advances Image Processing course. We completed the program using matlab and got a really good understanding of the problem.

A few persons have asked me if I could publish the matlab code, but I wont do that. Many of you are in school projects and should solve the problem yourself. This seems to be a trivial problem but it is in fact quite complicated. There are many, many ways to solve this and I can give you some hints to a good solution. Do not try to do an automatic solution that scans the whole image, you will then need to use som face-recognition algorithm and you do not want to go there, instead use the built in functions in matlab to mark an area. Then search for round areas in the red channel and do some opening/closing to get rid of noise. When you are changing the color, be sure that you dont remove the specular spot in the eyes becaus that will kill the person in the photo :) (It wont look realistic).

Hybri

A simple hybrid halftoning method written in Matlab.

hybri.jpg
I wanted to see how different halftoning methods worked together and how different areas or characteristics in the image could be used for choosing halftoning method in that area. A rasterization method can have good and bad properties. Then, what about combining the good properties of different halftoning methods and use them in the same image. To get an overview of this I created a simple GUI in Matlab where the user can select halftoning methods for different areas in an image.
Download matlab source (6 MB)
Download report (swe) (0.5 MB)

Project Sarpedon

A pilot for a multiplayer game using AI for real time battle field simulations of thousands of soldiers.


sarpedon.jpg

This project, called Sarpedon, was a part of a course in 3D and Virtual reality. We were five students in this project and we used C++ and DirectX as programming base.

The idea came from a game idea and the goal was to create a 3D-program that can take a script and then display a battle field scenario for the user. The troops should follow rules given in the script and the soldiers act on AI. The idea of this is to have gamers create strategy for their troops and then meet another player on the battle field. An AI-engine will then calculate the result of the battle in a game. The result will be a script that the user can play and view the battle in real-time. View the demo where two sides meet on the battle field. This simulation is running in real-time from a precompiled script and the soldiers act on real-time AI.
Download demo movie (140 MB)

Wednesday, December 12, 2007

Project Holger

A simple client/server chat written in Java.

holger_small.jpg
This project was created by me and five other students during the first year of our university program. The project aimed to create a possibility to run projects over a network. The first part was a web page where users could register and be added to some project, this page also contained a calendar and some project info. The web part was written in PHP and connected to an Access database.
The second part was a client/server program written in Java, connected to the same Access database as the webpage. In this program the user could login and chat with a group of people, the project members. It looked like a simple ICQ or MSN client with a chat and a user list. There was also a possibility to broadcast an image to all the members of the current session. This program was created as a Java Web Start program that could be started directly from the web page.
Half a year later this project was revisited in another course. This time me and two of the other group members redesigned the chat client GUI (Java swing). We used our new knowledge about cognition and perception to analyse and recreate a user friendly interface. Again this was done in Java swing.
View screen shots here (300 KB)