Skip to content

Commit

Permalink
fix example: match_keypoints (opencv3.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Duda authored and Alexander Duda committed Jan 7, 2015
1 parent f9f0db2 commit a909e79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/match_keypoints.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
require 'ropencv'
include OpenCV

img1 = cv::imread(File.join('data','tsukuba_l.png'),CV_LOAD_IMAGE_GRAYSCALE)
img2 = cv::imread(File.join('data','tsukuba_r.png'),CV_LOAD_IMAGE_GRAYSCALE)
img1 = cv::imread(File.join('data','tsukuba_l.png'),cv::IMREAD_GRAYSCALE)
img2 = cv::imread(File.join('data','tsukuba_r.png'),cv::IMREAD_GRAYSCALE)
if (img1.empty() || img2.empty())
puts("Can't read one of the images\n")
return -1
end

keypoints1=Vector.new(cv::KeyPoint)
keypoints2=Vector.new(cv::KeyPoint)
detector = cv::FeatureDetector::create('SURF')
detector = cv::FastFeatureDetector::create
detector.detect(img1, keypoints1)
detector.detect(img2, keypoints2)

# computing descriptors
extractor=cv::DescriptorExtractor::create('SURF')
extractor = cv::ORB.create
descriptors2=cv::Mat.new(3, 4, cv::CV_64FC1)
descriptors1=cv::Mat.new(3, 4, cv::CV_64FC1)
extractor.compute(img1, keypoints1, descriptors1)
Expand Down

0 comments on commit a909e79

Please sign in to comment.