Sunday, August 19, 2012

Image Processing with FPGA




Typical solutions of image processing, which are always seen in university laboratories, are run fully with the CPU of the computers which apply them. Those solutions, usually of real-time type, require a large memory capacity of each computer’s RAM. Hence the burden on both the CPU and RAM is high, which will slow down the computer and in the worst case: it will crash or cause a hang. Therefore FPGA – field -programmable gate array, is increasingly applied as an extra hardware to the computer to assist the task of running the image processing solutions. This article discusses a recent laboratorial test for image processing with FPGA, which was conducted by Mr. J.P. Bernecker and the writer, two postgraduate students of University of Applied Sciences of Darmstadt (Hochschule / HS Darmstadt). The test result showed that a real-time solution can be easily executed on a low performance computer with the help of FPGA.

NOTE: This article is written as a translated simple excerpt from the test report which was produced by two students mentioned above and was originally written in German language. Among the sources are named in the end.

During the Summer Semester 2012 at the HS Darmstadt in Germany, the students of the postgraduate course Optical Engineering and Image Processing (Optotechnik und Bildverarbeitung) had to run different laboratorial tests for the subject Industrial/Applied Image Processing (Angewandte Bildverarbeitung). The writer was paired with his lab partner to run 2 tests for image processing which used FPGA.

The other tests available to those students were such as inspection of liquid mixture using infra red camera, observation of the Venus transit etc.

Figure 1 - Linescan camera Basler Sprint spL4096 - 70 km
The test was conducted using two main instruments – a linescan camera (Zeilenkamera) and a frame grabber card, which comes with the field-programmable gate array (FPGA). The linescan camera has only 1 row, hence 1-dimensional, of pixel, which is different than conventional cameras which use CCD or CMOS chip with 2 dimensional array of pixel. The linescan type is mainly utilized in barcode reader, fax, scanner etc. In the following Figure 1 the camera which was used for this task is depicted along with its sensor. This is a model of Basler Sprint spL4096 – 70 km, with 4096 pixel along its column.

FPGA
FPGA is an integrated circuit, into which a logical circuit can be programmed. Alternatively it can be understood as a reuseable silicon chip. To program an FPGA , high languages such as VHDL (Very high speed integrated circuit Hardware Description Language) are used. The FPGA has diverse, prefabricated logic blocks, of which the purposes are to comprise the logical connection of conditions of the input signals to the output signals and to inquire as well as to set the conditions in periphery elements over specific I/O blocks.

With the logic blocks such chips can be so configured that they implement certain hardware functions. The configuration files originate from the compilation of digital algorithms that are developed into softwares.

Framegrabber
Figure 2 - Frame grabber Spartan XC2S 600 E-FPGA
The FPGA chip which was used in this test is a type of Spartan XC2S 600 E-FPGA, a product of the firm Xilinx Inc. This chip is mounted onto a frame grabber MicroEnable III-XL (see Fig. 2), which is produced by the firm SiliconSoftware. A frame frabber is an intelligent card/electronic device for high quality image acquisition and processing. The frame grabber sets up the connection between the camera and the computer.




Why Image Processing with FPGA?
FPGAs are used to reduce the large data streams from hardware into frame grabber. In FPGA-assisted image processing, the necessary computing power for image analysis is significantly decreased. This is the result of less work processes that fall to the CPU/processor, which does not have to partake in the procedures of image analysis. Therefore the latency/time delay from the image acquisition at the input until the output after the processing is notably recduced. Examples of image pre-processing with the help of FPGA are image transformationss, corrections of shadow effects and binary morphology.

The Test: Oscillating String
Figure 3 - Setup of the test
The test which was given to this 2-man groupd consists of 2 parts: Static image of a rotating roller and the swinging string. The former’s purpose is to teach students about the parameterization of linescan camera.

However this article will only discuss more of the latter, as it is directly about the application of FPGA as image processor. The objective of this test part is to detect the oscillation of a guitar string via the linescan camera (see Fig. 3)





Figure 4 - Oscillation of the guitar string
- an inverted gray level image
In the process of detecting the oscillation, the center of gravity (COG) of every image row and the instantaneous position of the string will be determined (see Fig. 4). With those determined COGs, an audio file of WAV-format will be generated, which replicates or recreates the detected oscillation of the guitar string. This WAV-file can be easily played on conventional media players. Audacity, an open source software, was used in this test.






