Octave: Difference between revisions

From SoftwareGuy
Jump to navigation Jump to search
Mark (talk | contribs)
No edit summary
Mark (talk | contribs)
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
== pull-last1.sh ==
== pull-last1.sh ==


<code>
<code>#!/bin/bash
#!/bin/bash


#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912
#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912
Line 35: Line 34:


#exit $id
#exit $id
<\code>
</code>
 


== retreive.sh ==
== retreive.sh ==


#!/bin/bash
<code>
<code>#!/bin/bash


<code>
#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912
#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912



Latest revision as of 15:02, 18 March 2024

Octave commands[edit | edit source]

[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[edit | edit source]

pull-last1.sh[edit | edit source]

#!/bin/bash

  1. otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912
  1. ip=192.168.1.9
  2. ip=10.150.1.9
  3. whichIE="uvx"
  4. whichIE="tx_low"
  5. whichIE="tx_high"
  6. whichIE="evx_right"
  7. 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

  1. exit $id

retreive.sh[edit | edit source]

#!/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>