JavaOpenCVBook/code

how about amd-x64 platform in windows?

Closed this issue · 26 comments

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.

Sure, use

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

In your pom.xml
Please, notice the x86_64.
It should work.
I believe that if you have 32bit JRE, it should work with the x32 version.

"
org.javaopencvbook
opencvjar-runtime
3.0.0
natives-windows-x86_64
"

'''

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

'''

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

thank you

Hi, have some code issues in Computervision with Java . Background project in chap.6, App.java. Netbeans generates errors. 1. Error : incompatible types, MixtureOfGaussianBackground cannot be converted to VideoProcessorBackground (videoProcessor = new MixtureOfGaussianBackground();)
2. Error: cannot find symbol method process(Mat) (foregroundImage = videoProcessor.process(currentImage);) can you please help me? All other code works fine.

Hi. Would you mind opening another thread for this issue? It might happen that people get updated about the other topic.

Well, regarding your problem, that's weird, because class MixtureOfGaussianBackground implements the VideoProcessor interface... like this:
public class MixtureOfGaussianBackground implements VideoProcessor

It could be a typing error... you said it cannot be converted to VideoProcessorBackground.
But line 63 states:
VideoProcessor videoProcessor;
and not
VideoProcessorBackground videoProcessor;
Are you sure you got that line correct?
I believe error 2 is related to this one, so if you correct that, this one will be done.
Please, check that.
Kind regards,
Daniel

Hi, in the first picture you can see how the original source for app.java
looks. The constructor-bit for MixtureOfGaussian looks Strange and
generated error. In the second picture you can see how I altered the
source code to make it run. As I made my own import-statements to point to
my folder structure and adding the background suffix where appropriate
, the Videoprocess Class has suffix of background as its part of the the
background project. The projects now runs.

Den tirsdag 24. mai 2016 skrev Daniel Lélis Baggio notifications@github.com
følgende:

Hi. Would you mind opening another thread for this issue? It might happen
that people get updated about the other topic.

Well, regarding your problem, that's weird, because class
MixtureOfGaussianBackground implements the VideoProcessor interface... like
this:
public class MixtureOfGaussianBackground implements VideoProcessor

It could be a typing error... you said it cannot be converted to
VideoProcessorBackground.
But line 63 states:
VideoProcessor videoProcessor;
and not
VideoProcessor_Background_ videoProcessor;
Are you sure you got that line correct?
I believe error 2 is related to this one, so if you correct that, this one
will be done.
Please, check that.
Kind regards,
Daniel


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)

Hi.
I can't see the pictures.
Can you post them again, please?
I find it weird that it wasn't compiling.

Im trying again, here they are.

Den tirsdag 24. mai 2016 skrev Daniel Lélis Baggio notifications@github.com
følgende:

Hi.
I can't see the pictures.
Can you post them again, please?
I find it weird that it wasn't compiling.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)

Well, they still haven't come...
Either way, the code from the book goes like this:
https://github.com/JavaOpenCVBook/code/blob/master/chapter6/background/src/main/java/org/javaopencvbook/App.java

private void runMainLoop(String[] args) throws InterruptedException {
        ImageProcessor imageProcessor = new ImageProcessor();
        Image tempImage;        
        VideoProcessor videoProcessor;
        VideoCapture capture = new VideoCapture("src/main/resources/videos/tree.avi");

        if( capture.isOpened()){

            capture.read(backgroundImage);

            //videoProcessor = new AbsDifferenceBackground(backgroundImage);
            //videoProcessor = new RunningAverageBackground();
            videoProcessor = new MixtureOfGaussianBackground();

You can create a reference to the VideoProcessor interface like this:

VideoProcessor videoProcessor;

you will only instantiate the object whose class implements the VideoProcessor interface afterwards, like this:

videoProcessor = new MixtureOfGaussianBackground();

Of course, you can also write it all in a single sentence, like you said:

VideoProcesso videoProcessor = new MixtureOfGaussianBackground();

or

VideoProcessorBackground videoProcessor = new MixtureOfGaussianBackground();

Both approaches should work.

Ok, thank you so much, I appreciate the help very much.

Den onsdag 25. mai 2016 skrev Daniel Lélis Baggio notifications@github.com
følgende:

Well, they still haven't come...
Either way, the code from the book goes like this:

https://github.com/JavaOpenCVBook/code/blob/master/chapter6/background/src/main/java/org/javaopencvbook/App.java

private void runMainLoop(String[] args) throws InterruptedException {
ImageProcessor imageProcessor = new ImageProcessor();
Image tempImage;
VideoProcessor videoProcessor;
VideoCapture capture = new VideoCapture("src/main/resources/videos/tree.avi");

    if( capture.isOpened()){

        capture.read(backgroundImage);

        //videoProcessor = new AbsDifferenceBackground(backgroundImage);
        //videoProcessor = new RunningAverageBackground();
        videoProcessor = new MixtureOfGaussianBackground();

You can create a reference to the VideoProcessor interface like this:

VideoProcessor videoProcessor;

you will only instantiate the object whose class implements the
VideoProcessor interface afterwards, like this:

videoProcessor = new MixtureOfGaussianBackground();

Of course, you can also write it all in a single sentence, like you said:

VideoProcesso videoProcessor = new MixtureOfGaussianBackground();

or

VideoProcessorBackground videoProcessor = new
MixtureOfGaussianBackground();

Both approaches should work.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)

You are welcome.

Thanks for checking up the code =)

Kind regards,
Daniel

=)

Den onsdag 25. mai 2016 skrev Daniel Lélis Baggio notifications@github.com
følgende:

You are welcome.

Thanks for checking up the code =)

