ENV: Windows Server 2008 R2 Enterprise, ОЗУ: 32.0 ГБ, x64, Java: 1.8.0_192, opencv3.4.1 (jar и dll)
код:
public class Test {
static {
String opencvpath = System.getProperty("user.dir") + "\\libs\\x64\\";
System.load(opencvpath + Core.NATIVE_LIBRARY_NAME + ".dll");
}
public static void main(String[] args) throws IOException {
Mat img = Imgcodecs.imread("D:\\test.jpg");
if (img == null){
System.out.println("img == null");
}
Mat hsvImg = new Mat();
Imgproc.cvtColor(img, hsvImg, Imgproc.COLOR_BGR2HSV);
Mat mask = new Mat();
Core.inRange(hsvImg, new Scalar(0, 0, 130), new Scalar(180, 30, 250), mask);
if(hsvImg == null){
System.out.println("himg == null");
}
System.out.println("cols = "+hsvImg.cols());
Imgproc.dilate(hsvImg, hsvImg, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(8, 3)), new Point(), 2);
System.out.println("rows = "+hsvImg.rows());
Imgproc.erode(mask, hsvImg, Imgproc.getStructuringElement(Imgproc.MORPH_ELLIPSE, new Size(3, 3)), new Point(), 2);
System.out.println("erode success....");
}
}
windowsРезультат запуска cmd сервера:
D:\SmokeDetectionDemo_jar>java -jar Test.jar
cols = 1920
Exception in thread "main" java.lang.Exception: unknown exception
at org.opencv.imgproc.Imgproc.dilate_1(Native Method)
at org.opencv.imgproc.Imgproc.dilate(Unknown Source)
at Test.main(Test.java:29)
, но запуск в windows10 cmd - это нормально, чем отличается от windows server?