-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
58 lines (39 loc) · 1.91 KB
/
README
File metadata and controls
58 lines (39 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Background:
This project implements an image classifier based on the UW paper
A Generative/Discriminative Learning Algorithm for Image Classification.
See: http://homes.cs.washington.edu/~shapiro/iccv2005.pdf
This was originally implemented for a UW grad class in computer vision.
An overview of the project and results can be found here:
https://github.com/catphive/image_classifier/blob/master/report.pdf
Slides for a presentation on the project can be found here:
https://github.com/catphive/image_classifier/blob/master/slides.pdf
Prerequisites:
0. POSIX.
1. GNU Make.
2. G++ 4.6 or better.
3. OpenCV 2.4.1 installed in /opt/opencv
Note that this version is important. Earlier versions of opencv had
a nasty bug in the EM implementation that would zero out the
covariance matrix in some situations.
My executable is currently hardcoded to find opencv in the
/opt/opencv directory (though this can be edited in the makefile by
adjusting the -I and -R paths).
Download opencv from here:
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.1/
To install opencv follow these steps.
cd ~/<your_working_dir>/opencv # the directory should contain CMakeLists.txt, INSTALL etc.
mkdir release # create the output directory
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/opt/opencv ..
Running:
Extract .jpg images of each class into separate directories.
Assuming you have separate directories of images of bikes, faces,
planes, and cars you can run the object recognition program like this:
./objrec bikes faces places cars
and it will use "bikes" as the positive image set, and the rest as the
negative. It will train a classifier, test it, and then report the
results.
To restrict the program to only using a specific kind of feature pass
a -f flag to the program.
-f 0 means only use SIFT and -f 1 means only use color. By default all
feature types are used.