Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Archive for March, 2013

Milestone 3 and Milestone 4

Milestone 3 contains the Milestone 3 binaries.

Milestone 4

I am an idiot for not thinking of this before!

It’s 2 days before the 3rd milestone. I am making my program prettier and making it so I can show off more things easier. I can now show what the picture looks like during different stages of the program and very easily showing off exactly what I am doing.

The thing is… this would’ve be highly useful to me quite a bit earlier, if I had focused on getting this kind of things like first two weeks, I would’ve been able to much easier get my stuff rolling.



I can see the picture at ANY stage, even during last stage, where it’s invariant numbers. It took a bit work to get text onto a picture, but with this I can easily show things off! It’s very useful for debugging though, to see whatever happens at any stage. I wish I had done this earlier.

I can even show off my super awesome fouriers that doesn’t do anything at all! That is irrelevant though, because they looks just impressive.  Now I just need to make a power point for the presentation and make sure I can run the program on the computer in the room where I am gonna do the third milestone presentation.


It’s the final push before time is up. I have not managed to do nearly as much as I wanted to. I haven’t touched searching at all, my comparison is unsatisfying, and it’s only 3 days left. I have come across one of the core problems, the contour detection.

In simple pictures it work fine, in more complex it does not.



First picture it looks great. I get a good contour of the picture and it’s EXACTLY what I want. Second picture is more tricky because of its weird colours. The contours get a bit messy, but the outer contour is still good so it’s still usable for comparison.

Third picture show the real problem. While it might look decent, 4th and 5th picture shows what really is going on in the picture. It’s not one big contour, but several small that looks connected, but if you look contour for contour you see they are not one big. This makes it completely unusable for shape comparison. To fix this I would need to use better parameters for contour detection OR make my own. If I was to improve my parameters I would have to do it smart someway so it tests several options and goes for the best one. This would be very expensive since my code is everything but perfectly efficient.

I have also done some look into values of the invariants(Thanks Dr Johannes for helping me out with that) and they seem to be bigger the more complex the figure is. The numbers vary quite a bit and noise/imperfect contours generally messes up any chance of getting a proper comparison done. Because the level of noise/bad contours the invariants generally just work so so.


I have yet started with colour comparison considering it’s only 3 days to third milestone I am not sure if I start with that before it. I might do, but I also might just improve my GUI for easier doing debugging and showing off the program, and adding different kinds of visual things, so it’s possible to show what happens during different steps of the program.

Fourier gave me tons of trouble, OpenCV gives me no debug info at all if something goes wrong. If the picture is in the wrong format, is too big, too small, have weird name, transparency the wrong way, uses wrong type of colours or anything else like that, it crashes. It gives an assertion and a memory location, but nothing else. Nothing to see in calls tack, nothing to step through to. Just a crash with no info at all. It’s extremely frustrating, and since I know so very little about the fouriers, I get that quite a bit, I have to guess what I am doing wrong. I have managed to get out a fourier picture, but I don’t know if it’s in the right format to work with or anything like that. I am unsure if I will do anything fancy with my fourier, or if I just focus on get something fast and easy done with colours and then work more on showing off what I have.

So many problems, so little time.

oooh look a fourier

Close to the end of the project! Look finally some in-program fouriers!



I will be using this to preferably accomplish some cool stuff and improve my shape recognition.

Same is similar

I can now take two pictures that is exactly the same, and tell that they are similar. The comparison is currently a mess I will have to make it somewhat smarter.

Currently I have a big pile of issues.

#1. Comparing shapes in pictures instead of comparing pictures.

#2. Pictures with varying number of shapes, how do you say they are similar?

#3. Different pictures have different ‘perfect parameters’.


#1 and #2 probably partially will be solved when I added fourier descriptors to the picture. #3 will be increased the more methods I add. Right now if I take out the contour of the picture with wrong parameters I will obtain tons of noise. I will probably have to improve the method for getting a countour, and/or I will have to dynamically find the best parameters. I have an idea for how to get the best parameters.

If I take out the contour with like 10 different parameters, then I just take the one with least amount of contours, more contours generally mean more noise.


The bigger problem is the Hu Invariants. Comparison done with them is a bit interesting. The seven hu invariants is seven float number somewhere from like 0.1 to like 1^-70. The numbers vary quite a bit with the shape, and the magnitudes are so vastly different. When I compare shapes I compare them using the numbers, the magnitudes are so extremely different though, so it’s a bit difficult.

Close but no cigar

Right now I am fairly close to having a simple Hu invariant comparison in. I have slight problems doing the comparison of Hu invariants done. Right now I take out central moments, get Hu invariants from that, but I haven’t done any comparing using it. I am not entirely sure about the number spreads and how they scale.

Probably it’s like a day of work off doing the comparison. Maybe on monday I can show off some simple stuff.


In less bright news I have reached a problem. Right now I take out contours of every shape in the picture, and it doesn’t let me compare a full picture but instead I just compare the shapes in the picture. Right now I am just gonna compare each shape in both picture to each other. But it’s still a very clumsy solution, and I don’t have a good one yet. Partially it will be fixed with fourier descriptors of the picture, we’ll see later on.