Error with cvScalar() in OpenCV 2.3.1 compiled and installed with MacPort (OS X Lion)

Indranil Mukhopadhyay neel82in at gmail.com
Mon Apr 9 20:17:45 PDT 2012


Hi,

I have used MacPort to compile and install OpenCV 2.3.1 on OS X Lion.

When trying to execute a simple draw program using XCode 4.3.2 and OpenCV
2.3.1 the following run time error is coming up at a line where cvScalar()
is getting used.

*/** Error **/*
*
*

*OpenCV Error: Assertion failed (connectivity == 8 || connectivity == 4) in
LineIterator, 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/drawing.cpp,
line 156*

*terminate called throwing an exception**(lldb) *

/** Program **/

#include <iostream.h>

#include <opencv2/opencv.hpp>



int main(int argc, const char * argv[])

{

    /* create an image */



    IplImage *img = cvCreateImage(cvSize(300,200),IPL_DEPTH_8U,3);





    /* draw green line */



    cvLine(img,

           cvPoint(10,10),

           cvPoint(100,80),

           cvScalar(0,255,0,0),

           1,10,0);



    cvRectangle(img,

                cvPoint(20,20),

                cvPoint(120,35),

                cvScalar(255,0,0,0),

                1,10,0);



    cvCircle(img,

             cvPoint(40,40),40,

             cvScalar(0,0,255,0),

             1,10,0);




    cvNamedWindow("OpenCVTestImage",CV_WINDOW_AUTOSIZE);



    cvShowImage("OpenCVTestImage",img);



    cvWaitKey(0);



    cvDestroyWindow("OpenCVTestImage");



    cvReleaseImage(&img);



    return 0;

}

Is this any kind of compatibility issue among OpenCV, MacPort, XCode and OS
X?

-- 
Indranil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120409/a9ca8fd9/attachment.html>


More information about the macports-users mailing list