Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1003795 // Test OpenCV - Minimal

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 436K of libraries. Click here for Pure Java version (105L/1K/4K).

!752

lib 1003792 // opencv-249

import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;

sS path = "/home/stefan/dev/opencv-249-min";

p {
  print("Welcome to OpenCV " + Core.VERSION);
  S libPath = System.getProperty("java.library.path");
  libPath = path + File.pathSeparator + libPath;
  print(libPath);
  System.setProperty("java.library.path", libPath);
  
  // fails!?
  //System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
  
  File lib = new File(path+ "/lib" + Core.NATIVE_LIBRARY_NAME + ".so");
  print("Looking for: " + lib.getAbsolutePath());
  Runtime.getRuntime().load(lib.getAbsolutePath());
  print("Lib loaded.");
 
  // TEST
  
  Mat m  = Mat.eye(3, 3, CvType.CV_8UC1);
  print("m = " + m.dump());
}

Author comment

Began life as a copy of #1003794

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1003795
Snippet name: Test OpenCV - Minimal
Eternal ID of this version: #1003795/1
Text MD5: 1076a2b43fba63839f674f966200ded3
Transpilation MD5: 9c74b528ffd7e2639ad6b0a556e30ba1
Author: stefan
Category: javax / opencv / native bindings
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-27 16:33:17
Source code size: 774 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 547 / 666
Referenced in: