Posts

Showing posts from 2013

ANPR Week 21 - 24: Documentation

Finally the project is completed. This last month of training was spent in creating project report that will be submitted to the supervisor and in the college. Also proper comments was inserted in the source code. This will help in understanding the code in future. Additional work will be done in the project, especially to create a GUI using Qt. Initially it has hung on executing the application. Also additional information related to project in detail will be posted soon on this blog.

ANPR Week 16 - 20: Testing

This month was used in testing the system and removing errors. Because of limited dataset and non-strict following of number plate standards by Indian vehicles, some errors have still remains in recognizing number plates. The errors occurred in instances where the characters shared some features with other characters like (O, 0), (B, 8) (I, 1), (U, V), (A, 4). Sometimes it skipped some characters present in the number plate. More analysis was done on the results obtained and ways to improve it.

ANPR Week 15( Day 71-75): ANPR Code Implementation - II

Last week, most of the code implementation was completed.  Errors and any kinks that occurred were ironed out. Special stress was given to the plate recognition part. GUI implementation was also tried but some issues have crept up. If no possible solution arises,the idea will be dropped. 

ANPR Week 14 (Day 66-70) : ANPR Code Implementation - I

This week using the Mastering OpenCV book, I tried to implement the ANPR algorithm in code form. The plate localization part was stressed this week. Some parts of code are not explained in detail in book. Have to go through code once more to gain better understanding. 

ANPR Week 13 (Day 61-65): ANPR Algorithm

This week was used in understanding the ANPR algorithm and its different components and steps. There are seven primary algorithms that the software requires for identifying a license plate: Plate localization – responsible for finding and isolating the plate on the picture. Plate orientation and sizing – compensates for the skew of the plate and adjusts the dimensions to the required size. Normalization – adjusts the brightness and contrast of the image. Character segmentation – finds the individual characters on the plates. Optical character recognition. Syntactical/Geometrical analysis – check characters and positions against country-specific rules. The averaging of the recognised value over multiple fields/images to produce a more reliable or confident result. Especially since any single image may contain a reflected light flare, be partially obscured or other temporary effect.

ANPR Week 12 (Day 56-60): Training ANN

This week the images collected were used to train ANN. Some jugaad   was also employed to overcome difficulties and Ouroboro effect was also used to create normalized segmented images of characters.  It could be the Achilles' heel of the main application. But still it might be workable. 

ANPR Week 11 (Day 51-55): Training SVM

Most of the week was spent in gathering the images to train SVM, but still I was unable to gather the required number of images. It was quite an interesting week in terms of facing from angry owners to disgruntled guards. Finally I've decided to use the older XML file as it works pretty well with the given specifications. 

ANPR Week 10 (Day 46-50): Extracting Lines, Contours and Components

This week was devoted in learning how to extract lines, contours and components of images. Day 46: Detecting Image Contours with the Canny Operator Day 47:  Detecting Lines in Images with the Hough Transform Day 48: Fitting a Line to a Set of Points Day 49:  Extracting the Components & Contours Day 50: Computing Components & Shape Descriptors

ANPR Week 9 (Day 41-45): Transforming and filtering images

This week using morphological operations, image transformations were done and use of filters on them. Day 41: Opening and Closing Images using Morphological Filters Day 42: Detecting edges and corners using morphological filters Day 43: Filtering Images using Low-pass Filters Day 44: Filtering Images using a Median Filter Day 45: Applying Directional Filters to Detect Edges

ANPR Week 8 (Day 36-40): Counting the pixels with histograms

This week was spent on learning how to count pixels using histograms. Day 36: Computing the Image histogram Day 37: Equalizing the image histogram Day 38: Backprojecting a Histogram to Detect Specific Image Content Day 39: Using the Meanshift Algorithm to Find an Object Day 40: Retrieving Similar Images using Histogram Comparison

ANPR Week 7 (Day 31-35): Processing Images with Classes

This week we learnt how to process images with classes. It helps in revisiting some important concepts of C++ as well. Day 26 - 28: Using strategy pattern in Algorithm Deesign Day 29 - 30: Converting colour spaces. 

ANPR Week 6 (Day 26-30): Manipulating the Pixels

This week we have learnt to manipulate pixels in images. Day 26: Accessing pixel values Day 27:Scanning an image with pointers and iterators Day 28: Writing efficient image scanning loops Day 29: Performing simple image arithmetic Day 30: Defining regions of interest

