Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:55:25+00:00 2026-06-05T07:55:25+00:00

Open-CV 2.4 Android-Java: i have searched for contours (list of MatofPoint) like this: Imgproc.findContours(roi_mat,

  • 0

Open-CV 2.4 Android-Java:

i have searched for contours (list of MatofPoint) like this:

Imgproc.findContours(roi_mat, contours, hierarchy, cfg.retMode, cfg.apxMode);

and then the convexhull (has to be a list of MatofInt )

for (int k=0; k < contours.size(); k++){

     Imgproc.convexHull(contours.get(k), hull.get(k));
}

The convexhull wants a MatofInt but the drawcontours wants a MatofPoint.. So what to do?

Thx in advance..


Edit: @OpenCV4Android

for (int k=0; k < contours.size(); k++){
    Imgproc.convexHull(contours.get(k), hullInt);

    for(int j=0; j < hullInt.toList().size(); j++){
        hullPointList.add(contours.get(k).toList().get(hullInt.toList().get(j)));
    }

    hullPointMat.fromList(hullPointList);
    hullPoints.add(hullPointMat);   
}

Imgproc.drawContours( mROI, hullPoints, -1,  new Scalar(255,0,0, 255), 1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:55:28+00:00Added an answer on June 5, 2026 at 7:55 am

    Looks like OpenCV Java API lacks another convexHull() signature:

    convexHull(MatOfPoint points, MatOfPoint hull);
    

    like it’s possible to call in C++.

    While we haven’t added it, you need to create the hull in MatOfPoint format manually:

    • use MatOfPoint::toArray() or MatOfPoint::toList() to get contour’s points
    • use MatOfInt::toArray() or MatOfInt::toList() to get their indexes for hull
    • create a new Point[] or List<Point> with hull’s points only
    • convert it to MatOfPoint via MatOfPoint::fromArray() or MatOfPoint::fromList()
    • call Core.drawContours()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started this week in exploring Android Open GL ES and related
I'm new to java,android and sqlite and i'm stuck at this. I have columns
My open-source Android application uses this in an SQL query: String.format(%f, someDoubleValue); Unfortunately, in
I am developing android application in which i have to open option menu from
I have a java server that sends files to an android client. for some
I'm learning android but have a pretty fair background in java so am a
I really have some troubles since 1 week ago. I got errors like this
I'm new to java/android and trying to help out with an open source project.
I have some confusion regarding where you put regular java code in an android
I use Eclipse to develop in java for Android. I have installed Mercurial to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.