Giter Site home page Giter Site logo

code's Introduction

code

Code repository for Packt Java OpenCV Book

https://www.packtpub.com/application-development/opencv-java-javacv

In order to setup the code, follow these instructions:

1- Setup Maven according to https://maven.apache.org/users/index.html . Make sure you check the links https://maven.apache.org/download.cgi https://maven.apache.org/install.html and https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html .

Also, make sure you download the BINARY file and not the SOURCE one.

2- Go to https://github.com/JavaOpenCVBook/code and download it to some folder (click on Download zip on the right)

3- Extract the projects from the zip file

4- Customize the desired pom.xml from the chapter according to your platform. For instance, if you want to build for Windows x64, change the desired project pom.xml file from:

<dependency>
	<groupId>org.javaopencvbook</groupId>
	<artifactId>opencvjar</artifactId>
	<version>2.4.7</version>    	     
	</dependency>

<dependency>
	<groupId>org.javaopencvbook</groupId>
	<artifactId>opencvjar-runtime</artifactId>
	<version>2.4.7</version>
	<classifier>natives-windows-x86</classifier>
</dependency>

to

<dependency>
	<groupId>org.javaopencvbook</groupId>
	<artifactId>opencvjar</artifactId>
	<version>2.4.7</version>    	     
	</dependency>

<dependency>
	<groupId>org.javaopencvbook</groupId>
	<artifactId>opencvjar-runtime</artifactId>
	<version>2.4.7</version>
	<classifier>natives-windows-x86_64</classifier>
</dependency>

or maybe natives-mac-x86_64 for 64 bit osx.

5- Import your maven project in your favorite IDE.

5-a) In Netbeans, File -> Open Project -> Browse to the project folder. Click on the Open Project button. Now, right-click the project, and select Build with dependencies. It's time to tell where the native libraries are. Right-click the project -> Properties -> Run -> VM Options -> Point java.library.path VM option to native files using the following: -Djava.library.path="C:\Users\baggio\Documents\OpenCV Offline\code\chapter2\swing-imageshow\target\natives" . Of course, you should change -Djava.library.path="C:\Users\baggio\Documents\OpenCV Offline\code\chapter2\swing-imageshow\target\natives" to your native files folder. In case Netbeans give you hard time erasing the field everytime, just shut it down and open it again. Now, run the project: Right-click it, Run.

5-b) In Eclipse, generate a project file through:

mvn eclipse::eclipse

Then, import it as an existing project in Eclipse. Before running it, check your referenced libraries and look for opencvjar-3.0.0 or opencvjar-2.4.7 and right click it -> Properties -> Native library -> Workspace -> Point it to the native file location, e.g.: histogram/target/natives . Right click your project -> Run as -> Java application -> Point to the App class, press ok and it should run.

code's People

Contributors

dannyxyz22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code's Issues

Test

testing notifications

Linux and Mac Natives

Hi, is there any platform natives -except Windows- that you put in your repository ? I tried natives-linux-x86_64 and natives-linux-x86 but couldn't reach.

New Version

Hello,

Is there any new maven dependency for the latest version of OpenCV?

Thanks

Errors

Hi,

I tried to execute the chapter1 code it didn't work. The repository you defined in the pom.xml doesn't exist anymore.

Did you find a better solution to have opencv via maven?

opencvjar-runtime v3.0.0 for MacOS does not exist

Hi
I tried to fetch opencvjar-runtime v3.0.0 for MacOS but it doesn't exist in github repo.

<dependency>
        <groupId>org.javaopencvbook</groupId>
        <artifactId>opencvjar-runtime</artifactId>
        <version>3.0.0</version>
        <classifier>natives-mac-x86_64</classifier>
    </dependency>

Issue with opencvjar-runtime

Morning

Working through your book and not able to get the first program to package via maven. Receiving the below error. Attached is the POM I am using. I am not able find a typo with what you have in the book. I also tried performing the mvn package command on the source code for the book, but getting the same error.

I am using Maven 3.5.4
Also tried Maven 3.3.9
Running from command line and from IntelliJ

Thoughts?

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-opencv-app: Could not resolve dependencies for project com.widgetech.app:my-opencv-app:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.javaopencvbook:opencvjar-runtime:jar:natives-windows-x86_64:3.0.0: Failed to read artifact descriptor for org.javaopencvbook:opencvjar-runtime:jar:natives-windows-x86_64:3.0.0: Could not transfer artifact org.javaopencvbook:opencvjar-runtime:pom:3.0.0 from/to widget-snapshots (http://localhost:8081/nexus/content/repositories/snapshots): Connect to localhost:8081 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect -> [Help 1]
[ERROR]
pom.txt

how about amd-x64 platform in windows?

Is there an existed version for amd-64 dll with maven install.
like:

org.javaopencvbook
opencvjar-runtime
3.0.0
natives-windows-x64

or
i could run x32 in x64 platform?

but i get an error :
Can't load IA 32-bit .dll on a AMD 64-bit platform.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.