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 8163915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:10:47+00:00 2026-06-06T19:10:47+00:00

I have used OpenCV 2.3.1 with Android 2.2 to find contours in bitmaps which

  • 0

I have used OpenCV 2.3.1 with Android 2.2 to find contours in bitmaps which seems to be working fine on Samsung Galaxy Ace, but now I need help with moving those contours. My aim is to make a selected contour follow the user’s finger when dragged to a different location. Help of any kind would be appreciated.

EDIT:
I am now able to move the contours based on the user’s touch, but then they don’t stay at the new position. So, I assume I need to erase the image from the original position and redraw it at the new one. Moreover, its only the surrounding contour which moves and not the pixels of the image within the contour. I am more concerned about the image pixels. How can I get the image pixels to move to the new location? It would also be great if I could somehow get the co-ordinates of the pixels within the contour.

Sorry, I wanted to upload an image but it seems new members cant upload images at this stage. For example – I have the contour surrounding the line in pink. When I drag, only the contour moves and the black pixels of the line do not move at all. Is there any way by which I can get the black pixels within the pink contour to move?

Another problem is that when I try my code on a closed figure like a circle or a square, I get two contours. One for the inner boundary and one surrounding for the outer boundary. But again as I said earlier, I am more interested in the image pixels. Please help.

P.S. – The image can be anything, any shape. I have just taken the example of a line.

  • 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-06T19:10:49+00:00Added an answer on June 6, 2026 at 7:10 pm

    First of all you have to add TouchListener/ClickListener (or something else, I don’t know Android API) to your bitmap or canvas.

    When user is touched the screen (listener is fired) than you have to identify which contour has user selected. For this use pointPolygonTest function.

    About moving: Contour is just a sequence (vector) of Points so if you want to shift (move) some contour you have to do the following (c++ code):

    void moveContour(vector<Point>& contour, int dx, int dy)
    {
        for (size_t i=0; i<contour.size(); i++)
        {
            contour[i].x += dx;
            contour[i].y += dy;
        }
    }
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used a plugin that uses prototype js, it's working fine but the
We are working on implementing an OCR on OpenCv. We have gained the contours
I have used the silverlight control in CRM 2011.It also published on form but
I have used NSSets many times in my apps, but I have never created
I have used geocoder in my ruby on rails application for a while but
I'm writing an android application in OpenCV, and have been spending a few hours
So I have used cvThreshold in the C++ version of OpenCV and when using
I am working with OpenCV for a project used for recognition and I had
I have been searching but could not find something clear for my doubt. I
I have used this in my HTML: <q> Hai How r u </q> Which

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.