Saturday 15 May 2010

Line Detection openCV -


I'm running a code to find lines in OpenCV 2.1 in Visual Studio 2008, here's a part of the code :

  IplImage * src = cvLoadImage ("parrot Pollock"); IplImage * dst = cvCreateImage (cvGetSize (source), 8, 1); IplImage * color_dst = cvCreateImage (cvGetSize (source), 8, 3); CvMemStorage * storage = cvCreateMemStorage (0); CVSeq * line = 0; Int i; Int choice = 0; CvCanny (source, DST, 10, 100, 3); Code   

compile the code correctly, but when run returns the following error: OpenCV error: the combination of formats (), file ........ \ Ocv in the unsupported format or unknown function \ Opencv \ src \ cv \ cvcanny.cpp, line 66

Any indication on how to fix it ...

By default when you load an image it loads as a color image. Kenny needs the image input and output of a channel. Therefore, I think that if you load your image as a gray scale or later change it into a gray scale, then it should work.

Either:

  IplImage * src = cvLoadImage ("parr. .png", CV_LOAD_IMAGE_GRAYSCALE);   

or:

  cvtColor (src, src, CV_RGB2GRAY);    

No comments:

Post a Comment