Ask Your Question

gaurav_kl's profile - activity

2020-04-19 22:50:53 -0500 received badge  Popular Question (source)
2013-11-14 14:52:26 -0500 asked a question use of sift keypoint radius in calculating feature vector

I have followed many tutorials on SIFT and have a good understanding of how key points are detected.But while extracting SIFT feature vectors where does the keypoint scale play the role.

As I understood, we just take a 16 X 16 window around a keypoint and store magnitudes and orientation into the bins.

I could understand where the keypoint orientation is used though not the scale.

2013-08-02 11:22:59 -0500 commented question using 3rd party jasper library fails in openCV 2.4.6 but works in 2.4.2

@berak did it work for you ?if it didn't,I can create an issue on the Opencv Tracker.

2013-08-02 11:21:57 -0500 commented answer using 3rd party jasper library fails in openCV 2.4.6 but works in 2.4.2

did it not work for you also?in that case,I can create an issue on the Opencv Tracker.

2013-08-01 17:40:23 -0500 commented question using 3rd party jasper library fails in openCV 2.4.6 but works in 2.4.2
2013-08-01 13:57:13 -0500 commented question using 3rd party jasper library fails in openCV 2.4.6 but works in 2.4.2

hi.I edited my post.. I cant attach the image here as ".jp2" isn't allowed.Also couldn't upload it to "imgur". But I have obtained the images from here .So you can download the * file to test any of the images.Thanks

2013-08-01 10:02:43 -0500 asked a question using 3rd party jasper library fails in openCV 2.4.6 but works in 2.4.2

I was trying open a "jp2" image file and tried using the inbuilt jasperd.lib file in my library dependencies.I am getting the error "unable to decode code stream".

But when I was using 2.4.2 library it worked fine and I didn't even need to specify any library dependencies.But this one seems to be very slow as loading 1 image takes about a copuple of seconds.

What might be the issue with 2.4.6?I trued using 2.4.3-2.4.5 also but didn't work. EDIT: the image can be downloaded from this url -

2013-07-08 15:10:09 -0500 asked a question flann : knn-search for hierarchical kmeans tree giving weird result

I have about 130,000 SIFT descriptors. I am building a hierarchical Kmeans-index using Opencv's flann module. After this I want to quantize these 130,000 descriptors (will quantize more later). I am using flann's knnsearch method for doing this. But the result of this method is something weird. For every descriptor the nearest index it is showing is the index of the descriptor itself. However, it should be displaying the cluster-ID of the nearest cluster which will be one of the leaves of the HIK-tree.

Should I try k=2

Here is a code snippet -

int k=1;
cv::flann::KMeansIndexParams indexParams(8,4,cvflann::FLANN_CENTERS_KMEANSPP) ;
cv::flann::Index hik_tree(cluster_data, indexParams);
Mat indices,dist;
hik_tree.knnSearch(cluster_data, indices, dist, k, cv::flann::SearchParams(64));
2012-10-21 15:40:31 -0500 asked a question gpu related project suggestion

Hi, I am looking for project suggestions for a course.The project requires primarily demonstrating the GPU performance .

So I was thinking to do something related to Computer Vision.

Can someone suggest some moderate ideas which are feasible for a 1-month timeframe using OpenCV.


2012-10-08 13:54:29 -0500 commented question word segmentation using OpenCV

the text is typed font but it is something like from 19th century .I just need to segment out the sub-images with extra spaces around them.

2012-10-06 20:17:07 -0500 asked a question word segmentation using OpenCV

Hi I am an OpenCV novice and am working on a scanned text image and I need to highlight all the words in that image.I know the problem is equivalent to finding subimages within an image with extra whitespaces around them. OCR cannot be used and I just need to outline each word with a border.

Can someone suggest how it might be done using OpenCV.

Also can someone point me to some appropriate tutorials for OpenCV for this kind of work.


2012-09-20 01:56:24 -0500 received badge  Student (source)
2012-09-19 13:11:54 -0500 received badge  Editor (source)
2012-09-19 13:07:06 -0500 asked a question 'SurfFeatureDescriptor' giving linker errors

Hi I am new to openCV and am trying to do some object detection in 2 images . I am trying out the sample code in this link for object detection. I have also included the "nonfree" module as per the change in 2.4 so I am not getting compiler error but am getting errors while running the code.Please suggest what might be wrong. This is the error and the code is below the error Error-

  "cv::DescriptorMatcher::match(cv::Mat const&, cv::Mat const&, __gnu_debug_def::vector<cv::DMatch, std::allocator<cv::DMatch> >&, cv::Mat const&) const", referenced from:

  "cv::FeatureDetector::detect(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const", referenced from:
_main in main.o
  "cv::drawMatches(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, __gnu_debug_def::vector<cv::DMatch, std::allocator<cv::DMatch> > const&, cv::Mat&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, __gnu_debug_def::vector<char, std::allocator<char> > const&, int)", referenced from:

  "cv::DescriptorExtractor::compute(cv::Mat const&, __gnu_debug_def::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat&) const", referenced from:

symbols not found

Here is the code

 * @file SURF_Homography
 * @brief SURF detector + descriptor + FLANN Matcher + FindHomography
 * @author A. Huaman

#include <stdio.h>
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace cv;
void readme();

 * @function main
 * @brief Main function
int main( int argc, char** argv )
    if( argc != 3 )
    { readme(); return -1; }

    cv::Mat img_object = cv::imread( "/user/gaurav_kl/Desktop/sample/p1.tif", CV_LOAD_IMAGE_GRAYSCALE );
    cv::Mat img_scene = cv::imread( "/user/gaurav_kl/Desktop/sample/p2.tif", CV_LOAD_IMAGE_GRAYSCALE );

    if( ! || ! )
    { std::cout<< " --(!) Error reading images " << std::endl; return -1; }

    //-- Step 1: Detect the keypoints using SURF Detector
    int minHessian = 400;

    SurfFeatureDetector detector(minHessian);

    std::vector<KeyPoint> keypoints_object, keypoints_scene;

    detector.detect( img_object, keypoints_object );
    detector.detect( img_scene, keypoints_scene );

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

    Mat descriptors_object, descriptors_scene;

    extractor.compute( img_object, keypoints_object, descriptors_object );
    extractor.compute( img_scene, keypoints_scene, descriptors_scene );

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

    double max_dist = 0; double min_dist = 100;

    //-- Quick calculation of max and min distances between keypoints
    for( int i = 0; i < descriptors_object.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 3*min_dist )
    std::vector< DMatch > good_matches;

    for( int i = 0; i < descriptors_object.rows; i++ )
    { if( matches[i].distance < 3*min_dist )
    { good_matches.push_back( matches[i]); }

    Mat img_matches;
    drawMatches( img_object, keypoints_object, img_scene, keypoints_scene, 
                good_matches, img_matches, Scalar::all(-1), Scalar::all(-1), 
                vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS ); 

    //-- Localize the object from img_1 in img_2 
    std ...