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

  • Home
  • SEARCH
  • 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 9224957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:27:30+00:00 2026-06-18T04:27:30+00:00

I try to use teh cvBlob lib for blob detection, in opencv under Ubuntu

  • 0

I try to use teh cvBlob lib for blob detection, in opencv under Ubuntu but i got blocked right at the beginning. When i try to compile the example form there site:

#include <cv.h>
#include <highgui.h>
#include <stdio.h>
#include "cvblob.h"

using namespace cvb;
using namespace std;

int main( int argc,char** argv){
    if( argv[1] == NULL ){
        printf("\n Please Provide a valid Argument \n");
        return(0);
    }
    else{
        IplImage* src = cvLoadImage(argv[1],CV_LOAD_IMAGE_UNCHANGED);
        cvNamedWindow("Original",CV_WINDOW_AUTOSIZE);
        cvShowImage("Original",src);
    IplImage src_g;
    cvThreshold(src, src_g,35,255, CV_THRESH_BINARY);  
    IplImage *labelImg=cvCreateImage(cvGetSize(src_g), IPL_DEPTH_LABEL, 1);
    CvBlobs blobs;
    unsigned int result=cvb::CvLabel(src_g, labelImg, blobs);
    cvRenderBlobs(labelImg, blobs, src, src);
    for (CvBlobs::const_iterator it=blobs.begin(); it!=blobs.end(); ++it)
    {
      cout << "Blob #" << it->second->label << ": Area=" << it->second->area << ", Centroid=(" << it->second->centroid.x << ", " << it->second->centroid.y << ")" << endl;
    }
    cvNamedWindow( "Mod", CV_WINDOW_AUTOSIZE );
    cvShowImage( "Mod", src );  
    cvWaitKey(0);
        cvReleaseImage(&src);
        cvReleaseImage(&src_g);
        cvDestroyWindow("Image");
        return(0);
    }

}

I get this error for this raw unsigned int result=cvb::CvLabel(src_g, labelImg, blobs);:

home/rrg/OpenCV-2.4.3/release/bagDetect/main.cpp: In function ‘int main(int, char**)’:
/home/rrg/OpenCV-2.4.3/release/bagDetect/main.cpp:28: error: functional cast expression list treated as compound expression
/home/rrg/OpenCV-2.4.3/release/bagDetect/main.cpp:28: error: invalid cast from type ‘cvb::CvBlobs’ to type ‘cvb::CvLabel’
make[2]: *** [CMakeFiles/bag.dir/main.o] Error 1
make[1]: *** [CMakeFiles/bag.dir/all] Error 2
make: *** [all] Error 2

I have no idea what should be the problem!

After the changes mentioned in the first answer i got a linker error 🙁

Linking CXX executable bag
CMakeFiles/bag.dir/main.o: In function `main':
main.cpp:(.text+0x103): undefined reference to `cvLabel'
main.cpp:(.text+0x134): undefined reference to `cvRenderBlobs'
collect2: ld returned 1 exit status

What and where should I put to be recognized the functions mentioned above?(CMakeList or Makefile)?

  • 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-18T04:27:32+00:00Added an answer on June 18, 2026 at 4:27 am

    There are two typos in your code, which generates you these errors:
    – IplImage src_g; –> should be declared as a pointer
    – unsigned int result=cvb::CvLabel(src_g, labelImg, blobs); –> use cvLabel() instead of CvLabel()

    Hope this helps,
    TL

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

Sidebar

Related Questions

I try use string as a regular expression pattern but I've following errors PHP
I try to use a variable in my kshell script but can't get a
i try to use jquery .text() but not really work : Before <a id=group_name
I try to use the columnFilter add-on of jquery datatable but I couldn't make
RegexBuddy shows the matches are OK, but in C# when I try use replace,
I try use ms access as data provider but it give me exception. static
I try use gssapi32.dll in my application but I receive exception when app start
how to generate random number in this code? I try use $RANDOM, but the
I have problems with PHP in Ubuntu 10.04. When I try use mysqli_result::fetch_all this
I try use Data.Array code It's ok, but slow. Then use Data.Array.Diff code Could

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.