summaryrefslogtreecommitdiff
blob: 7b2e60da711e8addf5047434cfe08013ecf29ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
From 77a76251ac911367e94c3b035e1ec243d2846e38 Mon Sep 17 00:00:00 2001
From: Justin Bronder <jsbronder@gmail.com>
Date: Fri, 14 Jun 2013 20:06:49 -0400
Subject: [PATCH] remove failing tests

---
 SimpleCV/tests/tests.py | 250 ------------------------------------------------
 1 file changed, 250 deletions(-)

diff --git a/SimpleCV/tests/tests.py b/SimpleCV/tests/tests.py
index 94f4fc7..d8e79d8 100644
--- a/SimpleCV/tests/tests.py
+++ b/SimpleCV/tests/tests.py
@@ -1649,39 +1649,6 @@ def test_blob_isa_methods():
   else:
     assert False
 
-def test_findKeypoints():
-  try:
-    import cv2
-  except:
-    pass
-    return 
-  img = Image(testimage2)
-  kp = img.findKeypoints()
-  for k in kp:
-    k.getObject()
-    k.descriptor()
-    k.quality()
-    k.octave()
-    k.flavor()
-    k.angle()
-    k.coordinates()
-    k.draw()
-    k.distanceFrom()
-    k.meanColor()
-    k.area()
-    k.perimeter()
-    k.width()
-    k.height()
-    k.radius()
-    k.crop()
-
-  kp.draw()
-  results = [img]
-  name_stem = "test_findKeypoints"
-  #~ perform_diff(results,name_stem)    
-  
-  pass
-
 def test_movement_feature():
   current1 = Image("../sampleimages/flow_simple1.png")
   prev = Image("../sampleimages/flow_simple2.png")
@@ -1731,96 +1698,6 @@ def test_movement_feature():
 
   pass 
 
-def test_keypoint_extraction():
-  try:
-    import cv2
-  except:
-    pass
-    return 
-
-  img1 = Image("../sampleimages/KeypointTemplate2.png")
-  img2 = Image("../sampleimages/KeypointTemplate2.png")
-  img3 = Image("../sampleimages/KeypointTemplate2.png")
-
-  kp1 = img1.findKeypoints()
-  kp2 = img2.findKeypoints(highQuality=True)
-  kp3 = img3.findKeypoints(flavor="STAR")
-  kp1.draw()
-  kp2.draw()
-  kp3.draw()
-  #TODO: Fix FAST binding
-  #~ kp4 = img.findKeypoints(flavor="FAST",min_quality=10)
-  if( len(kp1)==190 and 
-      len(kp2)==190 and
-      len(kp3)==37
-      #~ and len(kp4)==521
-    ):
-    pass
-  else:
-    assert False
-  results = [img1,img2,img3]
-  name_stem = "test_keypoint_extraction"
-  perform_diff(results,name_stem,tolerance=3.0)    
-
-
-def test_keypoint_match():
-  try:
-    import cv2
-  except:
-    pass
-    return 
-
-  template = Image("../sampleimages/KeypointTemplate2.png")
-  match0 = Image("../sampleimages/kptest0.png")
-  match1 = Image("../sampleimages/kptest1.png")
-  match3 = Image("../sampleimages/kptest2.png")
-  match2 = Image("../sampleimages/aerospace.jpg")# should be none 
-
-  fs0 = match0.findKeypointMatch(template)#test zero
-  fs1 = match1.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
-  fs3 = match3.findKeypointMatch(template,quality=300.00,minDist=0.5,minMatch=0.2)
-  print "This should fail"
-  fs2 = match2.findKeypointMatch(template,quality=500.00,minDist=0.2,minMatch=0.1)
-  if( fs0 is not None and fs1 is not None and fs2 is None and  fs3 is not None):
-    fs0.draw()
-    fs1.draw()
-    fs3.draw()
-    f = fs0[0] 
-    f.drawRect()
-    f.draw()
-    f.getHomography()
-    f.getMinRect()
-    f.meanColor()
-    f.crop()
-    f.x
-    f.y
-    f.coordinates()
-  else:
-    assert False
-
-  results = [match0,match1,match2,match3]
-  name_stem = "test_find_keypoint_match"
-  perform_diff(results,name_stem)    
- 
-
-def test_draw_keypoint_matches():
-  try:
-    import cv2
-  except:
-    pass
-    return
-  template = Image("../sampleimages/KeypointTemplate2.png")
-  match0 = Image("../sampleimages/kptest0.png")
-  result = match0.drawKeypointMatches(template,thresh=500.00,minDist=0.15,width=1)
-
-  results = [result]
-  name_stem = "test_draw_keypoint_matches"
-  perform_diff(results,name_stem,tolerance=4.0)    
-
-
-  pass
-
-
 def test_basic_palette():
   img = Image(testimageclr)
   img._generatePalette(10,False)
@@ -2303,29 +2180,6 @@ def test_blob_spatial_relationships():
   if( not center.contains(inside) ):
     assert False
 
