Commit a719a6f1 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #7368 from berak:py_tutorials_fix

parents 991c41c8 c2513ffb
...@@ -61,7 +61,7 @@ img = cv2.imread('simple.jpg',0) ...@@ -61,7 +61,7 @@ img = cv2.imread('simple.jpg',0)
star = cv2.xfeatures2d.StarDetector_create() star = cv2.xfeatures2d.StarDetector_create()
# Initiate BRIEF extractor # Initiate BRIEF extractor
brief = cv2.BriefDescriptorExtractor_create() brief = cv2.xfeatures2d.BriefDescriptorExtractor_create()
# find the keypoints with STAR # find the keypoints with STAR
kp = star.detect(img,None) kp = star.detect(img,None)
...@@ -69,10 +69,10 @@ kp = star.detect(img,None) ...@@ -69,10 +69,10 @@ kp = star.detect(img,None)
# compute the descriptors with BRIEF # compute the descriptors with BRIEF
kp, des = brief.compute(img, kp) kp, des = brief.compute(img, kp)
print brief.getInt('bytes') print brief.descriptorSize()
print des.shape print des.shape
@endcode @endcode
The function brief.getInt('bytes') gives the \f$n_d\f$ size used in bytes. By default it is 32. Next one The function brief.getDescriptorSize() gives the \f$n_d\f$ size used in bytes. By default it is 32. Next one
is matching, which will be done in another chapter. is matching, which will be done in another chapter.
Additional Resources Additional Resources
......
...@@ -108,15 +108,15 @@ kp = fast.detect(img,None) ...@@ -108,15 +108,15 @@ kp = fast.detect(img,None)
img2 = cv2.drawKeypoints(img, kp, None, color=(255,0,0)) img2 = cv2.drawKeypoints(img, kp, None, color=(255,0,0))
# Print all default params # Print all default params
print "Threshold: ", fast.getInt('threshold') print "Threshold: ", fast.getThreshold()
print "nonmaxSuppression: ", fast.getBool('nonmaxSuppression') print "nonmaxSuppression: ", fast.getNonmaxSuppression()
print "neighborhood: ", fast.getInt('type') print "neighborhood: ", fast.getType()
print "Total Keypoints with nonmaxSuppression: ", len(kp) print "Total Keypoints with nonmaxSuppression: ", len(kp)
cv2.imwrite('fast_true.png',img2) cv2.imwrite('fast_true.png',img2)
# Disable nonmaxSuppression # Disable nonmaxSuppression
fast.setBool('nonmaxSuppression',0) fast.setNonmaxSuppression(0)
kp = fast.detect(img,None) kp = fast.detect(img,None)
print "Total Keypoints without nonmaxSuppression: ", len(kp) print "Total Keypoints without nonmaxSuppression: ", len(kp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment