Object Detection using Template

- Main Page
- Packages
- Classes
- Files

- File List

All Classes Namespaces Files Functions Variables
SimpleSthrenghtHOGComparator.java
Go to the documentation of this file.
1 package cz.vutbr.feec.novak68.hogcomparators;
2
3 import cz.vutbr.feec.novak68.HOG;
4 import cz.vutbr.feec.novak68.hogfilters.HOGFilter;
5 import cz.vutbr.feec.novak68.hogfilters.StrengthElementFilter;
6
11 public class SimpleSthrenghtHOGComparator implements HOGComparator{
12
13 @Override
14 public double getDistance(HOG hog1, HOG hog2) {
15 return computeStrength(hog1.getCells()) - computeStrength(hog2.getCells());
16 }
17 private int computeStrength(float [][][] cells){
18 HOGFilter filter = new StrengthElementFilter();
19 float [][][] strenght = filter.filter(cells);
20 int strengthCount = 0;
21 for (int x=0; x<strenght.length;x++)
22 for(int y = 0; y<strenght[0].length; y++)
23 for (int a = 0; a <strenght[0][0].length; a++)
24 if (strenght[x][y][a] > 0)
25 strengthCount++;
26 return strengthCount;
27 }
28
29 }
cz.vutbr.feec.novak68.hogcomparators.SimpleSthrenghtHOGComparator.computeStrength
int computeStrength(float[][][] cells)
Definition: SimpleSthrenghtHOGComparator.java:17
cz.vutbr.feec.novak68.hogfilters.StrengthElementFilter
Definition: StrengthElementFilter.java:9
cz.vutbr.feec.novak68.hogcomparators.HOGComparator
Definition: HOGComparator.java:9
cz.vutbr.feec.novak68.hogcomparators.SimpleSthrenghtHOGComparator.getDistance
double getDistance(HOG hog1, HOG hog2)
Definition: SimpleSthrenghtHOGComparator.java:14
cz.vutbr.feec.novak68.HOG.getCells
float[][][] getCells()
Definition: HOG.java:345
cz.vutbr.feec.novak68.hogcomparators.SimpleSthrenghtHOGComparator
Definition: SimpleSthrenghtHOGComparator.java:11
cz.vutbr.feec.novak68.hogfilters.HOGFilter
Definition: HOGFilter.java:8
cz.vutbr.feec.novak68.HOG
Definition: HOG.java:19