Arduino image processing Eye Pupil Tracking, how to make Haarcascade XML file

(Last Updated On: October 23, 2019)

eye pupil tracking

Description:

eye pupil tracking– A few months back I uploaded a project on Arduino Image Processing human face recognition and Entrance control using the electronic lock, vb.net and EmguCv click here”. In this project, we successfully detected the human face using the frontalface XML file and controlled an electronic lock. The face recognition was possible due to the frontalface XML file, I recommend you should watch this tutorial first and then you can resume from here, as today we will be using the same project. You can create your own XML files and track almost anything you want.

In this tutorial, I will practically show you how to train an XML file for tracking the eye pupil, while the same steps can be used to train an XML file for any type of object.

In today’s episode, you will learn how to make your own XML file for eye pupil tracking. Today’s episode covers

  1. Steps to make your own XML file.
  2. How to use an XML file in vb.net programming.

For the complete step-by-step explanation, watch video Tutorial click here”.


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 NPN transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470uf capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / stripboard: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wirecutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!


Eye Pupil Tracking XML file training:

For creating the Haarcascade XML file you will need a software which you can download by “Clicking Here

As I want to track blue eyes, so that’s why I download pictures having blue eyes. If you want to track brown eyes or black eyes then simply download images consisting of brown or black color eyes. Or you can also take pictures of your own eye…

eye pupil tracking

The next step is to change the format of these images, as these images are of the type jpg, let’s convert these images to BMP format using adobe photoshop. This process is really simple, simply open the image and save as the image with a different name and select BMP as the format.


eye pupil tracking

We have a total of 6 images of the type bmp.

This is the software that I will be using form making the XML file.

eye pupil tracking

Open the cascades folder and delete all of these folders…

eye pupil tracking

Now open the negative folder, this folder consists of the negative images. Negative images are those images that do not consist of the object you want to track. You can also add more negative images of the type jpg…currently this folder have 200 negative images… The bg and create_list these two files are not included. Double click the create_list file.

eye pupil tracking

Now open the positive folder then open the raw data folder, simply delete these images


eye pupil tracking

And paste the images consisting of eyes, these are the positive images.

eye pupil tracking

now click on the object maker….now select the region you want to track…then simply press the space bar key on your keyboard and then press the enter key…repeat the same steps for all the images…

eye pupil tracking

eye pupil tracking

After you are done with all the images then Double click the samples creations file, which will make a file in the vector folder, which you can check. By Default the vector folder is empty.


eye pupil tracking

Right click on the haar training and select edit with notepad…the negative images are 200…while the positive images are 6. Update the number of positive images and negative images.

eye pupil tracking

Now double click on the haar training file and wait for a while, this can take some time.

Now the last step is to double click on the converted file to make the XML file…as you can see the XML file with the name myhaar is created…


eye pupil tracking

Rename this file with the name eyepupil…

eye pupil tracking

Now, this XML file is ready and can be used with Arduino, raspberry pi, you can use this XML file with emgucv, opencv, python, etc…

eye pupil tracking

This is the same application which I designed for the image processing based entrance control system…i have already explained this project in very detailed. You can watch this tutorial “Click here link2”.

The changes I made in this application can be watched in the video given below at the end of this article.

Programming:

For software changes, watch video given below.

Watch Video Tutorial:

 

Other Arduino Image Processing based Projects:

OCR Optical Character recognition using VB.net and Arduino

 

Arduino Image processing CCTV camera system using VB.net

 

Arduino Image Processing based Entrance lock Control System

 

 

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

2 Comments

  1. Dear Engr Fahad,
    I enjoyed watching your video regarding eye pupil tracking. If you wouldn’t mind, I would like to speak with you about your interest and availability in creating a similar system for my use in an academic research environment. I have some specific objectives, but have no idea if you are at all interested or available to speak about this. At your convenience, sir, please contact me via email to advise. In advance of your reply, I thank you.
    -David

Leave a Reply

Close