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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:03:36+00:00 2026-05-23T16:03:36+00:00

I’m using the OpenCV library in Objective-C (cross-compiled), which works fine basically. Unfortunately, when

  • 0

I’m using the OpenCV library in Objective-C (cross-compiled), which works fine basically.

Unfortunately, when using the example which can be found in find_obj.cpp, I get strange values for the CvSURFParams that has to be passed as an argument to the cvExtractSURF function.

features2d.hpp (part of openCV):

typedef struct CvSURFParams
{
    int    extended;
    double hessianThreshold;

    int    nOctaves;
    int    nOctaveLayers;

} CvSURFParams;

surf.cpp (part of openCV):

CvSURFParams cvSURFParams(double threshold, int extended)
{
    CvSURFParams params;
    params.hessianThreshold = threshold;
    params.extended = extended;
    params.upright = 0;
    params.nOctaves = 4;
    params.nOctaveLayers = 2;
    return params;
}

ViewController.mm (my main view controller):

CvSURFParams params = cvSURFParams(500, 1);

After calling the cvSURFParams function in ViewController.mm, the valus of params are:

extended         = (int)    1
hessianThreshold = (double) 0
nOctaves         = (int)    1082081280
nOctaveLayers    = (int)    4

Correcting the values for hessianThreshold, nOctaves, .. in ViewController.mm doesn’t help, as soon as I pass params to my cvExtractSURF function, the wrong values appear when debugging this function in surf.cpp:

extended         = (int)    1
upright          = (int)    0
hessianThreshold = (double) 500
nOctaves         = (int)    4
nOctaveLayers    = (int)    0

Can anyone help please?

Thanks in advance,

— Stephan

  • 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-23T16:03:37+00:00Added an answer on May 23, 2026 at 4:03 pm

    It sounds like the representation of the structure in OpenCV is different from how your ViewController.mm represents it. Either hessianThreshold is a different size, or else there is an alignment problem. Some things to check:

    1. Output sizeof(CvSURFParams) in your ViewController.mm as some debug code. Also do this from the OpenCV library. Most likely they are not the same.
    2. You can also output sizeof(double) in both projects. They should be the same, if not then you found the problem and you’ll need to instruct the compiler to use the same sizeof(double) in both projects.
    3. If sizeof(double) is the same in both projects, then the problem appears to be that the compiler is aligning the structures differently in each project. Again, this is most likely compiler settings, although typically there are #pragma instructions that can be used to specify a particular alignment scheme if you don’t want the default.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.