0

When I type the following code line.. where img_hsv is a Mat image...

IplImage abc=img_hsv;


// object that will contain blobs of inputImage
CBlobResult blobs;

// Extract the blobs using a threshold of 100 in the image
blobs = CBlobResult(&abc,NULL,100,true);

It displays the following error...

error C2661: 'CBlobResult::CBlobResult' : no overloaded function takes 4 arguments.. Any help is welcome...!!

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
Kaushal
  • 207
  • 1
  • 3
  • 11

2 Answers2

1

You probably have code written for an older library. Have a look at the header file, I guess the constructor has only 3 arguments. Remove true, then it should work.

This discussion might point out the problem with more details: http://tech.groups.yahoo.com/group/OpenCV/message/61534 to help you finding a maybe more suitable solution if simply removing the flag does have some undesirable side effects.

jdehaan
  • 19,700
  • 6
  • 57
  • 97
  • yes it still doesn't work... now the modified line is blobs = CBlobResult(&abc,NULL,0); still it gives errors... – Kaushal Jun 11 '10 at 18:32
  • what errors? compiler errors, linker errors or runtime errors? what do you see? not easy to help with no information. :-) – jdehaan Jun 11 '10 at 18:45
  • error LNK2019: unresolved external symbol "public: virtual __thiscall CBlobResult::~CBlobResult(void)" (??1CBlobResult@@UAE@XZ) referenced in function _main 1>Kaushal.obj : error LNK2019: unresolved external symbol "public: class CBlobResult & __thiscall CBlobResult::operator=(class CBlobResult const &)" (??4CBlobResult@@QAEAAV0@ABV0@@Z) referenced in function _main 1>Kaushal.obj : error LNK2019: unresolved external symbol "public: __thiscall CBlobResult::CBlobResult(struct _IplImage *,struct _IplImage *,unsigned char)" (??0CBlobResult@@QAE@PAU_IplImage@@0E@Z) referenced in function _main – Kaushal Jun 11 '10 at 19:06
  • you forgot to link to the opencv library. Look at your linker settings (project settings) and add the appropriate lib. http://stackoverflow.com/questions/2282216/configuring-opencv-with-visual-c-2008 – jdehaan Jun 11 '10 at 19:21
  • nope .. i linked the opencv libraries correctly.... but blogslib libraries couldn't be linked ... can you please suggest how to do that for a VC++ 2008 edition? – Kaushal Jun 11 '10 at 20:24
  • add it into the linker settings or add a `#pragma comment(lib, "blobslib.lib")` somewhere in an appropriate header or source file (perhaps stdafx.cpp could be a good idea) – jdehaan Jun 11 '10 at 21:31
0

For some reason thresholding with a zero value does not work.

Try blobs = CBlobResult(&abc,NULL,255);

Soatl
  • 10,224
  • 28
  • 95
  • 153