Octave and OpenCV

soren at hauberg.org soren at hauberg.org
Wed Aug 6 06:44:44 CDT 2008


Quoting Abdul Rahman Riza <abdulrahmanriza at gmail.com>:
> Can you share simple c code (with OpenCV)how to read image (as imread)
> and display it (as imshow) using gnuplot ?

I'm not quite sure I understand your question. I don't use Octave and  
OpenCV together, I use them seperatly. If you want to use them  
together (i.e. calling OpenCV functions from Octave) then you need the  
OpenCV SWIG-based package I mentioned in a previous mail.

If you have questions regarding using OpenCV alone, then I recommend  
the OpenCV mailing list, which is a friendly and helpful list. In an  
attempt to answer your question, I can tell you that the following  
Octave program

   im = imread ("myfile.png");
   imshow (im);

roughly corresponds to the following untested OpenCV program

   #include "cv.h"
   #include "highgui.h"

   int main ()
   {
     const char *window_name = "My window name";
     cvNamedWindow (window_name, CV_WINDOW_AUTOSIZE);
     IplImage *im = cvLoadImage ("myfile.png");
     cvShowImage (window, im);
     cvWaitKey (-1);

     return 0;
   }

Does that answer your question?

Søren




More information about the Help-octave mailing list