Script to run multiple OpenCv programs in Windows 8

Discussion in 'Software' started by astronaut, Feb 9, 2017.

  1. astronaut

    astronaut

    Joined:
    Feb 9, 2017
    Messages:
    1
    Likes Received:
    0
    I like to run several OpenCV programs one by one in a DO Loop. After searching the web , think for this case need to use batch file. Is that right?

    I have 10 OpenCV programs. Each program detect specific features in the image with some successful rate. So, for any image(with many features to be detected) I wonna run first the program with the highest successful rate. If this failed to detect feature then run next one with second highest rate and so on. So, for example program1 is the one with the highest rate, then come program2 and so on.
    So I have output for each of the 10 OpenCv programs. Let we say output 1 if detect the feature (or the object) in the image and 0 if it failed. So the script should start the program 1 first and if the outcome of this program is 1 then will run some other .exe program (let we say program.exe) but if the outcome is 0 then need to start the program 2. Same for program 2. If the output of program 2 is 1 then will run the same program.exe, but if the output is 0 (means did not detect the object) then run the next program (means program3). Same for program 3
    Any idea how it should look like?
    I have thinking of something like this , but not sure about the control

    @ECHO OFF
    START program1.exe
    ECHO Timeout waiting for program1.exe to start
    GOTO :EOF

    :: if the output of program1.exe is 1 then run program.exe, else
    if the output of program1.exe is 0 run the program2.exe

    :startnext
    program2.exe
    :: or START program2.exe
    ECHO Timeout waiting for program1.exe to start
    GOTO :EOF

    :: if the output of program2.exe is 1 then run program.exe, else
    if the output of program2.exe is 0 run the program3.exe

    ...
     
    astronaut, Feb 9, 2017
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.