Ask Your Question

birdy's profile - activity

2019-06-11 05:03:09 -0500 received badge  Notable Question (source)
2017-09-30 05:03:15 -0500 received badge  Notable Question (source)
2016-10-11 04:13:09 -0500 received badge  Popular Question (source)
2016-06-13 09:32:51 -0500 received badge  Student (source)
2015-08-14 10:37:50 -0500 received badge  Popular Question (source)
2013-03-31 13:57:32 -0500 asked a question How to access the Draw Functions with Java Bindings?

There are several draw functions available from OpenCV. I am trying the new Java wrapper for OpenCV however, I can't seem to find any of the draw functions in the java API

I would hate to think that draw functions didn't make it in the Java API...

Am I missing something? Whats is a way to access those draw functions in the Java API?

2013-03-30 22:51:38 -0500 received badge  Editor (source)
2013-03-30 22:33:15 -0500 asked a question How to pass points to minAreaRect using Java Bindings

I'm looking for a way to use minAreaRect with certain points I've collected. I'm converting this C++ code to Java using the OpenCV Java Bindings

c++

std::vector<cv::Point> box_points;
box_points.push_back(cv::Point(left, top));
box_points.push_back(cv::Point(left, bottom));
box_points.push_back(cv::Point(right, bottom));
box_points.push_back(cv::Point(right, top));

// Compute minimal bounding box for the ROI
// Note: for some unknown reason, width/height of the box are switched.
cv::RotatedRect box = cv::minAreaRect(cv::Mat(box_points));

Java:

List <Point> boxPoints = new ArrayList<Point>();
boxPoints.add(new Point(left, top));
boxPoints.add(new Point(left, bottom));
boxPoints.add(new Point(right, bottom));
boxPoints.add(new Point(right, top));

RotatedRect box = Imgproc.minAreaRect(new Mat(boxPoints));

However, the last line of my java code is giving me an error.

What is the best way to pass boxPoints to minAreaRect ?