下载地址
安装openCV+ java
sudo port selfupdate
sudo port install opencv +java
+号前有空格,+号后无空格。
若中途出现错误如下:
Error: Failed to build db48: command execution failed
则输入以下命令删除,再重新进行安装db48后,再安装opencv
sudo port clean db48
sudo port install db48
安装确认
port contents opencv | grep java
出现以下信息代表安装完成:
/opt/local/share/OpenCV/java/libopencv_java343.dylib
/opt/local/share/OpenCV/java/opencv-343.jar
/usr/local/Cellar/opencv/3.4.3
项目右键–>Open Module Settings–>Libratries–>加号–>Java–>/opt/local/share/OpenCV/java/
–>OK
Tomcat8 VM options 配置如下
-Djava.library.path=/opt/local/share/OpenCV/java/