使用'find'命令在opencv上生成收集文件时出错 [英] Error using the 'find' command to generate a collection file on opencv
问题描述
我在生成正像收集文件以在OpenCV中训练Haar级联以检测汽车时遇到问题。在互联网上找到的每个教程中,它都是相同的命令,但是我无法执行它。
我正在使用命令提示符和Windows Power Shell执行此命令。 查找./positive_images/ -iname'。* pgm'> positives.txt
输出的屏幕截图我正在运行此程序命令从我的目录的根目录。正图像存储在 positive_images
文件夹中。
I am facing a problem generating a collection file of the positive images to train the Haar Cascade in OpenCV to detect a car. On every tutorial I found on the internet, it is the same command, however i am unable to execute it.
I am using Command Prompt and Windows Power Shell to execute this command. find ./positive_images/ -iname '.*pgm' > positives.txt
the screenshot of the output I am running this command from root of my directory. The positive images are stored in positive_images
folder.
输出:
找不到文件-'* pgm'
但是, positive_images
目录包含550个扩展名为 .pgm
的文件。
However, the positive_images
directory contains 550 files with .pgm
extension.
推荐答案
错误找不到文件-'* pgm'
Error File not found - '*pgm'
我正在使用命令提示符和Windows Power Shell执行此命令:
I am using Command Prompt and Windows Power Shell to execute this command:
find ./positive_images/ -iname '.*pgm' > positives.txt
以上命令使用Unix版本<$的语法c $ c>查找,但是您正在Windows下运行它。 PowerShell没有内置的 find
命令,因此您正在运行 C:\Windows\System32\find.exe
。
The above command is using the syntax of a Unix version of find
, but you are running it under Windows. PowerShell does not have a built in find
command so you are running C:\Windows\System32\find.exe
.
注意:
-
Unix
发现
用于搜索文件。
Windows 查找
用于搜索文件
Windows find
is used to search for string in files.
在Windows上运行时,需要使用 dir
而不是查找
:
As you are running on Windows you need to use dir
instead of find
:
dir /b /s positive_images\*.pgm > positives.txt
进一步阅读
- Windows CMD命令行的AZ索引-Windows的绝佳参考与cmd行相关。
- dir -显示列表文件和子文件夹。
- 找到-搜索文件中的文本字符串&显示找到它的所有行。
- An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
- dir - Display a list of files and subfolders.
- find - Search for a text string in a file & display all the lines where it is found.
Further Reading
这篇关于使用'find'命令在opencv上生成收集文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!