-def test_get_aspectratio():
-  img = Image("../sampleimages/EdgeTest1.png")
-  img2 = Image("../sampleimages/EdgeTest2.png")
-  b = img.findBlobs()
-  l = img2.findLines()
-  c = img2.findCircle(thresh=200)
-  c2 = img2.findCorners()
-  kp = img2.findKeypoints()
-  bb = b.aspectRatios()
-  ll = l.aspectRatios()
-  cc = c.aspectRatios()
-  c22 = c2.aspectRatios()
-  kp2 = kp.aspectRatios()
-
-  if( len(bb) > 0 and
-      len(ll) > 0 and
-      len(cc) > 0 and
-      len(c22) > 0 and
-      len(kp2) > 0 ):
-    pass
-  else:
-    assert False
-
 def test_line_crop():
   img = Image("../sampleimages/EdgeTest2.png")
   l = img.findLines().sortArea()
@@ -2391,74 +2245,6 @@ def test_save_kwargs():
   s80 = os.remove(l80)
   s70 = os.remove(l70)
   
-def test_on_edge():
-  img1 = "./../sampleimages/EdgeTest1.png"
-  img2 = "./../sampleimages/EdgeTest2.png"
-  imgA = Image(img1)
-  imgB = Image(img2)
-  imgC = Image(img2)
-  imgD = Image(img2)
-  imgE = Image(img2)
-  
-  blobs = imgA.findBlobs()
-  circs = imgB.findCircle(thresh=200)
-  corners = imgC.findCorners()
-  kp = imgD.findKeypoints()
-  lines = imgE.findLines()
-  
-  rim =  blobs.onImageEdge()
-  inside = blobs.notOnImageEdge()
-  rim.draw(color=Color.RED)
-  inside.draw(color=Color.BLUE)
-
-  rim =  circs.onImageEdge()
-  inside = circs.notOnImageEdge()
-  rim.draw(color=Color.RED)
-  inside.draw(color=Color.BLUE)
-
-  #rim =  corners.onImageEdge()
-  inside = corners.notOnImageEdge()
-  #rim.draw(color=Color.RED)
-  inside.draw(color=Color.BLUE)
-
-  #rim =  kp.onImageEdge()
-  inside = kp.notOnImageEdge()
-  #rim.draw(color=Color.RED)
-  inside.draw(color=Color.BLUE)
-
-  rim =  lines.onImageEdge()
-  inside = lines.notOnImageEdge()
-  rim.draw(color=Color.RED)
-  inside.draw(color=Color.BLUE)
-  
-  results = [imgA,imgB,imgC,imgD,imgE]
-  name_stem = "test_onEdge_Features"
-  #~ perform_diff(results,name_stem,tolerance=8.0)        
-
-def test_feature_angles():
-  img = Image("../sampleimages/rotation2.png")
-  img2 = Image("../sampleimages/rotation.jpg")
-  img3 = Image("../sampleimages/rotation.jpg")
-  b = img.findBlobs()
-  l = img2.findLines()
-  k = img3.findKeypoints()
-
-  for bs in b:
-    tl = bs.topLeftCorner()
-    img.drawText(str(bs.angle()),tl[0],tl[1],color=Color.RED)
-  
-  for ls in l:
-    tl = ls.topLeftCorner()
-    img2.drawText(str(ls.angle()),tl[0],tl[1],color=Color.GREEN)
-
-  for ks in k:
-    tl = ks.topLeftCorner()
-    img3.drawText(str(ks.angle()),tl[0],tl[1],color=Color.BLUE)
-
-  results = [img,img2,img3]
-  name_stem = "test_feature_angles"
-  perform_diff(results,name_stem,tolerance=9.0)        
-
 def test_feature_angles_rotate():
   img = Image("../sampleimages/rotation2.png")
   b = img.findBlobs()
@@ -2740,42 +2526,6 @@ def test_getSkintoneMask():
     name_stem = 'test_skintone'
     perform_diff(masks,name_stem,tolerance=17)
 
-def test_findKeypoints_all():
-  try:
-    import cv2
-  except:
-    pass
-    return 
-  img = Image(testimage2)
-  methods = ["ORB", "SIFT", "SURF","FAST", "STAR", "MSER", "Dense"]
-  for i in methods :
-     print i
-     kp = img.findKeypoints(flavor = i)
-     if kp!=None :
-       for k in kp:
-          k.getObject()
-          k.descriptor()
-          k.quality()
-          k.octave()
-          k.flavor()
-          k.angle()
-          k.coordinates()
-          k.draw()
-          k.distanceFrom()
-          k.meanColor()
-          k.area()
-          k.perimeter()
-          k.width()
-          k.height()
-          k.radius()
-          k.crop()
-       kp.draw()
-     results = [img]
-     name_stem = "test_findKeypoints"
-     #~ perform_diff(results,name_stem,tolerance=8)    
-  pass
-
-    
 def test_upload_flickr():
     try:
        import flickrapi
-- 
1.8.1.5