Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

aww, try Not to mix the old 1.0, IplImage and the new 2.0 cv::Mat api.

do yourself a favour and stick to cv::Mat , whenever possible.

void VideoSeg::bwlabel( const cv::Mat & src, cv::Mat & out ) 
{

    namedWindow( "wndNameOut", CV_GUI_NORMAL );
    src.convertTo(out, src.type(), 255.);  // or:  out = src * 255.0;
    imshow( "wndNameOut", out);            //The image is succesfully plotted
    SimpleBlobDetector blobDetector( params );
    blobDetector.create("SimpleBlob");

    blobDetector.detect(out, keyPoints );  // The problem appears in this line

    for(int i=0; i<keyPoints.size(); i++ )
    {
        cv::floodFill(out,keyPoints[i].pt, Scalar::all((i+1)*255/(keyPoints.size()+1)));
    }

    cout << "Keypoints " << keyPoints.size() << endl;
}