gpt4 book ai didi

OpenCV 图像加载问题

转载 作者:行者123 更新时间:2023-12-02 17:53:07 25 4
gpt4 key购买 nike

我已经使用 imagesnake 开发了一个 opencv 程序,但它适用于一些图像,但对于其他图像则不起作用。我收到以下错误:

OpenCV Error: Bad number of channels (input image has more than onechannel) 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 functioncvSnakeImage


中止陷阱
有没有人看到这个问题或知道如何解决它?

最佳答案

看起来您正在尝试加载彩色图像,而 cvSnakeImage 只接受单 channel 图像,即:黑白图像。

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

关于OpenCV 图像加载问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14859104/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com