Monday, July 14, 2014

Another linux script

 #this file is to execute the stereo flow algorithm on multiple files in a folder  
 #the format of the image name should be six-digit numbers.  
 if test $# -lt 5 ; then  
      echo "usage: stereoflowbatch left_image_folder right_image_folder calibration_file start_id end_id"  
 else  
      for ((i=$4;i<=$5;i++))   
      do  
           lin=$(printf %06d.png ${i%.png})  
           flin="$1/$lin"  
           frin="$2/$lin"  
           j=`expr $i + 1`  
           lin2=$(printf %06d.png ${j%.png})  
           flin2="$1/$lin2"  
           echo $flin  
           echo $frin  
           echo $flin2  
           if [ -f $flin ] && [ -f $frin ] && [ -f $flin2 ]; then  
                ./runstereoflow $flin $frin $flin2 $3  
           fi  
      done       
 fi  

No comments:

Post a Comment