0

I have a code for ubuntu that extracts hessian-affine descriptors in an image. its an executable file named haff_cvpr09, it gets an image name for input in "haff_cvpr09 imageName.ppm" format and gives a result out. I can execute it on one image in '.\haff_cvpr09 imageNmae.ppm' command format in terminal, and it works well, but now I have 5000 images in 17 folders, I wanted to run that code on all images, then i tried

for file in 'folder path*.ppm'; do .\haff_cvpr09 $file; done

but I got segmentation fault(core dumped) error! I wanted to know how I can do this in terminal or bash in UBUNTU.

any help is appreciated: )

AZiZA Saber
  • 375
  • 2
  • 10
  • Are you invoking `./haff_cvpr09 folder` and segfaulting on that, or is the question incorrectly showing the string `folder path*.ppm`? – William Pursell Dec 26 '18 at 16:59

1 Answers1

1

The samples way is to use something like:

find <folder> -type f -name "*.ppm" -exec ./haff_cvpr09 {} \;

Be aware this may not work if you have files with whitespace in the name

Replace <folder> with you folder name

Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31