gpt4 book ai didi

c++ - 为什么当图像符合预期时,我会收到关于图像大小的 opencv 错误?

转载 作者:太空狗 更新时间:2023-10-29 21:40:10 24 4
gpt4 key购买 nike

我试图从这个站点运行 opencv 性别分类示例, http://docs.opencv.org/modules/contrib/doc/facerec/tutorial/facerec_gender_classification.html当我尝试运行 facerec_fisherfaces.cpp 时,它给出了一条错误消息,

OpenCV Error: Unsupported format or combination of formats (In the Fisherfaces method all input samples (training images) must be of equal size!  Expected 40000 pixels, but was 0 pixels.) in train, file  /home/kavin/opencv/opencv-2.4.10/modules/contrib/src/facerec.cpp, line 564
terminate called after throwing an instance of 'cv::Exception'
what(): /home/kavin/opencv/opencv- 2.4.10/modules/contrib/src/facerec.cpp:564: error: (-210) In the Fisherfaces method all input samples (training images) must be of equal size! Expected 40000 pixels, but was 0 pixels. in function train

Aborted (core dumped)

以下是我在该程序中使用的 csv 文件条目:

/home/kavin/Desktop/actors_cropped/female/an1_200_200.jpg;0

我有 50 个这样的条目,图像存在于大小为 200*200 的位置。我使用了与我发布的教程链接中相同的代码 facerec_fisherfaces.cpp。请帮忙。

最佳答案

这是因为csv文件中有一个空行,而且编码必须是UTF-8

关于c++ - 为什么当图像符合预期时,我会收到关于图像大小的 opencv 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31075016/

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