Go to Post The kick-off is your opportunity to finally open the REALLY BIG box that has been sitting under the tree. - dlavery [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 22-01-2017, 13:30
TBrient TBrient is offline
Registered User
FRC #5735
 
Join Date: Jan 2017
Location: Massachusetts
Posts: 1
TBrient is an unknown quantity at this point
Attempting to run a vision processing test results in library errors

I just created a GripPipeline file and put it into my eclipse project. When attempting to run a testing file (See below) I get the error "Exception in thread "main" java.lang.UsatisfiedLinkError: no cscore in java.library.path."

I have added all the WPILib libraries (including cscore) to my project's libraries list, and I have no clue what is wrong with the code.

Any suggestions?


My Test method:

public static void main(String args[]) {
UsbCamera camera = CameraServer.getInstance().startAutomaticCapture() ;
camera.setResolution(IMG_WIDTH, IMG_HEIGHT);

visionThread = new VisionThread(camera, new GripPipeline(), pipeline -> {
if (!pipeline.findContoursOutput().isEmpty()) {
Rect largestRectangle = Imgproc.boundingRect(pipeline.findContoursOutput() .get(0));
for (int i = 1; i < pipeline.findContoursOutput().size(); i++) {
Rect testRec = Imgproc.boundingRect(pipeline.findContoursOutput() .get(i));
if (largestRectangle.area() < testRec.area()) {
largestRectangle = testRec;
}
}
synchronized (imgLock) {
centerX = largestRectangle.x + (largestRectangle.width / 2);
System.out.println(centerX);
}
}
});
visionThread.start();
}
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2017, 15:40
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 377
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Attempting to run a vision processing test results in library errors

Make sure you're using the correct cscore build (eg windows, linux, arm-raspbian, etc)

If it still doesn't work, go into the cscore jar and pull out the dll/so/etc for your architecture. In Eclipse, edit the build path item for cscore and for "Native library location" point to the folder where you put the library file.
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2017, 19:48
wharrier2450 wharrier2450 is offline
Registered User
FRC #2450
 
Join Date: Jan 2017
Location: St Paul MN
Posts: 4
wharrier2450 is an unknown quantity at this point
Re: Attempting to run a vision processing test results in library errors

Make sure you configure the native location properly. When I configured this the first time, I thought I did that but when I looked at the native path on the build path for my project it was not there. I added it to the User Library, removed it from my project, re-added it and it started working.

http://docs.opencv.org/2.4/doc/tutor...l#java-eclipse

Good luck
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 13:25.

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