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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:47:45+00:00 2026-05-16T21:47:45+00:00

NOTE: I do believe that this is not an openCV related problem but since

  • 0

NOTE: I do believe that this is not an openCV related problem but since the error occurred using this library it might be a point of interest.

In the following code, by giving the wrong parameter as cascade_name, the load function throws an exception which is expected.
The interesting point is that by commenting the two following lines after catch block, the code would not throw any exception at all.

my question is, how such a thing is possible at all?!

cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name, 0, 0, 0 );
cv::CascadeClassifier c;
try
{
    c.load( std::string("") );
}catch(...)
{
    cout << "Exception";
}
cv::FileStorage fs( std::string(cascade_name), cv::FileStorage::READ );
bool t2 = fs.isOpened();
bool t = c.empty();
if ( cascade == 0 )
    return -1;
return 0;
  • 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-16T21:47:46+00:00Added an answer on May 16, 2026 at 9:47 pm

    It depends on the circumstances/assumptions about the program in general: it’s possible, given the right set of circumstances.

    For example:

    You are running this function from multiple threads, and inside the openCV library the FileStorage object interacts (shares variables, etc.) with the CascadeClassifier object. The code path in one thread causes the other thread to error on the ::load method.

    The times which I have seen things like this are (in order of likelihood):
    – The compiler didn’t rebuild with changes properly
    – You didn’t run the code you expected
    – The addition of lines caused some problems with multi-threaded synchronization (either in your code, or inside the library)
    – The addition code caused timings to change, which caused errors

    Hope that helps.

    • 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.