Octave

From SoftwareGuy
Jump to navigation Jump to search

Octave commands

[stat, num] = system("../pull-last1.sh uvx_tx_low 10.150.1.9");num=strtrim(num);i=imread([num ".orig.tiff"]);plot(mean(i(s:3:end,:)),'r');hold on;plot(mean(i(s+1:3:end,:)),'g');plot(mean(i(s+2:3:end,:)),'b');title(num);hold off;grid

associated shell scripts

pull-last1.sh

#!/bin/bash #otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912 #ip=192.168.1.9 #ip=10.150.1.9 #whichIE="uvx" #whichIE="tx_low" #whichIE="tx_high" #whichIE="evx_right" #whichIE="evx_left" if [ -z $1 ]; then whichIE="uvx"; else whichIE=$1; fi if [ -z $2 ]; then ip=192.168.1.9; else ip=$2; fi printf ".lastVehicleRecord.scans[] | select(.type | endswith(\""$whichIE"\"))\n" > parms.jq wget -qO heartbeat http://$ip/heartbeat cnt=$(jq '.lastVehicleRecord.scans | length' heartbeat) id=$(jq -f parms.jq heartbeat | jq '.id') if [ ! -z $id ]; then wget -qO $id.orig.tiff http://$ip/requestImage/?scanId=$id fi rm heartbeat parms.jq echo $id #exit $id


retreive.sh

#!/bin/bash

  1. otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912

if [ -z $1 ]; then ip=192.168.1.9; else ip=$1; fi if [ -z $2 ]; then echo "retrieve.sh <ip> <start_id> <end_id>"; exit; else start=$2; fi if [ -z $3 ]; then echo "retrieve.sh <ip> <start_id> <end_id>"; exit; else end=$3; fi cnt=$end-$start

  1. mkdir cbp

for i in $(eval echo {$start..$end}); do

   wget -O $i.tiff http://$ip/requestImage/?scanId=$i
   wget -O $i.modified.tiff "http://$ip/requestImage/?scanId=$i&format=modified"
   str="`wget -qO- http://$ip/getScanInfoByScanId/?scanId=$i`"
   str2=${str}_${i}
   #tiffcp $i.modified-orig.tiff $i.modified.tiff
   #tiffcp $i.orig.tiff $i.tiff
   #cp $i.modified.tiff $str2.modified.tiff
   #cp $i.tiff $str2.tiff
   #cp $str2.modified.tiff cbp
   #cp $str2.tiff cbp

done

exit

  1. for i in {8165..8244}
  2. for i in {8245..8412}

for i in {1911..1918} do

   wget -O $i.jpg http://192.168.1.9/requestPhoto/?photoId=$i
   str="`wget -qO - http://$ip/getScanInfoByScanId/?photoId=$i`"
   #str2=${str}_${i}
   #cp $i.jpg $str2.jpg
   #cp $str2.jpg cbp

done <\code>