更新时间:2023-01-08 21:33:16
在opencv3.0中,Java中没有更多的highgui模块.
该功能被拆分为新的videoio
和imgcodecs
(您将在其中找到未读的)模块.
the functionality was split up into new videoio
and imgcodecs
(that's where you will find imread) modules.
import org.opencv.core.*;
import org.opencv.imgcodecs; // imread, imwrite, etc
import org.opencv.videoio; // VideoCapture
编辑:将img=Highgui.imread(pathtoimage);
更改为img = Imgcodecs.imread(pathtoimage);
和Core.rectangle(img, tl, br, color);
到Imgproc.rectangle(img, t1, br, color);
我还将建议通过 OpenCV 3.0模块来解决这些错误.
I will also suggest go through OpenCV 3.0 modules to resolve these errors.