【问题标题】:OpenCV error: Image step is wrongOpenCV 错误:图像步骤错误
【发布时间】:2013-05-24 17:02:54
【问题描述】:

我正在阅读本教程:http://docs.opencv.org/trunk/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html#creating-the-csv-file

一切顺利,但是运行人脸识别脚本出现了这个错误:

OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed)

我使用的是 Ubuntu,所以我不确定如何实施此处找到的解决方案:Getting OpenCV Error "Image step is wrong" in Fisherfaces.train() method

我在调试模式下重建,但没有效果。

【问题讨论】:

    标签: linux opencv


    【解决方案1】:

    最近我在使用这个人脸识别示例时遇到了同样的错误。我通过提供相同比例(1:1)的图像消除了错误。

    使用此脚本裁剪图像(另请参阅Command line batch image cropping tool

    #!/bin/bash
    width=92;
    height=92;
    x_offset=0;
    y_offset=10;
    filelist=`ls | grep '.pgm'`
    for image_file in $filelist
    do
      convert -crop ${width}x${height}+${x_offset}+${y_offset} \
        $image_file $image_file
    done
    

    这将裁剪文件夹中的图像,因此您需要将此脚本放在图像所在的同一目录中。

    您还应该在 csv 文件中提供绝对路径。

    【讨论】:

      猜你喜欢
      • 2014-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-21
      • 1970-01-01
      • 1970-01-01
      • 2012-10-31
      • 2016-11-13
      相关资源
      最近更新 更多