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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:15:19+00:00 2026-05-14T07:15:19+00:00

Sorry for the confusing title, but it basically says it all. Here’s the structures

  • 0

Sorry for the confusing title, but it basically says it all. Here’s the structures I’m using (found in OpenCV) :

struct CV_EXPORTS CvRTParams : public CvDTreeParams
{
    bool calc_var_importance;
    int nactive_vars;
    CvTermCriteria term_crit;

    CvRTParams() : CvDTreeParams( 5, 10, 0, false, 10, 0, false, false, 0 ),
        calc_var_importance(false), nactive_vars(0)
    {
        term_crit = cvTermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 50, 0.1 );
    }
}

and

typedef struct CvTermCriteria
{
    int    type;
    int    max_iter;
    double epsilon;
}
CvTermCriteria;

CV_INLINE  CvTermCriteria  cvTermCriteria( int type, int max_iter, double epsilon )
{
    CvTermCriteria t;

    t.type = type;
    t.max_iter = max_iter;
    t.epsilon = (float)epsilon;

    return t;
}

Now, I initialize a CvRTParams structure and set values for its members :

 CvRTParams params;
 params.max_depth = 8;
 params.min_sample_count = 10;
 params.regression_accuracy = 0;
 params.use_surrogates = false;
 params.max_categories = 10;
 params.priors = priors;
 params.calc_var_importance = true;
 params.nactive_vars = 9;
 params.term_crit.max_iter = 33;
 params.term_crit.epsilon = 0.1;
 params.term_crit.type = 3;

Then call a function of an object, taking params in as a parameter :

CvRTrees* rt = new CvRTrees;
rt->train(t, CV_ROW_SAMPLE, r, 0, 0, var_type, 0, params);

What happens now ? Values of…

params.term_crit.max_iter
params.term_crit.epsilon
params.term_crit.type

have changed ! They are no longer 33, 0.1 and 3, but something along the lines of 3, 7.05541e-313 and 4, and this, for the whole duration of the CvRtrees::train() function…

  • 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-14T07:15:19+00:00Added an answer on May 14, 2026 at 7:15 am

    By the time I finished writing this question I found the answer. So I figured I’d post anyway if someone comes across the same problem. The code itself wasn’t wrong (or at least, it wasn’t completely wrong). However I am using MacOS X and apple-gcc on a ppc processor (G5). I was using the -fast flag for optimization. Removing the -fast flag (leaving only -O3) solved the problem.

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

Sidebar

Related Questions

Sorry for my ignorance here, but when I hear the word webserver, I immediately
Sorry if the title is poorly descriptive, but I can't do better right now
Sorry for this not being a real question, but Sometime back i remember seeing
Sorry the title isn't more help. I have a database of media-file URLs that
Sorry if this sounds like a really stupid question, but I need to make
Sorry for the long question title. I guess I'm on to a loser on
Sorry for the basic question - I'm a .NET developer and don't have much
Sorry, I'm new to SVN and I looked around a little for this. How
Sorry for the second newbie question, I'm a developer not a sysadmin so this
Sorry for the Windows developers out there, this solution is for Macs only. This

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.