Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java OpenCV - org.opencv.core.Core rectangle() method missing

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

like image 548
user3182445 Avatar asked Nov 10 '14 14:11

user3182445


2 Answers

it is found in org.opencv.imgproc.Imgproc package, e.g.

Imgproc.rectangle(webcam_img, null, null, null);
like image 120
Kokou Egbewatt Avatar answered Nov 20 '22 14:11

Kokou Egbewatt


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

like image 26
Nemaky Avatar answered Nov 20 '22 14:11

Nemaky