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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:30:48+00:00 2026-05-26T03:30:48+00:00

When I call the function cvGoodFeaturesToTrack to find Harris corners I get this error:

  • 0

When I call the function cvGoodFeaturesToTrack to find Harris corners I get this error:

OpenCV Error: Assertion failed (src.type() == CV_8UC1 || src.type() == CV_32FC1) in cornerEigenValsVecs, file /build/buildd/opencv-2.1.0/src/cv/cvcorner.cpp,line 254 
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/buildd/opencv-2.1.0/src/cv/cvcorner.cpp:254: error: (-215) src.type() == CV_8UC1 || src.type() == CV_32FC1 in function cornerEigenValsVecs

Aborted

It compiles correctly but when I try to run it, it gives me that error.

Here is the code:

IplImage* eig_image = 0;
IplImage* temp_image = 0;

IplImage *img1 = 0;

img1 = cvLoadImage("im1.pgm");
if(img1==0) {
    printf("oh no!");
}

eig_image = cvCreateImage(cvGetSize(img1),IPL_DEPTH_32F, 1);

temp_image = cvCreateImage(cvGetSize(img1),IPL_DEPTH_32F, 1);


const int MAX_CORNERS = 100;
CvPoint2D32f corners[MAX_CORNERS] = {0};
int corner_count = MAX_CORNERS;
double quality_level = 0.1;
double min_distance = 1;
int eig_block_size = 3;
int use_harris = true;
double k  = .4;

cvGoodFeaturesToTrack(img1, eig_image, temp_image,corners,&corner_count,quality_level,min_distance,NULL,eig_block_size,use_harris,k);

Why is this happening and how can I fix it? I appreciate any help!

  • 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-05-26T03:30:49+00:00Added an answer on May 26, 2026 at 3:30 am

    OpenCV is trying to tell you that one of the images you passed to cvGoodFeaturesToTrack() (the error is actually originating in the helper function cornerEigenValsVecs()) is not of the required type CV_8UC1 or CV_32FC1.

    I suspect img1 may not be of the type you need it to be. What is the type of the img1 matrix? If it is color, then it may be of type CV_8UC3. Consider using cvCvtColor to make it a grayscale image.

    Or, alternatively you can initially load the image as grayscale like:

    cvLoadImage("im1.pgm", CV_LOAD_IMAGE_GRAYSCALE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I call function in .NET using Reflection (Method.Invoke). If an error occurs inside this
I have encounters this abap snippet that I have difficulty to comprehend. call function
When I call this function, everything works, as long as I don't try to
I'm using this code to open a popup ExternalInterface.call(function () { window.open(' + url
I have this script below and somehow cannot call function from this anonymous one.
I want to call function in PHP i use require_once for this .... now
I have following function. I want to call this function when user click on
I am trying to use the ExternalInterface.call function in my ActionScript(2.0) to get a
How can I get a class into a variable to call function and get
How do you call function lol() from outside the $(document).ready() for example: $(document).ready(function(){ function

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.