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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:33:58+00:00 2026-06-07T15:33:58+00:00

I just started trying to play with OpenCV and I wrote a small program

  • 0

I just started trying to play with OpenCV and I wrote a small program from a book that is pretty simple. The problem is when I try to compile it, I get this error. I will give you all the information I have. I installed openCV using homebrew for Mac OS X 10.7.

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

int main(int argc, char *argv[])
{
cv::Mat image = cv::imread("usf.gif");
cv::namedWindow("My Image");
cv::imshow("My Image", image);
cv::waitKey(5000);

return 1;
}

I compiled liked this:

g++ -o test opencvtest.cc -lopencv_core -lopencv_imgproc -lopencv_calib3d -lopencv_video -lopencv_features2d -lopencv_ml -lopencv_highgui -lopencv_objdetect -lopencv_contrib -lopencv_legacy

And this is what I got back when I tried to run it.

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /tmp/homebrew-opencv-2.4.2-oQmu/OpenCV-2.4.2/modules/core/src/array.cpp, line 2482
terminate called throwing an exceptionAbort trap: 6

Thanks again.

  • 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-07T15:34:02+00:00Added an answer on June 7, 2026 at 3:34 pm

    That’s because OpenCV doesn’t support gif:

    The function imread loads an image from the specified file and returns it. If the image can not be read (because of missing file, improper permissions, unsupported or invalid format), the function returns empty matrix ( Mat::data==NULL ).Currently, the following file formats are supported:

    Windows bitmaps – *.bmp, *.dib (always supported)

    JPEG files – *.jpeg, *.jpg, *.jpe (see Note2 )

    JPEG 2000 files – *.jp2 (see Note2 )

    Portable Network Graphics – *.png (see Note2 )

    Portable image format – *.pbm, *.pgm, *.ppm (always supported)

    Sun rasters – *.sr, *.ras (always supported)

    TIFF files – *.tiff, *.tif (see Note2 )

    See docs.

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

Sidebar

Related Questions

I just started trying to build simple GUIs because I've always used command-line script
I just started to play with android dev and java+eclipse is pretty new to
I have just started trying to make a simple game with XNA 3.1 to
So i just started trying to develop a simple webpart today for a sharepoint
I've just started trying to use Solr, and already I think that I'm attempting
Just getting started with OpenFrameworks and I'm trying to do something that should be
I just started messing with android dev and I am trying to simply play
I just started trying out Pydev and Eclipse together for a small project. My
I just started trying out a book of OpenGL out of personal interest and
I just started trying out RavenDB and it seems that the new/easy way to

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.