@@ -54,18 +54,20 @@ public Category process(RenderedImage img){
54
54
I'm referring to this site: http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
55
55
for this. */
56
56
HoughTransform hough = new HoughTransform (img .getWidth (),
57
- img .getHeight (), .70 );
57
+ img .getHeight (), houghTolerance );
58
58
59
59
LocatedCircle circle = hough .getLargestCircle (imgData ,
60
60
img .getWidth (), img .getHeight ());
61
-
61
+
62
+ //REMOVE THESE AFTER TESTING
62
63
System .out .println (circle .getRadius ());
63
64
System .out .println ("Location: (" +circle .getX () +"," +circle .getY ()+")" );
64
65
System .out .println ("Confidence: " + circle .getConfidence ());
65
- /**
66
+
67
+ /*
66
68
* Check that the circle we're looking for is near the center.
67
69
* If it is not, then the hough transform probably found
68
- * a larger object than the one in question and failed.
70
+ * a different object than the one in question and failed.
69
71
*/
70
72
double circX = circle .getX (), circY = circle .getY ();
71
73
double confidence = circle .getConfidence ();
@@ -84,18 +86,4 @@ else if(confidence == 0)
84
86
return Category .ELLIPTICAL ;
85
87
}
86
88
87
-
88
- public static void main (String args []){
89
- if (args .length < 1 )
90
- System .exit (1 );
91
-
92
- //The last parameter is a placeholder for now
93
- HoughTransformer trans = new HoughTransformer (100 , .70 , 100.0 );
94
-
95
- try {
96
- trans .process (ImageIO .read (new File (args [0 ])));
97
- }catch (IOException e ){
98
- System .out .println (e .getMessage ());
99
- }
100
- }
101
89
}
0 commit comments