Figure 5 - The VisualApplet design
which was used to detect the oscillation

The following image (Fig. 5) shows a design – a program which is developed on the platform VisualApplets. This design was a work of a previous group (students Mr. U. Häberle and Mr. Klöß) and was allowed to be used in this test to ease the current group’s jobs. The programming on VisualApplets is quite complex and requires more time than the allocated for this test, especially for beginners. One can notice that the interface in VisualApplets is similar to those of MATLAB-Simulink and LabVIEW.

This design consists of the following steps – loading the images in the buffer, inverting, converting to binary images and the generation of a WAV-file.

Due to some problems, the design above has been synthesized – i.e. a C++ source code is generated from the design and the program is run from Visual Studio, instead of the proper platform microDisplay, which comes along with VisualApplets in the complete package.

The outputs of every execution of this program are always the same -  a TXT-file which lists all the calculated COGs and the expected WAV-file.

With Audacity, the oscillation or displacement of the guitar string is visualized and further deductions can be drawn (see Fig. 6).

Figure 6 - The playback of the oscillation via Audacity
From this image, one can easily notice that the guitar string was plucked five times during the period of image acquisition.

Conclusion
This test has served as a platform to deliver a good insight into the possibilities and problems that are associated with FPGA technology. The C++ program which was run from Visual Studio has yielded comparable and good results. Apart from that, the execution of the software caused frequent crash, hence the frequent restart of the computer. Such tests should use only prepared applets, as the developing of one’s own applet is too extensive for an experiment which must be done in only two period blocks (90 minutes each) per session/week.

Sources

  1. National Instruments Tutorium: Einführung in die FPGA-Bildverarbeitung mithilfe des NI LabVIEW FPGA Module (Jan 04, 2012)
  2. National Instrumens Tutorium: Einführung in die FPGA-Technologie: Die 5 größten Vorteile (May 20, 2012)
  3. SiliconSoftware - Official website http://www.silicon-software.de/
Nisi Dominus Frustra.

Sunday, June 10, 2012

Studying at the Hochschule Darmstadt, Germany


A brief introduction to Hochschule Darmstadt


Starting from Summer Semester 2012, I am pursuing a Master's degree in Optical Engineering and Image Processing at the Hochschule Darmstadt (another Hessian public university of applied sciences).


HS Darmstadt [1]
HS Darmstadt, or 'h_da' as the college uses it commercially, is situated in the city Darmstadt, just south of the metropolis Frankfurt am Main.


As usual, students here are entitled to use the transportations of the RMV within its region. From Darmstadt in the south, up to Marburg in the north of Hesse, as well as from Hanau in the east to Mainz (in the state Rheinland-Pfalz) in the west. In other words, just like the rest of the students in Hesse, mobility is easy for them.


Malaysian students at the h_da


Currently there are 3 Malaysian students at this college, including me myself. The other 2 (ladies) are students under the scholarship of Yayasan Telekom Malaysia, a foundation of Malaysian telecommunication consortium. Both are studying electrical engineering.

So far there has been only 1 known Malaysian graduate from this college, who has studied mechanical engineering and was a scholar of the JPA/PSD.


Courses available at the h_da


Under this adress one can find the whole list of courses taught at the h_da:
Studienangebot der HS Darmstadt

Optotechnik und Bildverarbeitung at the h_da


Here I would like to highlight the course which I am currently taking. Firstly I will tell you, how I jumped into this field due to my experiences during my undergraduate studies.

I am a graduate of mechatronics engineering and during the last phases of my studies in mechatronics, I took an elective subject - Industrialle Bildverarbeitung (industrial image processing). From that subject I took a keen interest in this field, hence agreed to take a project (Projektarbeit), which was compulsory and of which the theme was a simple image analysis (Bilderkennung). From this project I looked further to search a theme with digital image processing for my final thesis (Diplomarbeit), which landed me an attachment at the German firm Werth Messtechnik GmbH in Giessen. At the end of my thesis I had realized that I need proper trainings, lessons or courses in image processing, if this field is what I want to do for my professional job, hence the master course in the h_da.