ANPR Week 5 ( Day 21-25): Playing with Images

For next 7 weeks, we will learn the basics of OpenCV and how to use it to develop applications. For a CS student like me, what matters more than theoretical knowledge is practical knowledge. People with theoretical knowledge are dimes a dozen while those with practical knowledge and innovative ideas are one in a million. The best source  to learn OpenCV for beginners is :  http://www.laganiere.name/opencvCookbook/ This week we have done following tasks: Day 21: Installing OpenCV2 Library on Windows Day 22: Setting up Visual Studio and windows. Day 23: Creating First OpenCv Project Day 24: Loading, displaying and saving images Day 25:Working with Qt 

ANPR Day 20: ANN - Challenges

The major challenge in training ANN is the large dataset required to get more accurate results. More and more unique images are required  for each character. Also all of these images should be normalized and have same size,i.e., 10 x 10 pixels. To get this dataset we have to use the segmented characters produced by SVM - the Ouroboro problem. No clear solution to this problem has been found. 

ANPR Day 19: Training Data Requirements

Today, training data requirements for ANN were identified. It will require more than 20 images for each character. In our case, we will need to gather data for  set of 26 characters (10 numbers + 26 alphabets).

ANPR Day 18: ANN - How does it work?

Its working principle is mathematically heavy. Basically, it uses some input values, processes it using a function and then matches the value to a particular class.  

ANPR Day 17: ANN - How will it be used?

Today, the role of ANN in our system was analysed. The main role of ANN in our system was understood which is to recognise different characters present on the number plate. 

ANPR Day 16: What is ANN?

Artificial Neural Network an it s major aspects were understood today. In computer science and related fields, artificial neural networks are computational models inspired by animals' central nervous systems (in particular the brain) that are capable of machine learning and pattern recognition. They are usually presented as systems of interconnected "neurons" that can compute values from inputs by feeding information through the network. For example, in a neural network for handwriting recognition, a set of input neurons may be activated by the pixels of an input image representing a letter or digit. The activations of these neurons are then passed on, weighted and transformed by some function determined by the network's designer, to other neurons, etc., until finally an output neuron is activated that determines which character was read. In layman terms, it is used to identify the unique signature between different classes which falls  under same category.

ANPR Day 15: SVM - Challenges

Today, challenges to to train such a large SVM classifier were identified. A lot of training data is required to train SVM. Under given timeline, such a large dataset may not be collected in time. This is the major challenge in training SVM. 

ANPR Day 14: Training Data Requirements

Today, training data requirements were identified to train SVM. It requires 75 plate and 35 non-plate images. If these requirements are not, earlier data stored in training file (XML) will be used. 

ANPR Day 13 - SVM:How does it work?

The mathematical aspects and its working process was better understood. As well as how to implement  it in the code was also researched. 

ANPR Day 12- SVM: How will it be used?

Today, we got to understand what function it will perform in our proposed system. Support vector machine (SVM) algorithm will be used to classify number plate and non-number plate images. 

ANPR Day 11: What is SVM?

In  machine learning ,  support vector machines  ( SVMs , also  support vector networks ) are  supervised learning  models with associated learning  algorithms  that analyze data and recognize patterns, used for  classification  and  regression analysis .  Given a set of training examples, each marked as belonging to one of two categories, an SVM training algorithm builds a model that assigns new examples into one category or the other, making it a non-probabilistic binary linear classifier.  An SVM model is a representation of the examples as points in space, mapped so that the examples of the separate categories are divided by a clear gap that is as wide as possible. New examples are then mapped into that same space and predicted to belong to a category based on which side of the gap they fall on. In layman terms, SVM is used to differentiate between two different classes of training data.  

ANPR Day 10: Pattern Recognition using Statistical Machine Learning Library

For plate localization and character recognition, pattern recognition algorithms are used to teach machine to identify different patterns. This can be achieved using OpenCV's Statistical Machine Learning Library. Today, we have learnt about them and selected two such pattern recognition algorithms that will be used in this project, i.e., SVM and ANN. These algorithms will be discussed in next two weeks.

ANPR Day 9: Pattern Recognition using Statistical Machine Library

