OpenCV installation Tutorial, MS Visual C++ 2008

Installing OpenCV might sound very easy when you read it on some forums/websites, but there are some small changes in most of these tutorials that prevent the connection between OpenCV and MS Visual C++. In this tutorial we(my dear friend Puya Afsharian and I) try to guide you through the installation of these two products and the right way to make them talk with each other.

Although people say it is easy to make OpenCV 2.2 to work with MS Visual C++ 2010, but we did not get it to work properly while it seems that MS visual c++ 2008 works perfect with OpenCV 2.1. Here are the download links for both products :

OpenCV 2.1 :
This file is modified to work with MS Visual C++ 2008 and therefore there is no need to install CMake again.

MS Visual C++ 2008(Free of charge) :

Click More down here to read the rest of the tutorial …

Continue reading OpenCV installation Tutorial, MS Visual C++ 2008

Arduino Ethernet shield problem when on External Power

When Arduino/ethernet shield is connected with an external voltage source I have to press reset button to make it work. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin. The trick is to before initializing the Ethernet library, check an address in EEPROM. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.

<pre>int relayPin = 02;
int addr = 128;

void eepThang() {
eep_value =;
if (eep_value == 1) {
Serial.println("already reset. writing 0");
EEPROM.write(addr, 0);
else {
Serial.println("not reset.. writing 1, restarting");
EEPROM.write(addr, 1);
Serial.println("done wrote… here we go");
digitalWrite(relayPin, HIGH);

source :

Processing, the key for Arduino board independent programming

When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime without even updating the pde file on the board. The tool that gives you  the power to do this is called Processing & the library used exactly for Arduino is called StandardFirmdata. The very good thing about Processing is that it is based on Java and all Java codes works right out of the box on it. You can also import processing libraries into your Java framwork and enjoy the power of processing right in the middle of your Java project(in Eclipse).

The instruction to get Processing & Arduino talk together :

  1. Download this file.
  2. Unzip the library and copy the “arduino” folder into the “libraries” sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven’t made a “libraries” sub-folder, create one.)
  3. Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board.
  4. Configure Processing for serial:
  5. In Processing, open one of the examples that comes with with the Arduino library(in the same folder that we just unzipped).
  6. Edit the example code to select the correct serial port.
  7. Run the example.

Android development tricks

This is a summay of the tricks I have learned making an application called courseApp project.  This application was developed in the Mobile Information Systems that I took at University of Oslo. Eclipse is a very good tool to use for Android development. To start with you need to download Andriod SDK. After installing both of these(and ofcourse Java Development Kit, JDK which is a pre-requirement for both of these), you need to make Eclipse and Android SDK talk together. This is done by a plugin called “ADT plugin for Eclipse” from Google. You can read more about how to install this plugin by clicking hereIn case of Android SDK installation(the exe file) doesn’t recognize JDK on your computer, you can simply download the zip file and extract it. Don’t forget appending that folder to the %PATH% environment variable. Now some more tips follows :

Continue reading Android development tricks

>The tolerance issue in 3D printing


These broken parts are gonna delay my work …
The conjunction between the motor led and the robot body
The broken conjunction on robot body side
The broken conjunction on Motor side
 Totally new printed encoder parts were received on 9th of May 2011, and one of them(picture below) was broken into two pieces while being mounted on the same day
The old broken encoder part(black one) beside the new one that was broken under mounting

>Supervisor Meeting

Today I had a very quick supervisor meeting with my supervisor. Results :

  • I got the spare part for encoders, so now I can start to test my positioning code
  • I got some tips about I2C technology(Several cards connected together with the same wire)
  • I will have wired(RxTx, I2C, Dig2Dig, etc) & wireless(Xbee, …) networking of Arduino cards discussed in my thesis
  • I got tips that there are more products/technologies than Xbee
  • I get to write more about “Van der Waals” technology & discuss related to the conditions in offshore.