This course is an engineering discipline in the industrial and research field in optical technologies. The Optotechnik (optical engineering) covers optical metrology, laser technology and classical technical optics including its modern elements such as microoptics, illuminations and fiber optics. Meanwhile, Bildverarbeitung (image processing), also known as machine vision, combines illuminations, image acquisition and the processing of image datas for technical and scientifical applications. [2]

I can name a few examples of the application of image processing, used in scenes in 2 Hollywood films:

1) letters/pattern recognition which was featured in the recently released film Mission Impossible IV (Ghost Protocol): the early scene involved face recognition.

2) length/height measurement - featured in the film The Italian Job (2003): from the traffic camera at the streets, the tyres of the security trucks with the gold are measured from the captured images.

Applying for a placement

Generally among the uni. of applied sciences in Germany, for the intake Summer Semester (SS) every year, usually the closing date of applications is July 15, whereas for Winter Semester (WS) it is January 15.

Those closing dates may seem to cause a predicament for applicants who will get their test results (A-Levels, Test DaF, DSH etc.) AFTER the dates. Nevertheless, to my knowledge, applicants CAN still send their forms for courses, which are NOT classified as Numerus Clausus (NC). NC-courses, such as medicine, are considered critical for Germany and applications for them are strictly limited.

Should you prefer to apply ahead of the deadline, I would recommend you to prepare your documents with some support/statement letter(s), which states that your test result (e.g. German language test) is pending. I would say, your applications might be accepted and you get your placement, but eventually you MUST show your original test result/certificate upon immatriculation/registration day. Immatriculation or registration day does NOT mean the first day of the lectures.

At this link, you can find your way to apply online for a placement at h_da:

Online application for Hochschule Darmstadt







Sources/Quellen:


[1] Brigitte Zypries [SPD], Darmstadt - Studieren in Darmstadt
[2] Optotechnik und Bildverarbeitung, Fachbereich MN, HS Darmstadt

Tuesday, June 5, 2012

Studying at the TH Mittelhessen





Technische Hochschule Mittelhessen (Uni. of Applied Sciences Mittelhessen)


Having been among the earliest MARA students to enroll in and to graduate from the Technische Hochschule Mittelhessen or THM (formerly known as Fachhochschule Giessen-Friedberg), I feel obliged to promote this college to other fellow MARA as well as others (JPA, YTM etc.) to study here.


THM with campuses in Giessen (main campus), Friedberg and Wetzlar, is the largest public university of applied sciences in the state Hesse.


For the undergraduate courses - the courses which are taken by us MARA students are mechatronics and mechanical engineering.
THM's website


However many more courses are available, such as E&E, EIT, ICT etc.


THM's official website is http://www.thm.de/site/ .

Under 'Fachbereiche', one can find the list of the faculties of THM.


The mechanical engineering courses - with different majors, are divided into both campuses Giessen and Friedberg.


Mechatronics engineering course falls under the latter faculty 'FB 12'.


As of now, in the Summer Semester 2012, there are three JPA students who are undergoing Master's course in THM Campus Friedberg. Certain Master courses like their's are conducted in English.


Malaysian graduates from TH Mittelhessen


Until now, as of Summer Semester 2012:-



  • Mechanical engineering (Friedberg): 2 MARA students (Diplom)
  • Mechatronics engineering (Friedberg): 1 MARA student (Diplom)
  • Medical engineering (Giessen): 1 MARA student (Diplom)
  • Biotech/Biomedical (Giessen): 1 private student (Diplom)
  • Information and Communication engineering (Friedberg): 1 private student (Master)



The town Friedberg


Friedberg is situated between Germany's financial hub city Frankfurt am Main and Giessen.
Both cities are easily reachable via railway transports.


Enrolled students in the state Hesse usually have the 'RMV-Semesterticket' - which is also counted in the semester fees, and allows students to freely ride public transports like buses, trams, regional and subway trains within the region covered by the consortium RMV. So the question of mobility for students in Hesse is hardly a big issue here.


To be able to reach the large and hectic Frankfurt for shoppings, weekend hangouts etc while living peacefully, with relatively low living costs in Friedberg - is what the town Friedberg does have to offer to us students.


Applying for a placement?


Simply go to the section 'Bewerbung + Immatrikulation' at the website.


On behalf of the students in Friedberg, I would like to urge Malaysian students, who are aiming to study in Hesse especially in the town Friedberg or Giessen, to approach us, if our asssistance is needed.


- Vivat academia, vivant professores -