The most critical component of the ANPR system is its pattern recognition system. In pattern recognition system, the machine is taught to recognize patterns. It will be used to locate number plate in images and for character recognition. In order to do this, the system needs to be trained using OpenCV's Statistical Machine Library. The main algorithms used to realize this are Support Vector Machine algorithm and Artificial Neural Network algorithm.  To get a better understanding of OpenCV library and its machine learning library, online sources will be sorted and the most suitable one will be used. More about this will be discussed in next posts. 

ANPR Day 8: Introduction to OpenCV Library

Image
With the viral spread of digital technology in today's world, it has also reached the shores of our country. The spark of digital revolution has been lighted by the advent of powerful and affordable computing devices, as well as internet. This has also created a ocean of videos and images everywhere. For anyone who wishes to develop simple or sophisticated imaging applications, OpenCV library is the tool to use. OpenCV (Open Source Computer Vision) is an open source library containing more than 500 optimized algorithms for image and video analysis. Since its introduction in 1999, it has been largely adopted as the primary development tool by the community of researchers and developers in computer vision. OpenCV was originally developed at Intel by a team led by Gary Bradski as an initiative to advance research in vision and promote the development of rich, vision-based CPU-intensive applications. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iO

ANPR Day 7 - Previous Research Works

Today previous research papers published  on developing an ANPR system specific to Indian conditions were studied. Most of these papers were found using Google. Most of them give a brief description about mathematical aspects and different methodologies to realize such a system. But there is no code implementation part which can be studied to understand or develop such a system. By developing a opensource online repository for such projects, such project can be further developed and improved upon until it can be implemented in more real life situations. It could be a evolutionary model in which additional functions can be added. These papers are: Prathamesh Kulkarni (Student Member, IEEE), Ashish Khatri, Prateek Banga, Kushal Shah: A Feature Based Approach for Localization of Indian Number Plates, Dept. of Electronics and Telecommunication, Smt. Kashibai Navale College of Engineering, University of Pune, India. Shishir Kumar, Shashank Agarwal, Kumar Saurabh: License Plate Reco

ANPR Day 6: Existing Systems

Today, the existing systems were to be studied. But it was found that the existing system for number plate recognition is still basically in pre-technological era. Most of the recognition work is done manually because of which the whole process is long, tedious and lacks any transparency. It is unable to take benefits of the present and future technological capabilities. Due to which most of the traffic and security applications are done through outdated or pedestrian methods which are slow, error-prone and impractical in current scenario. With the advent of information technologies, it has become an increasing necessity that all existing systems be upgraded and integrated with this new technology in order to make these systems more advanced, transparent, fast and better than before. Another motivation for this project was the heinous crime that was committed on 16 December, 2012 in Delhi. In which the 23 year old woman was brutally gang-raped in a moving bus. That bus did not h

ANPR Day 5: User requirement Analysis

Today, analysis of user requirements was done taking under consideration the constraints and research work done. The User Requirement Analysis suggest that the main priority is to develop a simple and cost-effective system that is able to recognise characters from a given number plate image. Taking this into consideration following specifications are made: Instead of IR cameras, normal 5MP cameras will be used. Number Plates of Private Vehicles like cars that are medium-sized and follow standard number plate format will be considered. No special cases like VIP number plates and temporary number plates will be considered.  To train the system, non-indian number plate images can be used to meet the desired data set requirements. 

ANPR Day 4: Constraints

Today, the constraints were identified under which the project needs to be realized. The main constraints are given below:  Lack of strict enforcement of standardized number plate guidelines : This causes issues in training the system and results in less accurate results. Lack of a centralized traffic database system : This causes issues in developing real time applications and data gathering to produce more accurate results. Small Dataset : To develop a real life application, it is necessary to train and develop the system with a large dataset in order to minimize errors and have a better accuracy rate. But due to given time period gathering such large dataset is not possible. 

ANPR Day 3: Types of Vehicles

As seen in the previous post, the format and specifications of the number plate changes depending on the type of vehicles.Therefore, it is necessary to select the correct class of vehicle as per user requirements and constraints. This is also necessary because size and location of number plate is also critical to the system. The types of vehicles that will be considered are given below: Private  Commercial Government Four-wheeler Two-wheeler Heavy Vehicle Small Vehicle                                                                                                                                   

ANPR Day 2: Types of Number Plate

Image
In India, there are different types of number plates in existence that differ in background color, size and even format. Different formats are defined for military vehicles, diplomatic vehicles, government vehicles and temporary license plates. Plate specifications like font, background color, font size and plate size is also defined on basis of different classes of vehicles. A tabular information regarding this is given below:                      This wide range in specifications can be a problem in designing a proper methodology for the project.  Therefore, on the basis of user requirements analysis and given time-frame, a standard specification will be selected.

