用OpenCV中的imread读取图像,图是彩色图,而为什么dims是2呢?!
就这个图,然后我插入了一个断点,进行DEBUG下监视,看image的属性,发现dims的值为2是什么情况啊?...
就这个图,然后我插入了一个断点,进行DEBUG下监视,看image的属性,发现dims的值为2是什么情况啊?
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏25(财富值+成长值)
2个回答
展开全部
参数不对。
imread(const string& filename, int flags=1 )
filename – Name of file to be loaded.
flags –
Flags specifying the color type of a loaded image:
In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel.
CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one
CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one
Note:
>0 Return a 3-channel color image.
=0 Return a grayscale image.
<0 Return the loaded image as is (with alpha channel).
imread(const string& filename, int flags=1 )
filename – Name of file to be loaded.
flags –
Flags specifying the color type of a loaded image:
In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel.
CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one
CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one
Note:
>0 Return a 3-channel color image.
=0 Return a grayscale image.
<0 Return the loaded image as is (with alpha channel).
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询