Hello everyone. Now days i am working on how to detect the contours from my source data.
So in order to to this i am using openCV library, but when i run the program it gives me error. You can see What i tried in bellow. I do not understand why is this function giving error. Any help would be appreciated.
What I have tried:
void Contour::contourDetection( int nWidth, int nHeight, const QVector< float >& data )
{
QVector< float > tData = data;
Mat gray;
Mat image( nHeight, nWidth, CV_16UC1, tData.data() );
cvtColor( image, gray, CV_BGR2GRAY ); Canny( gray, gray, 100, 200, 3 );
vector< vector< Point > > contours;
vector< Vec4i > hierarchy;
RNG rng( 12345 );
findContours( gray, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point( 0, 0 ) );
}