English 中文(简体)
OpenCV: cvContourBoundingRect 给“Symbol Not Fan” ,而其他公司则负责罚款
原标题:OpenCV: cvContourBoundingRect gives "Symbol Not Found" while other contour functions work fine

NOTE: StackOverODEt 让我回答我自己的问题,因此我在这里回答这个问题。 请 bottom到底看我的答案。

QUESTION Given a binary image, I want to be able to identify which region has the greatest y-coordinate, i.e., which region is the closest to the bottom. In the function below, I try to use contours and bounding rectangles to get the answer I need. However, my use of the function cvContourBOundingRect gives rise to the following error message during compilation:

"_cvContourBoundingRectemphasized", referenced from: 
GetLowestContourBoundingRectangle(_IplImage * img, bool) 
in main.o. Symbol(s) not found. Collect2: Id returned 1 exit status. 
Build Failed.

This is very strange, since I have successfully used other contour functions like cvFindContours and cvContourArea without any trouble. I tried running some searches on Google, but nothing turned up. If anyone can point me in the right direction I would appreciate it.

提前感谢。

CvRect GetLowestContourBoundingRectangle(IplImage *img, bool invertFlag) {
    // NOTE: CONTOURS ARE DRAWN AROUND WHITE AREAS
    IplImage *output = invertFlag ? cvCloneImage(InvertImage(img)) : cvCloneImage(img); // this goes into find contours and is consequently modified

    // find contours
    CvMemStorage *contourstorage = cvCreateMemStorage(0);
    CvSeq* contours = NULL;
    cvFindContours(output, contourstorage, &contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);

    // analyze each contour
    int lowestRectangleCoordinate = 0;
    CvRect currentBoundingRectangle;
    CvRect lowestBoundingRectangle;

    while (contours) {
        currentBoundingRectangle = cvContourBoundingRect(contours);
        if (currentBoundingRectangle.y + currentBoundingRectangle.height > lowestRectangleCoordinate) {
            lowestRectangleCoordinate = currentBoundingRectangle.y + currentBoundingRectangle.height;
            lowestBoundingRectangle = currentBoundingRectangle;
        }

        contours = contours->h_next;
    }

    cvReleaseMemStorage(&contourstorage);
    return lowestBoundingRectangle;
}

ANSWER: Okay, ironically I found out why it s breaking shortly after drafting my original question (although in fairness I ve been wrestling with this for a few hours at this point).

我研究了确定以下三项职能的负责人档案:

  1. cvFindContours -- imgproc_c.h
  2. cvContourArea -- imgproc_c.h
  3. cvContourBoundingRect -- compat.hpp

表面上说,由于落后的相容性,这些功能被贬低。 在座各位撰写的文章:

/*
   A few macros and definitions for backward compatibility
   with the previous versions of OpenCV. They are obsolete and
   are likely to be removed in future. To check whether your code
   uses any of these, define CV_NO_BACKWARD_COMPATIBILITY before
   including cv.h.
*/

既然这样说,任何人都不知道我如何用非统一的定义来写这一职能?

问题回答

关于您的原始问题,“OpenCV:cvContourBoundingRect 给“Symbol Not Creat”。

图书馆用于与这一(折旧)方法连接:

lib opencv_legacy.so





相关问题
How can I detect if the user is on localhost in PHP?

In other words, how can I tell if the person using my web application is on the server it resides on? If I remember correctly, PHPMyAdmin does something like this for security reasons.

Tracking Right click menu events?

Is there a way to track the right click menu when clicked over a textarea. I would like to know if the user selected cut,copy,paste,select all. Also, I can know when the menu is visible by detecting ...

Recovering from stack overflow on Mac OS X

I am implementing a cross platform scripting language for our product. There is a requirement to detect and properly handle stack overflow condition in language VM. Before you jump in and say make ...

Detecting login credentials abuse

I am the webmaster for a small, growing industrial association. Soon, I will have to implement a restricted, members-only section for the website. The problem is that our organization membership both ...

How to detect page zoom level in all modern browsers?

How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can t find a good cross-browser solution. Firefox stores the page zoom level for ...

热门标签