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 8804517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:37:33+00:00 2026-06-14T01:37:33+00:00

I’m just now starting to learn how to use the openCV libraries. I’ve downloaded

  • 0

I’m just now starting to learn how to use the openCV libraries. I’ve downloaded and installed openCV 2.4.0, and have run a few example projects. In this block of code, I’m trying to get the output from goodFeaturesToTrack and plot the points on an image. The code compiles, but every time I run it, it crashes, and I get the following error:


Windows has triggered a breakpoint in Corner.exe.

This may be due to a corruption of the heap, which indicates a bug in Corner.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while Corner.exe has focus.

The output window may have more diagnostic information.


The output window does not have more diagnostic information. I’ve traced the error to the goodFeaturesToTrack function. Here’s the offending code:

// Corner.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <opencv.hpp>
#include <opencv_modules.hpp>
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>

#include <iostream>
#include <string>
#include <iomanip>
#include <sstream>

using namespace cv; //If you don't have this, you won't be able to create a mat...
using namespace std;


#include <stdio.h>
#include <cv.h>
#include <highgui.h>
#include <math.h>

//Whole bunch of #defines to make editing the code a lot easier

#define MAX_FEATURES 5
#define FILENAME "C:/Users/Mitchell/Desktop/lol.jpg"

int main(void)
{
    namedWindow("Out", CV_WINDOW_AUTOSIZE);
    namedWindow("In", CV_WINDOW_AUTOSIZE);  
    Mat Img;
    Img = cvLoadImage(FILENAME, CV_LOAD_IMAGE_GRAYSCALE);

    if(!Img.data)
    {
        fprintf(stderr, "ERROR: Couldn't open picture.");
        waitKey();
        return -1;
    }

    else
    {
        imshow("In", Img);
        waitKey();
    }

    std::vector<cv::Point2f> Img_features;
    int number_of_features = MAX_FEATURES;

    Mat Out = Mat::zeros(Img.cols, Img.rows, CV_32F);

    goodFeaturesToTrack(Img, Img_features, MAX_FEATURES, .01, .1, noArray(), 3, false);

    fprintf(stdout, "Got here...");

    /*for (int i = 0; i < MAX_FEATURES; i++)
    {
        Point2f p = Img_features[i];
        ellipse(Img, p, Size(1,1), 0, 0, 360, Scalar(255,0,0));
    }*/

    imshow("Out", Out);

    waitKey(0);
    return 0;


}

Is this a bug in the library, or am I doing something dumb?

  • 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-14T01:37:35+00:00Added an answer on June 14, 2026 at 1:37 am

    May be Img_features vector should have MAX_FEATURES items before calling goodFeatures? i.e. try Img_features.resize(MAX_FEATURES) before goodFeatures call.

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

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a small JavaScript validation script that validates inputs based on Regex. I
I would like to run a str_replace or preg_replace which looks for certain words
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported

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.