openCV 3的一些改动

import org.opencv.highgui.Highgui 有提示错误

主要是因为OpenCV 3版本的库中已经没有opencv.highgui.Highgui这个包,需要改为 import org.opencv.imgproc.Imgproc;

也就是说 Imgcodecs.imread 代替了 Highgui .imread 

 

Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height),new Scalar(0, 255, 0));

The method rectangle(Mat, Point, Point, Scalar) is undefined for the type Core

原因:需要import org.opencv.imgproc.Imgproc;    Imgproc.rectangle()代替Core.rectangle()

https://stackoverflow.com/questions/30284379/why-im-getting-the-method-rectanglemat-point-point-scalar-is-undefined-for

原文地址:https://www.cnblogs.com/xxg1993/p/7566973.html