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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:10:19+00:00 2026-06-03T00:10:19+00:00

I have a problem using openCV 2.3.1 installed from mac ports. For installation and

  • 0

I have a problem using openCV 2.3.1 installed from mac ports. For installation and configuration of the xcode project I used this post from Salem’s blog. The example code shown in the post works great. But if I change the mail.cpp file to just show an image it fails.
Here is my example code:

#include <iostream>

#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

int main (int argc, const char * argv[])
{
    cv::Mat img = cv::imread("Lena.jpg");
    cv::namedWindow("Image");
    cv::imshow("Image", img);
}

The error I get is the following:

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_opencv/opencv/work/OpenCV-2.3.1/modules/core/src/array.cpp, line 2482
terminate called throwing an exception(lldb) 

Now I am a bit confused since I’m also not that familiar with c++.

Any advice?

  • 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-03T00:10:20+00:00Added an answer on June 3, 2026 at 12:10 am

    There’s a chance that the crash is being caused by imread() failing to locate the image on the disk:

    cv::Mat img = cv::imread("Lena.jpg");
    if (!img.data)
    {
         // print error and abort execution
    }
    

    and you’ll never know unless you start to code safely.

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

Sidebar

Related Questions

i have problem using LIKE structure in DB2 : for example: select * from
I have a problem using the SSIS. I try to import data from database
i have a problem using the Catch Clipboard Events code found on this link
I have a problem using a simple AppleScript on Mac OSX 10.7.3. With the
i have a problem: I'm using VS Express 2010 and trying to add opencv
I have to code an object detector (in this case, a ball) using OpenCV.
I am using OpenCV 2.2 compiled and built from source for iOS. I used
I have installed OpenCV C libraries from package management into my Kubuntu 9.10. I
I have problem using arabic font for iOS. All fonts have the same render,
I have problem while using jquery maskedinput with asp.net textbox. I have a check

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.