SmartVessel

Foucs on C++

博客园 首页 新随笔 联系 订阅 管理
    const cv::Mat input = cv::imread("lena.jpg"0); //Load as grayscale
    cv::SiftFeatureDetector detector;
    //cv::FastFeatureDetector detector;
    std::vector<cv::KeyPoint> keypoints;
    detector.detect(input, keypoints);
    // Add results to image and save.
    cv::Mat output;
    cv::drawKeypoints(input, keypoints, output);

    cv::imwrite("sift_result.jpg", output);
    cv::namedWindow("sift_result", CV_WINDOW_AUTOSIZE); //创建窗口
    cv::imshow("sift_result", output); //显示图像
    cv::waitKey();
    return 0;
posted on 2011-10-17 21:52  SmartVessel  阅读(578)  评论(0编辑  收藏  举报