Ask Your Question

ven's profile - activity

2016-08-29 07:14:58 -0500 asked a question Clarification about incorrect image matching points in SIFT

I detected sift key points of two images. (two images have the same scene, but different view angle) after that I did matching of key points. To remove the bad matching I used RANSAC. Most of the matching's are correct. But still I have bad matching. But for research purpose I need to identify why bad matching happens.

2016-07-03 18:53:40 -0500 asked a question error C2065: 'SiftFeatureDetector' : undeclared identifier

I'm trying to use SiftFeatureDetector but i'm having undeclared identifier error. But i imported the libraries as follows. Any help is appreciated. ( i followed article -> (http://www.mattsheckells.com/opencv-a...)

imported libraries

#include <opencv2/features2d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>

I'm using opencv 2.4

SiftDescriptorExtractor extractor; // ERROR undeclared identifier
extractor.compute(timg, kps, desc); // ERROR undeclared identifier
2015-04-14 23:56:50 -0500 commented question stereoRectifyUncalibrated function error

@berak i have clearly mentioned my Error. would you please take a took at it . thank you.

2015-04-14 07:45:26 -0500 commented question stereoRectifyUncalibrated function error

@berak please find below the link of my image http://i.imgur.com/l621PQp.jpg which has the error im getting . could you please select the "(more)" . thank you.

2015-04-14 00:13:19 -0500 received badge  Enthusiast
2015-04-13 23:38:46 -0500 asked a question stereoRectifyUncalibrated function error

I'm new to opencv and its developing. i used SIFT descriptor and FLANN matcher to identify the good key points. I'm using Flea2 camera images. I dont have insentric parameters. so i moved to stereoRectifyUncalibrated function. I calculated fundamental metrix correctly and my images are CV_8UC3 type.

Error :Assertion failed: (unsigned)CV_MAT_DEPTH(type) <= CV_64F, file C :\builds\2_4_PackSlave-win32-vc12-shared\opencv\modules\core\include\opencv2/cor e/types_c.h, line 737

image description

please find below the code i used.

void Destriptor::extract_features_using_dector()
{
    int minHessian = 400;

    SurfFeatureDetector detector(0.01,10); // i changed minHessian value into 0.01 & 100

    //std::vector<KeyPoint> keypoints_1, keypoints_2;

    detector.detect(input_right, keypoints_right);
    detector.detect(input_center, keypoints_center);

    //-- Step 2: Calculate descriptors (feature vectors)
    SurfDescriptorExtractor extractor;

    Mat descriptors_1, descriptors_2;

    extractor.compute(input_right, keypoints_right, descriptor_right);
    extractor.compute(input_center, keypoints_center, descriptor_center);

    //-- Step 3: Matching descriptor vectors using FLANN matcher
    FlannBasedMatcher matcher;
    std::vector< DMatch > matches;
    matcher.match(descriptor_right, descriptor_center, matches);

    double max_dist = 0; double min_dist = 100;

    //-- Quick calculation of max and min distances between keypoints
    for (int i = 0; i < descriptor_right.rows; i++)
    {
        double dist = matches[i].distance;
        if (dist < min_dist) min_dist = dist;
        if (dist > max_dist) max_dist = dist;
    }

    printf("-- Max dist : %f \n", max_dist);
    printf("-- Min dist : %f \n", min_dist);

    //-- Draw only "good" matches (i.e. whose distance is less than 2*min_dist,
    //-- or a small arbitary value ( 0.02 ) in the event that min_dist is very
    //-- small)
    //-- PS.- radiusMatch can also be used here.
    std::vector< DMatch > good_matches;

    for (int i = 0; i < descriptor_right.rows; i++)
    {
        //here i change octaves and layers then i achieved more 
        if (matches[i].distance <= max(4 * min_dist, 0.02))
        {
            good_matches.push_back(matches[i]);
        }
    }

    //-- Draw only "good" matches
    Mat img_matches;

    // the draw method Change the Flag from default to rich then visible key points with maches DrawMatchesFlags::DEFAULT
    //scale and oriantation as well
    drawMatches(input_right, keypoints_right, input_center, keypoints_center,
        good_matches, img_matches, Scalar::all(-1), Scalar::all(-1),
        vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS);
//-- Show detected matches
    imshow("Good Matches", img_matches);

    float xr, yr; // for store x and y cordinates for right pixels
    float xc, yc; // for store x and y cordinates for center pixels

    for (int i = 0; i < (int)good_matches.size(); i++)
    {
        //printf("-- Good Match [%d] Keypoint 1: %d  -- Keypoint 2: %d  \n", i, good_matches[i].queryIdx, good_matches[i].trainIdx);
        xr = keypoints_right[good_matches[i].queryIdx].pt.x;
        yr = keypoints_right[good_matches[i].queryIdx].pt.y;

        printf("key points of right image x-> %f y-> %f \n", xr, yr);

        xc = keypoints_center[good_matches[i].trainIdx].pt.x;
        yc = keypoints_center[good_matches[i].trainIdx].pt.y;

        printf("key point of center image x-> %f y-> %f \n ", xc, yc);

        printf("\n");

    }

    // print number of good maches
    printf("Number of good machers %i \n", good_matches.size());

    //create fundamental matrix
    // convert 1 vector of keypoint info
    //2 vectors of Point2f for compute F matrix

    vector<int> pointIndexesCenter;
    vector<int> pointIndexesRight;
    for (vector<DMatch>::const_iterator it = good_matches.begin(); it != good_matches.end(); ++it) {

        // Get the indexes of the selected matched keypoints
        pointIndexesCenter.push_back(it->queryIdx);
        pointIndexesRight.push_back(it->trainIdx);
    }
    // Convert keypoints into Point2f

    vector<Point2f ...
(more)
2015-04-05 06:10:10 -0500 asked a question How do i create 3D points to save my model as .ply file( Meshlab file)

I'm developing 3D based application. There i used a Stereo( left image and right image) in order to match the corresponding pixels i used

  1. SIFT - To match the key points of that two images
  2. Feature Matching with FLANN - i used for matching keypoints

Up to that code has good matches. I need to write ply file.(display in meshlab) in order to do that how do i take 3D points ?

I've already have Camera Baseline, Focal length, and matching coordinates of two images. Any help is appreciated. thank you. Points i matched

2014-07-26 12:35:56 -0500 received badge  Editor (source)
2014-07-26 12:34:28 -0500 asked a question Opencv My first programme on Xcode Linker Errors

I'm new to opencv and its programming I've read this article and Please click here and try my first programme there.and now I'm getting following Errors .In my main.cpp but file there isn't any error .please help me.

Ld /Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Products/Debug/openCvtest normal x86_64
    cd /Users/venushka/Documents/openCvtest
    export MACOSX_DEPLOYMENT_TARGET=10.9
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Products/Debug -L/usr/local/lib -F/Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Products/Debug -filelist /Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Intermediates/openCvtest.build/Debug/openCvtest.build/Objects-normal/x86_64/openCvtest.LinkFileList -mmacosx-version-min=10.9 -stdlib=libc++ -Xlinker -dependency_info -Xlinker /Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Intermediates/openCvtest.build/Debug/openCvtest.build/Objects-normal/x86_64/openCvtest_dependency_info.dat -o /Users/venushka/Library/Developer/Xcode/DerivedData/openCvtest-crnuahbzopktrkgsgogwnagypbyi/Build/Products/Debug/openCvtest

Undefined symbols for architecture x86_64:
  "cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
      _main in main.o
  "cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in main.o
  "cv::Mat::deallocate()", referenced from:
      cv::Mat::release() in main.o
  "cv::Mat::zeros(cv::Size_<int>, int)", referenced from:
      _main in main.o
  "cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in main.o
  "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:
      _main in main.o
  "cv::waitKey(int)", referenced from:
      _main in main.o
  "cv::fastFree(void*)", referenced from:
      cv::Mat::~Mat() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image description