@@ -26,24 +26,24 @@ public class PlateHorizontalGraph extends Graph {
26
26
Configurator .getConfigurator ().getIntProperty ("platehorizontalgraph_detectionType" );
27
27
28
28
public float derivation (int index1 , int index2 ) {
29
- return this . yValues .elementAt (index1 ) - this . yValues .elementAt (index2 );
29
+ return yValues .elementAt (index1 ) - yValues .elementAt (index2 );
30
30
}
31
31
32
32
public Vector <Peak > findPeak () {
33
33
if (PlateHorizontalGraph .horizontalDetectionType == 1 ) {
34
- return this . findPeak_edgedetection ();
34
+ return findPeakEdgedetection ();
35
35
}
36
- return this . findPeak_derivative ();
36
+ return findPeakDerivative ();
37
37
}
38
38
39
- public Vector <Peak > findPeak_derivative () {
39
+ public Vector <Peak > findPeakDerivative () {
40
40
int a = 2 ;
41
- int b = this . yValues .size () - 1 - 2 ;
42
- float maxVal = this . getMaxValue ();
43
- while ((-this . derivation (a , a + 4 ) < (maxVal * 0.2 )) && (a < (this . yValues .size () - 2 - 2 - 4 ))) {
41
+ int b = yValues .size () - 1 - 2 ;
42
+ float maxVal = getMaxValue ();
43
+ while ((-derivation (a , a + 4 ) < (maxVal * 0.2 )) && (a < (yValues .size () - 2 - 2 - 4 ))) {
44
44
a ++;
45
45
}
46
- while ((this . derivation (b - 4 , b ) < (maxVal * 0.2 )) && (b > (a + 2 ))) {
46
+ while ((derivation (b - 4 , b ) < (maxVal * 0.2 )) && (b > (a + 2 ))) {
47
47
b --;
48
48
}
49
49
Vector <Peak > outPeaks = new Vector <Peak >();
@@ -52,19 +52,19 @@ public Vector<Peak> findPeak_derivative() {
52
52
return outPeaks ;
53
53
}
54
54
55
- public Vector <Peak > findPeak_edgedetection () {
56
- float average = this . getAverageValue ();
55
+ public Vector <Peak > findPeakEdgedetection () {
56
+ float average = getAverageValue ();
57
57
int a = 0 ;
58
- int b = this . yValues .size () - 1 ;
59
- while (this . yValues .elementAt (a ) < average ) {
58
+ int b = yValues .size () - 1 ;
59
+ while (yValues .elementAt (a ) < average ) {
60
60
a ++;
61
61
}
62
- while (this . yValues .elementAt (b ) < average ) {
62
+ while (yValues .elementAt (b ) < average ) {
63
63
b --;
64
64
}
65
65
Vector <Peak > outPeaks = new Vector <Peak >();
66
66
a = Math .max (a - 5 , 0 );
67
- b = Math .min (b + 5 , this . yValues .size ());
67
+ b = Math .min (b + 5 , yValues .size ());
68
68
outPeaks .add (new Peak (a , b ));
69
69
super .peaks = outPeaks ;
70
70
return outPeaks ;
0 commit comments