Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9018079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:25:51+00:00 2026-06-16T04:25:51+00:00

I am trying to use the goodFeatureToTrack() function with opencv 2.4.3 on an gray

  • 0

I am trying to use the goodFeatureToTrack() function with opencv 2.4.3 on an gray image of lena…however I always get a zero size of the vector storing the features as cv::Point2f…I have tried using a zero mask also but in that case the application hangs up..I tried playing with the quality level value from 0.01 to 0.001. However still the size of the vector is zero..any idea?…following is my code..

#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/video/tracking.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <vector>

using namespace cv;
using namespace std;

int main()
{
    Mat frameROI;
    frameROI = imread("C:\\lena.jpg");
    std::vector<cv::Point2f> corners;
    cvtColor(frameROI,frameROI,CV_RGB2GRAY);

    //Mat mask(frameROI.size(), CV_8UC1);
    //mask.setTo(Scalar::all(0));

    //goodFeaturesToTrack(frameROI,corners,10,0.001,10,mask,3,false,0.04);
    goodFeaturesToTrack(frameROI,corners,10,0.001,10);//AFTER EDIT
    cout<<"SIZE OF FEATURE VECTOR = "<<corners.size()<<endl;

    imshow("VIDEO ROI",frameROI);
    waitKey();

    return 0;
}

OUTPUT:

SIZE OF FEATURE VECTOR = 0

EDIT: afte Bob’s suggestion I omitted the line for mask and modified the function..but now the application hangs up after the goodFeaturesToTrack function is invoked…Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:25:52+00:00Added an answer on June 16, 2026 at 4:25 am

    Solved the problem just now….instead of using the pre build libs n dlls….build it with MSVC2008 and now its working fine…the same points indicated by Bob are detected..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying use the edit_post_link() function to contain an image. All of
I'm trying use this code to get image resolution from file bool GetImageSizeEx(const char
Anyone know how to create a cvCreateStructuringElementEx using a image? I'm trying use opencv.cv.cvCreateStructuringElementEx()
I am need paint my image. I'm trying use JQuery in here this link:
i'm trying use webview to load a image from sdcard i use this path
I am trying use TinyMCE to get code syntax to be displayed in the
I am trying use the onClick() function in an activity for an android app.
I am trying use the django ORM to get a list by year of
I revieving the following error when trying use mysql_real_escape() function Fatal error: Call to
I'm trying to use cv::calcOpticalFlowPyrLK but sometimes an internal assertion in that function fails.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.