Simple shape detector – Android Application

Again a little more on the apps that I am developing for my master thesis… While checking what’s new in the exergaming area and the solutions that are offered on the market I learned about interactive walls and I really liked their purpose. There are ones where a part of the wall lights and the player has to hit there and then another different part of the wall lights and the player has to hit that as soon as possible.  More about them can be read here http://www.exergamefitness.com/twall.htm  or wherever you can find on the internet.

It was all nice and great until I saw the prices of these walls… One of them was about 15k dollars which seemed too much! This is why these walls are only available in the labs or special playing rooms.  OK I am not saying that there are no such walls sold maybe all over America or other parts of the world but schools in Macedonia wouldn’t agree to buy one such wall. So I thought can’t this be somehow done using a simple mobile phone? It would cost not more than 500 dollars (if we take in consideration the most expensive smart phones on the market).  It would be available at any time and any place and there would be no need for children to go in special places intended for exergaming but they could do it whenever they feel like it…

So I started working on a mobile app that would make any white wall interactive. This should be done by sticking papers with different colors and shapes on it and make a shape detecting app.  So the first thing that I thought of was the OpenCV library and the miracles it can do but after a couple of simple tests I did on the phone that I have for testing purposes -T-Mobile Pulse I realized that I couldn’t make it real-time. This device is just not fast enough. Then I checked for some other libraries available and I found jjil – Jon’s Java Imaging Library, for mobile image processing but that didn’t help me as well. It was still not real-time…* It was time for me to read some more about shape detection. The book that helped me the most was Digital image processing – An Algorithmic introduction using Java. Having a white wall and colored shapes I went straight to the part that talked about Regions in Binary images and got couple of ideas about how current shapes can be determined. Actually the process turned out to be really simple. I think that anyone would understand when seeing this picture.

The first and last black pixels are determined and the black pixels are counted. If we compare the math formulas for areas of square, circle and triangle (a^a, a^2Π/4, a^2√3/4)  we could see that the square is more than 85%, circle between 85% and 70% and the triangle is between 70% and 55% of the area between the two pixels. After I finished writing the code doing all this simple math and did the first tests I was surprised that it worked immediately! 🙂

There is the making-of the testing wall in my room.

Here you can see a video of the app.

This app is later extended as a memory game showing the player an array of shapes that he has to remember and “hit” with the phone. ASA I have some more free time I’ll post the code on GitHub so that people having more creative ideas than me could use it. In the next posts I’ll write something more about how the testing of the apps went with primary school students.

*NOTE: I still encourage people to test this libraries further and use them since they are pretty cool! 🙂

Advertisements

Browsing SAP workplace messages via Android phone

If I want to claim that I am an SAP enthusiast I have to prove that somehow…

The video below is a demo app that I submitted at the SAP TECHED 2010 contest. It is really more of a test on the capabilities that some tools offer like the good and old SAP .NET connector ( I’d prefer using the SAP Java connector but this was what I had at the moment of making the app) and the lightweight SOAP library for Android phones – ksoap-2. I got 2-in-1 with this app- learned a lot about connecting SAP with external systems and started my Android development journey.

Hopefully I’ll make something more useful for this year’s SAP TECHED.  🙂

What the app does and how it does it is done in the video. It is subtitled because I had some difficulties with the sound.

It is a bit slow but if you are patient enough you’ll see the steps needed to get it done. I might add some parts of the code in future posts or if you really need it mail me and I’ll send it to you.

Since there was a lot of SAP wisdom in this post I am free for a whole week 🙂

Mobile phone applications for motivating physical activity

Since I am getting close to the end of my master thesis project named “Mobile phone applications for motivating physical activity” I decided to name my first post the same.  I am doing my last project in this area because of my childish nature and the fact that parents are neglecting their children’s physical activity. So I decided to make applications that could be used on one more device and maybe influence a bit on their behavior.

I have spent the last couple of months going through the solutions offered to the public that motivate physical activities and I am very happy that there is a lot of interest for them.  Game consoles like Sony Playstation, Xbox, Nintendo Wii, Kinect and even the good old Dance pad are projects that I really appreciate. So I started with the idea of making the phone a game controller for a game that can generally be played while sitting in front of a PC, then tried to make the phone the only device needed for the kids to play and at the end made an app that has user interface where kids/parents/players can make their own games.

I will try to describe each one of them in the future posts and give just a sneak preview in the first one in this.

Here is a youtube video showing the first presentation of one of the apps.

More info…

coming soon…