ANPR Project Day 1: Standard Format of Indian Number Plate

Image
The main purpose of ANPR project is to recognize the characters present in the number plate. To do this first, understanding the standard format of Indian Number Plate is required.  Since June 1, 2005, the Government of India has introduced High Security  Registration (HSR) number plates which are tamper proof. All new motorized  road vehicles that come into the market have to adhere to the new plates, while  existing vehicles have been given two years to comply with. Features  incorporated include the number plate having a patented chromium hologram; a  laser numbering containing the alpha-numeric identification of both the testing  agency and manufacturers and a retro-reflective film bearing a verification  inscription "India" at a 45-degree inclination. The numbers would be embossed  on the plate, rather than being painted for better visibility. The term "India" is to  be in a light shade of blue.  But still most of the vehicles don't follow this format. 

Python Chronicles: Updating FB Status using Python & GraphAPI

So, while I was exploring the infinite possibilities presented by Python. I found this great python package facepy . Using which you can update your facebook status from python terminal. The only prerequisite is that you must be facebook developer to gain access to GraphAPI. Following the steps given below, you can also update your status using python: 1. Download facepy and install it by running this command:       python setup install 2. Create a new application or use an existing one previously created. 3. Run python.exe from command terminal (cmd in Windows). Use the user access token created in the previous step with facepy: >> from facepy import GraphAPI >>ACCESS_TOKEN = 'access-token-copied-from-graph-api-explorer-on-web-browser' >>graph = GraphAPI(ACCESS_TOKEN) >>graph.post('me/feed', message='Hello World!') That's it. You may further experiment with GraphAPI using facepy. Happy Experimenting!! MG

Changing the Login Screen in Xubuntu 12.10

So, I've commenced my experimenting phase in Xubuntu by changing its login screen. For changing the login screen in Xubuntu, follow the steps given below: 1. Switch to root user using the command:       sudo -i 2. As per Wikipedia, LightDM is an X display manager that aims to be light, fast, extensible and multi-desktop. It uses various front-ends to draw login interfaces,so-called Greeters. Allow the user lightdm to create a connection to the X server using this command:     xhost +SI:localuser:lightdm 3. Switch to Lightdm and set its default shell as bash.     su lightdm -s bash 4. Edit the 'lightdm-gtk-greeter.conf' using any suitable editor.      vim /etc/lightdm/lightdm-gtk-greeter.conf 5. Replace the default image address in background entry in the [greeter] section with the path address to your desired image. You can also change theme, logo, icon theme and font from here. [greeter] logo=/usr/share/pixmaps/xubuntu-lightdm-computer.png

Living with the Wild Penguin, Linux - The First Step

My search for a Linux began a long time ago. But most flavors of Linux that I experimented with were either unstable or threatened to turn my laptop into an oven. The main reason behind these issues were my laptop's switchable graphic cards,unavailability of suitable open-source/propriety drivers and their graphic-intensive nature.  After a long search for a light-weight and less graphic-intensive Linux, the answer to my problem came from none other than the Father of Linux - Linus Torvalds. And the answer was XFCE. I decided place my bets on Xubuntu 12.10, since it has the stability of XFCE and Ubuntu's rich repository as we.ll as large support community.  While installing, Xubuntu  also seemed to overheat my laptop. But after a bit of googling, I was finally able to resolve the overheating issue by following the steps given below: 1. Open the rc.local file as the root user.                 sudo vi /etc/rc.local 2. Now, copy and paste the following two lines just b

Running .Py files in Windows

This blog is meant to act as a programming diary and solutions to the problems that I encountered while learning . I hope that this blogs provides help to my fellow programmers, too. Currently trying to learn Python and improve my programming skills as well. I'm following Google Code Python classes  for this purpose. While trying to run .Py files in Windows using Git Bash, I encountered the following error - sh.exe": python: no such command. To resole this problem, I did what I always do that is I googled it. And I found the following solution which I will now share with you all.  As per the solution I found, courtesy of stackoverflow.com, this error means Git Bash does not know where your python.exe is. It searches your normal windows search path, the PATH environment variable. You're probably failing the 4th step on the instructions already "Make sure Python is working in the Git Bash": $ python -- version sh . exe : python : command not found To