Skip to content

Commit

Permalink
Merge branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Jan 8, 2014
2 parents 57c6b2e + 68065af commit 0211c90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
12 changes: 6 additions & 6 deletions OpenCV2_Cookbook/OpenCV2_Cookbook.iml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<facet type="scala" name="Scala">
<configuration>
<option name="compilerLibraryLevel" value="Project" />
<option name="compilerLibraryName" value="Maven: org.scala-lang:scala-compiler-bundle:2.10.2" />
<option name="compilerLibraryName" value="Maven: org.scala-lang:scala-compiler-bundle:2.10.3" />
<option name="fsc" value="true" />
<option name="vmOptions" value="" />
</configuration>
Expand All @@ -24,11 +24,11 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.googlecode.javacv:javacv:linux-x86:0.5" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.10.2" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-swing:2.10.2" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacpp:javacpp:0.5" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacv:javacv:0.5" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacv:javacv:windows-x86_64:0.5" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-library:2.10.3" level="project" />
<orderEntry type="library" name="Maven: org.scala-lang:scala-swing:2.10.3" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacpp:javacpp:0.7" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacv:javacv:0.7" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.javacv:javacv:windows-x86_64:0.7" level="project" />
<orderEntry type="library" name="Maven: net.imagej:ij:1.47h" level="project" />
<orderEntry type="library" name="Maven: com.sun:tools:1.4.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
Expand Down
23 changes: 7 additions & 16 deletions OpenCV2_Cookbook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<groupId>javacv.examples</groupId>
<artifactId>opencv2-cookbook</artifactId>
<packaging>jar</packaging>
<version>0.5</version>
<version>0.7</version>
<name>OpenCV2 Cookbook Examples for JavaCV</name>
<url>https://code.google.com/p/javacv</url>
<inceptionYear>2011</inceptionYear>
Expand All @@ -26,9 +26,9 @@
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.version>2.10.2</scala.version>
<javacpp.version>0.5</javacpp.version>
<javacv.version>0.5</javacv.version>
<scala.version>2.10.3</scala.version>
<javacpp.version>0.7</javacpp.version>
<javacv.version>0.7</javacv.version>
<platform.name>${os.name}-${os.arch}</platform.name>
</properties>

Expand Down Expand Up @@ -97,20 +97,11 @@
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</version>
<version>3.1.6</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
Expand All @@ -119,7 +110,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<version>3.1</version>
<executions>
<execution>
<phase>compile</phase>
Expand All @@ -133,7 +124,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14</version>
<version>2.16</version>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ object Ex5GrabCut extends App {
// Define bounding rectangle, pixels outside this rectangle will be labeled as background.
val rectangle = new CvRect(10, 100, 380, 180)

val size = cvGetSize(image)
val result = IplImage.create(cvGetSize(image), IPL_DEPTH_8U, 1 /* channels */)
val iterCount = 5
val mode = GC_INIT_WITH_RECT

// Need to allocate arrays for temporary data
val bgdModel = new CvMat(null)
val fgdModel = new CvMat(null)

// GrabCut segmentation
grabCut(image, result, rectangle, null, null, iterCount, mode)
grabCut(image, result, rectangle, bgdModel, fgdModel, iterCount, mode)

// Extract foreground mask
cvCmpS(result, GC_PR_FGD, result, CV_CMP_EQ)
Expand Down

0 comments on commit 0211c90

Please sign in to comment.