2013-02-13 65 views
0

我开发了一个使用imagesnake的opencv程序,但它适用于少数图像,但对于其他程序则不适用。我得到以下错误:OpenCV Image加载问题

OpenCV Error: Bad number of channels (input image has more than one channel) in cvSnakeImage, file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_opencv/opencv/work/OpenCV-2.3.1/modules/legacy/src/snakes.cpp, line 416 terminate called after throwing an instance of 'cv::Exception' what():

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_opencv/opencv/work/OpenCV-2.3.1/modules/legacy/src/snakes.cpp:416: error: (-15) input image has more than one channel in function cvSnakeImage

中止陷阱

有没有人见过这个问题或知道如何解决它?

回答

1

看起来您正试图加载彩色图像,并且cvSnakeImage只接受单通道图像,即:黑白图像。

黑白图像是唯一有效的图像吗?