Skip to content

Using HAAR and LBP Classifier for Object Detection, in this case a phone

Notifications You must be signed in to change notification settings

raj-shah14/Find-Phone-with-Opencv

Repository files navigation

Find-Phone-with-Opencv

The task is to identify the phone from the given image

alt_text

Training Classifier

Use train_phone.py to first crop the object from the image based on the labels.txt provided in the images folder. Give the correct path path="C:/Python27/find_phone/images\\" pathsave="C:/Python27/find_phone/pos_img\\" at line 8 and 9 of the file.

getdata function combines the text file and images and returns an array,which is passed to the function crop_save.

Crop Images

alt_text alt_text alt_text alt_text alt_text alt_text alt_text alt_text alt_text

Using makefile function create info.dat file for positive images and bg.txt for negative images. Once that is done using train function start classifier training

Use train('LBP') for Local Binary Patterns(LBP) classifier, Use train('HAAR') for HAAR classifier

First it generates a positives.vec file and then begins training.

Prediction

The cascade.xml file will get created in data folder which is used for prediction in find_phone.py

The results of the x,y cordinates of a phone in an image are stored in the res.txt file. The cordinates are normalized.

Results

alt_text

Other Resutls

alt_text alt_text alt_text alt_text

About

Using HAAR and LBP Classifier for Object Detection, in this case a phone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published