1

First of all, I don't know Batch programming at all. I came across a FIND command in a tutorial I was reading about OpenCV
http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html

find ./positive_images -iname "*.jpg" > positives.txt

It basically is supposed to copy all the relative paths of all the jpeg files inside positive_images directory to positives.txt file. I ran this in CMD(as Administrator) and got the following:
Relative Path Error

What is the meaning of Access Denied? I don't want to learn Batch Programming for this as I am already busy in my project. Please give me a simple-to-understand solution.

Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105

1 Answers1

0

The referred tutorial uses the bash find command.But you're executing the Windows find command.Download from somewhere the windows port for the unix command put it in your directory and call it like

.\find.exe .\positive_images -iname "*.jpg" > positives.txt

mind also the windows path separator slashes.

you can use this port for example -> http://unxutils.sourceforge.net/ (probably there's a newer port but this should do the work)

npocmaka
  • 55,367
  • 18
  • 148
  • 187
  • Thats where I got confused, Find has different meanings. I am currently checking out your solution. Thx – Manish Kumar Sharma Apr 19 '15 at 16:03
  • It works except I am getting everything together instead each on a different line. OpenCV may process it fine(maybe I dunno yet) but I need them all the listings as each one on one line. Is there any flag or option for it? – Manish Kumar Sharma Apr 19 '15 at 16:16
  • @pulp_fiction - it's because the new line style is in unix format instead of windows.May be the easiest way to convert it is with powershell -> http://stackoverflow.com/questions/724083/unix-newlines-to-windows-newlines-on-windows – npocmaka Apr 19 '15 at 16:36
  • Actually, I happen to have Visual Studio and I changed the UNIX endings to Windows one(that solved my problem about newlines) but one more thing I still have the each file displayed as Passion_Flower\image_00013.jpg . I mean there is a '\' character. It should be '/' instead. What did I do wrong? – Manish Kumar Sharma Apr 19 '15 at 17:18
  • @pulp_fiction - just the paths are in Windows style and you needed it in Unix style.Mass replacement is probably the solution. – npocmaka Apr 19 '15 at 17:21
  • Bingo! Just used the Notepad Find and Replace option. Its done!! Thank You – Manish Kumar Sharma Apr 19 '15 at 17:26