Kind regards,
Daniel


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#3 (comment)

Am trying to run maven project with:

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

And it says that maven dependency not found , any help ?

I believe this is probably because you haven't added the OpenCVBook repository, like this:

<repositories>
    <repository>
        <id>javaopencvbook</id>
        <url>https://raw.github.com/JavaOpenCVBook/code/maven2/</url>
    </repository>
</repositories>

Can you send us your full pom.xml to check that?
Also, can you copy and paste the maven output?

Kind regards,
Daniel

Problem with

org.javaopencvbook
opencvjar-runtime
2.4.7
natives-windows-x86_64

As I am trying to use it on Mac , could you help or provide any other maven dependancy I could use ?

screen shot 2016-06-24 at 09 15 17

And one more image with mac native:
Also I tried changing to different versions
screen shot 2016-06-24 at 09 29 28

And output from mvn
screen shot 2016-06-24 at 09 54 46

Hi Vasilij,

actually, there aren't mac natives for 2.4.7.
You can use the 2.4.8 version:
2.4.8-natives-mac-x86_64.jar
https://github.com/JavaOpenCVBook/code/blob/maven2/org/javaopencvbook/opencvjar-runtime/2.4.8/opencvjar-runtime-2.4.8-natives-mac-x86_64.jar
I can't test right now, but changing your versions of opencvjar and
opencvjar-runtime to

2.4.8
should work.
You can browse available files here:
https://github.com/JavaOpenCVBook/code/tree/maven2/org/javaopencvbook/opencvjar-runtime

If you could provide the 3.0.0 mac runtimes I can put them on the server as
well.

Please, write back in case it works or not.

Kind regards,
Daniel

On Fri, Jun 24, 2016 at 5:55 AM, VasilijSviridov notifications@github.com
wrote:

And output from mvn
[image: screen shot 2016-06-24 at 09 54 46]
https://cloud.githubusercontent.com/assets/12127198/16333182/cabb61be-39f1-11e6-9c4f-f1451d20186c.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADcs62n3gUtUZRoWxk2jVSr5bI01pcBks5qO5uJgaJpZM4H10LS
.

Hi,
Give me some time to test it.

Sincerely

Well after adding it to mvn it still red on pom file
Moreover when I am trying to launch it via jenkins maven, it gives me an error with:
java.lang.UnsatisfiedLinkError: no opencv_java248 in java.library.path

Any help guys ?

screen shot 2016-06-24 at 13 54 15

What is the output of mvn package ?
Em 24 de jun de 2016 9:56 AM, "VasilijSviridov" notifications@github.com
escreveu:

Well after adding it to mvn it still red on pom file
Moreover when I am trying to launch it via jenkins maven, it gives me an
error with:
java.lang.UnsatisfiedLinkError: no opencv_java248 in java.library.path

Any help guys ?

[image: screen shot 2016-06-24 at 13 54 15]
https://cloud.githubusercontent.com/assets/12127198/16338231/37d156de-3a13-11e6-913a-afa974cfbf29.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADcsyO3MImf0gRwAnWNXRVEQMOfh64vks5qO9PfgaJpZM4H10LS
.

Here you go, I think that I have additionally provide jenkins java.library.path for opencv_java248.jar ?
screen shot 2016-06-24 at 14 08 38
screen shot 2016-06-24 at 14 09 08
screen shot 2016-06-24 at 14 10 03
screen shot 2016-06-24 at 14 10 57

I figured it out, yap all is good with maven, I had to specify where is the library jar for openCV , so basically instead of using :
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
I used:
System.load("full path to maven downloaded jar ");

And it works fine :)

Thank you all for helping me.

Sincerely

Nice it has worked, and you've documented the solution :)

Kind regards
Em 24 de jun de 2016 10:24 AM, "VasilijSviridov" notifications@github.com
escreveu:

I figured it out, yap all is good with maven, I had to specify where is
the library jar for openCV , so basically instead of using :
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
I used:
System.load("full path to maven downloaded jar ");

And it works fine :)

Thank you all for helping me.

Sincerely


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AADcsw5cE8JDJzryyganH_TvZM82DkMMks5qO9qdgaJpZM4H10LS
.