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

  • Home
  • SEARCH
  • 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 8893505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:15:53+00:00 2026-06-14T23:15:53+00:00

I am having trouble calling EMD() in OpenCV 2.4.2 under Mac OS ML. I

  • 0

I am having trouble calling EMD() in OpenCV 2.4.2 under Mac OS ML.

I have a class with an attribute Mat _signature defined like that :

Mat _signature(size,dim+1,CV_32F);
for (int i = 0; i<size; ++i){
    _signature.at<float>(i,0) = weight;
    for (int j = 1; j < dim+1; ++j){
       _signature.at<float>(i,j) = vec[i].at<float>(0,j-1); // vec[i] is a line vector containing the position in R^dim
    }
}

I then have u and v 2 instances of that class, and when I call EMD(u._signature, v._signature, CV_DIST_L2);

It fails with OpenCV Error: One of arguments' values is out of range () in icvInitEMD, file /*SOME PATH*/OpenCV-2.4.2/modules/imgproc/src/emd.cpp, line 408

I looked at the sourcecode but could not figure out what this fails. My arguments appear in correspondence to what the documentation wants. Any help will be appreciated.

  • 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-14T23:15:54+00:00Added an answer on June 14, 2026 at 11:15 pm

    Ok, it took me quite some time to figure it out, but among my data there was a component of one of my vector which was miscalculated, and ended up being NaN.
    Of course this was buried deep into my data so that it would be completely lost in any amount of data reasonably observable via a debugger (or even cout)

    The cryptic error from OpenCV did the rest in confusing me.

    For people stumbling upon the same issue as me :

    • Make sure your weight vectors are not zero
    • Make sure none of your data is NaN
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble in calling a method that I defined screenCap by a
I'm having trouble calling a non IDispatch method in an ActiveX control that I've
I'm having trouble with C++ calling elements of an array of type class .
I am having trouble calling a specific function within a class. The call is
I'm having trouble passing a variable defined in one class instance to another class
I'm having some trouble calling a function which is within a class in python.
I'm having trouble with a .NET Assembly that is com visible, and calling certain
I am having trouble calling a specific method from another class in my app.
I'm having trouble calling a specific function inside another on class. Example: var class
I am having some trouble calling an objective-c class method from a C++ file.

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.