Object Detection using Template

- Main Page
- Packages
- Classes
- Files

- File List

All Classes Namespaces Files Functions Variables
GetProperties.java
Go to the documentation of this file.
1 package cz.vutbr.feec.novak68;
2
3 import ij.ImagePlus;
4
5 import java.io.BufferedWriter;
6 import java.io.File;
7 import java.io.FileWriter;
8 import java.io.IOException;
9
10 import cz.vutbr.feec.novak68.extractors.SimpleHogPropertyExtractor;
11
16 public class GetProperties {
17 public static void main(String[] args) throws IOException {
18
19 String file = "out_variance.txt";
20 int width = 120;
21 int threshold = 1000;
22 int cellSizeX = 12;
23 int cellSizeY = 12;
24 int numOfBins = 6;
25 File folder;
26 File[] listOfFiles;
27
28 BufferedWriter writer = new BufferedWriter(new FileWriter(file));
29 //width, cellsizeX, cellSizeY, numOfBins, threshold,filewriter
30 SimpleHogPropertyExtractor extractor = new SimpleHogPropertyExtractor(width, cellSizeX,cellSizeY,numOfBins,threshold,writer);
31
32 folder = new File("./data/pedestrian/test/positive/");
33 listOfFiles = folder.listFiles();
34 // createHeader(writer, true);
35 for (File image : listOfFiles) {
36 if (image.isFile()) {
37 extractor.extractProperies(new ImagePlus("./data/pedestrian/test/positive/" + image.getName()),'p');
38 }
39 }
40
41 folder = new File("./data/pedestrian/test/negative/");
42 listOfFiles = folder.listFiles();
43 // createHeader(writer, false);
44 for (File image : listOfFiles) {
45 if (image.isFile()) {
46 extractor.extractProperies(new ImagePlus("./data/pedestrian/test/negative/" + image.getName()),'n');
47 }
48 }
49 }
55 private static void createHeader(BufferedWriter writer, boolean pOrN) throws IOException{
56 //writer.write("label; filename; ");
57 // if (pOrN)
58 // writer.write("Positive folder");
59 // else
60 // writer.write("Negative folder");
61 writer.flush();
62 //writer.write("========================================================");
63 // writer.newLine();
64 writer.flush();
65 }
66
67 }
cz.vutbr.feec.novak68.GetProperties
Definition: GetProperties.java:16
cz.vutbr.feec.novak68.GetProperties.main
static void main(String[] args)
Definition: GetProperties.java:17
cz.vutbr.feec.novak68.extractors.SimpleHogPropertyExtractor
Definition: SimpleHogPropertyExtractor.java:27
cz.vutbr.feec.novak68.GetProperties.createHeader
static void createHeader(BufferedWriter writer, boolean pOrN)
Definition: GetProperties.java:55