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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:01:47+00:00 2026-06-15T19:01:47+00:00

I am using this code to detect the basic shapes in the given Image.

  • 0

I am using this code to detect the basic shapes in the given Image. But it is telling that unable to open the Image . Please help me. Please let me know if my question is not clear

  • 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-15T19:01:48+00:00Added an answer on June 15, 2026 at 7:01 pm

    Your question needs a lot more detail than this to get an effective answer (e.g. are you doing this on a Macintosh or on an iPhone).

    The bit of code in the sample you pointed to that’s failing is this:

    img=cvLoadImage("shape.jpg");
    
    if(img==NULL)
    {
        printf("Error in opening image\n");
        return -1;
    }
    

    You need to put your file in a place where the app can find it.

    If you were on a Macintosh, put the file in the same place where the actual binary executable lives (e.g. “MyApp.app/Contents/MacOS/MyApp“). Or change the path to be a precise place where you know for a fact the image is saved (e.g. “/tmp/shape.jpg” or “/Users/sri/shape.jpg“).

    EDITED to add what to do for iOS. Try doing this:

    NSString *str = [[NSBundle mainBundle] pathForResource:@"YQpBE" ofType:@"png"];
    if(str)
    {
        const char *pathToFile = [str UTF8String];
        img=cvLoadImage(pathToFile);
        if(img==NULL)
        {
            NSLog( @"could not open image file at path %@", str);
        }
    } else {
        NSLog( @"could not find a file named YQpBE.png in the resource folder of this app");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code to detect layout orientation changes but the following code
I am using this code for detect the source language.. jsonObj = new JSONObject(response);
I'm trying to link to an external stylesheet using this code: <?php include(/homepages/9/myusername/htdocs/Mobile_Detect.php); $detect
I am using this code to detect the WindowsVersion on a PC. function GetOS:
I'm thinking of using this code to detect if the thread is the main
I'm using this jquery code to detect unsaved changes and warn users before they
I am trying to detect collisions in cocos2D. I am using this code: -
I am using this code to detect whether modifier keys are being held down
Using this code, i am able to send a notification to my own device.
Using this code to zip a folder and it works perfect on small files

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.