【问题标题】:Unspecified error could not find a writer未指定的错误找不到作家
【发布时间】:2015-12-11 02:32:00
【问题描述】:

我正在尝试运行并检查来自here 的示例程序并执行其sample.c。我给出了它的论点,第一个是facefinder的路径,第二个是输入图像,第三个是输出图像,依此类推。但是当我给出所有路径时,它会显示我跟随错误并关闭。我正在使用 Visual Studio 2015 和 opencv 2.4.10

错误:

命令行参数

路径

// command line options
        printf("Mandatory arguments to long options are mandatory for short options too.\n");
        printf("  -i,  --input=PATH          set the path to the input image\n");
        printf("                               (*.jpg, *.png, etc.)\n");
        printf("  -o,  --output=PATH         set the path to the output image\n");
        printf("                               (*.jpg, *.png, etc.)\n");
        printf("  -m,  --minsize=SIZE        sets the minimum size (in pixels) of an\n");
        printf("                               object (default is 128)\n");
        printf("  -M,  --maxsize=SIZE        sets the maximum size (in pixels) of an\n");
        printf("                               object (default is 1024)\n");
        printf("  -a,  --angle=ANGLE         cascade rotation angle:\n");
        printf("                               0.0 is 0 radians and 1.0 is 2*pi radians\n");
        printf("                               (default is 0.0)\n");
        printf("  -q,  --qthreshold=THRESH   detection quality threshold (>=0.0):\n");
        printf("                               all detections with estimated quality\n");
        printf("                               below this threshold will be discarded\n");
        printf("                               (default is 5.0)\n");
        printf("  -c,  --scalefactor=SCALE   how much to rescale the window during the\n");
        printf("                               multiscale detection process (default is 1.1)\n");
        printf("  -t,  --stridefactor=STRIDE how much to move the window between neighboring\n");
        printf("                               detections (default is 0.1, i.e., 10%%)\n");
        printf("  -u,  --usepyr              turns on the coarse image pyramid support\n");
        printf("  -n,  --noclustering        turns off detection clustering\n");
        printf("  -v,  --verbose             print details of the detection process\n");
        printf("                               to `stdout`\n");

        //
        printf("Exit status:\n");
        printf(" 0 if OK,\n");
        printf(" 1 if trouble (e.g., invalid path to input image).\n");

我的总体论点

E:\\pico-master\\rnt\\cascades\\facefinder -i E:\\1.jpg -o E:\\ -m 128 -M 1024 -a 0.0 -q 5.0 -c 1.1 -t 0.1

【问题讨论】:

  • 您能否显示您的-o 输出路径?您提供的图片扩展名似乎无效。
  • 我更新问题
  • 你应该指定一个输出图像:“-o E:\\img.jpg”等...
  • 谢谢,它有效。您能否将其发布为答案,以便我们对其进行整理。以及如何将其转换为网络摄像头输入作为命令行参数
  • 我现在不能,明天我会发布。你能更好地解释一下你的第二句话吗?

标签: c++ opencv image-processing computer-vision


【解决方案1】:

OpenCV 找不到将图像写入磁盘的写入器,因为您没有在 -o 选项中指定图像路径。

使用-o path_to_image保存输出图像,例如:

-o E:\\img.jpg

【讨论】:

  • 但它应该是 0 或 1,就像我们有 cvCaptureFromCAM( 0 )
  • 不,您的示例使用硬编码 0。如果您还需要能够选择设备编号,则必须稍微修改程序。但这是另一个问题的材料
  • 是的,但是当我使用硬编码 0 时,即使在删除 -i 之后,它也会给我无效参数的错误
  • 嗯,这回答了这个问题。您可以就如何设置相机设备提出一个新问题。
  • 我在这里为相机设备打开新线程stackoverflow.com/questions/34300914/…
猜你喜欢
  • 2016-01-22
  • 1970-01-01
  • 2017-05-06
  • 2015-12-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-29
相关资源
最近更新 更多