eclipse Java OpenCV - 缺少 org.opencv.core.Core rectangle() 方法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26845885/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java OpenCV - org.opencv.core.Core rectangle() method missing
提问by user3182445
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
我有 openCV-3.0.0 alpha,我在 openCV 教程网站上找到了一个示例代码。我曾经用相同的代码编译它,但是eclipse告诉我找不到类中的rectangle()
方法org.opencv.core.Core
。我自己查了类,确实找不到这个方法。有谁知道这个方法现在存储在哪个类中?我发现org.opencv.highgui.Highgui
在 openCV-3.0.0 中停止并由org.opencv.imgcodecs.Imgcodecs
回答by Kokou Egbewatt
it is found in org.opencv.imgproc.Imgproc
package, e.g.
它可以在org.opencv.imgproc.Imgproc
包中找到,例如
Imgproc.rectangle(webcam_img, null, null, null);
回答by Nemaky
in OpenCV 3.0.0 you should change
在 OpenCV 3.0.0 你应该改变
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()
import org.opencv.highgui.Highgui;
对import org.opencv.imgcodecs.Imgcodecs;
,Highgui.imread()
对imgcodecs.imread()
,Core.rectangle()
对imgproc.rectangle()
,Highgui.imwrite()
对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