I have openCV-3.0.0 alpha and I found a sample code on the openCV tutorials website. I used to same code and compiled it, but eclipse tells me that the rectangle()
method in the org.opencv.core.Core
class cannot be found. I checked the class myself and indeed could not find this method. Does anyone know in which class this method is now stored in? I found a similar problem with the org.opencv.highgui.Highgui
class which was discontinued in the openCV-3.0.0 and replaced by org.opencv.imgcodecs.Imgcodecs
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
it is found in org.opencv.imgproc.Imgproc
package, e.g.
Imgproc.rectangle(webcam_img, null, null, null);
回答2:
in OpenCV 3.0.0 you should change
import org.opencv.highgui.Highgui;
to import org.opencv.imgcodecs.Imgcodecs;
, Highgui.imread()
to imgcodecs.imread()
, Core.rectangle()
to imgproc.rectangle()
, Highgui.imwrite()
to imgcodecs.imwrite()
take a look at this link https://fossies.org/diffs/opencv/2.4.11_vs_3.0.0-rc1/samples/java/sbt/src/main/java/DetectFaceDemo.java-diff.html