Object Detection using Template

- Main Page
- Packages
- Classes
- Files

- File List

All Classes Namespaces Files Functions Variables
SimpleHOGbinExtractor.java
Go to the documentation of this file.
1 package cz.vutbr.feec.novak68.extractors;
2
3 import cz.vutbr.feec.novak68.HOG;
4
9 public class SimpleHOGbinExtractor {
10
11 private int threshold;
12 public SimpleHOGbinExtractor() {
13 this(1000);
14 }
15
19 public SimpleHOGbinExtractor(int threshold) {
20 this.threshold = threshold;
21 // this.output = writer;
22 }
23
28 public String extractProperies(HOG hogTest) {
29 // hogTest = new HOG(new ImagePlus("Resized", img.getProcessor().resize(
30 // width)), cellSizeX, cellSizeY, numOfBins);
31 // hogTest.compute();
32
33 int [] bins = computeBinCount(hogTest, threshold);
34
35 StringBuilder finStr = new StringBuilder();
36 // finStr.append("\"" + folder + "\"");
37 // finStr.append(", ");
38 // finStr.append("\"" + img.getTitle() + "\"");
39 for (int i = 0 ; i < (bins.length); i++)
40 {
41 finStr.append(bins[i]);
42 finStr.append(", ");
43 }
44 return finStr.toString();
45 // output.write(finStr.toString());
46 // output.newLine();
47 // output.flush();
48
49 }
50
56 private int [] computeBinCount (HOG hog, int threshold){
57 int [] binCount = new int [hog.getCells()[0][0].length];
58 for (int x = 0; x < hog.getCells().length;x++)
59 for (int y = 0; y < hog.getCells()[0].length; y++)
60 for (int a = 0; a <binCount.length; a++)
61 {
62 binCount[a] += ((hog.getCells()[x][y][a] > threshold) ? 1 : 0);
63 }
64 return binCount;
65 }
66
67 }
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor.SimpleHOGbinExtractor
SimpleHOGbinExtractor(int threshold)
Definition: SimpleHOGbinExtractor.java:19
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor.extractProperies
String extractProperies(HOG hogTest)
Definition: SimpleHOGbinExtractor.java:28
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor.threshold
int threshold
Definition: SimpleHOGbinExtractor.java:11
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor
Definition: SimpleHOGbinExtractor.java:9
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor.SimpleHOGbinExtractor
SimpleHOGbinExtractor()
Definition: SimpleHOGbinExtractor.java:12
cz.vutbr.feec.novak68.extractors.SimpleHOGbinExtractor.computeBinCount
int[] computeBinCount(HOG hog, int threshold)
Definition: SimpleHOGbinExtractor.java:56
cz.vutbr.feec.novak68.HOG
Definition: HOG.java:19