Change SURF to ORB in Java-Sbt sample to remove dependency on external non-free modules
This commit is contained in:
parent
b484f377dd
commit
319b6a447f
@ -21,8 +21,8 @@ object ScalaCorrespondenceMatchingDemo {
|
|||||||
def detectAndExtract(mat: Mat) = {
|
def detectAndExtract(mat: Mat) = {
|
||||||
// A special container class for KeyPoint.
|
// A special container class for KeyPoint.
|
||||||
val keyPoints = new MatOfKeyPoint
|
val keyPoints = new MatOfKeyPoint
|
||||||
// We're using the SURF detector.
|
// We're using the ORB detector.
|
||||||
val detector = FeatureDetector.create(FeatureDetector.SURF)
|
val detector = FeatureDetector.create(FeatureDetector.ORB)
|
||||||
detector.detect(mat, keyPoints)
|
detector.detect(mat, keyPoints)
|
||||||
|
|
||||||
println(s"There were ${keyPoints.toArray.size} KeyPoints detected")
|
println(s"There were ${keyPoints.toArray.size} KeyPoints detected")
|
||||||
@ -34,8 +34,8 @@ object ScalaCorrespondenceMatchingDemo {
|
|||||||
// arguments.
|
// arguments.
|
||||||
val bestKeyPoints: MatOfKeyPoint = new MatOfKeyPoint(sorted: _*)
|
val bestKeyPoints: MatOfKeyPoint = new MatOfKeyPoint(sorted: _*)
|
||||||
|
|
||||||
// We're using the SURF descriptor.
|
// We're using the ORB descriptor.
|
||||||
val extractor = DescriptorExtractor.create(DescriptorExtractor.SURF)
|
val extractor = DescriptorExtractor.create(DescriptorExtractor.ORB)
|
||||||
val descriptors = new Mat
|
val descriptors = new Mat
|
||||||
extractor.compute(mat, bestKeyPoints, descriptors)
|
extractor.compute(mat, bestKeyPoints, descriptors)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user