Skip to content

Commit

Permalink
Toward converting in chapter 9 to JavaCV 0.8 - switch to snapshot/loc…
Browse files Browse the repository at this point in the history
…al build that have fix for javacpp-presets bug #3

bytedeco/javacpp-presets#3
  • Loading branch information
jpsacha committed May 16, 2014
1 parent cf29d10 commit 7afbd86
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
18 changes: 10 additions & 8 deletions OpenCV2_Cookbook/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ libraryDependencies ++= Seq(
ExclusionRule(organization = "org.bytedeco.javacpp-presets"),
ExclusionRule(organization = "org.bytedeco.javacpp")
),
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacvVersion) classifier "",
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacvVersion) classifier platform,
"org.bytedeco" % "javacpp" % javacppVersion,
"org.scala-lang" % "scala-swing" % scalaVersion.value,
"net.imagej" % "ij" % "1.47v",
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier "",
"org.bytedeco.javacpp-presets" % "opencv" % ("2.4.9-" + javacppVersion) classifier platform,
"org.bytedeco" % "javacpp" % javacppVersion,
"org.scala-lang" % "scala-swing" % scalaVersion.value,
"net.imagej" % "ij" % "1.47v",
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)

resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
"ImageJ Releases" at "http://maven.imagej.net/content/repositories/releases/"
"ImageJ Releases" at "http://maven.imagej.net/content/repositories/releases/",
// Use local maven repo for local javacv builds
"Local Maven Repository" at "file:///" + Path.userHome.absolutePath + "/.m2/repository"
)

autoCompilerPlugins := true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object Ex7DescribingSURF extends App {
val upright = false
val surf = new SURF(hessianThreshold, nOctaves, nOctaveLayers, extended, upright)
// val surfDesc = DescriptorExtractor.create("SURF")
val surfDesc = new DescriptorExtractor().create("SURF")
val surfDesc = DescriptorExtractor.create("SURF")
val keyPoints = Array(new KeyPoint(), new KeyPoint())
val descriptors = new Array[Mat](2)

Expand All @@ -51,7 +51,7 @@ object Ex7DescribingSURF extends App {
val matches = new DMatch()
// "match" is a keyword in Scala, to avoid conflict between a keyword and a method match of the BFMatcher,
// we need to enclose method name in ticks: `match`.
matcher.`match`(descriptors(0), descriptors(1), matches, null)
matcher.`match`(descriptors(0), descriptors(1), matches)
println("Matched: " + matches.capacity)

// Select only 25 best matches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Ex3ComputeFundamentalMatrix extends App {
drawKeyPoints(imageLeft, keypointsLeft, "Left SURF Features")

// Construction of the SURF descriptor extractor
val surfDesc = new DescriptorExtractor().create("SURF")
val surfDesc = DescriptorExtractor.create("SURF")

// Extraction of the SURF descriptors
val descriptorsRight = new Mat()
Expand All @@ -64,7 +64,7 @@ object Ex3ComputeFundamentalMatrix extends App {
val matches = new DMatch()
// "match" is a keyword in Scala, to avoid conflict between a keyword and a method match of the BFMatcher,
// we need to enclose method name in ticks: `match`.
matcher.`match`(descriptorsRight, descriptorsLeft, matches, null)
matcher.`match`(descriptorsRight, descriptorsLeft, matches)

println("Number of matched points: " + matches.capacity())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void create() throws Exception {

// Test for bug https://github.com/bytedeco/javacpp-presets/issues/3

DescriptorExtractor surfDesc = new DescriptorExtractor().create("SURF");
DescriptorExtractor surfDesc = DescriptorExtractor.create("SURF");
assertNotNull(surfDesc);
}
}

0 comments on commit 7afbd86

Please sign in to comment.