我正在使用执行图像处理的命令行程序,并且需要在整个图像文件夹上运行相同的命令。我听说我可以在命令提示符下运行循环,但是我在网上看到了各种各样的示例,因此无法弄清楚语法。文件夹中的图像一直标记为 single0.pgm,single1.pgm,single2.pgm,...,一直到single39.pgm。我需要运行的命令是:
I'm working with a command-line program that does image-processing, and I need to run the same command on an entire folder of images. I have heard that I can run loops in the command prompt, but I have seen all sorts of different examples online and can't figure out the syntax. The images in the folder are labled "single0.pgm, single1.pgm, single2.pgm,..." all the way to single39.pgm. The command I need to run is:
DebayerGPU.exe -demosaic DFPD_R -CPU -pattern GRBG -i single0.pgm -o single0.ppm我需要为每张照片做到这一点。在C语言中,这只是一个简单的 for 循环,例如
And I need to do that for every picture. In C it is just a simple for loop like
for (int j = 0; j<40; j++) { DebayerGPU.exe -demosaic DFPD_R -CPU -pattern GRBG -i singlej.pgm -o singlej.ppm }如何在命令提示符下执行此操作?
How do I do that in the command prompt?
推荐答案我知道了!对于任何好奇的人,循环是:
I figured it out! For anyone curious, the loop is:
for %a in (0 1 2 3 4 5 6 7 8 9 10 11 1 2 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39) do DebayerGPU.exe -demosaic DFPD_R -CPU -pattern GRBG -i single%a..pgm -o si ngle%a.ppm更多推荐
如何在命令提示符下进行“ for”循环?
发布评论