Go to Post The only thing happy about ship day is the promise of sleep coming soon... - StephLee [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-01-2013, 22:56
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Getting OpenCV and JavaCV working on Windows

Hi all,

I've been trying to work on vision processing on the driverstation, but I can't seem to get OpenCV working correctly. I have a test file that should and display an image with OpenCV:

Code:
import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;

public class TestClass {

    public static void main(String[] args) {

        //Load image img1 as IplImage
        final IplImage image = cvLoadImage("img1.png");

        final CanvasFrame canvas = new CanvasFrame("Demo");

        canvas.showImage(image);

        canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
    }
}
But I get an UnsatisfiedLinkError with the message "no jniopencv_core in java.library.path" when I run it. I have a feeling that OpenCV isn't installed correctly based on some research I've done. Are there any good tutorials for getting JavaCV working with the SmartDashboard?
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #2   Spotlight this post!  
Unread 07-01-2013, 10:12
mitchellweb1 mitchellweb1 is offline
Registered User
AKA: Mitchell W
FRC #0190
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Acton, MA
Posts: 30
mitchellweb1 is an unknown quantity at this point
Re: Getting OpenCV and JavaCV working on Windows

Hi Sam,

Check to see that the JVM that you are running in 32-bit (not 64-bit) as the native libraries are 32-bit and must run in a 32-bit JVM. You can check this by running "java -version" from the command line.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:02.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi