This is only going to be a short over view of what I was up to over the weekend as there was a bit of time limitation with what I was up to. As I will now explain.
So over the weekend I was working on getting video up of PETS 2009 with HoG(Histogram of oriented gradients), moving average of HoG and ground truth. My first issue came when I noticed that the ground truth I was using was not accurate and missing out counting people that were in the scene. As I had trouble finding other ground truths for S2L1 scene and other scenes I created my own xml ground truth generator. This goes through the images one by one and the user can then enter the number of people in the scene. This then creates an xml document with the ground truth the user enters for the scene. This makes creating ground truth for future scenes that I can not find ground truths for a lot easier. I can then check through this and compare to the results of HoG and the moving average.
Once this was implemented then I had to generate a video displaying this information. This originally took a long time of close to an hour for 794 images which was was too long. I then reduced the number of frames to take down to 120 this meant it was a lot quicker. Then I had to turn the images into a video, originally I tried turning them straight into a .mp4 but took to long and crashed laptop several times. To overcome this I converted them to a .gif and then turned the .gif into a .mp4. This was still time consuming but more stable. I did this using the following commands.
convert -delay 30 -loop 0 *.jpg result.gif - using this source
ffmpeg -f gif -i infile.gif outfile.mp4 - using this source
Once I got them done I joined them together using the following command.
MP4Box -cat s2f.mp4 -cat s2ff.mp4 -cat s6f.mp4 -cat s6ff.mp4 -new all.mp4
- That I found here
Now the video was done I uploaded to YouTube with a brief description. The video can be found here.
I am now looking at implementing blob tracking on the videos then move onto dealing with occlusions which will help me more accurately count people in a crowd. First I need to create some tests for the stuff I have.
A nice little blog about my general life and thought/ideas I feel like rambling on about.
Showing posts with label video. Show all posts
Showing posts with label video. Show all posts
Monday, 23 February 2015
Video and XML fun
Labels:
aberystwyth,
blog detector,
blog tracking,
ffmpeg,
funding,
histogram of orientated gradients,
HoG,
moving average,
opencv,
PETS 2009,
phd,
phd funding,
Python,
tests,
Ubuntu,
uni,
university,
video,
xml,
youtube
Wednesday, 18 February 2015
Faces, Bodies and Rectangles
I have finally got Viola-Jones implemented in OpenCV in Python evern if the faces it detects on the PETS 2009 data sets are not very accurate. As I am sure grass does not have a face. I will work on fine tuning it and maybe even combining it with HoG(histogram of orientated gradients) person detection.
Thats another thing I have implemented, using some of OpenCVs example code but tweaked to be a little more modular. HoG person detector can now pick up people in images with a reasonable degree of accuracy. Both this, Viola-Jones and any future implementations will be checked against the ground truth for the set of images. This will give me an idea of how accurate the implementations are when values are changed or my own combinations/implementations are used.
I have also written tests for my files that I have made such as img_handler.py, viola_jones.py and hogDetector.py using pytest. This allows me to test all the methods to make sure they do what they are meant to and will not break when passing certain data. This makes them good for regression tests or if I ever need to change something in them. There are some parts which I have not tested as they require user input. I am currently looking it to simulating this to be able to test them.
The only ground truth file I have come across for PETS 2009 is one from this site for scenario S2.L1. This comes in a .xml file so I will be looking at parsing this to get the relevant data for comparison. I am also looking at other data sets to test more. As well as this I am looking into creating my own small test data set of around 6 people, a plan of what will be acted is currently being drafted up.
I have encountered a few problems over the past few days one of which being OpenCV on Ubuntu 14.04... again. I think due to a recent install of some software I damaged the OpenCV install that I had previously done. After following the steps from this website again it was up and running. As well as this the HoG detector was not picking up al people but after a few tweaks with some settings to do with it I am now picking up most of the samples with a few false positives. As well as making it more accurate in certain aspects it has also increased the time taken to process images. Viola-Jones needs some tweaking with its settings as it is detecting faces where there are definitely not faces, such as the grass.
I have also altered the file I was using to manually step through the images to do it automatically and put the results from both Viola-Jones and HoG detector. These are then saved and will be turned it to a video which will be linked on this site when up and running. It will have a voice over explaining what is going on and what each rectangle is .
My next tasks if I manage to get that all done as well as a few improvements to files is to work on optical flow tracking. This will require me to compare positions of people in a previous image to current image and map their movement over time. This will be done in a different colour that will hopefully get darker the faster they appear to be moving. When I have that working I will post a video on YouTube and some images on here.
So that's it for this week, got a lot to crack on with hopefully won't be too bad and hopefully OpenCV won't mess up again.
Thats another thing I have implemented, using some of OpenCVs example code but tweaked to be a little more modular. HoG person detector can now pick up people in images with a reasonable degree of accuracy. Both this, Viola-Jones and any future implementations will be checked against the ground truth for the set of images. This will give me an idea of how accurate the implementations are when values are changed or my own combinations/implementations are used.
![]() |
| HoG detection green boxes, Viola-Jones in blue boxes |
I have also written tests for my files that I have made such as img_handler.py, viola_jones.py and hogDetector.py using pytest. This allows me to test all the methods to make sure they do what they are meant to and will not break when passing certain data. This makes them good for regression tests or if I ever need to change something in them. There are some parts which I have not tested as they require user input. I am currently looking it to simulating this to be able to test them.
![]() |
| Showing my tests completing successfully |
The only ground truth file I have come across for PETS 2009 is one from this site for scenario S2.L1. This comes in a .xml file so I will be looking at parsing this to get the relevant data for comparison. I am also looking at other data sets to test more. As well as this I am looking into creating my own small test data set of around 6 people, a plan of what will be acted is currently being drafted up.
I have encountered a few problems over the past few days one of which being OpenCV on Ubuntu 14.04... again. I think due to a recent install of some software I damaged the OpenCV install that I had previously done. After following the steps from this website again it was up and running. As well as this the HoG detector was not picking up al people but after a few tweaks with some settings to do with it I am now picking up most of the samples with a few false positives. As well as making it more accurate in certain aspects it has also increased the time taken to process images. Viola-Jones needs some tweaking with its settings as it is detecting faces where there are definitely not faces, such as the grass.
I have also altered the file I was using to manually step through the images to do it automatically and put the results from both Viola-Jones and HoG detector. These are then saved and will be turned it to a video which will be linked on this site when up and running. It will have a voice over explaining what is going on and what each rectangle is .
My next tasks if I manage to get that all done as well as a few improvements to files is to work on optical flow tracking. This will require me to compare positions of people in a previous image to current image and map their movement over time. This will be done in a different colour that will hopefully get darker the faster they appear to be moving. When I have that working I will post a video on YouTube and some images on here.
So that's it for this week, got a lot to crack on with hopefully won't be too bad and hopefully OpenCV won't mess up again.
Friday, 27 June 2014
Weekend is here
Well the week is coming to a close and the weekend is upon us. I hope you all have some fun events/activities planned for the weekend, mine will be a little relaxing and a little work.
I will be queuing up a load of YouTube videos and trying out a few new things with my awesome new microphone. I also have a podcast now so if you prefer to listen rather than read then head over to Podbean (will provide a link at the bottom).
Also I am now a member of Netflix so there goes most of my weekend and my sleep. I was looking through it last night and found out I have watched a lot of stuff. There is also a lot of stuff I still need to watch. If anyone has a recommendation of a film of TV series I will put it on list of things to watch if I haven't seen it before. Might start reviewing some films on here as well.
As always thanks for reading :)
Podbean
I will be queuing up a load of YouTube videos and trying out a few new things with my awesome new microphone. I also have a podcast now so if you prefer to listen rather than read then head over to Podbean (will provide a link at the bottom).
Also I am now a member of Netflix so there goes most of my weekend and my sleep. I was looking through it last night and found out I have watched a lot of stuff. There is also a lot of stuff I still need to watch. If anyone has a recommendation of a film of TV series I will put it on list of things to watch if I haven't seen it before. Might start reviewing some films on here as well.
As always thanks for reading :)
Podbean
Thursday, 26 June 2014
New Microphone
Woop! Finally got my new microphone through so my videos should start sounding a little more professional, just need to work on my self sounding professional :P.
The microphone I went with was a Samson Go Microphone which is a nice little portable thing and has Omni setting to pick up sounds from all around, bidirectional to pick up sound in front and behind while ignoring sounds to the side.
The one I find myself using most though is Cardioid which picks up sound directly infront of the microphone. This is the best for me as I use it for my lets plays and possibly for some future talky stuff. If you feel like hearing my voice through my new microphone stay tuned to my YouTube page.
Thanks again for reading :)
YouTube page is https://www.youtube.com/user/GamingMarriott
The microphone I went with was a Samson Go Microphone which is a nice little portable thing and has Omni setting to pick up sounds from all around, bidirectional to pick up sound in front and behind while ignoring sounds to the side.
The one I find myself using most though is Cardioid which picks up sound directly infront of the microphone. This is the best for me as I use it for my lets plays and possibly for some future talky stuff. If you feel like hearing my voice through my new microphone stay tuned to my YouTube page.
Thanks again for reading :)
YouTube page is https://www.youtube.com/user/GamingMarriott
Labels:
audio,
blog,
cardioid,
mentalmarriot,
mic,
microphone,
portable,
samson,
samson go,
video,
voice,
youtube
Wednesday, 25 June 2014
Video Woes
Afternoon, well it is where I am, anyway in m previous post I mentioned I had a YouTube channel that I am trying to post to more regularly.
Issues, my first problem with uploading videos was that my screens resolution is 1440 x 900, which when kept at that resolution and uploaded to YouTube it cause black borders to appear, this didn't look very professional. Also using my headset mic doesn't seem to make my voice very clear and makes it sound monotone(it's not, honestly). As well as this I also have an issue with my home internets speed being atrocious so takes forever to upload.
I have been getting better and now have my resolution set to 720p so no more horrible black borders. I also have ordered a bettter mic that should 'hopefully' make my voice clearer and much nicer to listen to. Just got to get my gaming skills up so I can be a bit more entertaining. It's all in good fun and is helping my presentation skills so I can't really complain.
Issues, my first problem with uploading videos was that my screens resolution is 1440 x 900, which when kept at that resolution and uploaded to YouTube it cause black borders to appear, this didn't look very professional. Also using my headset mic doesn't seem to make my voice very clear and makes it sound monotone(it's not, honestly). As well as this I also have an issue with my home internets speed being atrocious so takes forever to upload.
I have been getting better and now have my resolution set to 720p so no more horrible black borders. I also have ordered a bettter mic that should 'hopefully' make my voice clearer and much nicer to listen to. Just got to get my gaming skills up so I can be a bit more entertaining. It's all in good fun and is helping my presentation skills so I can't really complain.
Labels:
fun,
games,
gaming,
mic,
microphone,
monotone,
presentation,
resolution,
scree,
skills,
upload,
video,
voice,
youtube
Tuesday, 3 April 2012
New Stuff
First of new videos on youtube channel http://www.youtube.com/user/mentalmarriott go check it out.
Now shameless plug is done bit about what I have been up to. Currently still in Uni durnig a bit of the holidays doing some of my individual assignment. I have to create a Point Of Sale system for a pizza shop and revise over a short holiday, not nice at all.
I keep trying to update my blog more and more but been a bit dull recently. Been swimming, done work, made few youtube videos. I need a project for me to work on so over the next week or so I shall hopefully find something to do.
I NEED a job. Money Is being stretched really thin and I want to earn some money. So far I am hoping my Google AdSense goes up to £60 so I can claim it. Just wish I could make a popular video, that would be brilliant.
Now shameless plug is done bit about what I have been up to. Currently still in Uni durnig a bit of the holidays doing some of my individual assignment. I have to create a Point Of Sale system for a pizza shop and revise over a short holiday, not nice at all.
I keep trying to update my blog more and more but been a bit dull recently. Been swimming, done work, made few youtube videos. I need a project for me to work on so over the next week or so I shall hopefully find something to do.
I NEED a job. Money Is being stretched really thin and I want to earn some money. So far I am hoping my Google AdSense goes up to £60 so I can claim it. Just wish I could make a popular video, that would be brilliant.
Subscribe to:
Posts (Atom)

