Ask Your Question
0

c++ to java

asked 2016-07-06 09:05:28 -0600

masehitam gravatar image

I found source code in c++

std::vector< std::vector<cv::Point> > allContours;

how do I make it in java ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-07-06 09:10:05 -0600

berak gravatar image

it's a List<MatOfPoint>.

for a usage example, e.g. see here

edit flag offensive delete link more

Comments

yes, I am using List<MatOfPoint>. but I need to calculate it's size

void MarkerDetector::findContours(const cv::Mat& thresholdImg,std::vector<std::vector<cv::Point>>& contours,int minContourPointsAllowed)
{
    std::vector< std::vector<cv::Point> > allContours;
    cv::findContours(thresholdImg, allContours, CV_RETR_LIST, CV_CHAIN_APPROX_NONE);
    contours.clear();
    for (size_t i=0; i<allContours.size(); i++)
    {
        int contourSize = allContours[i].size();
        if (contourSize > minContourPointsAllowed)
        {
            contours.push_back(allContours[i]);
        }
    }
}
masehitam gravatar imagemasehitam ( 2016-07-06 20:08:42 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-06 09:05:28 -0600

Seen: 349 times

Last updated: Jul 06 '16