Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
An example of keypoint detection using SimpleCV.
from SimpleCV import Image, Color, Display
# load an image from imgur
img = Image('http://i.imgur.com/lfAeZ4n.png')
# use a keypoint detector to find areas of interest
feats = img.findKeypoints()
# draw the list of keypoints
feats.draw(color=Color.RED)
# show the resulting image.
img.show()
# apply the stuff we found to the image.
output = img.applyLayers()
# save the results.
output.save('juniperfeats.png')
@muroshi

This comment has been minimized.

Show comment Hide comment
@muroshi

muroshi May 25, 2014

I receive:
Fatal Python error: (pygame parachute) Segmentation Fault [Finished in 1.2s with exit code -6]

muroshi commented May 25, 2014

I receive:
Fatal Python error: (pygame parachute) Segmentation Fault [Finished in 1.2s with exit code -6]

@tyoc213

This comment has been minimized.

Show comment Hide comment
@tyoc213

tyoc213 Jun 30, 2014

TypeError                                 Traceback (most recent call last)
C:\Python27\lib\site-packages\SimpleCV\Shell\Shell.pyc in <module>()
      3 img = Image('http://i.imgur.com/lfAeZ4n.png')
      4 # use a keypoint detector to find areas of interest
----> 5 feats = img.findKeypoints()
      6 # draw the list of keypoints
      7 feats.draw(color=Color.RED)

C:\Python27\lib\site-packages\SimpleCV\ImageClass.pyc in findKeypoints(self, min_quality, flavor, highQuality)
   7748             kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=1)
   7749         else:
-> 7750             kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=0)
   7751
   7752         if( flavor in ["ORB", "SIFT", "SURF"]  and kp!=None and d !=None ):

C:\Python27\lib\site-packages\SimpleCV\ImageClass.pyc in _getRawKeypoints(self, thresh, flavor, highQuality, forceReset)
   7344                     #mask = self.getGrayNumpy()
   7345                     #mask.fill(255)
-> 7346                     self._mKeyPoints,self._mKPDescriptors = surfer.detect(self.getGrayNumpy(),None,useProvidedKeypoints = False)
   7347                     if( len(self._mKPDescriptors) == 0 ):
   7348                         return None, None

TypeError: FeatureDetector.detect() takes at most 2 arguments (3 given)

tyoc213 commented Jun 30, 2014

TypeError                                 Traceback (most recent call last)
C:\Python27\lib\site-packages\SimpleCV\Shell\Shell.pyc in <module>()
      3 img = Image('http://i.imgur.com/lfAeZ4n.png')
      4 # use a keypoint detector to find areas of interest
----> 5 feats = img.findKeypoints()
      6 # draw the list of keypoints
      7 feats.draw(color=Color.RED)

C:\Python27\lib\site-packages\SimpleCV\ImageClass.pyc in findKeypoints(self, min_quality, flavor, highQuality)
   7748             kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=1)
   7749         else:
-> 7750             kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=0)
   7751
   7752         if( flavor in ["ORB", "SIFT", "SURF"]  and kp!=None and d !=None ):

C:\Python27\lib\site-packages\SimpleCV\ImageClass.pyc in _getRawKeypoints(self, thresh, flavor, highQuality, forceReset)
   7344                     #mask = self.getGrayNumpy()
   7345                     #mask.fill(255)
-> 7346                     self._mKeyPoints,self._mKPDescriptors = surfer.detect(self.getGrayNumpy(),None,useProvidedKeypoints = False)
   7347                     if( len(self._mKPDescriptors) == 0 ):
   7348                         return None, None

TypeError: FeatureDetector.detect() takes at most 2 arguments (3 given)
@cletrix

This comment has been minimized.

Show comment Hide comment
@cletrix

cletrix Nov 7, 2014

I receive too:

TypeError: FeatureDetector.detect() takes at most 2 arguments (3 given)

If someone has any ideas please post here , thanks.

cletrix commented Nov 7, 2014

I receive too:

TypeError: FeatureDetector.detect() takes at most 2 arguments (3 given)

If someone has any ideas please post here , thanks.

@sodle

This comment has been minimized.

Show comment Hide comment
@sodle

sodle Jan 12, 2016

I receive:

ERROR: 
Traceback (most recent call last):
  File "canny_example.py", line 5, in <module>
    feats = img.findKeypoints()
  File "/usr/lib/python2.7/site-packages/SimpleCV/ImageClass.py", line 7750, in findKeypoints
    kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=0)
  File "/usr/lib/python2.7/site-packages/SimpleCV/ImageClass.py", line 7343, in _getRawKeypoints
    surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
AttributeError: 'module' object has no attribute 'SURF'

sodle commented Jan 12, 2016

I receive:

ERROR: 
Traceback (most recent call last):
  File "canny_example.py", line 5, in <module>
    feats = img.findKeypoints()
  File "/usr/lib/python2.7/site-packages/SimpleCV/ImageClass.py", line 7750, in findKeypoints
    kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=0)
  File "/usr/lib/python2.7/site-packages/SimpleCV/ImageClass.py", line 7343, in _getRawKeypoints
    surfer = cv2.SURF(hessianThreshold=thresh,extended=highQuality,upright=1)
AttributeError: 'module' object has no attribute 'SURF'
@wilkic

This comment has been minimized.

Show comment Hide comment
@wilkic

wilkic Jul 10, 2016

On line5: feats = img.findKeypoints() I get a seg fault:

Using ipdb, I've traced it down to
/usr/local/lib/python2.7/dist-packages/SimpleCV/ImageClass.py(1942)getGrayNumpy() 1941 -> 1942 return self._grayNumpy

which then yields:
Fatal Python error: (pygame parachute) Segmentation Fault Aborted (core dumped)

The numpy array looked fine prior to returning it, so not sure why it faulted. Has anyone else encountered this before?

wilkic commented Jul 10, 2016

On line5: feats = img.findKeypoints() I get a seg fault:

Using ipdb, I've traced it down to
/usr/local/lib/python2.7/dist-packages/SimpleCV/ImageClass.py(1942)getGrayNumpy() 1941 -> 1942 return self._grayNumpy

which then yields:
Fatal Python error: (pygame parachute) Segmentation Fault Aborted (core dumped)

The numpy array looked fine prior to returning it, so not sure why it faulted. Has anyone else encountered this before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment