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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:48:17+00:00 2026-06-08T09:48:17+00:00

I am working on detecting edges and finding quadrilateral shapes on image using opencv

  • 0

I am working on detecting edges and finding quadrilateral shapes on image using opencv 2.4.2 libraries. Everthing was going smooth, until I got these compilation errors

../src/GoodFeaturesToDetect.cpp:198:109: error: ‘cvFindContours’ was not declared in this scope
../src/GoodFeaturesToDetect.cpp:203:106: error: ‘cvContourPerimeter’ was not declared in this scope
../src/GoodFeaturesToDetect.cpp:203:114: error: ‘cvApproxPoly’ was not declared in this scope
../src/GoodFeaturesToDetect.cpp:206:64: error: ‘cvContourArea’ was not declared in this scope

Here are my headers:

#include <opencv2/core/core.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace cv;
using namespace std;

void DrawLine( Mat img, Point start, Point end );
vector<Point2f> FindCornersUsingGoodFeaturesToTrack(Mat toTrack);
void ConnectPointsWithLine(Mat img,vector<Point2f> corners);
void DrawQuad(Mat img, Point a, Point b, Point c, Point d);
void DetectAndDrawQuads(Mat img);

Here is the method that calls the function(s)

void DetectAndDrawQuads(Mat img){
        CvSeq* contours;
        CvSeq* result;
        CvMemStorage *storage=cvCreateMemStorage(0);
        Mat gray;
        cvtColor(img,gray,CV_BGR2GRAY);
        cvFindContours(&gray,storage, &contours, sizeof(CvContour),CV_RETR_LIST,CV_CHAIN_APPROX_SIMPLE, Point(0,0));

        //Loop through all the contours discovered
        //Figure out which ones form a quad
        while(contours){
            result=cvApproxPoly(contours, sizeof(CvContour),storage, CV_POLY_APPROX_DP,cvContourPerimeter(contours)*0.02,0);

        if(result->total=4 && fabs(cvContourArea(result, CV_WHOLE_SEQ)) > 20){
            CvPoint *pt[4];
            for(int i=0; i<4; i++)
                pt[i]=(CvPoint*) cvGetSeqElem(result,i);

            DrawQuad(gray,*pt[0],*pt[1],*pt[2],*pt[3]); 

        }
        contours = contours->h_next;
        }

}

DetectAndDrawQuads gets called from main()..

Here are the linked libraries

opencv_contrib opencv_flann opencv_legacy opencv_calib3d opencv_ml opencv_imgproc opencv_highgui opencv_objdetect opencv_core opencv_features2d

I am working on Eclipse CDT (Helois)

I would appreciate any hint. Thanks.

  • 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-08T09:48:18+00:00Added an answer on June 8, 2026 at 9:48 am

    It turns out that the methods I was calling are from openCv 2.0. I had to change cvFindContours to findContours(…), cvApproxPoly to approxPolyDP and so on as described in OpenCV 2.4.2.

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

Sidebar

Related Questions

I'm new to image processing and I'm working on detecting lines in a document
I am working on openCV for detecting the face .I want face to get
I am working on a face detection and recognition software...i succeeded in detecting the
I got an issue with deleting an object from ArrayList when working on the
I am working through the book Learning OpenCV from the O'Reilly series and am
I have little issue with detecting internet connection while using static IP on device.
i'm using a php script for redirection after detecting the search word to my
I am working on a plan to build an online image editor with just
Possible Duplicate: Detecting endianness programmatically in a C++ program I am working on a
I'm working on a game right now where I'm going to have paths dynamically

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.