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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:22:46+00:00 2026-06-06T01:22:46+00:00

This is regarding a project that concerns detection of text in an image using

  • 0

This is regarding a project that concerns detection of text in an image using OpenCV in C. The process is to detect the colors inside and outside the corresponding contours and the way to do that is to draw normals on the contours in equal spaced positions and extract the pixel colors in the corresponding positions of the normals end-points.

I am trying to implement this using the following code but it’s not working. I mean, its drawing the normals but not in and equi-spaced fashion.

for( ; contours!=0 ; contours = contours->h_next )
{
        CvScalar color = CV_RGB( rand()&255, rand()&255, rand()&255 );

        cvDrawContours( cc_color, contours, color, CV_RGB(0,0,0), -1, 1, 8, cvPoint(0,0) );
        ptr = contours;
        for( i=1; i<ptr->total; i++)
        {
         p1 = CV_GET_SEQ_ELEM( CvPoint, ptr, i );

         p2 = CV_GET_SEQ_ELEM( CvPoint, ptr, i+1 );

         x1 = p1->x;
         y1 = p1->y;

         x2 = p2->x;
         y2 = p2->y;
         printf("%d %d     %d %d\n",x1,y1,x2,y2);
         draw_normals(x1,y1,x2,y2);
     }
}

So is there a way to find the length of a contour so that I can divide it by the number of normals I want to draw. Thanks in advance.

EDIT: The draw_normal function draws the normals between two points passed to it as parameters.

  • 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-06T01:22:48+00:00Added an answer on June 6, 2026 at 1:22 am

    So is there a way to find the length of a contour?

    Yes, you can find length of a contour using OpenCV standard function , cvarcLength().

    Check Documentation here.

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

Sidebar

Related Questions

Yesterday I posted this question regarding using lambdas inside of a Join() method to
its me again with this project. im having a problem reading the text on
What is your opinion regarding a project that will try to take a code
I'm currently in the middle of a project that involves YouTube API. I'm using
This question is regarding migration project. Currently the legacy Application is in ColdFusion and
I've been asking a series of evolving questions regarding my Android project that continually
Disclaimer : This is for a semester project that I am currently working on.
I have a asp.net project that uses mvc-mini-profiler. I was using version 1.7 of
I saved my project.apk file, and I was reading this document: http://developer.android.com/guide/publishing/app-signing.html#setup and they
is it better to do this (regarding performance, not readability...): $('a.updateCartButton').click(function() { $('form[name=updateCartForm]').attr('action', $(this).attr('href')

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.