Dissertation 8th April
Currently the tracking now implements a kalman filter algorithm. At present, for the first set of traffic the tracker correctly identifies every car. However it detects more than there are. For the first 28 cars the tracker counts 35. Making it over-sensitive by about 25%.
Notes:
The video can be improved, less shaking.
Also the cars enter the frame occulded which means the count is sometimes messed up.
The count of cars is not enough to determine the quality of the tracking algorithm. A car could be missed, and then an extra car could be counted which would then cancel out each other and make it appear very accurate. A good evaluation method needs to be thought of.
Tweaking the background-subtraction system is essential to ensure the best results.
Dissertation – 3rd April
Above is the current output of my tracking program. It computes the nearest neighbour in the previous frame for each tracked vehicle and keeps record of how many have been tracked previously. If a new vehicle is detected that is not in the previous frame then it is added to the training data, if a previously tracked vehicle is no longer detected it is removed from the training data and otherwise the training data is just updated.
Obviously there are problems such as overlapping, misdetected blobs ..etc so i plan to use a kalman-filter tracking system to smooth out the tracking.
Dissertation Update 20th March
I have now been able to draw bounding boxes around the vehicles. This was possible using the inbuilt Blob Analysis subsystem of Simulink. There are a number of problems that have been presented and which I aim to get rid of. Firstly though here is output of the current program.
Problems
The first problem is with large or long vehicles such as a bus. As you can see from the picture below the bus causes the background image to be smudged with a shape of the bus. This means that when the background is subtracted the bus appears to have a tail which causes its incorrect bounding.
Since I am using a median filter algorithm is should make sense that increasing the size of the buffer will eradicate the problem. As you can see below increasing it from 30 to 65 has reduced the problem. It may be improved more with better thresholding or a better background algorithm. I have decided a good medium for robustness and processing speed is a 50 frame buffer.
Here is the bus later in the scene.
Another problem is with occlusion, that is, when two objects overlap one another. When this happens the blobs will combine into 1 blob and so they will be bounded together. Some examples of this are below. I plan to focus on this aspect as it is an interesting problem that can cause problems in many computer vision tasks.
As my proposal states there are the Graph Matching, Mean-Shift Tracking and Kalman filter algorithms that can be used to track objects. The kalman filter algorithms sounds very good as it uses the predicted position rather than the actual position so it would perform well when objects overlap.
Next Steps
The next steps i plan to take are to work on object classification and tracking.
Dissertation Update – 1st March
I began writing my matlab system by creating a GUI with matlab’s GUIDE tool. GUIDE is an inbuilt matlab tool that takes much of the hard work out of construction a GUI. Once this was done I then began to construct my system around it by loading in the video, then applying a simple background subtraction algorithm. I immediately encountered an issue, that is with the performance of the program. It would take almost a whole second to update the GUI with the next frame and this was just with the simple frame-differencing algorithm. If it was taking a second per frame for that algorithm then surely it would take an unbearable amount of time for more complex algorithms such as the median filter.
Since then I have discovered Matlabs Simulink Models which are a far better solution particularly for image processing. Simulink models are a way of making modelling and simulating dynamic systems using connectors and blocks. There is a built-in Image and Video Processing Blockset which provides many methods that i may require and thus will save me alot of time programming them. On top of that it is much neater and lets you connect the output of X to the input of Y so much less code is needed. If a processing block isnt available then you can write your own in matlab or c. I have decided to abandon the idea of a GUI system and concentrate of the code underneath. I know that the Simulink Model approach will be fast becuase there are a number of demos available that demonstrate similar functionality and from which i may use code from.
- State of my program so far
As you can see it is much easier to follow than written code and video performance is good. It is also very intuitive to build. When run it outputs 3 video players which show the frame, background and foreground in sync. Overall i am pleased with the my new approach, it should allow me to construct the system quickly and my aim to find a part of the system (perhaps tracking) to concentrate on and perhaps write a custom block in matlab code.
General performance so far using median filter is good. I began with 30fps video which required a large buffer for the median filter and thus slower processing. I reduced the video to 10fps and now a 25 frame median filter buffer gives good performance. Next job is to tweak the post-procssing of morphological processes and thresholding in order to obtain reliable results, then i may be able to go onto tracking.
Dissertation Update 1 – 15th Feb
In the last week I have collected a few videos to be working with. I have decided to keep things simple with a single lane of traffic to begin with and I may collect further videos as the dissertation progresses.
- Video Format
Before I can begin processing the videos I must first convert them into a suitable format. Firstly the resolution must be reduced in order to speed up processing, I have decided upon the Half-VGA standard 480×320 as this gives a compromise between quality and processing time.
Following this I must consider the codec and container to use for encoding the video. Having consulted the matlab manual it seems that it will read any format which is supported by Microsoft Direct Show. To be sure that the file would be read I have installed the K-Lite Codec pack to make sure as many formats as possible can be read.
The quality of the encoding will be largely irrelevent because a combination of thresholding and morpholigical processes will remove unwanted background noise in the video. However, decoding speed is of importance and after some careful searching I have found h264 to offer the best decoding performance. This is mainly due much less data having to be transferred. MJPEG, for example, has to store information for every frame. h264 is widely regarded as the best all-round video codec offering excellent video compression and quality preservation and is therefore my codec of choice.
Below is one of the videos that I will be using for my car tracking dissertation.
Dissertation – Useful Links
Here are some useful links that I have come across that may help with my dissertation.
http://www.ingeniumblog.net/2010/06/object-counting-using-matlab/
A tutorial about counting objects in an image using thresholding. This may be useful during the object identification part of my dissertation.
http://www.mathworks.co.uk/products/computer-vision/demos.html?file=/products/demos/shipping/vision/videostabilize.html
http://www.mathworks.co.uk/products/computer-vision/demos.html?file=/products/demos/shipping/vision/videostabilize_pm.html
Two interesting links regarding image stabilization. They may be worth exploring for preprocessing the video and remove the slight camera shakes.
Dashcam Time-Lapse
So I bought a 808 #11 camera from China for £25, a 720p spy-cam which comes in the shape of a car key fob. I bought this on the recommendation of techmoan, as he explains how it offers the best price/quality/size ratio.
![]()
It size makes it perfect for mounting on my model plane, but i thought id put it throught its paces as a dashcam. Here’s my video going from Sale to Youlgreave (Derbyshire).
How to Setup a VPS – Part 2
So now that you have your webmin and virtualmin panels set up you will want to get your domain, somedomain.com to point to the server rather than having to type in the IP address every time. Usually with shared hosting you would set the domains nameservers as those provided by the hosting provider. With my VPS provider, however i was required to use my own nameserver. This means I have to set up my server to act as the nameserver and then set the nameservers of my domains to point to my server. Heres how I did it.
First step is to register the nameservers that you wish to use. I had a choice of a few domains that I’m hosting here but i decided to go with this one rob90.com. So on my domain registrars panel i went to register nameservers and chose ns1.rob90.com and ns2.rob90.com corresponding to the two IP address that i was assigned.
Whilst you are on the domain registrar site you can then set the nameservers to ns1.yourdomain.com and ns2.yourdomain.com. Do this for any of the domains you wish to host on your server.
Next you will need to set those nameservers up to work on your computer. This requires you to install bind. If you have yum installed on your server you can install simply by executing:
yum install bind
Now go onto your webmin panel and you can now begin to configure BIND DNS.
For each domain you will want to Create Master Zone. If you followed my instructions previously about virtualmin then these will have already been created for you.
On opening the master zone you will get a page like the following:
For the Adress record you will need to add the following:
Address Records
rob90.com. – MAIN IP
www.rob90.com. – MAIN IP
ftp.rob90.com. – MAIN IP
m.rob90.com. – MAIN IP
localhost.rob90.com. – 127.0.0.01
webmail.rob90.com. – MAIN IP
admin.rob90.com. – MAIN IP
mail.rob90.com. – MAIN IP
then the following two records must also be added (ONLY for the registered nameserver domain)
ns1.rob90.com. – MAIN IP
ns2.rob90.com. – SECONDARY IP
Next you will need to add nameserver records for each of the domains.
These should point to your nameservers.
Nameserver Records
rob90.com. – ns1.rob90.com
rob90.com. – ns2.rob90.com
Finally you may want to add a mail server.
rob90.com. – mail.rob90.com.
This is how mine has been set up, it may be that you may require a different setup but refer to official webmin manuals for more info.
Be Sociable, Share!
How to Setup a VPS – Part 1
I was required to upgrade to a VPS for my website mp32flv owing to excess loads on my original shared hosting account. I was initially daunted by the prospect, i didnt even know what a VPS was at first. If u dont know it stands for Virtual Private Server and essentially you are given part of a server to do what you want with. There are many VPS users on one server but you wouldnt know as the resources are allocated .
You will be given some sort of limited control panel to view resources and perform backups/repairs..etc. Mine was called Virtuozzo and it can be accessed from the link sent in a confirmation email. note you will need to access it by IP since the DNS hasnt been setup yet.
Parallels Virtuozzo Control Panel
you can have a browse but there is nothing really that can be done yet with it.
###########
To do the work you will need to download putty and connect over SSH. Open up putty and type in your servers IP address and login. You should now have command-line access to the system.
First of all we need to get the dns setup to resolve domain names. If you type in ping google.co.uk you will notice that it is unable to resolve domains. In order to fix this add the following to /etc/resolv.conf. These are the OpenDNS servers (see http://www.opendns.com/). I assume you already know how to use vi editor in linux.
vi /etc/resolv.conf
nameserver 208.67.220.220
nameserver 208.67.222.222
You can now check that ping google.co.uk works.
###########
The next step is to setup a control panel that is more powerful than the virtuozzo one. A favourite candidate is webmin control panel. If you are on centOS its fairly easy to setup using an RPM. Simply head over to http://webmin.com/download.html, copy think to the required rpm and install by using the command below.
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570-1.noarch.rpm
rpm -i webmin-1.570-1.noarch.rpm
The install should then tell you where to point your browser in order to log on to webmin. For me it was on port 10000 e.g. XX.XX.XX.XX:10000. Once you have logged in the page below should appear.
webmin control panel
HTC Mazaa [Fixed]
I was just about to ship my HTC Mazaa device off to the U.S. to get fixed when i saw an interesting post over on XDA forums. Only posted 4 days ago was a ROM image for my device : ) I wasnt even sure if i would be able to flash it since, previous attempts to repair or restore the device have failed. Due to it being a developer device there is very little help and from what I have read on forums I believe theyre not releasing updates for it. Its a shame because it really enjoy the phone. Anyway to anyone whose HTC Mazaa gets stuck on the Mobile Operator screen as the picture below, heres how to fix it.
Files:
HTC Mazaa FFU ROM: http://www.megaupload.com/?d=KY8J8SIY
Zune Client (Beta 4.8.2134.0)
First step is to download the Zune Client (Beta for Mango). You need to look for the version number 4.8.2134.0 specifically. Once this is installed look in the setup files for an installer like UpdateWPSetup.exe or similar. This will install the Windows Phone Update Flashing tool which is required to reflash WP. You will also need the FFU file for the HTC Mazaa which is linked to above.
Now that you have all the prequisites you can begin flashing the firmware. Open up a cmd shell in the Program Files/Zune directory and run:
UpdateWP /list
This should confirm that your phone is connected and willing. Next you want to flash the firmware that you have downloaded.
UpdateWP /ffu Filename.ffu
Thats it, now watch the phone be reformatted and reflashed by the UpdateWP tool. I wish i had know about it alot sooner.
Thankyou to XDA Forums thread 1410089 for help and the FFU file.
- stuck on mobile operator screen
- using the UpdateWP tool


















