how to add open cv blobs library in Visual studio 2013.
I am not able to add open cv blobs library with visual studio 2013, i need to calculate contourArea which needs blobs library ,how can i add those libraries. EDIT:-I had used all the instructions given below my contourArea() is still showing undefined,please help?
#include <opencv2/opencv.hpp>
#include<stdio.h>
#include<iostream>
using namespace std;
using namespace cv;
int main()
{
// open the image
cv::Mat &image= cv::imread("cancer.jpg");
vector<vector<Point> > contours;
cv::Canny(image, // gray-level image
contours, // output contours
125, // low threshold
350);
for(unsigned int i=0;i<contours.size(),i++)
{
cout << "# of contour points: " << contours[i].size() << endl ;
for(unsigned int j=0;j<contours[i].size(),j++)
{
cout << "Point(x,y)=" << contours[i][j] << endl;
}
cout << " Area: " << contourArea(contours[i]) << endl;//its contourArea() is undefined
}
cvWaitKey(0);
}
you don't need that lib, since contourArea is already builtin in the imgproc module
i had already included that header file still its showing "contourArea() is undefined" Is function contourArea() declaration is wrong? if yes, how we need to declare that?
cv::contourArea()
? includeopencv2/imgproc/imgproc.hpp
you probably need to show your code, if we have to look for errors.
hey,Berak thanks for the reply i added the code above please check what exactly the problem is.
looks like a namespace problem.
either do:
using namespace cv;
or use:cv::contourArea();
also:
#include <opencv2/imgproc/imgproc.hpp>
That i had done,its some other issues please check?
i don't know, what other issues you got.
Its still showing contourArea(),"identifier not found" what you said i had included? There is some packages problems or libraries is missing ? I am using open cv 2.4.10 with visual studio 2013.
@Dp have you set the path where visual studio should find the opencv libraries?