Hola he intentado correr este programa con la librería cvBLOB, muy poco he tocado este lenguaje, espero me puedan ayudar, estos son los errores que me tira
g++ -Wall -o "blob" "blob.cpp" (en el directorio: /home/daniel/Descargas)
/usr/bin/ld: /tmp/ccCestzE.o: en la función `main':
blob.cpp:(.text+0x5c): referencia a `cv::imread(cv::String const&, int)' sin definir
/usr/bin/ld: blob.cpp:(.text+0x7a): referencia a `cv::SimpleBlobDetector::Params::Params()' sin definir
/usr/bin/ld: blob.cpp:(.text+0x11e): referencia a `cv::SimpleBlobDetector::create(cv::SimpleBlobDetector::Params const&)' sin definir
/usr/bin/ld: blob.cpp:(.text+0x13f): referencia a `cv::noArray()' sin definir
/usr/bin/ld: blob.cpp:(.text+0x216): referencia a `cv::drawKeypoints(cv::_InputArray const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::_InputOutputArray const&, cv::Scalar_<double> const&, int)' sin definir
/usr/bin/ld: blob.cpp:(.text+0x27c): referencia a `cv::imshow(cv::String const&, cv::_InputArray const&)' sin definir
/usr/bin/ld: blob.cpp:(.text+0x2a4): referencia a `cv::waitKey(int)' sin definir
/usr/bin/ld: /tmp/ccCestzE.o: en la función `cv::String::String(char const*)':
blob.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x54): referencia a `cv::String::allocate(unsigned long)' sin definir
/usr/bin/ld: /tmp/ccCestzE.o: en la función `cv::String::~String()':
blob.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): referencia a `cv::String::deallocate()' sin definir
/usr/bin/ld: /tmp/ccCestzE.o: en la función `cv::String::operator=(cv::String const&)':
blob.cpp:(.text._ZN2cv6StringaSERKS0_[_ZN2cv6StringaSERKS0_]+0x28): referencia a `cv::String::deallocate()' sin definir
/usr/bin/ld: /tmp/ccCestzE.o: en la función `cv::Mat::~Mat()':
blob.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): referencia a `cv::fastFree(void*)' sin definir
/usr/bin/ld: /tmp/ccCestzE.o: en la función `cv::Mat::release()':
blob.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x4b): referencia a `cv::Mat::deallocate()' sin definir
collect2: error: ld returned 1 exit status
Ha fallado la compilación.
y este es el programa que quiero compilar o el código que quiero compilar
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
// Read image
Mat im = imread( "blob.jpg", IMREAD_GRAYSCALE );
// Setup SimpleBlobDetector parameters.
SimpleBlobDetector::Params params;
// Change thresholds
params.minThreshold = 10;
params.maxThreshold = 200;
// Filter by Area.
params.filterByArea = true;
params.minArea = 1500;
// Filter by Circularity
params.filterByCircularity = true;
params.minCircularity = 0.1;
// Filter by Convexity
params.filterByConvexity = true;
params.minConvexity = 0.87;
// Filter by Inertia
params.filterByInertia = true;
params.minInertiaRatio = 0.01;
// Storage for blobs
vector<KeyPoint> keypoints;
#if CV_MAJOR_VERSION < 3 // If you are using OpenCV 2
// Set up detector with params
SimpleBlobDetector detector(params);
// Detect blobs
detector.detect( im, keypoints);
#else
// Set up detector with params
Ptr<SimpleBlobDetector> detector = SimpleBlobDetector::create(params);
// Detect blobs
detector->detect( im, keypoints);
#endif
// Draw detected blobs as red circles.
// DrawMatchesFlags::DRAW_RICH_KEYPOINTS flag ensures
// the size of the circle corresponds to the size of blob
Mat im_with_keypoints;
drawKeypoints( im, keypoints, im_with_keypoints, Scalar(0,0,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS );
// Show blobs
imshow("keypoints", im_with_keypoints );
waitKey(0);
}