Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • l1nuxn3wbieJune 24, 2009 6:27 PM PDT   
    Displaying a Picture in OpenCV

    I have the OpenCV O'Reilly manual, and I am testing out the sample code in the section "Display a Picture."  The picture I wish to display is a jpeg format stored on the Desktop.  Here is a copy of the code:
    // Sample Project.cpp : Defines the entry point for the console application.
    //
    #include "stdafx.h"
    #include "highgui.h" //GUI header
    #include "cv.h" //main OpenCV header


    int main(int argc, char** argv)
    {
    IplImage* img = cvLoadImage("p-pod-jpeg.jpg",1);
    cvNamedWindow("Example 1",1);
    cvShowImage("Example 1", img);
    cvWaitKey(0);
    cvReleaseImage(&img);
    cvDestroyWindow("Example 1");
    }

    The code compiled successfully, but when I went into debug mode, the command line terminal pops up with a window that has a gray background.  The image does not display.  What am I doing wrong?

    Thanks!

    Gennady Fedorov (Intel)June 28, 2009 12:23 PM PDT
    Rate
     
    Re: Displaying a Picture in OpenCV


    Please verify if the pointer *img is not null after returning by cvLoadImage(..)
    --Gennady



    l1nuxn3wbieJune 30, 2009 12:12 PM PDT
    Rate
     
    Re: Displaying a Picture in OpenCV


    Please verify if the pointer *img is not null after returning by cvLoadImage(..)
    --Gennady


    I have it working now! Thanks!

Forum jump:  

Intel Software Network Forums Statistics

16,369 users have contributed to 46,341 threads and 163,954 posts to date.

In the past 24 hours, we have 18 new thread(s) 102 new posts(s), and 67 new user(s).

In the past 3 days, the most popular thread for everyone has been Formula for the intersection of straight lines The most posts were made to Take a look at John Burkhard&# The post with the most views is \"-check none\" generates error

Please welcome our newest member bikerepair8


For more complete information about compiler optimizations, see our Optimization Notice.