Thursday, February 8, 2007

BlogDay 28: Miranda Version 0.2

Finally added a pretty much working model of neural networks onto the code...
The ml libraries are really a boon...they are pretty much optimized and efficient. I was amazed by the the accuracy of predictions.... More abt it later...

I send the whole of yesterday optimizing our code... it runs much faster now...

Tuesday, February 6, 2007

BlogDay 26: CvANN_MLP::train

<update>
If you are looking for sample code for CvANN_MLP, see this
</update>

The Pro work is going on... i was a bit lazy abt filling up the blog...

We decided to try out a small vehicle rather than a full sized automobile. Reasons: Mechanical difficulties, Financial difficulties.


Has been trying out quite a number of stuffs. Interestingly, i'm back to square one in one thing.... ai for the vehicle. Has been exploring a lot of machine learning stuff in openCV... unfortunately most of them are either too complex or pretty much useless for our purpose...
And then i found neural networks in the machine learning libraries....

The difficult part was the implementation. All the documentation stuff were there but that was not enough for making a working example of ANN. Despite a lot of unsuccessful tries , i actually coded a pretty much working artificial network model in OpenCV/ML.

The code is for a simple purpose : Predict the average of two numbers. Its given 15 samples and then asked to find the average of 25 and 35. Here is a run:

Creating matrices..
12.000000 22.000000
56.000000 22.000000
34.000000 18.000000
26.000000 80.000000
23.000000 55.000000
34.000000 56.000000
22.000000 18.000000
26.000000 80.000000
23.000000 78.000000
20.000000 30.000000
45.000000 40.000000
33.000000 35.000000
39.000000 48.000000
27.000000 35.000000
28.000000 42.000000
12.000000 22.000000 17.000000
56.000000 22.000000 39.000000
34.000000 18.000000 26.000000
26.000000 80.000000 53.000000
23.000000 55.000000 39.000000
34.000000 56.000000 45.000000
22.000000 18.000000 20.000000
26.000000 80.000000 53.000000
23.000000 78.000000 50.500000
20.000000 30.000000 25.000000
45.000000 40.000000 42.500000
33.000000 35.000000 34.000000
39.000000 48.000000 43.500000
27.000000 35.000000 31.000000
28.000000 42.000000 35.000000
30.694805 0.000000

As u can see the prediction is 30.69.. yipee!!

I'm excited... But what abt the real thing....?? will it work on a much bigger scale... with all the unpredictable
things the image processing thing is to give the neural layer... well, lets hope it does..

Saturday, January 20, 2007

BlogDay 8: Nothing So Far

Yes. Almost nothing from my part today till now. Eoeo and Sri must be trying to interface the wiper motors with the AVR thing. Their servo controlling part is now working good.

Mech guys have taken out an old one-man-vehicle from their workshop.
Working condition: Dubious. I seriously hope they would find something better. There are a lot of things to be concerned about the vehicle. Improper suspension would mean the mounted camera would be vibrating too much rendering the images inconsistent. Controlling the gear accelerator combination would also be a matter of concern. That's why they are planning for something 'electric'.

Friday, January 19, 2007

Blogday 7: Simplicity matters..??

A day of mixed fortunes.

Eohan and Sri Raj found out that two of three servos we have are actually not working. They had a very hard time yesterday programming the AVR for the servos. I gave them company for a while and most of their discussion seemed greek to me. A world of flags, interrupts and clock cycles.....

In the high level coding part, i was in for a surprise. I had an idea to solve some of the problems we were facing yesterday. The averaging (finding the center line ) for the road we had detected was giving some diappointing results. I tried changing the very approach. Instead of a curve fitting thing i went for something which uses the whole of the data we are amassing in each frame. I divided the frame into two, by a vertical line through the center and counted the 'road' pixels on each side. The difference between the sum of the left and right parts gave a fair approximation of the road curvature !! I could improve the results by calculating the percentage of the difference over the total 'road' pixels present. That works nice now. Need to improve the strategy for better results.

Here are some of the frames....
The original image:


The road detected:
The calculations:


Simple ! !

Thursday, January 18, 2007

Blogday 6: A Revisit.....

Sreedal did a nice job in doing the conversion i mentioned in the morning. But we have a problem with the final curve now. The program now detects the road almost perfectly, but the jagged edges creates a very funny curve in the middle which the vehicle has to traverse. We need to smoothen it to find a viable path. And most of the strategic data lies in a very small area of the image which varies according to road conditions. The curve fitting experiments in openCV created "unhandled run time exceptions".

And the neural networking part. I did some experiments with the code but the appropriate structure is still to be found out.

We had a planned for a data collection tomorrow on Jeslin's car. That won't happen. The car is in workshop now.

BlogDay 6

Finally, i made Sreedal to sit down and start converting his matlab script to c++. He's currently learning the OpenCV interface to the captured image frame i have provided. Hope he completes it today itself.

Bipin has downloaded a set of good tutorials for opencv. Need to check them out.

And a very good news: Eohan and Sri Raj has completed the AVR programmer circuit. Now they can concentrate on the programming part.

Saturday, January 13, 2007

The pro so far...

Let me tell you the current status of the project.

Software:
We have decided on OpenCV - the computer vision libraries provided by Intel.

Search for Neural network packages continues even though we have got a few good ones.

Sreedal has created an algorithm to find the roadway,in matlab. Some curve fitting features has to be added to it and it must be converted to pure c++ in order to incorporate it into our main software.

I'm working on OpenCV now. The interface with the camera is working fine now, thanks to the powerful library, the example code and documentation. We are able to grab frames from the camera and the image processing has to be done on it. Once its done experiments on the machine learning part has to start. I'm still confused about the neural networks implementation. The parameters which are going to be the input and the output of the neural nets are a bit complex.

Hardware:

We got a camera - a Sony handycam from the image processing lab.

Eohan and Sri Raj are working on the AVR programming part. Eohan has crearted a PCB for the AVR Programmer. Our interfaces are yet be specified completely.
They shall interface the software with the vehicle.

Mech guys ( Abhilash, Prithvi etc ) are working on the vehicle. They have two options now - either to modify an existing vehicle or create a new one - a single seater with simpler driving mechanisms.

We tried to use the Blackfin EZLite 561 but it wasn't a complete success. Even the demo codes are not working properly. Too much time was wasted in it during the beginning of the semester. We hope to check that later but the current plan is to go on with the PC.