| Thread Tools | Search this thread |
|---|
l1nuxn3wbie
| June 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! | |||||
|
|||||||||||||
|
|||||||||||||
| 8286 users have contributed to 31231 threads and 99107 posts to date. |
|---|
| In the past 24 hours, we have 7 new thread(s) 31 new posts(s), and 43 new user(s). In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing... Escalated as Please welcome our newest member titanius.anglesmith |